diff --git a/scripts/backup b/scripts/backup index d66fb5b..8a0c86f 100644 --- a/scripts/backup +++ b/scripts/backup @@ -28,6 +28,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) +config_path=$(ynh_app_setting_get --app=$app --key=config_path) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -44,7 +45,7 @@ ynh_backup --src_path="$final_path" # BACKUP THE APP CONFIG DIR #================================================= -ynh_backup --src_path="/var/lib/$app" +ynh_backup --src_path="$config_path" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/change_url b/scripts/change_url index 9f3e56f..9f415e3 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,6 +29,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) +config_path=$(ynh_app_setting_get --app=$app --key=config_path) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP @@ -107,7 +108,6 @@ fi ynh_script_progression --message="Modifying a config file..." --weight=1 path_url="$new_path" -config_path="/var/lib/$app" cp ../conf/navidrome.toml "$config_path/navidrome.toml" diff --git a/scripts/install b/scripts/install index 2b3ec8f..3d3d21a 100644 --- a/scripts/install +++ b/scripts/install @@ -112,6 +112,7 @@ ynh_multimedia_addfolder --source_dir="/home/yunohost.$app/Music" --dest_dir="sh ynh_script_progression --message="Modifying a config file..." --weight=1 config_path="/var/lib/$app" +ynh_app_setting_set --app=$app --key=config_path --value=$config_path mkdir -p "$config_path" cp ../conf/navidrome.toml "$config_path/navidrome.toml" diff --git a/scripts/remove b/scripts/remove index b23af30..1da005f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +config_path=$(ynh_app_setting_get --app=$app --key=config_path) #================================================= # STANDARD REMOVE @@ -63,7 +64,7 @@ ynh_secure_remove --file="$final_path" ynh_script_progression --message="Removing $app config directory..." --weight=6 # Remove the config directory securely -ynh_secure_remove --file="/var/lib/$app" +ynh_secure_remove --file="$config_path" #================================================= # REMOVE NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 556c820..0d7fdfa 100644 --- a/scripts/restore +++ b/scripts/restore @@ -29,6 +29,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +config_path=$(ynh_app_setting_get --app=$app --key=config_path) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -61,7 +62,7 @@ ynh_restore_file --origin_path="$final_path" #================================================= ynh_script_progression --message="Restoring $app config directory..." --weight=2 -ynh_restore_file --origin_path="/var/lib/$app" +ynh_restore_file --origin_path="$config_path" #================================================= # RECREATE THE DEDICATED USER @@ -78,7 +79,7 @@ ynh_script_progression --message="Restoring user rights..." # Restore permissions on app files chown -R $app:$app "$final_path" -chown -R $app:$app "/var/lib/$app" +chown -R $app:$app "$config_path" #================================================= # SPECIFIC RESTORATION @@ -110,7 +111,7 @@ yunohost service add $app --description "Web-based music collection server and s #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Version:" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Version:" #================================================= # RESTORE THE LOGROTATE CONFIGURATION