From 279feedd74744ac2ba5c8d18921ba3be9b853bd2 Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 10 Apr 2017 10:44:24 +0200 Subject: [PATCH 01/29] Sudo on nodejs install --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 8e086a7..95be1b2 100644 --- a/scripts/install +++ b/scripts/install @@ -62,7 +62,7 @@ ynh_app_setting_set $app final_path $final_path # Install de Node.js pushd /opt -curl -sL https://deb.nodesource.com/setup_4.x | bash - +curl -sL https://deb.nodesource.com/setup_4.x | sudo bash - sudo apt-get -y install nodejs npm install -g yarn @@ -182,4 +182,4 @@ sudo systemctl reload nginx || true sudo systemctl status nginx # Nettoyer hosts -sudo sed -i '/#MASTODON/d' /etc/hosts \ No newline at end of file +sudo sed -i '/#MASTODON/d' /etc/hosts From d81564718cac221ab1243dc6a28c3245b8bdafde Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 10 Apr 2017 10:48:39 +0200 Subject: [PATCH 02/29] Sudo on yarn install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 95be1b2..d7e5f5f 100644 --- a/scripts/install +++ b/scripts/install @@ -64,7 +64,7 @@ ynh_app_setting_set $app final_path $final_path pushd /opt curl -sL https://deb.nodesource.com/setup_4.x | sudo bash - sudo apt-get -y install nodejs -npm install -g yarn +sudo npm install -g yarn ## Install postgresql database dbname=$app From 64e013a56708149e97f1731a36b3cdc2dd246427 Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 10 Apr 2017 11:05:16 +0200 Subject: [PATCH 03/29] Add Postgresql Restart Add Postgresql Restart before database creation --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index d7e5f5f..805560a 100644 --- a/scripts/install +++ b/scripts/install @@ -67,6 +67,7 @@ sudo apt-get -y install nodejs sudo npm install -g yarn ## Install postgresql database +sudo systemctl restart postgresql dbname=$app dbuser=$app # Generate random password From bbdb5bf40cee75a0875e3d7339413d7854c5c08d Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 10 Apr 2017 11:10:24 +0200 Subject: [PATCH 04/29] Sudo on git clone --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 805560a..14aee5a 100644 --- a/scripts/install +++ b/scripts/install @@ -76,9 +76,9 @@ ynh_psql_create_db "$dbname" "$dbuser" "$dbpass" # Download all Ruby source sudo git clone https://github.com/rbenv/rbenv.git $final_path/.rbenv -git clone https://github.com/rbenv/ruby-build.git $final_path/.rbenv/plugins/ruby-build -git clone https://github.com/tootsuite/mastodon.git $final_path/live -git clone git://github.com/dcarley/rbenv-sudo.git $final_path/.rbenv/plugins/rbenv-sudo +sudo git clone https://github.com/rbenv/ruby-build.git $final_path/.rbenv/plugins/ruby-build +sudo git clone https://github.com/tootsuite/mastodon.git $final_path/live +sudo git clone git://github.com/dcarley/rbenv-sudo.git $final_path/.rbenv/plugins/rbenv-sudo sudo chown -R $app: "${final_path}" # Install de rbenv From 81df00a1a6a96e961ba85e8b2f1a15547b4d85f5 Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 10 Apr 2017 12:06:45 +0200 Subject: [PATCH 05/29] Modify pushd --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 14aee5a..fb15986 100644 --- a/scripts/install +++ b/scripts/install @@ -132,7 +132,7 @@ RAILS_ENV=production bin/bundle exec rails assets:precompile ENDCOMMANDS # Add Services -pushd /var/cache/yunohost/from_file/scripts +pushd /var/cache/yunohost/from_file/mastodon_ynh-master/scripts sudo cp ../conf/mastodon-web.service /etc/systemd/system/mastodon-web.service sudo chown root: /etc/systemd/system/mastodon-web.service From 226cbaad593b07c4289c961a73ba11d52d3b7edc Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 10 Apr 2017 15:40:28 +0200 Subject: [PATCH 06/29] Update remove --- scripts/remove | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index b8f2d6b..f83b286 100644 --- a/scripts/remove +++ b/scripts/remove @@ -75,6 +75,9 @@ ynh_psql_drop_user $app SECURE_REMOVE '/opt/$app' [[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf" +# Suppression d'un lien symbolique +rm /usr/bin/ruby + REMOVE_NGINX_CONF # Suppression de la configuration nginx SECURE_REMOVE '/var/log/$app/' # Suppression des log @@ -85,4 +88,4 @@ sudo userdel -f $app # Reload services sudo service nginx reload -echo -e "\e[0m" # Restore normal color \ No newline at end of file +echo -e "\e[0m" # Restore normal color From b2cd5cc97ad463beac1f12f8ccc02a76c97dc257 Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 10 Apr 2017 15:46:57 +0200 Subject: [PATCH 07/29] Adjust Mastodon config .env.production --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index fb15986..f3c9ed4 100644 --- a/scripts/install +++ b/scripts/install @@ -113,7 +113,7 @@ sudo cp -a .env.production.sample .env.production sudo sed -i "s@REDIS_HOST=localhost@REDIS_HOST=127.0.0.1@g" "${final_path}/live/.env.production" sudo sed -i "s@DB_HOST=db@DB_HOST=/var/run/postgresql@g" "${final_path}/live/.env.production" sudo sed -i "s@DB_USER=mastodon@DB_USER=${dbuser}@g" "${final_path}/live/.env.production" -sudo sed -i "s@DB_NAME=mastodon@DB_NAME=${dbuser}@g" "${final_path}/live/.env.production" +sudo sed -i "s@DB_NAME=mastodon@DB_NAME=${dbname}@g" "${final_path}/live/.env.production" sudo sed -i "s@LOCAL_DOMAIN=domainedevotreinstance.tld@LOCAL_DOMAIN=${domain}@g" "${final_path}/live/.env.production" sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" From 1c8abcfbef197a27155e9ce6a78eae144d35e061 Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 10 Apr 2017 21:09:27 +0200 Subject: [PATCH 08/29] add reload-daemon for mastodon services --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index ad88c10..b5236ec 100644 --- a/scripts/install +++ b/scripts/install @@ -140,7 +140,7 @@ sudo cp ../conf/mastodon-sidekiq.service /etc/systemd/system/mastodon-sidekiq.se sudo chown root: /etc/systemd/system/mastodon-sidekiq.service sudo cp ../conf/mastodon-streaming.service /etc/systemd/system/mastodon-streaming.service sudo chown root: /etc/systemd/system/mastodon-streaming.service - +sudo systemctl daemon-reload sudo systemctl enable /etc/systemd/system/mastodon-*.service # sudo systemctl start mastodon-web.service mastodon-sidekiq.service mastodon-streaming.service # # debug From 23211dff3cc38d5646ec2ad06897607b85704ed3 Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 10 Apr 2017 23:27:02 +0200 Subject: [PATCH 09/29] Set postgre encoding on UTF8 --- scripts/install | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index b5236ec..4541d02 100644 --- a/scripts/install +++ b/scripts/install @@ -66,8 +66,20 @@ sudo apt-get -y install nodejs sudo npm install -g yarn # Create DB without password -sudo systemctl restart postgresql -ynh_psql_create_db_without_password "$app" +# sudo systemctl restart postgresql +# ynh_psql_create_db_without_password "$app" +# Don't work + +# Create user mastodon and set UTF8 encoding by default +sudo su - postgres +psql +CREATE USER mastodon CREATEDB; +update pg_database set datistemplate='false' where datname='template1'; +drop database template1; +create database template1 encoding='UTF8' template template0; +update pg_database set datistemplate='true' where datname='template1'; +\q +exit # Download all Ruby source sudo git clone https://github.com/rbenv/rbenv.git $final_path/.rbenv From a91a1fa199b4a346335b67fc7ae97185e4ff7a77 Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 10 Apr 2017 23:29:33 +0200 Subject: [PATCH 10/29] Change ruby version from 2.3.1 to 2.4.1 --- scripts/install | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 4541d02..73e70a2 100644 --- a/scripts/install +++ b/scripts/install @@ -98,17 +98,17 @@ COMMANDS # Install ruby-build sudo su - $app < Date: Tue, 11 Apr 2017 11:39:46 +0200 Subject: [PATCH 11/29] Change pg encoding, again ... --- scripts/install | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/scripts/install b/scripts/install index 73e70a2..9f3103c 100644 --- a/scripts/install +++ b/scripts/install @@ -65,21 +65,15 @@ curl -sL https://deb.nodesource.com/setup_4.x | sudo bash - sudo apt-get -y install nodejs sudo npm install -g yarn -# Create DB without password -# sudo systemctl restart postgresql -# ynh_psql_create_db_without_password "$app" -# Don't work +# Create DB user +ynh_psql_create_user "$app" # Create user mastodon and set UTF8 encoding by default -sudo su - postgres -psql -CREATE USER mastodon CREATEDB; -update pg_database set datistemplate='false' where datname='template1'; -drop database template1; -create database template1 encoding='UTF8' template template0; -update pg_database set datistemplate='true' where datname='template1'; -\q -exit +sudo su -c "psql" postgres <<< \ + "update pg_database set datistemplate='false' where datname='template1';"\ + "drop database template1;"\ + "create database template1 encoding='UTF8' template template0;"\ + "update pg_database set datistemplate='true' where datname='template1'; # Download all Ruby source sudo git clone https://github.com/rbenv/rbenv.git $final_path/.rbenv From f4f12dad136b5447f76a92db94b6756f4464c090 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 11:47:25 +0200 Subject: [PATCH 12/29] Update .fonctions --- scripts/.fonctions | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/.fonctions b/scripts/.fonctions index 7d9c54d..902d62c 100644 --- a/scripts/.fonctions +++ b/scripts/.fonctions @@ -155,6 +155,15 @@ ynh_psql_create_user() { "CREATE USER ${1} WITH PASSWORD '${2}';" } +# Create a user without password +# +# usage: ynh_mysql_create_user user pwd [host] +# | arg: user - the user name to create +ynh_psql_create_user_without_password() { + sudo su -c "psql" postgres <<< \ + "CREATE USER ${1};" +} + # Create a database and grant optionnaly privilegies to a user # # usage: ynh_mysql_create_db db [user [pwd]] @@ -187,4 +196,4 @@ ynh_psql_drop_db() { # | arg: user - the user name to drop ynh_psql_drop_user() { sudo su -c "dropuser ${1}" postgres -} \ No newline at end of file +} From 2de65844e95337f04983566a08052cb20a4653d1 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 11:48:49 +0200 Subject: [PATCH 13/29] Fix db user creation --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 9f3103c..299b945 100644 --- a/scripts/install +++ b/scripts/install @@ -66,7 +66,7 @@ sudo apt-get -y install nodejs sudo npm install -g yarn # Create DB user -ynh_psql_create_user "$app" +ynh_psql_create_user_without_password "$app" # Create user mastodon and set UTF8 encoding by default sudo su -c "psql" postgres <<< \ From 1cc7f73737c00c224b326489a441f307ae2a0c06 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 11:55:32 +0200 Subject: [PATCH 14/29] Fix PG again --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 299b945..432b1ad 100644 --- a/scripts/install +++ b/scripts/install @@ -73,7 +73,7 @@ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='false' where datname='template1';"\ "drop database template1;"\ "create database template1 encoding='UTF8' template template0;"\ - "update pg_database set datistemplate='true' where datname='template1'; + "update pg_database set datistemplate='true' where datname='template1';" # Download all Ruby source sudo git clone https://github.com/rbenv/rbenv.git $final_path/.rbenv From 692ceacf077628b739af16965e451c8df5c652a2 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 12:00:33 +0200 Subject: [PATCH 15/29] Fix comment --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 432b1ad..f5bc3dc 100644 --- a/scripts/install +++ b/scripts/install @@ -65,10 +65,10 @@ curl -sL https://deb.nodesource.com/setup_4.x | sudo bash - sudo apt-get -y install nodejs sudo npm install -g yarn -# Create DB user +# Create DB user mastodon ynh_psql_create_user_without_password "$app" -# Create user mastodon and set UTF8 encoding by default +# Set UTF8 encoding by default sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='false' where datname='template1';"\ "drop database template1;"\ From 22e483a8a3d8d5db6abff71cab7b2605b3d04455 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 13:39:37 +0200 Subject: [PATCH 16/29] Add create DB --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index f5bc3dc..7232b27 100644 --- a/scripts/install +++ b/scripts/install @@ -68,6 +68,9 @@ sudo npm install -g yarn # Create DB user mastodon ynh_psql_create_user_without_password "$app" +# Create DB user mastodon +ynh_psql_create_db_without_password "$app" + # Set UTF8 encoding by default sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='false' where datname='template1';"\ From 0ab50ab5ebd65944784bea1b1af950d2a722471e Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 13:54:13 +0200 Subject: [PATCH 17/29] Update install --- scripts/install | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 7232b27..0a5d1bb 100644 --- a/scripts/install +++ b/scripts/install @@ -65,12 +65,6 @@ curl -sL https://deb.nodesource.com/setup_4.x | sudo bash - sudo apt-get -y install nodejs sudo npm install -g yarn -# Create DB user mastodon -ynh_psql_create_user_without_password "$app" - -# Create DB user mastodon -ynh_psql_create_db_without_password "$app" - # Set UTF8 encoding by default sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='false' where datname='template1';"\ @@ -78,6 +72,9 @@ sudo su -c "psql" postgres <<< \ "create database template1 encoding='UTF8' template template0;"\ "update pg_database set datistemplate='true' where datname='template1';" +# Create DB user mastodon +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 From b3c81edb5dc91e241288c668358037e088e43931 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 14:36:12 +0200 Subject: [PATCH 18/29] Another change on PG set UTF8 --- scripts/install | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index dba714e..239a2fa 100644 --- a/scripts/install +++ b/scripts/install @@ -68,10 +68,13 @@ 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';"\ - "drop database template1;"\ - "create database template1 encoding='UTF8' template template0;"\ - "update pg_database set datistemplate='true' where datname='template1';" + "update pg_database set datistemplate='false' where datname='template1';" +sudo su -c "psql" postgres <<< \ + "drop database template1;" +sudo su -c "psql" postgres <<< \ + "create database template1 encoding='UTF8' template template0;" +sudo su -c "psql" postgres <<< \ + "update pg_database set datistemplate='true' where datname='template1';" # Create DB user mastodon ======= From 289d9fb81f00d17957b9f788eb709a3cd9618fa1 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 14:51:38 +0200 Subject: [PATCH 19/29] Clean lines --- scripts/install | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/scripts/install b/scripts/install index 239a2fa..4d215bd 100644 --- a/scripts/install +++ b/scripts/install @@ -65,7 +65,6 @@ 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';" @@ -76,28 +75,20 @@ sudo su -c "psql" postgres <<< \ 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 @@ -212,10 +203,8 @@ 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 +# sudo systemctl status nginx +# sudo systemctl reload nginx + From 79f620fc4ea5c7a9f3afc96c964a7087316a1d53 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 15:00:05 +0200 Subject: [PATCH 20/29] Mkdir live not need --- scripts/install | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 4d215bd..b324893 100644 --- a/scripts/install +++ b/scripts/install @@ -79,17 +79,19 @@ sudo su -c "psql" postgres <<< \ ynh_psql_create_db_without_password "$app" # Download all Ruby source +su - mastodon 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 sudo git clone https://github.com/tootsuite/mastodon.git $final_path/live +exit # Be king rewind (/var/cache/yunohost/from_file/scripts) popd # Get Mastodon last version -sudo mkdir "${final_path}/live" -SETUP_SOURCE -sudo chown -R $app: "${final_path}" +# sudo mkdir "${final_path}/live" +# SETUP_SOURCE +# sudo chown -R $app: "${final_path}" # Install de rbenv sudo su - $app < Date: Tue, 11 Apr 2017 15:04:27 +0200 Subject: [PATCH 21/29] Missing sudo --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index b324893..df33c1e 100644 --- a/scripts/install +++ b/scripts/install @@ -79,7 +79,7 @@ sudo su -c "psql" postgres <<< \ ynh_psql_create_db_without_password "$app" # Download all Ruby source -su - mastodon +sudo su - mastodon 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 sudo git clone https://github.com/tootsuite/mastodon.git $final_path/live From ea76c40191257cff2fc10837a7a5b28498d90544 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 15:10:40 +0200 Subject: [PATCH 22/29] Fix on git clone --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index df33c1e..aa4bd68 100644 --- a/scripts/install +++ b/scripts/install @@ -79,11 +79,11 @@ sudo su -c "psql" postgres <<< \ ynh_psql_create_db_without_password "$app" # Download all Ruby source -sudo su - mastodon +sudo su - $app < Date: Tue, 11 Apr 2017 15:16:49 +0200 Subject: [PATCH 23/29] Update install --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index aa4bd68..e968b7d 100644 --- a/scripts/install +++ b/scripts/install @@ -79,11 +79,11 @@ sudo su -c "psql" postgres <<< \ ynh_psql_create_db_without_password "$app" # Download all Ruby source -sudo su - $app < Date: Tue, 11 Apr 2017 15:20:55 +0200 Subject: [PATCH 24/29] Update install --- scripts/install | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index e968b7d..c1da21f 100644 --- a/scripts/install +++ b/scripts/install @@ -79,11 +79,11 @@ sudo su -c "psql" postgres <<< \ ynh_psql_create_db_without_password "$app" # Download all Ruby source -sudo su - $app < Date: Tue, 11 Apr 2017 16:06:16 +0200 Subject: [PATCH 25/29] Re-run mastodon install at the end --- scripts/install | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index c1da21f..903416f 100644 --- a/scripts/install +++ b/scripts/install @@ -159,8 +159,17 @@ pushd ~/live # RAILS_ENV=production bin/bundle exec rails mastodon:confirm_email USER_EMAIL=$admin_mastodon@$domain ACOMMANDS +# Re-Install Mastodon WHY ??? +sudo su - $app < Date: Tue, 11 Apr 2017 16:08:02 +0200 Subject: [PATCH 26/29] Use popd --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 903416f..849a88e 100644 --- a/scripts/install +++ b/scripts/install @@ -169,7 +169,7 @@ MCOMMANDS # Add Services #pushd /var/cache/yunohost/from_file/mastodon_ynh-master/scripts -popd +pushd $(popd) sudo cp ../conf/mastodon-web.service /etc/systemd/system/mastodon-web.service sudo chown root: /etc/systemd/system/mastodon-web.service From 51a5fc28f10acd0eba05bdeae6d384153a535881 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 16:51:11 +0200 Subject: [PATCH 27/29] Repair broken services --- scripts/install | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index 849a88e..b3150f0 100644 --- a/scripts/install +++ b/scripts/install @@ -159,14 +159,6 @@ pushd ~/live # RAILS_ENV=production bin/bundle exec rails mastodon:confirm_email USER_EMAIL=$admin_mastodon@$domain ACOMMANDS -# Re-Install Mastodon WHY ??? -sudo su - $app < Date: Tue, 11 Apr 2017 16:54:46 +0200 Subject: [PATCH 28/29] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4fe4817..6d5b174 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Mastodon est un réseau social gratuit et open source. Une alternative décentra ### Mise à jour -`$ sudo yunohost app upgrade --verbose mastodon -u https://github.com/YunoHost-Apps/mastoron_ynh.git` +`$ sudo yunohost app upgrade --verbose mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh.git` ## What is Mastodon? @@ -25,8 +25,8 @@ Mastodon is a free, open-source social network. A decentralized alternative to c ### Install -`$ sudo yunohost app install https://github.com/YunoHost-Apps/mastoron_ynh.git` +`$ sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh.git` ### Update -`$ sudo yunohost app upgrade --verbose mastoron -u https://github.com/YunoHost-Apps/mastoron_ynh.git` \ No newline at end of file +`$ sudo yunohost app upgrade --verbose mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh.git` From 6cca229765263b90433b776b9d2cc97e8c04ad22 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 17:03:11 +0200 Subject: [PATCH 29/29] Add stop and start services --- scripts/upgrade | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0260ee1..771b98b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,6 +31,9 @@ db_name=$app sudo sed -i "s@__PATH__@$app@g" ../conf/nginx.conf* sudo sed -i "s@__FINALPATH__@$final_path/@g" ../conf/nginx.conf* +# Stop Mastodon Services +sudo systemctl stop /etc/systemd/system/mastodon-*.service + # Update Mastodon sudo su - $app <