From 161f54fc22ae82cbdfe0e4230ca8b5584be384f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 1 Mar 2022 10:03:38 +0100 Subject: [PATCH] Fix url (#48) * Update change_url --- scripts/change_url | 5 ++--- scripts/upgrade | 11 +++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index c91cca3..6e51285 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -99,14 +99,13 @@ fi #================================================= ynh_script_progression --message="Reconfiguring congif file.." --weight=1 -new_app_url_domain="https://${new_domain}${new_path%/}" old_app_url_domain="https://${old_domain}${old_path%/}" pushd $final_path - yes | php$phpversion artisan bookstack:update-url $old_app_url_domain $new_app_url_domain + yes | php$phpversion artisan bookstack:update-url $old_app_url_domain https://${new_domain}${new_path} popd -sed -i "/APP_URL=/c\APP_URL=$new_app_url_domain" $final_path/.env +sed -i "/APP_URL=/c\APP_URL=https://${new_domain}${new_path}" $final_path/.env #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index 6db94bf..1d27d63 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,7 @@ phpversion=$YNH_PHP_VERSION timezone="$(cat /etc/timezone)" redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) mail_pwd=$(ynh_string_random --length=12) +timezone="$(cat /etc/timezone)" fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) @@ -125,6 +126,16 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint +#================================================= +# MODIFY A CONFIG FILE +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +app_url_domain="https://$domain${path_url%/}" + +ynh_add_config --template=../conf/.env.example --destination=$final_path/.env +chmod 600 $final_path/.env + #================================================= # INSTALL LYCHEE WITH COMPOSER #=================================================