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 upgrade to set the code error

This commit is contained in:
--help 2023-08-13 10:47:43 +02:00
parent 8b30a536cb
commit b863da7cff
3 changed files with 14 additions and 3 deletions

View file

@ -0,0 +1,5 @@
# Build error access
error_page 404 /error/404.html;
location = __PATH__/error/404.html {
internal;
}

View file

@ -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"

View file

@ -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