mirror of
https://github.com/YunoHost-Apps/redirect_ynh.git
synced 2024-09-03 20:16:10 +02:00
Just adding some getops
This commit is contained in:
parent
2be200f19a
commit
2684e51427
4 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue