From 74526f2e537ed660233fd6abc512ffa28f78237b Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Wed, 16 Aug 2023 18:16:57 +0200 Subject: [PATCH] Remove duplicate nginx config Clear manifest data, option only available with the config panel Try to setup the config panel Set the version number --- conf/nginx.conf | 6 ------ config_panel.toml | 17 +++++++++++++---- manifest.toml | 8 +------- scripts/config | 5 +++++ 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 22dd70d..e522e75 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -20,12 +20,6 @@ location __PATH__/ { access_log off; } - # Build error access - error_page 404 /error/404.html; - location = __PATH__/error/404.html { - internal; - } - # Deny access to hidden files and directories location ~ ^__PATH__/(.+/|)\.(?!well-known\/) { deny all; diff --git a/config_panel.toml b/config_panel.toml index 113b804..375b895 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -18,13 +18,22 @@ name = "My Webapp configuration" visible = "with_sftp" help = "If a password already exist, leave blank and it will not be replaced." - [main.error] + [main.code_error] name = "Html Custom error" - [main.error.errorfile] - ask = "HTML Path" + [main.code_error.custom_error_file] + ask = "Activate the custom error file use" + type = "boolean" + default = false + # default = "/404.html" + help = "you enable this, you can create a custom `404.html` file at the root of your app to act as the custom 404 error page" + + [main.code_error.path_folder] + ask = "Specifie folder where your error file are sto" type = "string" - default = "/404.html" + default = "/" + help = "You can set where your error file are store in your www folder." + [main.php_fpm_config] name = "PHP-FPM configuration" diff --git a/manifest.toml b/manifest.toml index 10be47a..f17289e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "My Webapp" description.en = "Custom Web app with SFTP access to serve static (HTML, CSS, JS) and PHP files" description.fr = "Application Web personnalisée avec accès SFTP pour servir des fichiers statiques (HTML, CSS, JS) et PHP" -version = "1.0~ynh17" +version = "1.0~ynh15" maintainers = [] @@ -58,12 +58,6 @@ ram.runtime = "50M" type = "boolean" default = false - [install.codeerror] - ask.en = "Define a path about the 404 error page" - ask.fr = "Definir un chemin pour la page d'erreur 404" - type = "path" - default = "/404.html" - [resources] [resources.system_user] diff --git a/scripts/config b/scripts/config index 21b6f17..319756e 100644 --- a/scripts/config +++ b/scripts/config @@ -148,6 +148,11 @@ ynh_app_config_apply() { ynh_system_user_del_group --username=$app --groups="sftp.app" fi + if [ "${changed[errorfile]}" == "true" ] + then + echo Update error nginx config + fi + if [ "$phpversion" != "none" ] then ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint