From 1a2cf5707421196835c49281ec128b47c8cdd403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:05:52 +0200 Subject: [PATCH] cleaning --- scripts/restore | 30 ------------------------------ scripts/upgrade | 10 +++++----- 2 files changed, 5 insertions(+), 35 deletions(-) diff --git a/scripts/restore b/scripts/restore index fe4d961..140805f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -24,23 +24,6 @@ if ! yunohost app list | grep -q "id: $dex_app"; then yunohost app install https://github.com/YunoHost-Apps/dex_ynh --force --args "domain=$dex_domain&path=$dex_path&OIDC_name=$oidc_name&OIDC_secret=$oidc_secret&OIDC_callback=$oidc_callback" fi -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -54,7 +37,6 @@ chown -R $app:www-data "$install_dir" #================================================= # RESTORE LOCAL STORAGE #================================================= - ynh_script_progression --message="Restoring the app local storage..." --weight=1 ynh_restore_file --origin_path="/var/lib/outline" @@ -80,18 +62,6 @@ ynh_script_progression --message="Restoring the PostgreSQL database..." --weight ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name -#================================================= -# UPDATING A CONFIGURATION -#================================================= - -#REMOVEME? ynh_secure_remove --file="$install_dir/.env" -ynh_script_progression --message="Updating the configuration file..." --weight=1 - -ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" - -chmod 400 "$install_dir/.env" -chown $app:$app "$install_dir/.env" - #================================================= # RESTORE SYSTEMD #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 953bf7c..7ec9abd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,13 +33,13 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_secure_remove --file="$final_path" - ynh_setup_source --dest_dir="$final_path" + ynh_secure_remove --file="$install_dir" + ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #======================================================= # MIGRATE MINIO BUCKET IF UPGRADING FROM AN OLD VERSION