diff --git a/manifest.json b/manifest.json index 6621ebc..80c9f27 100644 --- a/manifest.json +++ b/manifest.json @@ -29,7 +29,6 @@ { "name": "domain", "type": "domain", - "example": "domain.org" }, { "name": "path", @@ -68,7 +67,8 @@ "name": "is_public", "type": "boolean", "default": true, - "visible": "redirect_type == 'proxy'" + "visible": "redirect_type == 'proxy'", + "help": "You can manage public or private mode only with the proxy mode." } ] } diff --git a/scripts/install b/scripts/install index ef17fc4..839787b 100644 --- a/scripts/install +++ b/scripts/install @@ -25,7 +25,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH redirect_type=$YNH_APP_ARG_REDIRECT_TYPE redirect_path=$YNH_APP_ARG_REDIRECT_PATH -is_public=$YNH_APP_ARG_IS_PUBLIC +is_public=${YNH_APP_ARG_IS_PUBLIC:-1} propagate_subpath=$(echo $YNH_APP_ARG_REDIRECT_TYPE | grep -q subpath && echo 1 || echo 0) frame_ancestors="'none'" client_max_body_size="1m" @@ -62,7 +62,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=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 -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=frame_ancestors --value="'none'" ynh_app_setting_set --app=$app --key=client_max_body_size --value="1m" diff --git a/scripts/restore b/scripts/restore index 1a34710..88f8c98 100644 --- a/scripts/restore +++ b/scripts/restore @@ -27,7 +27,6 @@ redirect_type=$(ynh_app_setting_get --app=$app --key=redirect_type) redirect_path=$(ynh_app_setting_get --app=$app --key=redirect_path) frame_ancestors=$(ynh_app_setting_get --app=$app --key=frame_ancestors) client_max_body_size=$(ynh_app_setting_get --app=$app --key=client_max_body_size) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) # Validate redirect path url_regex='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]' @@ -40,23 +39,6 @@ NGINX_CONF="/etc/nginx/conf.d/${domain}.d/${app}.conf" # Restore configuration files ynh_restore_file "$NGINX_CONF" -#================================================= -# SETUP SSOWAT -#================================================= - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. - if [[ $redirect_type != "proxy" ]] - then - ynh_permission_update --permission="main" --add="visitors" --protected=1 - else - ynh_permission_update --permission="main" --add="visitors" - fi -fi - #================================================= # RELOAD NGINX AND PHP-FPM #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 96040a4..1e560c5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -126,17 +126,13 @@ ynh_add_nginx_config # CONFIGURE SSOWAT #================================================= -# Make app public if necessary -if [ $is_public -eq 1 ] +# Everyone can access the app. +# The "main" permission is automatically created before the install script. +if [[ $redirect_type != "proxy" ]] then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. - if [[ $redirect_type != "proxy" ]] - then - ynh_permission_update --permission="main" --add="visitors" --protected=1 - else - ynh_permission_update --permission="main" --add="visitors" --protected=0 - fi + ynh_permission_update --permission="main" --add="visitors" --protected=1 +else + ynh_permission_update --permission="main" --protected=0 fi #=================================================