1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/n8n_ynh.git synced 2024-09-03 19:55:52 +02:00
This commit is contained in:
ericgaspar 2021-09-18 23:14:02 +02:00
parent dd293b33d2
commit 7ec32f4596
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 20 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -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