Merge branch 'testing' into enh-testing

This commit is contained in:
Éric Gaspar 2021-06-05 19:16:11 +02:00 committed by GitHub
commit 91d9264b90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View file

@ -10,6 +10,7 @@
setup_root=1
setup_nourl=0
setup_private=0
setup_private=1
setup_public=1
upgrade=1
backup_restore=1

View file

@ -33,6 +33,12 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
url_regex='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
[[ ! $redirect_path =~ $url_regex ]] && ynh_die "Invalid destination: $redirect_path" 1
# Avoid uncrypted remote destination with reverse proxy mode
# Indeed the SSO send the password in all requests in HTTP headers
url_regex='^(http://(127\.[0-9]+\.[0-9]+\.[0-9]+|localhost)|https://.*)(:[0-9]+)?(/.*)?$'
[[ "$redirect_type" = "proxy" ]] && [[ ! $redirect_path =~ $url_regex ]] && ynh_die \
"For secure reason, you can't use an unencrypted http remote destination couple with ssowat for your reverse proxy: $redirect_path" 1
# Save extra settings
ynh_app_setting_set --app=$app --key=redirect_type --value=$redirect_type
ynh_app_setting_set --app=$app --key=redirect_path --value=$redirect_path

View file

@ -38,9 +38,13 @@ NGINX_CONF="/etc/nginx/conf.d/${domain}.d/${app}.conf"
ynh_restore_file "$NGINX_CONF"
#=================================================
# CONFIGURE SSOWAT
# SETUP SSOWAT
#=================================================
if [[ "$is_public" -eq 0 ]]
then # Remove the public access
ynh_app_setting_delete "$app" skipped_uris
fi
# Make app public if necessary
if [ "$redirect_type" != "private_proxy" ]
then