mirror of
https://github.com/YunoHost-Apps/my_webapp_ynh.git
synced 2024-09-03 19:46:26 +02:00
add custom_error_file in the manifest, default to false
This commit is contained in:
parent
55c0bbb594
commit
f92817b922
3 changed files with 12 additions and 4 deletions
|
@ -59,6 +59,12 @@ ram.runtime = "50M"
|
||||||
choices = [ "none", "mysql", "postgresql" ]
|
choices = [ "none", "mysql", "postgresql" ]
|
||||||
default = "none"
|
default = "none"
|
||||||
|
|
||||||
|
[install.custom_error_file]
|
||||||
|
ask = "Activate the custom error file use"
|
||||||
|
type = "boolean"
|
||||||
|
default = false
|
||||||
|
help = "Once custom error enabled, you can add/create a custom `404.html` file in a directory `www/error`."
|
||||||
|
|
||||||
[resources]
|
[resources]
|
||||||
[resources.system_user]
|
[resources.system_user]
|
||||||
|
|
||||||
|
|
|
@ -67,9 +67,11 @@ then
|
||||||
YNH_PHP_VERSION="$phpversion"
|
YNH_PHP_VERSION="$phpversion"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add the custom error build with the application
|
if [ $custom_error_file -eq 1 ]
|
||||||
ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf"
|
then
|
||||||
ynh_app_setting_set --app=$app --key=custom_error_file --value="true"
|
# Add the custom error build with the application
|
||||||
|
ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
|
|
|
@ -70,7 +70,7 @@ fi
|
||||||
|
|
||||||
# If custom_error_file doesn't exist, create it.
|
# If custom_error_file doesn't exist, create it.
|
||||||
if [ -z "${custom_error_file:-}" ]; then
|
if [ -z "${custom_error_file:-}" ]; then
|
||||||
custom_error_file=1
|
custom_error_file=0
|
||||||
ynh_app_setting_set --app=$app --key=custom_error_file --value=$custom_error_file
|
ynh_app_setting_set --app=$app --key=custom_error_file --value=$custom_error_file
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue