From d41c3be8410a4d25b6f8882fb54eb852461e2579 Mon Sep 17 00:00:00 2001 From: Boudewijn Date: Sun, 2 Mar 2025 21:27:39 +0100 Subject: [PATCH] Include backup- and change-URL-scripts --- scripts/backup | 35 ++--------------------------------- scripts/change_url | 14 ++++---------- 2 files changed, 6 insertions(+), 43 deletions(-) diff --git a/scripts/backup b/scripts/backup index 1336d22..836c6ef 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,47 +21,16 @@ ynh_print_info "Declaring files to be backed up..." ynh_backup "$install_dir" -#================================================= -# BACKUP THE DATA DIR -#================================================= - -# Only relevant if there is a "data_dir" resource for this app -# NB: $data_dir is not backuped during safety-backup-before-upgrades, -# because the data dir may be huge and we don't want to just yolo-create a 10+ GB archive just for upgrades. -# On the other hand, $data_dir is also *not* removed by default in the "app remove" step unless --purge is used -# This means that even if the upgrade fails and the backup is restored, the data are still there. -ynh_backup "$data_dir" - #================================================= # BACKUP SYSTEM CONFIGURATION #================================================= -# Backup the PHP-FPM configuration -ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf" - # Backup the NGINX configuration ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -# Backup the systemd service unit -ynh_backup "/etc/systemd/system/$app.service" - -# Backup the logrotate configuration -ynh_backup "/etc/logrotate.d/$app" - # Backup the Fail2Ban config -ynh_backup "/etc/fail2ban/jail.d/$app.conf" -ynh_backup "/etc/fail2ban/filter.d/$app.conf" - -#================================================= -# BACKUP VARIOUS FILES -#================================================= - -ynh_backup "/etc/cron.d/$app" - -ynh_backup "/etc/$app/" - -# NB: /var/log is not backuped during safety-backup-before-upgrades, same as $data_dir -ynh_backup "/var/log/$app/" +#ynh_backup "/etc/fail2ban/jail.d/$app.conf" +#ynh_backup "/etc/fail2ban/filter.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE diff --git a/scripts/change_url b/scripts/change_url index 25e55b5..890c4d6 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -14,9 +14,8 @@ source /usr/share/yunohost/helpers #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression "Stopping $app's systemd service..." -ynh_systemctl --service="$app" --action="stop" +## My Idlers runs as a Laravel app on nginx; keep that running. #================================================= # MODIFY URL IN NGINX CONF @@ -30,14 +29,9 @@ ynh_config_change_url_nginx # SPECIFIC MODIFICATIONS #================================================= -## do any changes to files that reference specific installation domain/path, i.e. regenerate configs etc - -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression "Starting $app's systemd service..." - -ynh_systemctl --service="$app" --action="start" +## Only the app_url in .env needs to change +sed -i -e 's/$old_doman/new_domain/g' __INSTALL_DIR__/.env +sed -i -e 's/$old_path/new_path/g' __INSTALL_DIR__/.env #================================================= # END OF SCRIPT