mirror of
https://github.com/YunoHost-Apps/bookstack_ynh.git
synced 2024-09-03 18:16:02 +02:00
parent
5ea726260f
commit
a4d380986f
4 changed files with 25 additions and 2 deletions
|
@ -15,7 +15,7 @@ APP_DEBUG=false
|
||||||
APP_KEY=SomeRandomString
|
APP_KEY=SomeRandomString
|
||||||
|
|
||||||
# Application URL
|
# Application URL
|
||||||
APP_URL=https://__DOMAIN____PATH__
|
APP_URL=__APP_URL_DOMAIN__
|
||||||
|
|
||||||
# Application default language
|
# Application default language
|
||||||
APP_LANG=__LANGUAGE__
|
APP_LANG=__LANGUAGE__
|
||||||
|
|
|
@ -33,6 +33,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
phpversion=$YNH_PHP_VERSION
|
phpversion=$YNH_PHP_VERSION
|
||||||
|
app_url_domain=$(ynh_app_setting_get --app=$app --key=app_url_domain)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
|
@ -104,7 +105,7 @@ fi
|
||||||
ynh_script_progression --message="Reconfiguring congif file.." --weight=1
|
ynh_script_progression --message="Reconfiguring congif file.." --weight=1
|
||||||
|
|
||||||
pushd $final_path
|
pushd $final_path
|
||||||
yes | php$phpversion artisan bookstack:update-url https://${domain}${path_url} https://${new_domain}${new_path}
|
yes | php$phpversion artisan bookstack:update-url $app_url_domain https://${new_domain}${new_path%/}
|
||||||
popd
|
popd
|
||||||
|
|
||||||
sed -i "/APP_URL=/c\APP_URL=https://${new_domain}${new_path}" $final_path/.env
|
sed -i "/APP_URL=/c\APP_URL=https://${new_domain}${new_path}" $final_path/.env
|
||||||
|
|
|
@ -119,6 +119,9 @@ ynh_install_composer --phpversion=$phpversion --workdir=$final_path --install_ar
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||||
|
|
||||||
|
app_url_domain="https://$domain${path_url%/}"
|
||||||
|
ynh_app_setting_set --app=$app --key=app_url_domain --value=$app_url_domain
|
||||||
|
|
||||||
ynh_add_config --template=../conf/.env.example --destination=$final_path/.env
|
ynh_add_config --template=../conf/.env.example --destination=$final_path/.env
|
||||||
chmod 600 $final_path/.env
|
chmod 600 $final_path/.env
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
phpversion=$YNH_PHP_VERSION
|
phpversion=$YNH_PHP_VERSION
|
||||||
redis_db=$(ynh_app_setting_get --app=$app --key=redis_db)
|
redis_db=$(ynh_app_setting_get --app=$app --key=redis_db)
|
||||||
mail_pwd=$(ynh_string_random --length=12)
|
mail_pwd=$(ynh_string_random --length=12)
|
||||||
|
app_url_domain=$(ynh_app_setting_get --app=$app --key=app_url_domain)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -47,6 +48,24 @@ ynh_clean_setup () {
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
|
# If app_url_domain doesn't exist, create it
|
||||||
|
if [ -z "$app_url_domain" ]; then
|
||||||
|
app_url_domain="https://$domain${path_url%/}"
|
||||||
|
ynh_app_setting_set --app=$app --key=app_url_domain --value=$app_url_domain
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Cleaning legacy permissions
|
||||||
|
if ynh_legacy_permissions_exists; then
|
||||||
|
ynh_legacy_permissions_delete_all
|
||||||
|
|
||||||
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue