mirror of
https://github.com/YunoHost-Apps/redirect_ynh.git
synced 2024-09-03 20:16:10 +02:00
[fix] Linter
This commit is contained in:
parent
4a20a37ed7
commit
8a9a2d8234
4 changed files with 9 additions and 32 deletions
|
@ -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."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue