diff --git a/manifest.toml b/manifest.toml index 29a30ee..ee49d7d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -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] diff --git a/scripts/install b/scripts/install index 836605b..f039e84 100644 --- a/scripts/install +++ b/scripts/install @@ -67,9 +67,11 @@ then YNH_PHP_VERSION="$phpversion" fi -# 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" +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" +fi # Create a dedicated NGINX config diff --git a/scripts/upgrade b/scripts/upgrade index 31f947a..a0852cc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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