From 7029f6eb8586144a8fdf49773440d3f23927c3fa Mon Sep 17 00:00:00 2001 From: --help Date: Sat, 12 Aug 2023 11:30:01 +0200 Subject: [PATCH 01/99] Add error 404 code --- conf/nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index 9f696ae..f446dd0 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -20,6 +20,12 @@ location __PATH__/ { access_log off; } + 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; From 6095c6c21f2529917deecf8f55c58b5d4c04cff2 Mon Sep 17 00:00:00 2001 From: --help Date: Sat, 12 Aug 2023 13:21:59 +0200 Subject: [PATCH 02/99] Update default config about the http error --- conf/nginx.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f446dd0..7e27119 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,7 +6,7 @@ location __PATH__/ { # Default indexes and catch-all index index.html index.php; - try_files $uri $uri/ __PATH__/index.php?$args; + try_files $uri $uri/ __PATH__/index.php?$args =404; # Prevent useless logs location = __PATH__/favicon.ico { @@ -20,12 +20,12 @@ location __PATH__/ { access_log off; } - error_page 404 error/404.html; + # Build error access + error_page 404 /404.html; location = __PATH__/error/404.html { internal; } - # Deny access to hidden files and directories location ~ ^__PATH__/(.+/|)\.(?!well-known\/) { deny all; From 7083a50ec88a8f8d7e8f7890a39c01d189d031a1 Mon Sep 17 00:00:00 2001 From: --help Date: Sat, 12 Aug 2023 13:29:35 +0200 Subject: [PATCH 03/99] Update app version --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index e0085f2..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~ynh14" +version = "1.0~ynh15" maintainers = [] From 4255b0a4bc9ef98fb74b2bdb954c8cce8503c696 Mon Sep 17 00:00:00 2001 From: --help Date: Sat, 12 Aug 2023 16:52:25 +0200 Subject: [PATCH 04/99] Add code error 50X --- conf/nginx.conf | 5 +++++ manifest.toml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 7e27119..45d178d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -25,6 +25,11 @@ location __PATH__/ { location = __PATH__/error/404.html { internal; } + error_page 500 502 503 /50x.html; + location = __PATH__/error/50x.html { + internal; + } + # Deny access to hidden files and directories location ~ ^__PATH__/(.+/|)\.(?!well-known\/) { diff --git a/manifest.toml b/manifest.toml index f17289e..97fd1e1 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~ynh15" +version = "1.0~ynh16" maintainers = [] From 718c0dbdd863adfd700a02fea863b22b9a0c40bc Mon Sep 17 00:00:00 2001 From: --help Date: Sat, 12 Aug 2023 17:58:39 +0200 Subject: [PATCH 05/99] Fix path error_page --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 45d178d..ac5da7f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -21,7 +21,7 @@ location __PATH__/ { } # Build error access - error_page 404 /404.html; + error_page 404 /error/404.html; location = __PATH__/error/404.html { internal; } From 140562326ec380d904ed7840572af118ba17db34 Mon Sep 17 00:00:00 2001 From: --help Date: Sun, 13 Aug 2023 09:08:31 +0200 Subject: [PATCH 06/99] Try to config the 404.html file Remove error page 50X --- conf/nginx.conf | 5 ----- config_panel.toml | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index ac5da7f..22dd70d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -25,11 +25,6 @@ location __PATH__/ { location = __PATH__/error/404.html { internal; } - error_page 500 502 503 /50x.html; - location = __PATH__/error/50x.html { - internal; - } - # Deny access to hidden files and directories location ~ ^__PATH__/(.+/|)\.(?!well-known\/) { diff --git a/config_panel.toml b/config_panel.toml index b229f0f..aa5b049 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -18,6 +18,14 @@ name = "My Webapp configuration" visible = "with_sftp" help = "If a password already exist, leave blank and it will not be replaced." + [main.error] + name = "Html Custom error" + + [main.error.setting] + ask = "HTML Path" + type = "string" + default = "/404.html" + [main.php_fpm_config] name = "PHP-FPM configuration" From 8b30a536cba3502384a434a19181239b3d87d70e Mon Sep 17 00:00:00 2001 From: --help Date: Sun, 13 Aug 2023 09:39:48 +0200 Subject: [PATCH 07/99] Try to setup the error code upgrade --- config_panel.toml | 2 +- manifest.toml | 8 +++++++- scripts/upgrade | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index aa5b049..113b804 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -21,7 +21,7 @@ name = "My Webapp configuration" [main.error] name = "Html Custom error" - [main.error.setting] + [main.error.errorfile] ask = "HTML Path" type = "string" default = "/404.html" diff --git a/manifest.toml b/manifest.toml index 97fd1e1..32879ee 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~ynh16" +version = "1.0~ynh17" maintainers = [] @@ -58,6 +58,12 @@ ram.runtime = "50M" type = "boolean" default = false + [install.errorfile] + 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/upgrade b/scripts/upgrade index 19a6549..bf15aaa 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -90,6 +90,11 @@ then YNH_PHP_VERSION="$phpversion" fi +if [ $errorfile ] +then + echo add the error config +fi + # Create a dedicated NGINX config ynh_add_nginx_config ynh_add_config --template="example-custom-nginx-config.conf" --destination="$nginx_extra_conf_dir/sample.conf" From b863da7cff82ffb3f4aaa2636c50bc055497ba0b Mon Sep 17 00:00:00 2001 From: --help Date: Sun, 13 Aug 2023 10:47:43 +0200 Subject: [PATCH 08/99] Update upgrade to set the code error --- conf/nginx-code-error.conf | 5 +++++ manifest.toml | 2 +- scripts/upgrade | 10 ++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 conf/nginx-code-error.conf diff --git a/conf/nginx-code-error.conf b/conf/nginx-code-error.conf new file mode 100644 index 0000000..dba1050 --- /dev/null +++ b/conf/nginx-code-error.conf @@ -0,0 +1,5 @@ +# Build error access +error_page 404 /error/404.html; +location = __PATH__/error/404.html { + internal; +} \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 32879ee..10be47a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -58,7 +58,7 @@ ram.runtime = "50M" type = "boolean" default = false - [install.errorfile] + [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" diff --git a/scripts/upgrade b/scripts/upgrade index bf15aaa..234636c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,6 +56,11 @@ if [ -z "$phpversion" ]; then ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion fi +# If $codeerror doesn't exist, create it. We assume it is the default system one. +if [ -z "$codeerror" ]; then + codeerror=$(ynh_app_setting_get --app=$app --key=codeerror) +fi + # Delete old user if [ -n "$(ynh_app_setting_get --app=$app --key=user)" ] then @@ -90,9 +95,10 @@ then YNH_PHP_VERSION="$phpversion" fi -if [ $errorfile ] +if [ $codeerror ] then - echo add the error config + echo add the error config + ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error.conf" fi # Create a dedicated NGINX config From adb9f09d60481eec481a58e2b38829f9931c5ead Mon Sep 17 00:00:00 2001 From: --help Date: Tue, 15 Aug 2023 15:09:55 +0200 Subject: [PATCH 09/99] Change the upgrade config Update the post-install documentation --- doc/POST_INSTALL_fr.md | 7 +++++++ scripts/upgrade | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/POST_INSTALL_fr.md b/doc/POST_INSTALL_fr.md index 87467a7..3fda038 100644 --- a/doc/POST_INSTALL_fr.md +++ b/doc/POST_INSTALL_fr.md @@ -5,3 +5,10 @@ Si vous avez demandé une base de données MYSQL, voici les informations de cett - Mot de passe : __DB_PWD__ La documentation ci-dessous contient également les informations pour se connecter en SSH et modifier le contenu du site web. + + + +Si vous avez activé la gestion du code d'erreur 404, vous pouvez placer un fichier 404.html, à la racine de votre +répertoire, le fichier sera alors reconnu par Nginx. + +Il est sinon possible de modifier le chemin dans l'administration afin de spécifier un repertoire. diff --git a/scripts/upgrade b/scripts/upgrade index 234636c..99ee670 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,7 +57,7 @@ if [ -z "$phpversion" ]; then fi # If $codeerror doesn't exist, create it. We assume it is the default system one. -if [ -z "$codeerror" ]; then +if [ -n "$(ynh_app_setting_get --app=$app --key=codeerror)" ]; then codeerror=$(ynh_app_setting_get --app=$app --key=codeerror) fi @@ -95,7 +95,8 @@ then YNH_PHP_VERSION="$phpversion" fi -if [ $codeerror ] +# Add the config error code +if [ -n "$(ynh_app_setting_get --app=$app --key=codeerror)" ]; then echo add the error config ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error.conf" From 74526f2e537ed660233fd6abc512ffa28f78237b Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Wed, 16 Aug 2023 18:16:57 +0200 Subject: [PATCH 10/99] 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 From 8fe710187a7c53ec6cad9a6dacc7f6a1cf7039a4 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Wed, 16 Aug 2023 18:36:04 +0200 Subject: [PATCH 11/99] Update install/upgrade --- config_panel.toml | 12 +++++------- scripts/install | 6 ++++++ scripts/upgrade | 11 +++++------ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 375b895..48c03ed 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -25,15 +25,13 @@ name = "My Webapp configuration" 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 = "/" - help = "You can set where your error file are store in your www folder." - + # [main.code_error.path_folder] + # ask = "Specifie folder where your error file are sto" + # type = "string" + # 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/scripts/install b/scripts/install index a976713..d671e86 100644 --- a/scripts/install +++ b/scripts/install @@ -63,6 +63,12 @@ then YNH_PHP_VERSION="$phpversion" fi +if [ ! $custom_error_file ] +then + ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" + CUSTOM_ERROR_FILE="$custom_error_file" +fi + # Create a dedicated NGINX config ynh_add_nginx_config ynh_add_config --template="example-custom-nginx-config.conf" --destination="$nginx_extra_conf_dir/sample.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 99ee670..a9beb78 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,9 +56,9 @@ if [ -z "$phpversion" ]; then ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion fi -# If $codeerror doesn't exist, create it. We assume it is the default system one. -if [ -n "$(ynh_app_setting_get --app=$app --key=codeerror)" ]; then - codeerror=$(ynh_app_setting_get --app=$app --key=codeerror) +# If custom_error_files doesn't exist, create it. We assume it is the default system one. +if [ -n "$(ynh_app_setting_get --app=$app --key=custom_error_file)" ]; then + custom_error_file=$(ynh_app_setting_get --app=$app --key=custom_error_file) fi # Delete old user @@ -96,10 +96,9 @@ then fi # Add the config error code -if [ -n "$(ynh_app_setting_get --app=$app --key=codeerror)" ]; +if [ ! $custom_error_file ] then - echo add the error config - ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error.conf" + ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" fi # Create a dedicated NGINX config From 9384644c80989f1a3dfc476c119d0b060902152d Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Wed, 16 Aug 2023 18:40:21 +0200 Subject: [PATCH 12/99] Update upgrade script to fix the unbound variable error --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index a9beb78..4becbd5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,7 +57,7 @@ if [ -z "$phpversion" ]; then fi # If custom_error_files doesn't exist, create it. We assume it is the default system one. -if [ -n "$(ynh_app_setting_get --app=$app --key=custom_error_file)" ]; then +if [ -z "$custom_error_file" ]; then custom_error_file=$(ynh_app_setting_get --app=$app --key=custom_error_file) fi From 613e58e14929204295c1ca8ab9758de8734fd7e0 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Wed, 16 Aug 2023 18:49:45 +0200 Subject: [PATCH 13/99] Change a set value --- scripts/config | 3 ++- scripts/upgrade | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/config b/scripts/config index 319756e..1cbd2a5 100644 --- a/scripts/config +++ b/scripts/config @@ -148,9 +148,10 @@ ynh_app_config_apply() { ynh_system_user_del_group --username=$app --groups="sftp.app" fi - if [ "${changed[errorfile]}" == "true" ] + if [ "${changed[$custom_error_file]}" == "true" ] then echo Update error nginx config + ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" fi if [ "$phpversion" != "none" ] diff --git a/scripts/upgrade b/scripts/upgrade index 4becbd5..a9beb78 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,7 +57,7 @@ if [ -z "$phpversion" ]; then fi # If custom_error_files doesn't exist, create it. We assume it is the default system one. -if [ -z "$custom_error_file" ]; then +if [ -n "$(ynh_app_setting_get --app=$app --key=custom_error_file)" ]; then custom_error_file=$(ynh_app_setting_get --app=$app --key=custom_error_file) fi From c0688fc115b5cf13d9c5d79decfa8a210d17aeb9 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Wed, 16 Aug 2023 18:56:49 +0200 Subject: [PATCH 14/99] Add more debug info --- scripts/upgrade | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index a9beb78..51369cf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,10 +56,17 @@ if [ -z "$phpversion" ]; then ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion fi -# If custom_error_files doesn't exist, create it. We assume it is the default system one. +echo Init the custom error variable +# If custom_error_file doesn't exist, create it. We assume it is the default system one. if [ -n "$(ynh_app_setting_get --app=$app --key=custom_error_file)" ]; then + echo Variable not existing, create-it custom_error_file=$(ynh_app_setting_get --app=$app --key=custom_error_file) +else + echo The variable exist fi +echo Test a condition +echo ynh_app_setting_get --app=$app --key=custom_error_file +echo Value return # Delete old user if [ -n "$(ynh_app_setting_get --app=$app --key=user)" ] @@ -95,6 +102,7 @@ then YNH_PHP_VERSION="$phpversion" fi +echo call this variable $custom_error_file # Add the config error code if [ ! $custom_error_file ] then From 33968949856a61ed8a99eb843e5a53904aed50e9 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Wed, 16 Aug 2023 19:29:01 +0200 Subject: [PATCH 15/99] Update config file --- scripts/config | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 1cbd2a5..baf65b7 100644 --- a/scripts/config +++ b/scripts/config @@ -150,7 +150,7 @@ ynh_app_config_apply() { if [ "${changed[$custom_error_file]}" == "true" ] then - echo Update error nginx config + CUSTOM_ERROR_FILE=$custom_error_file ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" fi @@ -158,6 +158,11 @@ ynh_app_config_apply() { then ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint fi + + if [ ! $custom_error_file ] + then + ynh_app_setting_set --app=$app --key=custom_error_file --value="$custom_error_file" + fi } ynh_app_config_run $1 From 83394391359f4e49eb62a2d5f19f6e7e53977b13 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 11:05:13 +0200 Subject: [PATCH 16/99] Fix bad variable allocation --- scripts/upgrade | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 51369cf..b895c34 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,9 +56,8 @@ if [ -z "$phpversion" ]; then ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion fi -echo Init the custom error variable # If custom_error_file doesn't exist, create it. We assume it is the default system one. -if [ -n "$(ynh_app_setting_get --app=$app --key=custom_error_file)" ]; then +if [ -z "$custom_error_file" ]; then echo Variable not existing, create-it custom_error_file=$(ynh_app_setting_get --app=$app --key=custom_error_file) else From 7b02f2817e88b0b99b76e74c111d15cf3326413d Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 11:25:18 +0200 Subject: [PATCH 17/99] Another test about the init variable --- scripts/upgrade | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b895c34..6260a83 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,16 +56,12 @@ if [ -z "$phpversion" ]; then ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion fi +ynh_script_progression --message="Start to init custom error code" # If custom_error_file doesn't exist, create it. We assume it is the default system one. -if [ -z "$custom_error_file" ]; then - echo Variable not existing, create-it +if [ -z "${custom_error_file}" ]; then + ynh_script_progression --message="Variable not existing, create-it" custom_error_file=$(ynh_app_setting_get --app=$app --key=custom_error_file) -else - echo The variable exist fi -echo Test a condition -echo ynh_app_setting_get --app=$app --key=custom_error_file -echo Value return # Delete old user if [ -n "$(ynh_app_setting_get --app=$app --key=user)" ] From f06a4f5ba9825f9855f76ee6e33a174973bfbc3d Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 11:33:48 +0200 Subject: [PATCH 18/99] Try another conditional test --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6260a83..8f249d6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -58,7 +58,7 @@ fi ynh_script_progression --message="Start to init custom error code" # If custom_error_file doesn't exist, create it. We assume it is the default system one. -if [ -z "${custom_error_file}" ]; then +if [ -z "${custom_error_file:-}" ]; then ynh_script_progression --message="Variable not existing, create-it" custom_error_file=$(ynh_app_setting_get --app=$app --key=custom_error_file) fi From ab804195664e8b96ae46bb164b799cf3b01a58b3 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 15:01:51 +0200 Subject: [PATCH 19/99] Write a short description info about the 404 errors setup --- doc/DESCRIPTION.md | 2 ++ doc/DESCRIPTION_fr.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index de48a9d..67b9aaf 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -5,3 +5,5 @@ It can also create a MySQL database - which will be backed up and restored with PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`. **Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. + +The application can also lets you manage 404 errors - if you activate the option. Simply create an`error` folder in the `www` root directory. \ No newline at end of file diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 2bf7f20..9e6de17 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -5,3 +5,5 @@ Elle peut également créer une base de données MySQL - qui sera sauvegardée e La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1` et `8.2`. **Une fois installé, rendez-vous sur l'URL choisie pour connaître l'utilisateur, le domaine et le port que vous devrez utiliser pour l'accès SFTP.** Le mot de passe est celui que vous avez choisi lors de l'installation. Sous le répertoire Web, vous verrez un dossier `www` qui contient les fichiers publics servis par cette application. Vous pouvez mettre tous les fichiers de votre application Web personnalisée à l'intérieur. + +L'application vous permet aussi de gérer - si vous activez l'option - la gestion des erreurs 404, il vous suffit de créer un dossier `error` dans le répertoire racine `www`. \ No newline at end of file From 92c86736468865fe08b50af0444ed932dc58f1be Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 15:49:08 +0200 Subject: [PATCH 20/99] Tweak the description en/fr --- doc/DESCRIPTION.md | 2 +- doc/DESCRIPTION_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 67b9aaf..55475c8 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -6,4 +6,4 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` **Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. -The application can also lets you manage 404 errors - if you activate the option. Simply create an`error` folder in the `www` root directory. \ No newline at end of file +The application can also lets you manage 404 errors - if you activate the post-install option. Simply create an`error` folder in the `www` root directory. \ No newline at end of file diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 9e6de17..35ac7a6 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -6,4 +6,4 @@ La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1 **Une fois installé, rendez-vous sur l'URL choisie pour connaître l'utilisateur, le domaine et le port que vous devrez utiliser pour l'accès SFTP.** Le mot de passe est celui que vous avez choisi lors de l'installation. Sous le répertoire Web, vous verrez un dossier `www` qui contient les fichiers publics servis par cette application. Vous pouvez mettre tous les fichiers de votre application Web personnalisée à l'intérieur. -L'application vous permet aussi de gérer - si vous activez l'option - la gestion des erreurs 404, il vous suffit de créer un dossier `error` dans le répertoire racine `www`. \ No newline at end of file +L'application vous permet aussi de gérer - si vous activez l'option en post-installe - la gestion des erreurs 404, il vous suffit de créer un dossier `error` dans le répertoire racine `www`. \ No newline at end of file From 1e5d23df24c50aad621e3c3f487264224ea4a95a Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 15:57:28 +0200 Subject: [PATCH 21/99] Update the update script --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 8f249d6..508b986 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -61,6 +61,7 @@ ynh_script_progression --message="Start to init custom error code" if [ -z "${custom_error_file:-}" ]; then ynh_script_progression --message="Variable not existing, create-it" custom_error_file=$(ynh_app_setting_get --app=$app --key=custom_error_file) + ynh_app_setting_set --app=$app --key=custom_error_file --value=$custom_error_file fi # Delete old user From beb6c7e39976a8a04b7c1eb8b9301c922511f51d Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 16:20:51 +0200 Subject: [PATCH 22/99] Update nginx config Fix config function --- conf/nginx.conf | 3 ++- scripts/config | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index e522e75..5971601 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,7 +6,8 @@ location __PATH__/ { # Default indexes and catch-all index index.html index.php; - try_files $uri $uri/ __PATH__/index.php?$args =404; + # try_files $uri $uri/ __PATH__/index.php?$args =404; + try_files $uri $uri/ __PATH__/index.php?$args; # Prevent useless logs location = __PATH__/favicon.ico { diff --git a/scripts/config b/scripts/config index baf65b7..43d19bc 100644 --- a/scripts/config +++ b/scripts/config @@ -148,10 +148,13 @@ ynh_app_config_apply() { ynh_system_user_del_group --username=$app --groups="sftp.app" fi - if [ "${changed[$custom_error_file]}" == "true" ] + if [ "${changed[custom_error_file]}" == "true" ] then CUSTOM_ERROR_FILE=$custom_error_file ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" + else + # TODO + echo remove config file fi if [ "$phpversion" != "none" ] From efc260135c332020581414b1be2c8b3aff129403 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 16:30:25 +0200 Subject: [PATCH 23/99] Variable not declared --- scripts/config | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/config b/scripts/config index 43d19bc..da5f3c0 100644 --- a/scripts/config +++ b/scripts/config @@ -151,6 +151,7 @@ ynh_app_config_apply() { if [ "${changed[custom_error_file]}" == "true" ] then CUSTOM_ERROR_FILE=$custom_error_file + nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d" ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" else # TODO From 632567c13fd6be4bb0a23fd2b6bcfb374d1789dc Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 16:33:34 +0200 Subject: [PATCH 24/99] Change path declaration --- scripts/config | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/config b/scripts/config index da5f3c0..fb058e2 100644 --- a/scripts/config +++ b/scripts/config @@ -151,8 +151,7 @@ ynh_app_config_apply() { if [ "${changed[custom_error_file]}" == "true" ] then CUSTOM_ERROR_FILE=$custom_error_file - nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d" - ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" + ynh_add_config --template="nginx-code-error.conf" --destination="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" else # TODO echo remove config file From d0255441315706ac5870d8a101b4f10b1605b9eb Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 17:01:36 +0200 Subject: [PATCH 25/99] On/Off nginx file --- scripts/config | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/config b/scripts/config index fb058e2..801c530 100644 --- a/scripts/config +++ b/scripts/config @@ -153,8 +153,7 @@ ynh_app_config_apply() { CUSTOM_ERROR_FILE=$custom_error_file ynh_add_config --template="nginx-code-error.conf" --destination="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" else - # TODO - echo remove config file + ynh_secure_remove --file="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" fi if [ "$phpversion" != "none" ] From e7b199e5737f937aa35df622a0271342761e9c7d Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 17:18:33 +0200 Subject: [PATCH 26/99] Remove old post-install info --- doc/POST_INSTALL_fr.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/POST_INSTALL_fr.md b/doc/POST_INSTALL_fr.md index 3fda038..87467a7 100644 --- a/doc/POST_INSTALL_fr.md +++ b/doc/POST_INSTALL_fr.md @@ -5,10 +5,3 @@ Si vous avez demandé une base de données MYSQL, voici les informations de cett - Mot de passe : __DB_PWD__ La documentation ci-dessous contient également les informations pour se connecter en SSH et modifier le contenu du site web. - - - -Si vous avez activé la gestion du code d'erreur 404, vous pouvez placer un fichier 404.html, à la racine de votre -répertoire, le fichier sera alors reconnu par Nginx. - -Il est sinon possible de modifier le chemin dans l'administration afin de spécifier un repertoire. From d51c90ffb95693492d617bd7d7b7328654e8ba70 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 17:18:55 +0200 Subject: [PATCH 27/99] Remove unused setting set --- scripts/config | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/config b/scripts/config index 801c530..87d22b0 100644 --- a/scripts/config +++ b/scripts/config @@ -161,10 +161,6 @@ ynh_app_config_apply() { ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint fi - if [ ! $custom_error_file ] - then - ynh_app_setting_set --app=$app --key=custom_error_file --value="$custom_error_file" - fi } ynh_app_config_run $1 From 42a5b8939372b2c98bee19e6196374f2e2ca9056 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 17:22:57 +0200 Subject: [PATCH 28/99] Test config script --- scripts/config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 87d22b0..42a5e9d 100644 --- a/scripts/config +++ b/scripts/config @@ -151,7 +151,8 @@ ynh_app_config_apply() { if [ "${changed[custom_error_file]}" == "true" ] then CUSTOM_ERROR_FILE=$custom_error_file - ynh_add_config --template="nginx-code-error.conf" --destination="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" +# ynh_add_config --template="nginx-code-error.conf" --destination="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" + ynh_secure_remove --file="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" else ynh_secure_remove --file="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" fi From 1b4c09bc1dbb64ca6e775937734b9bfdb90b8e7f Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 17:56:51 +0200 Subject: [PATCH 29/99] Update the On/Off error code parameter Revert nginx config --- conf/nginx.conf | 3 +-- scripts/config | 12 ++++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 5971601..e522e75 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,8 +6,7 @@ location __PATH__/ { # Default indexes and catch-all index index.html index.php; - # try_files $uri $uri/ __PATH__/index.php?$args =404; - try_files $uri $uri/ __PATH__/index.php?$args; + try_files $uri $uri/ __PATH__/index.php?$args =404; # Prevent useless logs location = __PATH__/favicon.ico { diff --git a/scripts/config b/scripts/config index 42a5e9d..d2b5e8c 100644 --- a/scripts/config +++ b/scripts/config @@ -151,10 +151,14 @@ ynh_app_config_apply() { if [ "${changed[custom_error_file]}" == "true" ] then CUSTOM_ERROR_FILE=$custom_error_file -# ynh_add_config --template="nginx-code-error.conf" --destination="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" - ynh_secure_remove --file="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" - else - ynh_secure_remove --file="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" + nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d" + + if [ "$custom_error_file" ] + then + ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" + else + ynh_secure_remove --file="$nginx_extra_conf_dir/error-code.conf" + fi fi if [ "$phpversion" != "none" ] From 9e6f1621b41de675962711acdd8fc08cb6615fb3 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 18:02:02 +0200 Subject: [PATCH 30/99] Clear the config panel file --- config_panel.toml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 48c03ed..812f02e 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -25,13 +25,7 @@ name = "My Webapp configuration" ask = "Activate the custom error file use" type = "boolean" default = false - 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 = "/" - # help = "You can set where your error file are store in your www folder." + help = "When you enable this, you can add/create a custom `404.html` file in a directory `www\\error`." [main.php_fpm_config] name = "PHP-FPM configuration" From 8c3b1e2161e62a7fb7362acc5430796bee87fc90 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 18:04:47 +0200 Subject: [PATCH 31/99] Update config with the conditional state in the custom error file section --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index d2b5e8c..5fda374 100644 --- a/scripts/config +++ b/scripts/config @@ -153,7 +153,7 @@ ynh_app_config_apply() { CUSTOM_ERROR_FILE=$custom_error_file nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d" - if [ "$custom_error_file" ] + if [ $custom_error_file ] then ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" else From 8d4188382b96a2a07307e443b47894822258c82a Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 18:08:11 +0200 Subject: [PATCH 32/99] Add debug info with the config file --- scripts/config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/config b/scripts/config index 5fda374..a4ef631 100644 --- a/scripts/config +++ b/scripts/config @@ -152,11 +152,14 @@ ynh_app_config_apply() { then CUSTOM_ERROR_FILE=$custom_error_file nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d" + ynh_print_info --message="Update the custom setting $custom_error_file" if [ $custom_error_file ] then + ynh_print_info --message="Add the config file" ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" else + ynh_print_info --message="Remove the config file" ynh_secure_remove --file="$nginx_extra_conf_dir/error-code.conf" fi fi From 18041281e30df674665c0c54e0855c8deac7446c Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 18:13:41 +0200 Subject: [PATCH 33/99] Update config with int comparaison --- scripts/config | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/config b/scripts/config index a4ef631..4c8b5c9 100644 --- a/scripts/config +++ b/scripts/config @@ -154,11 +154,12 @@ ynh_app_config_apply() { nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d" ynh_print_info --message="Update the custom setting $custom_error_file" - if [ $custom_error_file ] + if [ $custom_error_file -eq 1 ] then ynh_print_info --message="Add the config file" ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" - else + elif [ $custom_error_file -eq 0 ] + then ynh_print_info --message="Remove the config file" ynh_secure_remove --file="$nginx_extra_conf_dir/error-code.conf" fi From ea8278b48bdbdd8d75b5cafb8f03a604c7169580 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 18:19:59 +0200 Subject: [PATCH 34/99] Add the 403 error code build --- conf/nginx-code-error.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/nginx-code-error.conf b/conf/nginx-code-error.conf index dba1050..bb32b79 100644 --- a/conf/nginx-code-error.conf +++ b/conf/nginx-code-error.conf @@ -1,4 +1,9 @@ # Build error access +error_page 403 /error/403.html; +location = __PATH__/error/403.html { + internal; +} + error_page 404 /error/404.html; location = __PATH__/error/404.html { internal; From 5f1dfbd192c9fac1d066817ad732c3605be25b2e Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 18:22:53 +0200 Subject: [PATCH 35/99] Wrong path construction with the nginx error code --- conf/nginx-code-error.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx-code-error.conf b/conf/nginx-code-error.conf index bb32b79..4b71cff 100644 --- a/conf/nginx-code-error.conf +++ b/conf/nginx-code-error.conf @@ -1,10 +1,10 @@ # Build error access error_page 403 /error/403.html; -location = __PATH__/error/403.html { +location = /error/403.html { internal; } error_page 404 /error/404.html; -location = __PATH__/error/404.html { +location = /error/404.html { internal; } \ No newline at end of file From a561b9c449abb5315a17a56d5d977836c00e8987 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 19:10:47 +0200 Subject: [PATCH 36/99] Try another way with the status code return --- conf/nginx-code-error.conf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/conf/nginx-code-error.conf b/conf/nginx-code-error.conf index 4b71cff..5807407 100644 --- a/conf/nginx-code-error.conf +++ b/conf/nginx-code-error.conf @@ -4,7 +4,8 @@ location = /error/403.html { internal; } -error_page 404 /error/404.html; -location = /error/404.html { - internal; -} \ No newline at end of file +error_page 404 @error404; + +location @error404 { + rewrite ^ /error/404.html last; +} From adf7f2ba838b07f1c076789eb5ab84c44da8010a Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 19:33:37 +0200 Subject: [PATCH 37/99] Change - once again - the nginx error build --- conf/nginx-code-error.conf | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/conf/nginx-code-error.conf b/conf/nginx-code-error.conf index 5807407..c1e14cf 100644 --- a/conf/nginx-code-error.conf +++ b/conf/nginx-code-error.conf @@ -1,11 +1,8 @@ # Build error access error_page 403 /error/403.html; -location = /error/403.html { +error_page 404 /error/404.html; + +location ^/ /error* { internal; -} - -error_page 404 @error404; - -location @error404 { - rewrite ^ /error/404.html last; + root /var/www/my_webapp__3/www/; } From 08a58729a2febca4d84cf6d3c08051e55507cdfc Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Thu, 17 Aug 2023 19:33:37 +0200 Subject: [PATCH 38/99] Change - once again - the nginx error build --- conf/nginx-code-error.conf | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/conf/nginx-code-error.conf b/conf/nginx-code-error.conf index 5807407..074b013 100644 --- a/conf/nginx-code-error.conf +++ b/conf/nginx-code-error.conf @@ -1,11 +1,8 @@ # Build error access error_page 403 /error/403.html; -location = /error/403.html { +error_page 404 /error/404.html; + +location ^/ /error/ { internal; -} - -error_page 404 @error404; - -location @error404 { - rewrite ^ /error/404.html last; + root /var/www/my_webapp__3/www/; } From 04338ac0911c07a4e4dde6372423b5ed3f28fd0b Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 09:19:41 +0200 Subject: [PATCH 39/99] Restart Nginx with the config update --- scripts/config | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/config b/scripts/config index 4c8b5c9..bc90b0d 100644 --- a/scripts/config +++ b/scripts/config @@ -163,6 +163,7 @@ ynh_app_config_apply() { ynh_print_info --message="Remove the config file" ynh_secure_remove --file="$nginx_extra_conf_dir/error-code.conf" fi + ynh_systemd_action --service_name=nginx --action=restart fi if [ "$phpversion" != "none" ] From c409b9d0e103c5f5a182955a6202e982aab5471b Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 09:40:42 +0200 Subject: [PATCH 40/99] Clear debug message, and add a restart about Nginx service --- scripts/config | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/config b/scripts/config index bc90b0d..278b74e 100644 --- a/scripts/config +++ b/scripts/config @@ -152,15 +152,12 @@ ynh_app_config_apply() { then CUSTOM_ERROR_FILE=$custom_error_file nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d" - ynh_print_info --message="Update the custom setting $custom_error_file" if [ $custom_error_file -eq 1 ] then - ynh_print_info --message="Add the config file" ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" elif [ $custom_error_file -eq 0 ] then - ynh_print_info --message="Remove the config file" ynh_secure_remove --file="$nginx_extra_conf_dir/error-code.conf" fi ynh_systemd_action --service_name=nginx --action=restart From b578765b41ffd4c89113432d726b1fe97c6c24a8 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 09:55:41 +0200 Subject: [PATCH 41/99] Fix location path error config --- conf/nginx-code-error.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx-code-error.conf b/conf/nginx-code-error.conf index 074b013..dad5740 100644 --- a/conf/nginx-code-error.conf +++ b/conf/nginx-code-error.conf @@ -2,7 +2,7 @@ error_page 403 /error/403.html; error_page 404 /error/404.html; -location ^/ /error/ { +location ^~ /error/ { internal; root /var/www/my_webapp__3/www/; } From db2876a58aae1f68ff6e16a5b90999130f0b4ddd Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 10:01:56 +0200 Subject: [PATCH 42/99] Remove unused setup --- conf/nginx-code-error.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/nginx-code-error.conf b/conf/nginx-code-error.conf index dad5740..bebbabe 100644 --- a/conf/nginx-code-error.conf +++ b/conf/nginx-code-error.conf @@ -4,5 +4,4 @@ error_page 404 /error/404.html; location ^~ /error/ { internal; - root /var/www/my_webapp__3/www/; } From bcdf80162f646a633056d7d28cfd7840b522ae5d Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 10:12:23 +0200 Subject: [PATCH 43/99] Add information in the admin fr/en text --- doc/ADMIN.md | 4 ++++ doc/ADMIN_fr.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/doc/ADMIN.md b/doc/ADMIN.md index 6269999..5dc0377 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -19,6 +19,10 @@ Once logged in SFTP, under the Web directory, you will see a `www` folder which If you forgot your SFTP password, you can change it in YunoHost's webadmin interface in `Apps > My webapp > My Webapp configuration`. +### 403 and 404 error handling + +The web server configuration supports http error handling `403` and `404` (access denied and resource not found), just add an `error` folder in the `www` directory, then your `403.html` and `404.html` files. + ### Customizing the nginx configuration If you want to add tweak the nginx configuration for this app, it is recommended to edit `/etc/nginx/conf.d/__DOMAIN__.d/__ID__.d/WHATEVER_NAME.conf` (ensure that the file has the `.conf` extension) and reload the nginx after making sure that the configuration is valid using `nginx -t`. diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index 562ba76..292e61d 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -23,6 +23,10 @@ Si vous avez oublié votre mot de passe SFTP, vous pouvez le changer dans la web Si vous n'arrivez pas à vous connecter et que vous avez vérifié que le nom d'utilisateur et le mot de passe sont bons, vérifiez si SFTP est activé pour votre app +### Gestion des erreurs 403 et 404 + +La configuration du serveur web prend en charge la gestion des erreurs http `403` et `404` (accès refusé et ressource non trouvé), il suffit de d'ajouter un dossier `error` dans le repertoire `www` puis vos fichiers `403.html` et `404.html`. + ### Personnaliser la configuration nginx Si vous souhaitez ajuster la configuration nginx pour cette app, il est recommandé d'éditer `/etc/nginx/conf.d/__DOMAIN__.d/__ID__.d/WHATEVER_NAME.conf` (assurez-vous que le fichier a l'extension `.conf`) puis rechargez nginx après vous être assuré que la configuration est valide à l'aide de `nginx -t`. From d7271b65afda416ce21810d090e6d897497e1142 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 10:19:31 +0200 Subject: [PATCH 44/99] Update the nginx to be reload and not restart --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 278b74e..0958338 100644 --- a/scripts/config +++ b/scripts/config @@ -160,7 +160,7 @@ ynh_app_config_apply() { then ynh_secure_remove --file="$nginx_extra_conf_dir/error-code.conf" fi - ynh_systemd_action --service_name=nginx --action=restart + ynh_systemd_action --service_name=nginx --action=reload fi if [ "$phpversion" != "none" ] From 9d885a896aeb5695f27ffc7e0c9640b440a77e71 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 10:35:16 +0200 Subject: [PATCH 45/99] Set to true the default error code status used --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 812f02e..cfc6f87 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -24,7 +24,7 @@ name = "My Webapp configuration" [main.code_error.custom_error_file] ask = "Activate the custom error file use" type = "boolean" - default = false + default = true help = "When you enable this, you can add/create a custom `404.html` file in a directory `www\\error`." [main.php_fpm_config] From 7b0b29cdccfbba44c1afb05f9e54acc553a42cac Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 10:46:04 +0200 Subject: [PATCH 46/99] Update install and upgrade script. Clear old debug info. --- scripts/install | 4 ++-- scripts/upgrade | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index d671e86..f88e123 100644 --- a/scripts/install +++ b/scripts/install @@ -63,10 +63,10 @@ then YNH_PHP_VERSION="$phpversion" fi -if [ ! $custom_error_file ] +if [ $custom_error_file -eq 1 ] then ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" - CUSTOM_ERROR_FILE="$custom_error_file" + #CUSTOM_ERROR_FILE="$custom_error_file" fi # Create a dedicated NGINX config diff --git a/scripts/upgrade b/scripts/upgrade index 508b986..ac436ca 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,11 +56,9 @@ if [ -z "$phpversion" ]; then ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion fi -ynh_script_progression --message="Start to init custom error code" -# If custom_error_file doesn't exist, create it. We assume it is the default system one. +# If custom_error_file doesn't exist, create it. if [ -z "${custom_error_file:-}" ]; then - ynh_script_progression --message="Variable not existing, create-it" - custom_error_file=$(ynh_app_setting_get --app=$app --key=custom_error_file) + custom_error_file=1 ynh_app_setting_set --app=$app --key=custom_error_file --value=$custom_error_file fi @@ -98,9 +96,8 @@ then YNH_PHP_VERSION="$phpversion" fi -echo call this variable $custom_error_file # Add the config error code -if [ ! $custom_error_file ] +if [ $custom_error_file -eq 1 ] then ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" fi From 791d7880e9a25ffe81d40db8a31a41dd3be03124 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 11:06:48 +0200 Subject: [PATCH 47/99] Fix the install script --- scripts/install | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index f88e123..2edeba2 100644 --- a/scripts/install +++ b/scripts/install @@ -63,12 +63,8 @@ then YNH_PHP_VERSION="$phpversion" fi -if [ $custom_error_file -eq 1 ] -then - ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" - #CUSTOM_ERROR_FILE="$custom_error_file" -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" # Create a dedicated NGINX config ynh_add_nginx_config ynh_add_config --template="example-custom-nginx-config.conf" --destination="$nginx_extra_conf_dir/sample.conf" From 1eb8d54769d6c6a1cc63f7a20ea55b3e88ecf90d Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 11:10:25 +0200 Subject: [PATCH 48/99] init the custom error config --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 2edeba2..b98a257 100644 --- a/scripts/install +++ b/scripts/install @@ -65,6 +65,8 @@ 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" +CUSTOM_ERROR_FILE=1 + # Create a dedicated NGINX config ynh_add_nginx_config ynh_add_config --template="example-custom-nginx-config.conf" --destination="$nginx_extra_conf_dir/sample.conf" From 7d919559a1564b8a790905b3b274b2badcf87129 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 11:19:17 +0200 Subject: [PATCH 49/99] Variable type set --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index b98a257..7375167 100644 --- a/scripts/install +++ b/scripts/install @@ -65,7 +65,7 @@ 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" -CUSTOM_ERROR_FILE=1 +CUSTOM_ERROR_FILE="true" # Create a dedicated NGINX config ynh_add_nginx_config From 0f008b68d26a6b77066e8586f028264b35cb0c76 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 11:23:39 +0200 Subject: [PATCH 50/99] Fix setting set about custom error code value --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 7375167..b3de321 100644 --- a/scripts/install +++ b/scripts/install @@ -65,7 +65,8 @@ 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" -CUSTOM_ERROR_FILE="true" +ynh_app_setting_set --app=$app --key=custom_error_file --value="true" + # Create a dedicated NGINX config ynh_add_nginx_config From c4cc60d93fa4c931d9b01ee35d72abc324f1d465 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 14:29:42 +0200 Subject: [PATCH 51/99] Update location path, fix about the sub-dir setting --- conf/nginx-code-error.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx-code-error.conf b/conf/nginx-code-error.conf index bebbabe..aa25131 100644 --- a/conf/nginx-code-error.conf +++ b/conf/nginx-code-error.conf @@ -2,6 +2,6 @@ error_page 403 /error/403.html; error_page 404 /error/404.html; -location ^~ /error/ { +location ^~ __PATH__/error/ { internal; } From 467aef4618d35cc6a860518d3a7b52666bbff7ba Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Fri, 18 Aug 2023 16:32:42 +0200 Subject: [PATCH 52/99] Update location path, fix about the sub-dir setting ; and change url --- conf/nginx-code-error.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx-code-error.conf b/conf/nginx-code-error.conf index aa25131..5ded6cc 100644 --- a/conf/nginx-code-error.conf +++ b/conf/nginx-code-error.conf @@ -1,6 +1,6 @@ # Build error access -error_page 403 /error/403.html; -error_page 404 /error/404.html; +error_page 403 __PATH__/error/403.html; +error_page 404 __PATH__/error/404.html; location ^~ __PATH__/error/ { internal; From ac625f32d3face1ec2e945e169607d7977355072 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Mon, 21 Aug 2023 12:31:26 +0200 Subject: [PATCH 53/99] Change description info to be more accurate --- doc/DESCRIPTION.md | 2 +- doc/DESCRIPTION_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 55475c8..69a0d76 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -6,4 +6,4 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` **Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. -The application can also lets you manage 404 errors - if you activate the post-install option. Simply create an`error` folder in the `www` root directory. \ No newline at end of file +You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. \ No newline at end of file diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 35ac7a6..a274e6f 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -6,4 +6,4 @@ La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1 **Une fois installé, rendez-vous sur l'URL choisie pour connaître l'utilisateur, le domaine et le port que vous devrez utiliser pour l'accès SFTP.** Le mot de passe est celui que vous avez choisi lors de l'installation. Sous le répertoire Web, vous verrez un dossier `www` qui contient les fichiers publics servis par cette application. Vous pouvez mettre tous les fichiers de votre application Web personnalisée à l'intérieur. -L'application vous permet aussi de gérer - si vous activez l'option en post-installe - la gestion des erreurs 404, il vous suffit de créer un dossier `error` dans le répertoire racine `www`. \ No newline at end of file +L'application vous permet aussi de gérer - si vous activez l'option dans le panneau de configuration - la gestion des erreurs 404, il vous suffit de créer un dossier `error` dans le répertoire racine `www` et d'y placer vos fichiers d'erreur `html` \ No newline at end of file From ad2673106c29fcba75ddb8e2dc8e8987282a29cf Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Mon, 21 Aug 2023 13:27:43 +0200 Subject: [PATCH 54/99] Update change_url script to update location path nginx error --- scripts/change_url | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index 4433872..a373e5a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -52,6 +52,12 @@ then domain="$old_domain" path_url="$new_path" + # Update custom error file path if needed + if [ $custom_error_file -eq 1 ] + then + ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" + fi + # Create a dedicated NGINX config ynh_add_nginx_config fi @@ -62,6 +68,7 @@ then # Delete file checksum for the old conf file location ynh_delete_file_checksum --file="$nginx_conf_path" ynh_delete_file_checksum --file="$nginx_extra_conf_dir/php.conf" + ynh_delete_file_checksum --file="$nginx_extra_conf_dir/nginx-code-error.conf" path_url="$new_path" domain="$old_domain" @@ -74,6 +81,7 @@ then # Store file checksum for the new config file location ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/php.conf" + ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/nginx-code-error.conf" fi #================================================= From c4c9581eabb599b8e8830fb8a953d82aab9cc430 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Mon, 21 Aug 2023 13:31:36 +0200 Subject: [PATCH 55/99] Generate backup about the custom error setup --- scripts/backup | 9 +++++++++ scripts/change_url | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index 17b1472..4786b1d 100644 --- a/scripts/backup +++ b/scripts/backup @@ -36,6 +36,15 @@ then ynh_backup --src_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf" fi +#================================================= +# BACKUP CUSTOM CONF +#================================================= + +if [ $custom_error_file -eq 1 ] +then + ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.d/nginx-code-error.conf" +fi + #================================================= # BACKUP THE MYSQL DATABASE #================================================= diff --git a/scripts/change_url b/scripts/change_url index a373e5a..1cc7ea7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -58,7 +58,7 @@ then 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 configssh ynh_add_nginx_config fi From ee658ef96663e3a6a18e3b8312cbeae531a72447 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Mon, 21 Aug 2023 13:32:40 +0200 Subject: [PATCH 56/99] Comment change url config --- scripts/change_url | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 1cc7ea7..9018ece 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -53,10 +53,10 @@ then path_url="$new_path" # Update custom error file path if needed - if [ $custom_error_file -eq 1 ] - then - ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" - fi + #if [ $custom_error_file -eq 1 ] + #then + # ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" + #fi # Create a dedicated NGINX configssh ynh_add_nginx_config @@ -68,7 +68,7 @@ then # Delete file checksum for the old conf file location ynh_delete_file_checksum --file="$nginx_conf_path" ynh_delete_file_checksum --file="$nginx_extra_conf_dir/php.conf" - ynh_delete_file_checksum --file="$nginx_extra_conf_dir/nginx-code-error.conf" + #ynh_delete_file_checksum --file="$nginx_extra_conf_dir/nginx-code-error.conf" path_url="$new_path" domain="$old_domain" @@ -81,7 +81,7 @@ then # Store file checksum for the new config file location ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/php.conf" - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/nginx-code-error.conf" + #ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/nginx-code-error.conf" fi #================================================= From 9dbb8b1821e2fde3e981862fd0f2cfb4613ab748 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Mon, 21 Aug 2023 14:59:50 +0200 Subject: [PATCH 57/99] Fix warning message about the backup --- scripts/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index 4786b1d..16dcc06 100644 --- a/scripts/backup +++ b/scripts/backup @@ -40,7 +40,7 @@ fi # BACKUP CUSTOM CONF #================================================= -if [ $custom_error_file -eq 1 ] +if [ $custom_error_file == "true"] then ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.d/nginx-code-error.conf" fi From 2c0b155c9447b1547cf5f8e4236982f3f8a12f29 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Mon, 21 Aug 2023 15:02:29 +0200 Subject: [PATCH 58/99] Change conditional expression --- scripts/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index 16dcc06..d224333 100644 --- a/scripts/backup +++ b/scripts/backup @@ -40,7 +40,7 @@ fi # BACKUP CUSTOM CONF #================================================= -if [ $custom_error_file == "true"] +if [ $custom_error_file ] then ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.d/nginx-code-error.conf" fi From 66626c71c79f718cd8e624ecd42240aae4e2922d Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Mon, 21 Aug 2023 15:04:42 +0200 Subject: [PATCH 59/99] Wrong backup path --- scripts/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index d224333..1f0c044 100644 --- a/scripts/backup +++ b/scripts/backup @@ -42,7 +42,7 @@ fi if [ $custom_error_file ] then - ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.d/nginx-code-error.conf" + ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.d/code-error.conf" fi #================================================= From b6a23c7bc5b1b2b99a414fe60d09d621ab093e68 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Mon, 21 Aug 2023 15:12:24 +0200 Subject: [PATCH 60/99] Wrong filename --- scripts/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index 1f0c044..3aafb41 100644 --- a/scripts/backup +++ b/scripts/backup @@ -42,7 +42,7 @@ fi if [ $custom_error_file ] then - ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.d/code-error.conf" + ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" fi #================================================= From 44f371dae613c57d0fcae28cf9cd800675debb0f Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Mon, 21 Aug 2023 15:20:52 +0200 Subject: [PATCH 61/99] WIP: Update the custom config file --- scripts/change_url | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 9018ece..af6bc80 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -44,6 +44,7 @@ nginx_extra_conf_dir=/etc/nginx/conf.d/$old_domain.d/$app.d # Change the path in the NGINX config file if [ $change_path -eq 1 ] +ynh_print_info --message="Change the path in the Nginx config file" then # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" @@ -53,10 +54,11 @@ then path_url="$new_path" # Update custom error file path if needed - #if [ $custom_error_file -eq 1 ] - #then - # ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" - #fi + if [ $custom_error_file -eq 1 ] + ynh_print_info --message="Change the custom error config file" + then + ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" + fi # Create a dedicated NGINX configssh ynh_add_nginx_config From c1c68f946379af99cff8d560af2888096cc7a14a Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Mon, 21 Aug 2023 15:38:14 +0200 Subject: [PATCH 62/99] Fix warning info with the change url script --- scripts/change_url | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index af6bc80..d6a18d1 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -54,7 +54,7 @@ then path_url="$new_path" # Update custom error file path if needed - if [ $custom_error_file -eq 1 ] + if [ $custom_error_file ] ynh_print_info --message="Change the custom error config file" then ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" From 66249120ded202a122310a931f53026a0bbe0e29 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Mon, 21 Aug 2023 15:50:54 +0200 Subject: [PATCH 63/99] Revert the default value, set to false --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index cfc6f87..812f02e 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -24,7 +24,7 @@ name = "My Webapp configuration" [main.code_error.custom_error_file] ask = "Activate the custom error file use" type = "boolean" - default = true + default = false help = "When you enable this, you can add/create a custom `404.html` file in a directory `www\\error`." [main.php_fpm_config] From 6ea232f503d2c618921bf30249e854e05b407c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 26 Sep 2023 10:10:08 +0200 Subject: [PATCH 64/99] Add PostgreSQL database --- doc/DESCRIPTION.md | 2 +- doc/DESCRIPTION_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index de48a9d..0df591d 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,6 +1,6 @@ This application allows you to easily install a custom Web application, providing files access with [SFTP](https://yunohost.org/en/filezilla). -It can also create a MySQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory. +It can also create a MySQL or PostgreSQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory. PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 2bf7f20..0ad9a17 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1,6 +1,6 @@ Cette application vous permet d'installer facilement une application vide personnalisée, fourni un accès aux fichiers avec [SFTP](https://yunohost.org/fr/filezilla). -Elle peut également créer une base de données MySQL - qui sera sauvegardée et restaurée avec votre application. Les détails de connexion seront stockés dans le fichier `db_accesss.txt` situé dans le répertoire racine. +Elle peut également créer une base de données MySQL ou PostgreSQL - qui sera sauvegardée et restaurée avec votre application. Les détails de connexion seront stockés dans le fichier `db_accesss.txt` situé dans le répertoire racine. La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1` et `8.2`. From 00b181c417c41f6d645d9627cc260b8963d283d9 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 26 Sep 2023 08:10:13 +0000 Subject: [PATCH 65/99] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b48addc..68d017f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in This application allows you to easily install a custom Web application, providing files access with [SFTP](https://yunohost.org/en/filezilla). -It can also create a MySQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory. +It can also create a MySQL or PostgreSQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory. PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`. diff --git a/README_fr.md b/README_fr.md index d81d0bb..425ff80 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Cette application vous permet d'installer facilement une application vide personnalisée, fourni un accès aux fichiers avec [SFTP](https://yunohost.org/fr/filezilla). -Elle peut également créer une base de données MySQL - qui sera sauvegardée et restaurée avec votre application. Les détails de connexion seront stockés dans le fichier `db_accesss.txt` situé dans le répertoire racine. +Elle peut également créer une base de données MySQL ou PostgreSQL - qui sera sauvegardée et restaurée avec votre application. Les détails de connexion seront stockés dans le fichier `db_accesss.txt` situé dans le répertoire racine. La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1` et `8.2`. From 060e15e3658831a6696d8e25a07a21c44b8462d8 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Wed, 27 Sep 2023 23:27:41 +0200 Subject: [PATCH 66/99] Update config_panel.toml Tweak the help message Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com> --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 812f02e..dfe5e24 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -25,7 +25,7 @@ name = "My Webapp configuration" ask = "Activate the custom error file use" type = "boolean" default = false - help = "When you enable this, you can add/create a custom `404.html` file in a directory `www\\error`." + help = "Once custom error enabled, you can add/create a custom `404.html` file in a directory `www\\error`." [main.php_fpm_config] name = "PHP-FPM configuration" From 55190b8272bf0d36e1b0ca90b372411a6429bc47 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 8 Oct 2023 10:40:01 +0200 Subject: [PATCH 67/99] Improve error pages documentation --- doc/ADMIN.md | 2 +- doc/ADMIN_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ADMIN.md b/doc/ADMIN.md index 5dc0377..dae1579 100644 --- a/doc/ADMIN.md +++ b/doc/ADMIN.md @@ -21,7 +21,7 @@ If you forgot your SFTP password, you can change it in YunoHost's webadmin inter ### 403 and 404 error handling -The web server configuration supports http error handling `403` and `404` (access denied and resource not found), just add an `error` folder in the `www` directory, then your `403.html` and `404.html` files. +The web server configuration supports http error handling `403` and `404` (access denied and resource not found). Create an `error` folder at `__INSTALL_DIR__/www/error`, and put your `403.html` and `404.html` files in there. ### Customizing the nginx configuration diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md index 292e61d..a334a3a 100644 --- a/doc/ADMIN_fr.md +++ b/doc/ADMIN_fr.md @@ -25,7 +25,7 @@ Si vous n'arrivez pas à vous connecter et que vous avez vérifié que le nom d' ### Gestion des erreurs 403 et 404 -La configuration du serveur web prend en charge la gestion des erreurs http `403` et `404` (accès refusé et ressource non trouvé), il suffit de d'ajouter un dossier `error` dans le repertoire `www` puis vos fichiers `403.html` et `404.html`. +La configuration du serveur web prend en charge la gestion des erreurs http `403` et `404` (accès refusé et ressource non trouvée). Ajoutez un dossier `error` à l'emplacement `__INSTALL_DIR__/www/error`, puis ajoutez-y vos fichiers `403.html` et `404.html`. ### Personnaliser la configuration nginx From 9b8d318fb63b00576d48bb8a45ecb3e13ad119cd Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 8 Oct 2023 08:47:38 +0000 Subject: [PATCH 68/99] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 68d017f..d25aca6 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,12 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` **Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. +You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. **Shipped version:** 1.0~ynh15 ## Documentation and resources * Upstream app code repository: -* YunoHost documentation for this app: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index 425ff80..ba5194d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,12 +24,12 @@ La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1 **Une fois installé, rendez-vous sur l'URL choisie pour connaître l'utilisateur, le domaine et le port que vous devrez utiliser pour l'accès SFTP.** Le mot de passe est celui que vous avez choisi lors de l'installation. Sous le répertoire Web, vous verrez un dossier `www` qui contient les fichiers publics servis par cette application. Vous pouvez mettre tous les fichiers de votre application Web personnalisée à l'intérieur. +L'application vous permet aussi de gérer - si vous activez l'option dans le panneau de configuration - la gestion des erreurs 404, il vous suffit de créer un dossier `error` dans le répertoire racine `www` et d'y placer vos fichiers d'erreur `html` **Version incluse :** 1.0~ynh15 ## Documentations et ressources * Dépôt de code officiel de l’app : -* Documentation YunoHost pour cette app : * Signaler un bug : ## Informations pour les développeurs From 808799353409a5f6275edc4106441cbfc8deeb51 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 8 Oct 2023 10:27:51 +0200 Subject: [PATCH 69/99] Prioritize index.php over index.html --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index e522e75..2b2c03f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -5,7 +5,7 @@ location __PATH__/ { alias __INSTALL_DIR__/www/; # Default indexes and catch-all - index index.html index.php; + index index.php index.html; try_files $uri $uri/ __PATH__/index.php?$args =404; # Prevent useless logs From e4f955e2dc9857bcf1005cd68e0dbefe7f0f27f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 8 Oct 2023 10:55:29 +0200 Subject: [PATCH 70/99] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 2be35b6..2226004 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~ynh15" +version = "1.0~ynh16" maintainers = [] From 37d888f16abbee8ba650ff44967b44d897293d95 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 8 Oct 2023 08:55:36 +0000 Subject: [PATCH 71/99] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d25aca6..13b84ab 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. -**Shipped version:** 1.0~ynh15 +**Shipped version:** 1.0~ynh16 ## Documentation and resources * Upstream app code repository: diff --git a/README_fr.md b/README_fr.md index ba5194d..ce7556a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -26,7 +26,7 @@ La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1 L'application vous permet aussi de gérer - si vous activez l'option dans le panneau de configuration - la gestion des erreurs 404, il vous suffit de créer un dossier `error` dans le répertoire racine `www` et d'y placer vos fichiers d'erreur `html` -**Version incluse :** 1.0~ynh15 +**Version incluse :** 1.0~ynh16 ## Documentations et ressources * Dépôt de code officiel de l’app : From 365d2c7641d1bf49cbc878a021fe588a45009d0e Mon Sep 17 00:00:00 2001 From: Florent Date: Sun, 15 Oct 2023 10:10:40 +0200 Subject: [PATCH 72/99] explicitly call ynh_remove_app_dependencies when changing phpversion --- scripts/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 0958338..65a87ca 100644 --- a/scripts/config +++ b/scripts/config @@ -114,7 +114,7 @@ ynh_app_config_apply() { then ynh_app_setting_set --app=$app --key=phpversion --value="${old[phpversion]}" ynh_remove_fpm_config - # ^ the helper includes ynh_remove_app_dependencies + ynh_remove_app_dependencies YNH_PHP_VERSION=$phpversion # ^ ynh_add_config replaces __PHPVERSION__ by __PHP_YNH_VERSION__... ynh_app_setting_set --app=$app --key=phpversion --value="$phpversion" From 4801ff47a88351402b4f33c99f2778e4eb31ff56 Mon Sep 17 00:00:00 2001 From: Florent Date: Sun, 15 Oct 2023 11:51:39 +0200 Subject: [PATCH 73/99] Reinstall all the dependencies when changing php version #131 --- manifest.toml | 6 +++--- scripts/config | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index 2226004..3bcb9e9 100644 --- a/manifest.toml +++ b/manifest.toml @@ -70,15 +70,15 @@ ram.runtime = "50M" [resources.apt] packages = "nginx" # Kind of "dummy" value to be sure to have a non-empty dep list packages_from_raw_bash = """ - if [[ "$database" == "mysql" ]]; then + if [[ "$database" == "mysql" ]]; then echo "mariadb-server" - + if [[ "$phpversion" != none ]]; then echo "php${phpversion}-mysql" fi elif [[ "$database" == "postgresql" ]]; then echo "postgresql postgresql-contrib" - + if [[ "$phpversion" != none ]]; then echo "php${phpversion}-pgsql" fi diff --git a/scripts/config b/scripts/config index 65a87ca..1ff9b49 100644 --- a/scripts/config +++ b/scripts/config @@ -127,7 +127,10 @@ ynh_app_config_apply() { ynh_secure_remove --file="$nginx_extra_conf_dir/php.conf" else ynh_add_config --template="nginx-php.conf" --destination="$nginx_extra_conf_dir/php.conf" - ynh_install_app_dependencies "php${phpversion}-fpm" + database=$(ynh_app_setting_get --app=$app --key=database) + dependencies="$(ynh_read_manifest -k "resources.apt.packages")" + dependencies_from_raw_bash=$(eval "$(ynh_read_manifest -k "resources.apt.packages_from_raw_bash")" | tr "\n" " ") + ynh_install_app_dependencies "$dependencies $dependencies_from_raw_bash" ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion # ^ the helper takes care of ynh_app_setting_set the phpversion fi From 1bb337ce1850205bd9e276a118a2a521709e55e4 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 7 May 2024 14:17:57 +0000 Subject: [PATCH 74/99] Auto-update READMEs --- ALL_README.md | 7 +++++++ README.md | 20 ++++++++++---------- README_eu.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ README_fr.md | 26 ++++++++++++------------- README_gl.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 174 insertions(+), 23 deletions(-) create mode 100644 ALL_README.md create mode 100644 README_eu.md create mode 100644 README_gl.md create mode 100644 README_zh_Hans.md diff --git a/ALL_README.md b/ALL_README.md new file mode 100644 index 0000000..a01b345 --- /dev/null +++ b/ALL_README.md @@ -0,0 +1,7 @@ +# All available README files by language + +- [Read the README in English](README.md) +- [Irakurri README euskaraz](README_eu.md) +- [Lire le README en français](README_fr.md) +- [Le o README en galego](README_gl.md) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index b618f26..05ff413 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ @@ -9,10 +9,10 @@ It shall NOT be edited by hand. [![Install My Webapp with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp) -*[Lire ce readme en français.](./README_fr.md)* +*[Read this README in other languages.](./ALL_README.md)* -> *This package allows you to install My Webapp quickly and simply on a YunoHost server. -If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* +> *This package allows you to install My Webapp quickly and simply on a YunoHost server.* +> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* ## Overview @@ -29,17 +29,17 @@ You can also customize 404 errors - if you enable the option in the config panel **Shipped version:** 1.0~ynh16 ## Documentation and resources -* Upstream app code repository: -* YunoHost Store: -* Report a bug: +- Upstream app code repository: +- YunoHost Store: +- Report a bug: ## Developer info -Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing). +Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing). -To try the testing branch, please proceed like that. +To try the `testing` branch, please proceed like that: -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug or sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug diff --git a/README_eu.md b/README_eu.md new file mode 100644 index 0000000..7a0fcc4 --- /dev/null +++ b/README_eu.md @@ -0,0 +1,48 @@ + + +# My Webapp YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) + +[![Instalatu My Webapp YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek My Webapp YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +This application allows you to easily install a custom Web application, providing files access with [SFTP](https://yunohost.org/en/filezilla). + +It can also create a MySQL or PostgreSQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory. + +PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`. + +**Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. + +You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. + +**Paketatutako bertsioa:** 1.0~ynh16 +## Dokumentazioa eta baliabideak + +- Jatorrizko aplikazioaren kode-gordailua: +- YunoHost Denda: +- Eman errore baten berri: + +## Garatzaileentzako informazioa + +Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug +edo +sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_fr.md b/README_fr.md index 81ce520..ea713ab 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,6 +1,6 @@ # My Webapp pour YunoHost @@ -9,10 +9,10 @@ It shall NOT be edited by hand. [![Installer My Webapp avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp) -*[Read this readme in english.](./README.md)* +*[Lire le README dans d'autres langues.](./ALL_README.md)* -> *Ce package vous permet d’installer My Webapp rapidement et simplement sur un serveur YunoHost. -Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* +> *Ce package vous permet d’installer My Webapp rapidement et simplement sur un serveur YunoHost.* +> *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.* ## Vue d’ensemble @@ -26,23 +26,23 @@ La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1 L'application vous permet aussi de gérer - si vous activez l'option dans le panneau de configuration - la gestion des erreurs 404, il vous suffit de créer un dossier `error` dans le répertoire racine `www` et d'y placer vos fichiers d'erreur `html` -**Version incluse :** 1.0~ynh16 +**Version incluse :** 1.0~ynh16 ## Documentations et ressources -* Dépôt de code officiel de l’app : -* YunoHost Store: -* Signaler un bug : +- Dépôt de code officiel de l’app : +- YunoHost Store : +- Signaler un bug : ## Informations pour les développeurs -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing). +Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing). -Pour essayer la branche testing, procédez comme suit. +Pour essayer la branche `testing`, procédez comme suit : -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug ou sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug ``` -**Plus d’infos sur le packaging d’applications :** \ No newline at end of file +**Plus d’infos sur le packaging d’applications :** diff --git a/README_gl.md b/README_gl.md new file mode 100644 index 0000000..b59a02c --- /dev/null +++ b/README_gl.md @@ -0,0 +1,48 @@ + + +# My Webapp para YunoHost + +[![Nivel de integración](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) + +[![Instalar My Webapp con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp) + +*[Le este README en outros idiomas.](./ALL_README.md)* + +> *Este paquete permíteche instalar My Webapp de xeito rápido e doado nun servidor YunoHost.* +> *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.* + +## Vista xeral + +This application allows you to easily install a custom Web application, providing files access with [SFTP](https://yunohost.org/en/filezilla). + +It can also create a MySQL or PostgreSQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory. + +PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`. + +**Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. + +You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. + +**Versión proporcionada:** 1.0~ynh16 +## Documentación e recursos + +- Repositorio de orixe do código: +- Tenda YunoHost: +- Informar dun problema: + +## Info de desenvolvemento + +Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing). + +Para probar a rama `testing`, procede deste xeito: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug +ou +sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug +``` + +**Máis info sobre o empaquetado da app:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..8710f34 --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,48 @@ + + +# YunoHost 上的 My Webapp + +[![集成程度](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![工作状态](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) + +[![使用 YunoHost 安装 My Webapp](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 My Webapp。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + +This application allows you to easily install a custom Web application, providing files access with [SFTP](https://yunohost.org/en/filezilla). + +It can also create a MySQL or PostgreSQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory. + +PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`. + +**Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. + +You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. + +**分发版本:** 1.0~ynh16 +## 文档与资源 + +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug +或 +sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** From 36738b45a137b463ee395aecd010c2fe4288a048 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 7 May 2024 16:18:30 +0200 Subject: [PATCH 75/99] add php8.3 + default to php8.1 --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 3bcb9e9..66c239e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -49,8 +49,8 @@ ram.runtime = "50M" ask.en = "Choose a PHP version you want to use for your app" ask.fr = "Choisissez une version PHP que vous souhaitez utiliser pour votre application" type = "select" - choices = ["none", "7.4", "8.0", "8.1", "8.2"] - default = "8.0" + choices = ["none", "7.4", "8.0", "8.1", "8.2", "8.3"] + default = "8.1" [install.database] ask.en = "Do you need a database?" From 0ab0c6b3025ee518ed3e7448fdb5bfcdaf25fbe9 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 7 May 2024 16:20:07 +0200 Subject: [PATCH 76/99] bump version --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 66c239e..5c01f61 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~ynh16" +version = "1.0~ynh17" maintainers = [] From 22f48f479f06770456939a7d9461e92d4f9bc9c2 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 7 May 2024 14:20:38 +0000 Subject: [PATCH 77/99] Auto-update READMEs --- README.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_zh_Hans.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 05ff413..c48125c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. -**Shipped version:** 1.0~ynh16 +**Shipped version:** 1.0~ynh17 ## Documentation and resources - Upstream app code repository: diff --git a/README_eu.md b/README_eu.md index 7a0fcc4..e04a703 100644 --- a/README_eu.md +++ b/README_eu.md @@ -26,7 +26,7 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. -**Paketatutako bertsioa:** 1.0~ynh16 +**Paketatutako bertsioa:** 1.0~ynh17 ## Dokumentazioa eta baliabideak - Jatorrizko aplikazioaren kode-gordailua: diff --git a/README_fr.md b/README_fr.md index ea713ab..be7eb8a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -26,7 +26,7 @@ La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1 L'application vous permet aussi de gérer - si vous activez l'option dans le panneau de configuration - la gestion des erreurs 404, il vous suffit de créer un dossier `error` dans le répertoire racine `www` et d'y placer vos fichiers d'erreur `html` -**Version incluse :** 1.0~ynh16 +**Version incluse :** 1.0~ynh17 ## Documentations et ressources - Dépôt de code officiel de l’app : diff --git a/README_gl.md b/README_gl.md index b59a02c..2f46a38 100644 --- a/README_gl.md +++ b/README_gl.md @@ -26,7 +26,7 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. -**Versión proporcionada:** 1.0~ynh16 +**Versión proporcionada:** 1.0~ynh17 ## Documentación e recursos - Repositorio de orixe do código: diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 8710f34..4efb3a3 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -26,7 +26,7 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. -**分发版本:** 1.0~ynh16 +**分发版本:** 1.0~ynh17 ## 文档与资源 - 上游应用代码库: From 23535f094f500368dd83781cc4166534b6e43dd2 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 7 May 2024 16:53:49 +0200 Subject: [PATCH 78/99] Bump default PHP version to 8.3 Co-authored-by: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 5c01f61..29a30ee 100644 --- a/manifest.toml +++ b/manifest.toml @@ -50,7 +50,7 @@ ram.runtime = "50M" ask.fr = "Choisissez une version PHP que vous souhaitez utiliser pour votre application" type = "select" choices = ["none", "7.4", "8.0", "8.1", "8.2", "8.3"] - default = "8.1" + default = "8.3" [install.database] ask.en = "Do you need a database?" From 8213b4d9a3b3fbca14ef6717c7e619805f0f83df Mon Sep 17 00:00:00 2001 From: tituspijean Date: Tue, 7 May 2024 16:54:53 +0200 Subject: [PATCH 79/99] Add more PHP tests --- tests.toml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index a94ffe7..48ddfd4 100644 --- a/tests.toml +++ b/tests.toml @@ -9,7 +9,7 @@ test_format = 1.0 args.with_sftp = "1" args.password = "SuperDuper_StrongPassw0rd" args.database = "none" - args.phpversion = "8.0" + args.phpversion = "8.3" test_upgrade_from.bf5d3ed.name = "1.0~ynh14" test_upgrade_from.bf5d3ed.args.with_mysql = "0" test_upgrade_from.bf5d3ed.args.domain = "sub.domain.tld" @@ -21,6 +21,16 @@ test_format = 1.0 only = ["install.subdir", "backup_restore", "upgrade" ] args.phpversion = "8.0" +[81_test] + + only = ["install.subdir", "backup_restore", "upgrade" ] + args.phpversion = "8.1" + +[82_test] + + only = ["install.subdir", "backup_restore", "upgrade" ] + args.phpversion = "8.2" + [none_test] only = ["install.subdir", "backup_restore", "upgrade" ] From e51913303c3f284a9cd900427b2cebd2b49b552b Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 7 May 2024 16:58:16 +0200 Subject: [PATCH 80/99] Update config_panel.toml : add php8.3 --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index dfe5e24..c9fcad5 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -33,7 +33,7 @@ name = "My Webapp configuration" [main.php_fpm_config.phpversion] ask = "PHP version" type = "select" - choices = ["none", "7.4", "8.0", "8.1", "8.2"] + choices = ["none", "7.4", "8.0", "8.1", "8.2", "8.3"] default = "none" [main.php_fpm_config.fpm_footprint] From 0540f194c8f8ba838d792f686b96c2edacfdd21b Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 9 May 2024 08:59:44 +0000 Subject: [PATCH 81/99] Auto-update READMEs --- README_fr.md | 1 - README_gl.md | 2 -- 2 files changed, 3 deletions(-) diff --git a/README_fr.md b/README_fr.md index dd63014..be7eb8a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,7 +27,6 @@ La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1 L'application vous permet aussi de gérer - si vous activez l'option dans le panneau de configuration - la gestion des erreurs 404, il vous suffit de créer un dossier `error` dans le répertoire racine `www` et d'y placer vos fichiers d'erreur `html` **Version incluse :** 1.0~ynh17 - ## Documentations et ressources - Dépôt de code officiel de l’app : diff --git a/README_gl.md b/README_gl.md index 637a2aa..2f46a38 100644 --- a/README_gl.md +++ b/README_gl.md @@ -18,7 +18,6 @@ NON debe editarse manualmente. This application allows you to easily install a custom Web application, providing files access with [SFTP](https://yunohost.org/en/filezilla). - It can also create a MySQL or PostgreSQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory. PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`. @@ -28,7 +27,6 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. **Versión proporcionada:** 1.0~ynh17 - ## Documentación e recursos - Repositorio de orixe do código: From 17aa532b661115d4a2976c90174501f9dc2c3fe8 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Thu, 9 May 2024 16:32:26 +0200 Subject: [PATCH 82/99] Update backup: remove unecessary code for custom error page, the .d folder is already backuped/restored --- scripts/backup | 9 --------- 1 file changed, 9 deletions(-) diff --git a/scripts/backup b/scripts/backup index 83dbbd0..4e0ff8c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -36,15 +36,6 @@ then ynh_backup --src_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf" fi -#================================================= -# BACKUP CUSTOM CONF -#================================================= - -if [ $custom_error_file ] -then - ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.d/error-code.conf" -fi - #================================================= # BACKUP THE MYSQL DATABASE #================================================= From e16a41b7dd91a25c368892de88e06047d2019bf0 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Thu, 9 May 2024 16:34:08 +0200 Subject: [PATCH 83/99] Update change_url: zgrmblpfhonmgf --- scripts/change_url | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index d6a18d1..31f1e6e 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -54,8 +54,7 @@ then path_url="$new_path" # Update custom error file path if needed - if [ $custom_error_file ] - ynh_print_info --message="Change the custom error config file" + if [ $custom_error_file -eq 1 ] then ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" fi From cab30de6850c5e2fdc4ee87d3f42bfd0f1f626a7 Mon Sep 17 00:00:00 2001 From: Grena Date: Wed, 5 Jun 2024 09:59:35 +0200 Subject: [PATCH 84/99] Fix password change --- scripts/config | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/config b/scripts/config index 21b6f17..7bb46c3 100644 --- a/scripts/config +++ b/scripts/config @@ -59,7 +59,7 @@ get__free_footprint() { #================================================= set__password() { - if [ "$password" == "" ] + if [ ! "$password" == "" ] then ynh_app_setting_set --app=$app --key=password --value="$password" fi @@ -147,6 +147,11 @@ ynh_app_config_apply() { then ynh_system_user_del_group --username=$app --groups="sftp.app" fi + + if [ "${changed[password]}" == "true" ] && [ ! "$password" == "" ] + then + chpasswd <<< "${app}:${password}" + fi if [ "$phpversion" != "none" ] then From 0f47d1c6cb179887d073566050b5b83d43c75657 Mon Sep 17 00:00:00 2001 From: Grena Date: Wed, 5 Jun 2024 10:34:40 +0200 Subject: [PATCH 85/99] Add french translation of SFTP access into config panel --- config_panel.toml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index b229f0f..02f511a 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -4,19 +4,23 @@ version = "1.0" name = "My Webapp configuration" [main.sftp] - name = "SFTP access" + name.en = "SFTP access" + name.fr = "Accès SFTP" [main.sftp.with_sftp] - ask = "Do you need a SFTP access?" + ask.en = "Do you need a SFTP access?" + ask.fr = "Avez-vous besoin d'un accès SFTP ?" type = "boolean" default = true [main.sftp.password] - ask = "Set a password for the SFTP access" + ask.en = "Set a password for the SFTP access" + ask.fr = "Définir un mot de passe pour l’accès SFTP" type = "password" optional = true visible = "with_sftp" - help = "If a password already exist, leave blank and it will not be replaced." + help.en = "If a password already exist, leave blank and it will not be replaced." + help.fr = "Si un mot de passe existe déjà, laissez vide et il ne sera pas remplacé." [main.php_fpm_config] name = "PHP-FPM configuration" From da1fc5e54bf05e7b3683f288997faa2f31e75e6f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 24 Jun 2024 10:13:24 +0000 Subject: [PATCH 86/99] Auto-update READMEs --- ALL_README.md | 1 + README_es.md | 5 +++-- README_eu.md | 1 - README_zh_Hans.md | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ALL_README.md b/ALL_README.md index a01b345..152f2e7 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,6 +1,7 @@ # All available README files by language - [Read the README in English](README.md) +- [Lea el README en español](README_es.md) - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) diff --git a/README_es.md b/README_es.md index 0ec9f3e..f340022 100644 --- a/README_es.md +++ b/README_es.md @@ -18,14 +18,15 @@ No se debe editar a mano. This application allows you to easily install a custom Web application, providing files access with [SFTP](https://yunohost.org/en/filezilla). -It can also create a MySQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory. +It can also create a MySQL or PostgreSQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory. PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`. **Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. +You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. -**Versión actual:** 1.0~ynh15 +**Versión actual:** 1.0~ynh17 ## Documentaciones y recursos - Repositorio del código fuente oficial de la aplicación : diff --git a/README_eu.md b/README_eu.md index 7c36047..e04a703 100644 --- a/README_eu.md +++ b/README_eu.md @@ -27,7 +27,6 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. **Paketatutako bertsioa:** 1.0~ynh17 - ## Dokumentazioa eta baliabideak - Jatorrizko aplikazioaren kode-gordailua: diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 2f7de7a..4efb3a3 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -27,7 +27,6 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. **分发版本:** 1.0~ynh17 - ## 文档与资源 - 上游应用代码库: From cefdd63e384e6a74c14f6e0b6268263adda0d9b6 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Wed, 3 Jul 2024 18:09:55 +0200 Subject: [PATCH 87/99] Typo --- doc/DESCRIPTION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index f00f770..8ff7d95 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -6,4 +6,4 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` **Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. -You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. \ No newline at end of file +You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files. From 81ecb8ba901ee6a1b95f94003e8d3598997412ae Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 3 Jul 2024 16:09:59 +0000 Subject: [PATCH 88/99] Auto-update READMEs --- README.md | 5 +++-- README_es.md | 5 +++-- README_eu.md | 5 +++-- README_fr.md | 2 +- README_gl.md | 5 +++-- README_zh_Hans.md | 5 +++-- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c48125c..c3ff178 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # My Webapp for YunoHost -[![Integration level](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![Working status](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Working status](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) [![Install My Webapp with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp) @@ -24,7 +24,8 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` **Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. -You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. +You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files. + **Shipped version:** 1.0~ynh17 ## Documentation and resources diff --git a/README_es.md b/README_es.md index f340022..1c54236 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # My Webapp para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) [![Instalar My Webapp con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp) @@ -24,7 +24,8 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` **Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. -You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. +You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files. + **Versión actual:** 1.0~ynh17 ## Documentaciones y recursos diff --git a/README_eu.md b/README_eu.md index e04a703..48ee029 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # My Webapp YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) [![Instalatu My Webapp YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp) @@ -24,7 +24,8 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` **Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. -You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. +You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files. + **Paketatutako bertsioa:** 1.0~ynh17 ## Dokumentazioa eta baliabideak diff --git a/README_fr.md b/README_fr.md index be7eb8a..548272f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # My Webapp pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) [![Installer My Webapp avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp) diff --git a/README_gl.md b/README_gl.md index 2f46a38..82af726 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # My Webapp para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) [![Instalar My Webapp con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp) @@ -24,7 +24,8 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` **Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. -You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. +You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files. + **Versión proporcionada:** 1.0~ynh17 ## Documentación e recursos diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 4efb3a3..15676af 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 My Webapp -[![集成程度](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![工作状态](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) [![使用 YunoHost 安装 My Webapp](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp) @@ -24,7 +24,8 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2` **Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. -You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files. +You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files. + **分发版本:** 1.0~ynh17 ## 文档与资源 From f7e3c828ec29385c37d77b0e740e36b09a19ced6 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 23 Jul 2024 11:36:02 +0000 Subject: [PATCH 89/99] Auto-update READMEs --- ALL_README.md | 1 + README_id.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 README_id.md diff --git a/ALL_README.md b/ALL_README.md index 152f2e7..4ed64dd 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -5,4 +5,5 @@ - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) +- [Baca README dalam bahasa bahasa Indonesia](README_id.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README_id.md b/README_id.md new file mode 100644 index 0000000..c65247b --- /dev/null +++ b/README_id.md @@ -0,0 +1,49 @@ + + +# My Webapp untuk YunoHost + +[![Tingkat integrasi](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) + +[![Pasang My Webapp dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp) + +*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)* + +> *Paket ini memperbolehkan Anda untuk memasang My Webapp secara cepat dan mudah pada server YunoHost.* +> *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.* + +## Ringkasan + +This application allows you to easily install a custom Web application, providing files access with [SFTP](https://yunohost.org/en/filezilla). + +It can also create a MySQL or PostgreSQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory. + +PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`. + +**Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside. + +You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files. + + +**Versi terkirim:** 1.0~ynh17 +## Dokumentasi dan sumber daya + +- Repositori kode aplikasi hulu: +- Gudang YunoHost: +- Laporkan bug: + +## Info developer + +Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing). + +Untuk mencoba branch `testing`, silakan dilanjutkan seperti: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug +atau +sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug +``` + +**Info lebih lanjut mengenai pemaketan aplikasi:** From 72ae3827de3b196c476ddb8d4db2756f3659e7bf Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 23 Jul 2024 13:43:07 +0200 Subject: [PATCH 90/99] =?UTF-8?q?Reinstall=20all=20the=20dependencies=20wh?= =?UTF-8?q?en=20changing=20php=20version=C2=B2=20(remove=20php-fpm=20deps?= =?UTF-8?q?=20if=20phpversion=20is=20none)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/config | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/config b/scripts/config index 771b610..0cbb223 100644 --- a/scripts/config +++ b/scripts/config @@ -119,6 +119,11 @@ ynh_app_config_apply() { # ^ ynh_add_config replaces __PHPVERSION__ by __PHP_YNH_VERSION__... ynh_app_setting_set --app=$app --key=phpversion --value="$phpversion" + database=$(ynh_app_setting_get --app=$app --key=database) + dependencies="$(ynh_read_manifest -k "resources.apt.packages")" + dependencies_from_raw_bash=$(eval "$(ynh_read_manifest -k "resources.apt.packages_from_raw_bash")" | tr "\n" " ") + ynh_install_app_dependencies "$dependencies $dependencies_from_raw_bash" + nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d" mkdir -p "$nginx_extra_conf_dir" if [ "$phpversion" == "none" ] @@ -127,10 +132,6 @@ ynh_app_config_apply() { ynh_secure_remove --file="$nginx_extra_conf_dir/php.conf" else ynh_add_config --template="nginx-php.conf" --destination="$nginx_extra_conf_dir/php.conf" - database=$(ynh_app_setting_get --app=$app --key=database) - dependencies="$(ynh_read_manifest -k "resources.apt.packages")" - dependencies_from_raw_bash=$(eval "$(ynh_read_manifest -k "resources.apt.packages_from_raw_bash")" | tr "\n" " ") - ynh_install_app_dependencies "$dependencies $dependencies_from_raw_bash" ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion # ^ the helper takes care of ynh_app_setting_set the phpversion fi From cb465e8573aaa82fdefe54652af6b34908daf2d0 Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 23 Jul 2024 13:48:14 +0200 Subject: [PATCH 91/99] reenable ynh_delete_file_checksum of the nginx error conf file, let's wait the CI --- scripts/change_url | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 31f1e6e..1238ffd 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -44,8 +44,9 @@ nginx_extra_conf_dir=/etc/nginx/conf.d/$old_domain.d/$app.d # Change the path in the NGINX config file if [ $change_path -eq 1 ] -ynh_print_info --message="Change the path in the Nginx config file" then + ynh_print_info --message="Change the path in the Nginx config file" + # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" @@ -69,7 +70,7 @@ then # Delete file checksum for the old conf file location ynh_delete_file_checksum --file="$nginx_conf_path" ynh_delete_file_checksum --file="$nginx_extra_conf_dir/php.conf" - #ynh_delete_file_checksum --file="$nginx_extra_conf_dir/nginx-code-error.conf" + ynh_delete_file_checksum --file="$nginx_extra_conf_dir/nginx-code-error.conf" path_url="$new_path" domain="$old_domain" @@ -82,7 +83,7 @@ then # Store file checksum for the new config file location ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/php.conf" - #ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/nginx-code-error.conf" + ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/nginx-code-error.conf" fi #================================================= From 55c0bbb5948ff9b3aa2b403e3bc94905ec922e69 Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 23 Jul 2024 13:52:14 +0200 Subject: [PATCH 92/99] fix indent --- scripts/config | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/scripts/config b/scripts/config index 0cbb223..3d3e50b 100644 --- a/scripts/config +++ b/scripts/config @@ -159,24 +159,23 @@ ynh_app_config_apply() { if [ "${changed[custom_error_file]}" == "true" ] then - CUSTOM_ERROR_FILE=$custom_error_file - nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d" + CUSTOM_ERROR_FILE=$custom_error_file + nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d" - if [ $custom_error_file -eq 1 ] - then - ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" - elif [ $custom_error_file -eq 0 ] - then - ynh_secure_remove --file="$nginx_extra_conf_dir/error-code.conf" - fi - ynh_systemd_action --service_name=nginx --action=reload + if [ $custom_error_file -eq 1 ] + then + ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" + elif [ $custom_error_file -eq 0 ] + then + ynh_secure_remove --file="$nginx_extra_conf_dir/error-code.conf" + fi + ynh_systemd_action --service_name=nginx --action=reload fi if [ "$phpversion" != "none" ] then ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint fi - } ynh_app_config_run $1 From f92817b922927f75f63e25f9371334dfe654c151 Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 23 Jul 2024 13:57:51 +0200 Subject: [PATCH 93/99] add custom_error_file in the manifest, default to false --- manifest.toml | 6 ++++++ scripts/install | 8 +++++--- scripts/upgrade | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) 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 From df628b6cd11507896720999cd26a73cb0994eb2d Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 23 Jul 2024 14:01:30 +0200 Subject: [PATCH 94/99] add a test for custom_error_file --- tests.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests.toml b/tests.toml index 48ddfd4..fcab393 100644 --- a/tests.toml +++ b/tests.toml @@ -50,3 +50,12 @@ test_format = 1.0 only = ["install.subdir", "backup_restore", "upgrade" ] args.database = "postgresql" + +[custom_error_file_test] + only = ["install.subdir", "backup_restore", "upgrade" ] + args.custom_error_file = "1" + test_upgrade_from.bf5d3ed.name = "1.0~ynh14" + test_upgrade_from.bf5d3ed.args.with_mysql = "0" + test_upgrade_from.bf5d3ed.args.domain = "sub.domain.tld" + test_upgrade_from.bf5d3ed.args.path = "/" + test_upgrade_from.bf5d3ed.args.password = "SuperDuper_StrongPassw0rd" From 7226257ce86a588be51df34f2fbb111071161a6c Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 23 Jul 2024 14:04:28 +0200 Subject: [PATCH 95/99] add all tests for custom_error_file_test --- tests.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index fcab393..52b512b 100644 --- a/tests.toml +++ b/tests.toml @@ -52,7 +52,7 @@ test_format = 1.0 args.database = "postgresql" [custom_error_file_test] - only = ["install.subdir", "backup_restore", "upgrade" ] + args.custom_error_file = "1" test_upgrade_from.bf5d3ed.name = "1.0~ynh14" test_upgrade_from.bf5d3ed.args.with_mysql = "0" From eca97b65aaa5c821e957647eb411b2fa4cb3fd4f Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 23 Jul 2024 16:36:00 +0200 Subject: [PATCH 96/99] fix change url --- scripts/change_url | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 1238ffd..5fb6b9f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -45,8 +45,6 @@ nginx_extra_conf_dir=/etc/nginx/conf.d/$old_domain.d/$app.d # Change the path in the NGINX config file if [ $change_path -eq 1 ] then - ynh_print_info --message="Change the path in the Nginx config file" - # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" @@ -60,7 +58,7 @@ then ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf" fi - # Create a dedicated NGINX configssh + # Create a dedicated NGINX config ynh_add_nginx_config fi @@ -70,7 +68,7 @@ then # Delete file checksum for the old conf file location ynh_delete_file_checksum --file="$nginx_conf_path" ynh_delete_file_checksum --file="$nginx_extra_conf_dir/php.conf" - ynh_delete_file_checksum --file="$nginx_extra_conf_dir/nginx-code-error.conf" + ynh_delete_file_checksum --file="$nginx_extra_conf_dir/code-error.conf" path_url="$new_path" domain="$old_domain" @@ -83,7 +81,7 @@ then # Store file checksum for the new config file location ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/php.conf" - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/nginx-code-error.conf" + ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/code-error.conf" fi #================================================= From db7dcbdd1bad3e08483e8c6e44f1119ad1f3fd19 Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 23 Jul 2024 17:43:36 +0200 Subject: [PATCH 97/99] =?UTF-8?q?fix=20change=5Furl=C2=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/change_url | 10 ++++++++-- tests.toml | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 5fb6b9f..11ed31f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -80,8 +80,14 @@ then mv $nginx_extra_conf_dir /etc/nginx/conf.d/$new_domain.d/$app.d # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/php.conf" - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/code-error.conf" + if [ $phpversion != "none" ] + then + ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/php.conf" + fi + if [ $custom_error_file -eq 1 ] + then + ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/code-error.conf" + fi fi #================================================= diff --git a/tests.toml b/tests.toml index 52b512b..e4659c6 100644 --- a/tests.toml +++ b/tests.toml @@ -33,7 +33,6 @@ test_format = 1.0 [none_test] - only = ["install.subdir", "backup_restore", "upgrade" ] args.phpversion = "none" [mysql_test] From 19f09d856985410e537f791b3ad0ca07e6ea270e Mon Sep 17 00:00:00 2001 From: Kayou Date: Wed, 24 Jul 2024 10:14:09 +0200 Subject: [PATCH 98/99] Note to self - open your eyes BEFORE writing code --- scripts/change_url | 4 ++-- tests.toml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 11ed31f..b50b097 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -68,7 +68,7 @@ then # Delete file checksum for the old conf file location ynh_delete_file_checksum --file="$nginx_conf_path" ynh_delete_file_checksum --file="$nginx_extra_conf_dir/php.conf" - ynh_delete_file_checksum --file="$nginx_extra_conf_dir/code-error.conf" + ynh_delete_file_checksum --file="$nginx_extra_conf_dir/error-code.conf" path_url="$new_path" domain="$old_domain" @@ -86,7 +86,7 @@ then fi if [ $custom_error_file -eq 1 ] then - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/code-error.conf" + ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/error-code.conf" fi fi diff --git a/tests.toml b/tests.toml index e4659c6..80bece3 100644 --- a/tests.toml +++ b/tests.toml @@ -7,6 +7,7 @@ test_format = 1.0 # ------------------------------- args.with_sftp = "1" + args.custom_error_file = "0" args.password = "SuperDuper_StrongPassw0rd" args.database = "none" args.phpversion = "8.3" From 89fbb93c76a3637b5453557e81bbf48338b4d25e Mon Sep 17 00:00:00 2001 From: Kayou Date: Wed, 24 Jul 2024 11:59:06 +0200 Subject: [PATCH 99/99] fix restore script --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index cd4f1af..7e0bac9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.d/" +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.d" #================================================= # RESTORE THE MYSQL DATABASE