aboutsummaryrefslogtreecommitdiff
path: root/scripts/install
diff options
context:
space:
mode:
authornemsia <nemsia@nemsia.org>2017-04-11 14:27:49 +0200
committernemsia <nemsia@nemsia.org>2017-04-11 14:27:49 +0200
commit8f906508aa797c46910dffd8f53cac207ece39b2 (patch)
treeca6b88ef303fd1991cfc5beabb8fd9bd76a34bc2 /scripts/install
parent0ab50ab5ebd65944784bea1b1af950d2a722471e (diff)
parent39b07db1b9d61211122395a6e33f39adc45472cd (diff)
downloadmastodon_ynh-8f906508aa797c46910dffd8f53cac207ece39b2.tar.gz
mastodon_ynh-8f906508aa797c46910dffd8f53cac207ece39b2.tar.bz2
mastodon_ynh-8f906508aa797c46910dffd8f53cac207ece39b2.zip
Merge remote-tracking branch 'refs/remotes/magikcypress/master'
# Conflicts: # scripts/install
Diffstat (limited to 'scripts/install')
-rw-r--r--scripts/install40
1 files changed, 35 insertions, 5 deletions
diff --git a/scripts/install b/scripts/install
index 0a5d1bb..dba714e 100644
--- a/scripts/install
+++ b/scripts/install
@@ -65,6 +65,7 @@ curl -sL https://deb.nodesource.com/setup_4.x | sudo bash -
sudo apt-get -y install nodejs
sudo npm install -g yarn
+<<<<<<< HEAD
# Set UTF8 encoding by default
sudo su -c "psql" postgres <<< \
"update pg_database set datistemplate='false' where datname='template1';"\
@@ -73,19 +74,34 @@ sudo su -c "psql" postgres <<< \
"update pg_database set datistemplate='true' where datname='template1';"
# Create DB user mastodon
+=======
+# Create DB without password
+sudo systemctl restart postgresql
+>>>>>>> refs/remotes/magikcypress/master
ynh_psql_create_db_without_password "$app"
# Download all Ruby source
sudo git clone https://github.com/rbenv/rbenv.git $final_path/.rbenv
sudo git clone https://github.com/rbenv/ruby-build.git $final_path/.rbenv/plugins/ruby-build
+<<<<<<< HEAD
sudo git clone https://github.com/tootsuite/mastodon.git $final_path/live
+=======
+
+# Be king rewind (/var/cache/yunohost/from_file/scripts)
+popd
+
+# Get Mastodon last version
+sudo mkdir "${final_path}/live"
+SETUP_SOURCE
+>>>>>>> refs/remotes/magikcypress/master
sudo chown -R $app: "${final_path}"
# Install de rbenv
sudo su - $app <<COMMANDS
pushd ~/.rbenv
src/configure && make -C src
+echo 'export PATH="/opt/mastodon/.rbenv/bin:/opt/mastodon/live/bin:$PATH"' >> ~/.profile
echo 'export PATH="/opt/mastodon/.rbenv/bin:/opt/mastodon/live/bin:$PATH"' >> ~/.bashrc
echo 'eval "\$(rbenv init -)"' >> ~/.bashrc
COMMANDS
@@ -99,7 +115,7 @@ RCOMMANDS
# Create symlink for ruby
sudo ln -s /opt/mastodon/.rbenv/versions/2.4.1/bin/ruby /usr/bin/ruby || true
-# # Install Mastodon
+# Install Mastodon
sudo su - $app <<MCOMMANDS
pushd ~/live
/opt/mastodon/.rbenv/versions/2.4.1/bin/gem install bundler
@@ -107,6 +123,12 @@ bin/bundle install --deployment --without development test
yarn install
MCOMMANDS
+# Vérif Mastodon
+sudo su - $app <<VCOMMANDS
+pushd ~
+type rbenv
+VCOMMANDS
+
# Adjust Mastodon config
pushd $final_path/live/
sudo cp -a .env.production.sample .env.production
@@ -126,16 +148,20 @@ sudo sed -i 's,SMTP_FROM_ADDRESS=notifications@example.com,SMTP_FROM_ADDRESS='${
# Create database
# Preconfig CSS & JS
-# Create admin user
-# Create confirm email
-sudo su - $app <<ENDCOMMANDS
+
+sudo su - $app <<CCOMMANDS
pushd ~/live
RAILS_ENV=production bin/bundle exec rails db:setup
RAILS_ENV=production bin/bundle exec rails assets:precompile
-ENDCOMMANDS
+CCOMMANDS
+# Create admin user
+# Create confirm email
+sudo su - $app <<ACOMMANDS
+pushd ~/live
# RAILS_ENV=production bin/bundle exec rails mastodon:make_admin USERNAME=$admin_mastodon
# RAILS_ENV=production bin/bundle exec rails mastodon:confirm_email USER_EMAIL=$admin_mastodon@$domain
+ACOMMANDS
# Add Services
pushd /var/cache/yunohost/from_file/mastodon_ynh-master/scripts
@@ -183,6 +209,10 @@ fi
sudo yunohost app ssowatconf
# Reload Nginx
+<<<<<<< HEAD
sudo systemctl reload nginx || true
# debug
sudo systemctl status nginx
+=======
+sudo systemctl reload nginx
+>>>>>>> refs/remotes/magikcypress/master