1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/my_webapp_ynh.git synced 2024-09-03 19:46:26 +02:00

Update install/upgrade

This commit is contained in:
Aurelien Vaillant 2023-08-16 18:36:04 +02:00
parent 74526f2e53
commit 8fe710187a
3 changed files with 16 additions and 13 deletions

View file

@ -25,15 +25,13 @@ name = "My Webapp configuration"
ask = "Activate the custom error file use" ask = "Activate the custom error file use"
type = "boolean" type = "boolean"
default = false 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" 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] # [main.code_error.path_folder]
ask = "Specifie folder where your error file are sto" # ask = "Specifie folder where your error file are sto"
type = "string" # type = "string"
default = "/" # default = "/"
help = "You can set where your error file are store in your www folder." # help = "You can set where your error file are store in your www folder."
[main.php_fpm_config] [main.php_fpm_config]
name = "PHP-FPM configuration" name = "PHP-FPM configuration"

View file

@ -63,6 +63,12 @@ then
YNH_PHP_VERSION="$phpversion" YNH_PHP_VERSION="$phpversion"
fi 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 # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
ynh_add_config --template="example-custom-nginx-config.conf" --destination="$nginx_extra_conf_dir/sample.conf" ynh_add_config --template="example-custom-nginx-config.conf" --destination="$nginx_extra_conf_dir/sample.conf"

View file

@ -56,9 +56,9 @@ if [ -z "$phpversion" ]; then
ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion
fi fi
# If $codeerror doesn't exist, create it. We assume it is the default system one. # 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=codeerror)" ]; then if [ -n "$(ynh_app_setting_get --app=$app --key=custom_error_file)" ]; then
codeerror=$(ynh_app_setting_get --app=$app --key=codeerror) custom_error_file=$(ynh_app_setting_get --app=$app --key=custom_error_file)
fi fi
# Delete old user # Delete old user
@ -96,10 +96,9 @@ then
fi fi
# Add the config error code # Add the config error code
if [ -n "$(ynh_app_setting_get --app=$app --key=codeerror)" ]; if [ ! $custom_error_file ]
then then
echo add the error config 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="$nginx_extra_conf_dir/error.conf"
fi fi
# Create a dedicated NGINX config # Create a dedicated NGINX config