diff --git a/scripts/_common.sh b/scripts/_common.sh index e106b18..7849e16 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,13 +5,13 @@ URL_REGEX_SECURE='^(http://(127\.[0-9]+\.[0-9]+\.[0-9]+|localhost)|https://.*)(: _validate_redirect_uri() { if [[ ! $target =~ $URL_REGEX_VALID ]]; then - ynh_die "Invalid destination: $target" 1 + ynh_die --message="Invalid destination: $target" 1 fi # Avoid uncrypted remote destination with reverse proxy mode # Indeed the SSO send the password in all requests in HTTP headers if [[ "$redirect_type" = "reverseproxy" ]] && [[ ! $target =~ $URL_REGEX_SECURE ]]; then - ynh_die "For secure reason, you can't use an unencrypted http remote destination couple with ssowat for your reverse proxy: $target" 1 + ynh_die --message="For secure reason, you can't use an unencrypted http remote destination couple with ssowat for your reverse proxy: $target" 1 fi } diff --git a/scripts/backup b/scripts/backup index 5598312..942c232 100644 --- a/scripts/backup +++ b/scripts/backup @@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # Copy the conf files -ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" +ynh_backup --src_path="/etc/nginx/conf.d/${domain}.d/${app}.conf" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index de715e2..926294b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -3,7 +3,7 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -ynh_restore_file "/etc/nginx/conf.d/${domain}.d/${app}.conf" +ynh_restore_file --origin_path="/etc/nginx/conf.d/${domain}.d/${app}.conf" ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 8f8a22c..52b7cad 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,12 +12,12 @@ if [[ "${redirect_type:-}" == *"proxy"* ]]; then else redirect_type="redirect" fi -ynh_app_setting_set $app 'redirect_type' $redirect_type +ynh_app_setting_set --app=$app --key='redirect_type' --value=$redirect_type if [[ -z "${target:-}" ]] && [[ -n "${redirect_path:-}" ]]; then target="$redirect_path" ynh_app_setting_delete --app=$app --key=redirect_path - ynh_app_setting_set --app=$app --key=target --value="$redirect_path" + ynh_app_setting_set --app=$app --key=target --value="$target" fi # When testing on the CI, we need a service to test the reverse-proxying