From 6e6f3cd38d0f589415ab71acd5c00d487f0b668e Mon Sep 17 00:00:00 2001 From: nemsia Date: Fri, 21 Apr 2017 14:29:37 +0200 Subject: [PATCH 01/11] Acl for Postgres user dump --- scripts/restore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index f754d81..80233af 100644 --- a/scripts/restore +++ b/scripts/restore @@ -81,6 +81,9 @@ sudo su -c "psql" postgres <<< \ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='true' where datname='template1';" +# Acl for Postgres user dump +sudo setfacl -R -m u:postgres:r $YNH_APP_BACKUP_DIR || true + # Restore db ynh_psql_create_db_without_password "$app" sudo su - postgres < Date: Mon, 24 Apr 2017 23:52:44 +0200 Subject: [PATCH 02/11] [fix] Stop streaming service --- scripts/remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index 6ddf97b..373d028 100644 --- a/scripts/remove +++ b/scripts/remove @@ -32,7 +32,7 @@ fi # Stop mastodon-sidekiq if [ -e "/etc/systemd/system/mastodon-streaming.service" ]; then echo "Delete systemd script" - sudo systemctl stop mastodon-sidekiq.streaming + sudo systemctl stop mastodon-streaming.service ynh_secure_remove "/etc/systemd/system/mastodon-streaming.service" sudo systemctl disable mastodon-streaming.service fi From 3604622ae5400c7d757943d70cf528904149dbdf Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 25 Apr 2017 00:04:58 +0200 Subject: [PATCH 03/11] [fix] replace setfact by chmod --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 80233af..a0498f0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -82,7 +82,7 @@ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='true' where datname='template1';" # Acl for Postgres user dump -sudo setfacl -R -m u:postgres:r $YNH_APP_BACKUP_DIR || true +sudo chmod o+r $YNH_APP_BACKUP_DIR/mastodon_db.sql || true # Restore db ynh_psql_create_db_without_password "$app" From fadf3e03b9361e04d55ca738fdff8ce7a71ac906 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 25 Apr 2017 12:46:21 +0200 Subject: [PATCH 04/11] [fix] Chmod .sql --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index a0498f0..c7e380c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -82,7 +82,7 @@ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='true' where datname='template1';" # Acl for Postgres user dump -sudo chmod o+r $YNH_APP_BACKUP_DIR/mastodon_db.sql || true +sudo chmod a+rx $YNH_APP_BACKUP_DIR/mastodon_db.sql || true # Restore db ynh_psql_create_db_without_password "$app" From d15d28745678bc9a9e9bf285988b83e3cb534bf4 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 25 Apr 2017 14:46:40 +0200 Subject: [PATCH 05/11] [fix] Acl backup directory --- scripts/restore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index c7e380c..414a5f5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -82,7 +82,8 @@ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='true' where datname='template1';" # Acl for Postgres user dump -sudo chmod a+rx $YNH_APP_BACKUP_DIR/mastodon_db.sql || true +sudo chmod a+rx $YNH_APP_BACKUP_DIR +sudo chmod a+rx $YNH_APP_BACKUP_DIR/mastodon_db.sql # Restore db ynh_psql_create_db_without_password "$app" From 5850d816620c8b6c1664f0c478321570591f9118 Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 25 Apr 2017 21:21:11 +0200 Subject: [PATCH 06/11] [fix] Copy dump in $finalpath --- scripts/restore | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/restore b/scripts/restore index 414a5f5..f931f0d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -81,16 +81,18 @@ sudo su -c "psql" postgres <<< \ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='true' where datname='template1';" -# Acl for Postgres user dump -sudo chmod a+rx $YNH_APP_BACKUP_DIR -sudo chmod a+rx $YNH_APP_BACKUP_DIR/mastodon_db.sql +# Copy postgresql dump +sudo cp $YNH_APP_BACKUP_DIR/mastodon_db.sql $final_path # Restore db ynh_psql_create_db_without_password "$app" sudo su - postgres < Date: Wed, 26 Apr 2017 10:40:39 +0200 Subject: [PATCH 07/11] [fix] Chmod on backup/tmp --- scripts/restore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/restore b/scripts/restore index f931f0d..8d0df6a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -70,6 +70,8 @@ sudo cp -a ./sources "$final_path" # Set permissions sudo chown -R $app: "$final_path" +sudo chmod -R a+rx /home/yunohost.backup/tmp + # Set UTF8 encoding by default sudo su -c "psql" postgres <<< \ From ed08bd31ad591bbae6fbd66f910ccf0d129738ef Mon Sep 17 00:00:00 2001 From: nemsia Date: Wed, 26 Apr 2017 13:52:17 +0200 Subject: [PATCH 08/11] [fix] Add restart postgre --- scripts/restore | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/restore b/scripts/restore index 8d0df6a..65a4af8 100644 --- a/scripts/restore +++ b/scripts/restore @@ -88,6 +88,7 @@ sudo cp $YNH_APP_BACKUP_DIR/mastodon_db.sql $final_path # Restore db ynh_psql_create_db_without_password "$app" +sudo systemctl restart postgresql sudo su - postgres < Date: Wed, 26 Apr 2017 16:12:34 +0200 Subject: [PATCH 09/11] [fix] PG restore --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 65a4af8..7820e04 100644 --- a/scripts/restore +++ b/scripts/restore @@ -90,7 +90,7 @@ sudo cp $YNH_APP_BACKUP_DIR/mastodon_db.sql $final_path ynh_psql_create_db_without_password "$app" sudo systemctl restart postgresql sudo su - postgres < Date: Fri, 28 Apr 2017 11:42:08 +0200 Subject: [PATCH 10/11] [fix] Replace pushd by cd on upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 655f22f..076e3fb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,7 +39,7 @@ sudo systemctl stop mastodon-*.service # Update Mastodon sudo su - $app < Date: Fri, 28 Apr 2017 13:30:04 +0200 Subject: [PATCH 11/11] [enh] Install tagged releases --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index ed2b1e7..67e69b0 100644 --- a/scripts/install +++ b/scripts/install @@ -87,6 +87,8 @@ sudo su - $app <