diff --git a/check_process b/check_process index a82cc48..20bad8e 100644 --- a/check_process +++ b/check_process @@ -16,7 +16,7 @@ #upgrade=1 from_commit=CommitHash backup_restore=1 multi_instance=1 - change_url=0 + change_url=1 ;;; Options Email= Notification=none diff --git a/conf/systemd.service b/conf/systemd.service index c5e7ee4..247766d 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Commento daemon service +Description=Commento: commenting platform After=network.target postgresql.service [Service] diff --git a/scripts/change_url b/scripts/change_url index ff37e4c..8368d51 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -17,7 +17,7 @@ old_domain=$YNH_APP_OLD_DOMAIN old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +new_path="/" app=$YNH_APP_INSTANCE_NAME @@ -28,6 +28,10 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name +db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP @@ -100,6 +104,17 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +domain="$new_domain" +ynh_add_config --template="../conf/.env" --destination="$final_path/commento.env" + +chmod 400 "$final_path/commento.env" +chown $app:$app "$final_path/commento.env" + #================================================= # GENERIC FINALISATION #=================================================