diff --git a/scripts/change_url b/scripts/change_url index 17b25b5..4af83d4 100755 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,6 +29,11 @@ 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) port=$(ynh_app_setting_get --app=$app --key=port) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) +password=$(ynh_app_setting_get --app=$app --key=password) +timezone="$(cat /etc/timezone)" #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP @@ -101,6 +106,18 @@ 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 +path=$new_path +ynh_add_config --template="../conf/.env" --destination="$final_path/.env" + +chmod 400 "$final_path/.env" +chown $app:$app "$final_path/.env" + #================================================= # RELOAD NGINX #================================================= @@ -114,7 +131,7 @@ ynh_systemd_action --service_name=nginx --action=reload ynh_script_progression --message="Starting a systemd service..." --weight=6 # Start a systemd service -ynh_systemd_action --service_name=$app --action=restart --log_path=systemd +ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Editor is now accessible via:" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 403e001..0d559f0 100755 --- a/scripts/install +++ b/scripts/install @@ -51,6 +51,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=2 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin +ynh_app_setting_set --app=$app --key=password --value=$password #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/upgrade b/scripts/upgrade index c260f62..3f8ff5a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,7 +71,7 @@ then # Download, check integrity, uncompress and patch the source from app.src pushd $final_path ynh_use_nodejs - ynh_exec_warn_less env $ynh_node_load_PATH npm update n8n + ynh_exec_warn_less env $ynh_node_load_PATH npm install n8n@${n8n_version} popd fi