1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/snserver_ynh.git synced 2024-09-03 20:26:22 +02:00

Fix Upgrade compatibility

This commit is contained in:
Fabian Wilkens 2021-01-22 20:41:41 +01:00
parent 8164943495
commit 4ad8116a0b
4 changed files with 36 additions and 7 deletions

View file

@ -34,7 +34,7 @@ if [[ ! -f $config_file || \
! -d "$final_path/live/public/extensions/" || \
! -d "$final_path/live/public/extensions/src/" ]]
then
ynh_die --message="Standard Notes - Extensions can not be installed." --ret_code=1
ynh_die --message="Standard Notes - Extensions can not be installed. Please upgrade snserver" --ret_code=1
fi
#=================================================

View file

@ -95,7 +95,10 @@ then
domain="$old_domain"
path_url="$new_path"
# Create a dedicated nginx config
ynh_add_nginx_config "port access_domain"
ynh_add_nginx_config "\
port \
access_domain\
"
fi
# Change the domain for nginx

View file

@ -101,7 +101,10 @@ ynh_setup_source --dest_dir="$final_path/live"
ynh_script_progression --message="Configuring nginx web server..." --weight=3
# Create a dedicated nginx config
ynh_add_nginx_config "port access_domain"
ynh_add_nginx_config "\
port \
access_domain \
"
#=================================================
# CREATE DEDICATED USER

View file

@ -25,8 +25,8 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
port=$(ynh_app_setting_get --app=$app --key=port)
install_extensions=(ynh_app_setting_get --app=$app --key=install_extensions)
access_domain=(ynh_app_setting_get --app=$app --key=access_domain)
install_extensions=$(ynh_app_setting_get --app=$app --key=install_extensions)
access_domain=$(ynh_app_setting_get --app=$app --key=access_domain)
#=================================================
# CHECK VERSION
@ -66,6 +66,27 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
# If install_extensions doesn't exist, create it
if [ -z "$install_extensions" ]; then
install_extensions=0
ynh_app_setting_set --app=$app --key=install_extensions --value=$install_extensions
fi
# If access_domain doesn't exist, create it
if [ -z "$access_domain" ]; then
access_domain=$domain
ynh_app_setting_set --app=$app --key=access_domain --value=$access_domain
fi
if [[ ! -d "$final_path/live/public/extensions/" || \
! -d "$final_path/live/public/extensions/src/" ]]
then
if test -e "$../sources/extra_files/app"
then
cp -a $../sources/extra_files/app/. "$final_path/"
fi
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -118,8 +139,10 @@ fi
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1
# Create a dedicated nginx config
ynh_add_nginx_config "port"
ynh_add_nginx_config "\
port \
acess_domain
"
#=================================================
# UPGRADE DEPENDENCIES