From 8547062da6d6d1fc4989c712f5134ffe7249bb42 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 22 Feb 2022 23:04:26 +0100 Subject: [PATCH] Fix change url --- scripts/change_url | 4 ++++ scripts/install | 12 ++++++------ scripts/upgrade | 7 ++++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 1fa2763..612f31b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,6 +28,10 @@ ynh_script_progression --message="Loading installation settings..." --time --wei # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) +port=$(ynh_app_setting_get --app=$app --key=port) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) +api_secret=$(ynh_app_setting_get --app=$app --key=api_secret) +invite_secret=$(ynh_app_setting_get --app=$app --key=invite_secret) # Add settings here as needed by your application #db_name=$(ynh_app_setting_get --app=$app --key=db_name) diff --git a/scripts/install b/scripts/install index 3d48706..54a83c1 100755 --- a/scripts/install +++ b/scripts/install @@ -104,12 +104,6 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Installing NodeJS dependencies..." --time --weight=1 -invite_secret=$(ynh_string_random --length=32) -api_secret=$(ynh_string_random --length=32) - -ynh_app_setting_set --app=$app --key=invite_secret --value=$invite_secret -ynh_app_setting_set --app=$app --key=api_secret --value=$api_secret - pushd $final_path ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error install ynh_exec_as $app $ynh_node_load_PATH $ynh_npm --loglevel=error audit fix @@ -134,6 +128,12 @@ chown -R $app:www-data "$datadir" #================================================= ynh_script_progression --message="Adding a configuration file..." --time --weight=1 +invite_secret=$(ynh_string_random --length=32) +api_secret=$(ynh_string_random --length=32) + +ynh_app_setting_set --app=$app --key=invite_secret --value=$invite_secret +ynh_app_setting_set --app=$app --key=api_secret --value=$api_secret + ynh_add_config --template="default.json" --destination="$final_path/config/default.json" chmod 400 "$final_path/config/default.json" diff --git a/scripts/upgrade b/scripts/upgrade index 7e1562a..2e97584 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,10 +18,11 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -language=$(ynh_app_setting_get --app=$app --key=language) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) +port=$(ynh_app_setting_get --app=$app --key=port) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) +api_secret=$(ynh_app_setting_get --app=$app --key=api_secret) +invite_secret=$(ynh_app_setting_get --app=$app --key=invite_secret) #================================================= # CHECK VERSION