diff --git a/scripts/upgrade b/scripts/upgrade index abca621..dd76818 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -100,6 +100,17 @@ then ynh_setup_source --dest_dir=$final_path fi +#================================================= +# STORE THE CONFIG FILE CHECKSUM +#================================================= + +### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. +### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it. +ynh_backup_if_checksum_is_different --file="$config_path/config.js" + +# Recalculate and store the checksum of the file for the next upgrade. +ynh_store_file_checksum --file="$config_path/config.js" + #================================================= # COPY A CONFIG FILE #================================================= @@ -187,6 +198,18 @@ cp -a ../conf/config.js "$config_path" chown -R $app: $final_path chown -R $app: $config_path +#================================================= +# SETUP SSOWAT +#================================================= +ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1 + +# Make app public if necessary +if [ $is_public -eq 1 ] +then + # unprotected_uris allows SSO credentials to be passed anyway + ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" +fi + #================================================= # START SYSTEMD SERVICE #=================================================