1
0
Fork 0
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:
Kayou 2024-07-23 13:57:51 +02:00 committed by GitHub
parent 55c0bbb594
commit f92817b922
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 4 deletions

View file

@ -59,6 +59,12 @@ ram.runtime = "50M"
choices = [ "none", "mysql", "postgresql" ]
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.system_user]

View file

@ -67,9 +67,11 @@ then
YNH_PHP_VERSION="$phpversion"
fi
if [ $custom_error_file -eq 1 ]
then
# Add the custom error build with the application
ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf"
ynh_app_setting_set --app=$app --key=custom_error_file --value="true"
fi
# Create a dedicated NGINX config

View file

@ -70,7 +70,7 @@ fi
# If custom_error_file doesn't exist, create it.
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
fi