mirror of
https://github.com/YunoHost-Apps/bookstack_ynh.git
synced 2024-09-03 18:16:02 +02:00
Merge branch 'fix-url-2' into Admin
This commit is contained in:
commit
39831e976f
5 changed files with 22 additions and 6 deletions
|
@ -17,7 +17,7 @@
|
|||
upgrade=1 from_commit=aaa9c9534b01a210989aceb4ad4d2b9c585be6df
|
||||
backup_restore=1
|
||||
multi_instance=0
|
||||
change_url=0
|
||||
change_url=1
|
||||
;;; Options
|
||||
Email=
|
||||
Notification=none
|
||||
|
|
|
@ -15,7 +15,7 @@ APP_DEBUG=false
|
|||
APP_KEY=SomeRandomString
|
||||
|
||||
# Application URL
|
||||
APP_URL=https://__DOMAIN____PATH__
|
||||
APP_URL=__APP_URL_DOMAIN__
|
||||
|
||||
# Application default language
|
||||
APP_LANG=__LANGUAGE__
|
||||
|
@ -24,7 +24,7 @@ APP_LANG=__LANGUAGE__
|
|||
APP_AUTO_LANG_PUBLIC=true
|
||||
|
||||
# Application timezone
|
||||
APP_TIMEZONE=UTC
|
||||
APP_TIMEZONE=__TIMEZONE__
|
||||
|
||||
# Database details
|
||||
DB_HOST=localhost
|
||||
|
|
|
@ -32,7 +32,8 @@ language=$(ynh_app_setting_get --app=$app --key=language)
|
|||
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)
|
||||
redis_db=$(ynh_app_setting_get --app=$app --key=redis_db)
|
||||
phpversion=$YNH_PHP_VERSION
|
||||
app_url_domain=$(ynh_app_setting_get --app=$app --key=app_url_domain)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
|
@ -101,12 +102,16 @@ fi
|
|||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
sed -i 's/^APP_URL= .*$/APP_URL=https://${new_domain}${new_path}/' $final_path/.env
|
||||
ynh_script_progression --message="Reconfiguring congif file.." --weight=1
|
||||
|
||||
new_app_url_domain="https://${new_domain}${new_path%/}"
|
||||
|
||||
pushd $final_path
|
||||
php$phpversion artisan bookstack:update-url https://${old_domain}${old_path_url} https://${new_domain}${new_path}
|
||||
yes | php$phpversion artisan bookstack:update-url $app_url_domain $new_app_url_domain
|
||||
popd
|
||||
|
||||
sed -i "/APP_URL=/c\APP_URL=$new_app_url_domain" $final_path/.env
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
|
|
|
@ -28,6 +28,7 @@ phpversion=$YNH_PHP_VERSION
|
|||
password=$YNH_APP_ARG_PASSWORD
|
||||
admin=$YNH_APP_ARG_ADMIN
|
||||
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||
timezone="$(cat /etc/timezone)"
|
||||
redis_db=$(ynh_redis_get_free_db)
|
||||
mail_pwd=$(ynh_string_random --length=12)
|
||||
|
||||
|
@ -116,6 +117,10 @@ ynh_install_composer --phpversion=$phpversion --workdir=$final_path --install_ar
|
|||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
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
|
||||
chmod 600 $final_path/.env
|
||||
|
|
|
@ -26,6 +26,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
|||
phpversion=$YNH_PHP_VERSION
|
||||
redis_db=$(ynh_app_setting_get --app=$app --key=redis_db)
|
||||
mail_pwd=$(ynh_string_random --length=12)
|
||||
app_url_domain=$(ynh_app_setting_get --app=$app --key=app_url_domain)
|
||||
|
||||
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
|
||||
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
|
||||
|
@ -65,6 +66,11 @@ fi
|
|||
if [ -z "$fpm_usage" ]; then
|
||||
fpm_usage=low
|
||||
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
||||
|
||||
# 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
|
||||
|
|
Loading…
Add table
Reference in a new issue