mirror of
https://github.com/YunoHost-Apps/reverseproxy_ynh.git
synced 2024-09-03 20:16:23 +02:00
Merge branch 'testing' into enh-testing
This commit is contained in:
commit
91d9264b90
3 changed files with 12 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
|||
setup_root=1
|
||||
setup_nourl=0
|
||||
setup_private=0
|
||||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
backup_restore=1
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue