aboutsummaryrefslogtreecommitdiff
path: root/scripts/backup
diff options
context:
space:
mode:
authornemsia <nemsia@nemsia.org>2017-07-13 00:12:42 +0200
committerGitHub <noreply@github.com>2017-07-13 00:12:42 +0200
commit8711b925306be63d7b2b7669fe2ef3cf8ebdc476 (patch)
tree46765118fb06d5e0c4caf911430b2f108f1476dc /scripts/backup
parent7cd6bc84ac242c38b719077a7ad5fcf23497421c (diff)
downloadmastodon_ynh-8711b925306be63d7b2b7669fe2ef3cf8ebdc476.tar.gz
mastodon_ynh-8711b925306be63d7b2b7669fe2ef3cf8ebdc476.tar.bz2
mastodon_ynh-8711b925306be63d7b2b7669fe2ef3cf8ebdc476.zip
add __FINALPATH__ on Nginx conf (#46)
* [enh] Final_path on nginx * [enh] final_path on nginx.conf * Merge remote-tracking branch 'refs/remotes/YunoHost-Apps/master' into nginx-conf # Conflicts: # scripts/restore * [fix] nginx path on backup * [fix] Error on final_path nginx * Version num in badge
Diffstat (limited to 'scripts/backup')
-rw-r--r--scripts/backup6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/backup b/scripts/backup
index d3bf424..e4a5bba 100644
--- a/scripts/backup
+++ b/scripts/backup
@@ -23,6 +23,9 @@ domain=$(ynh_app_setting_get "$app" domain)
final_path="/opt/${app}"
ynh_backup "$final_path" "sources" 1
+# final_path on nginx
+sudo sed -i "s@$final_path@__FINALPATH__@g" /etc/nginx/conf.d/${domain}.d/${app}.conf
+
# Copy the nginx conf files
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
ynh_backup "/etc/cron.d/${app}" "cron.conf"
@@ -32,6 +35,9 @@ ynh_backup "/etc/systemd/system/mastodon-streaming.service" "systemd_streaming.s
ynh_backup "/etc/apt/sources.list.d/backports.list" "apt_backports.list"
ynh_backup "/etc/apt/sources.list.d/yarn.list" "apt_yarn.list"
+# final_path on nginx
+sudo sed -i "s@__FINALPATH__@$final_path@g" /etc/nginx/conf.d/${domain}.d/${app}.conf
+
# Backup db
sudo su - postgres <<COMMANDS
pg_dump --role=mastodon -U postgres --no-password mastodon_production > mastodon_db.sql