diff --git a/scripts/install b/scripts/install index c9d3d34..9e61390 100644 --- a/scripts/install +++ b/scripts/install @@ -204,6 +204,13 @@ ynh_add_systemd_config --service="$app-server" --template="funkwhale-server.serv ynh_add_systemd_config --service="$app-worker" --template="funkwhale-worker.service" ynh_add_systemd_config --service="$app-beat" --template="funkwhale-beat.service" +#================================================= +# STORE THE CONFIG FILE CHECKSUM +#================================================= + +# Calculate and store the config file checksum into the app settings +ynh_store_file_checksum --file="$configfile" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2db5b62..f3df721 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -168,7 +168,7 @@ virtualenv -p python3 "$final_path/code/virtualenv" #================================================= configfile="$final_path/code/config/.env" - +ynh_backup_if_checksum_is_different --file="$configfile" cp ../conf/env.prod "$configfile" key=$(ynh_string_random) @@ -226,6 +226,13 @@ ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" python api/manage.py script delete_pre_017_federated_uploads --no-input ) +#================================================= +# STORE THE CONFIG FILE CHECKSUM +#================================================= + +# Recalculate and store the checksum of the file for the next upgrade. +ynh_store_file_checksum --file="$configfile" + #================================================= # SETUP SYSTEMD #=================================================