1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/plateau_ynh.git synced 2024-09-03 20:06:38 +02:00

Merge pull request #4 from Ddataa/testing

repair upgrade multi-instance change-url
This commit is contained in:
DDATAA 2022-12-15 16:26:07 +00:00 committed by GitHub
commit ab970eef71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 16 deletions

View file

@ -22,7 +22,7 @@
upgrade=1
#upgrade=1 from_commit=CommitHash
backup_restore=1
multi_instance=1
multi_instance=0
port_already_use=0
change_url=1
;;; Options

View file

@ -6,7 +6,7 @@
"en": "Helps designers organize and document participatory workshops.",
"fr": "Aide les designers a organiser et documenter des ateliers participatifs."
},
"version": "1.0~ynh1",
"version": "2.0.0b~ynh1",
"url": "https://plateau.latelier-des-chercheurs.fr/",
"upstream": {
"license": "AGPL-3.0-or-later",

View file

@ -28,6 +28,7 @@ ynh_script_progression --message="Loading installation settings..."
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$port --key=port)
#=================================================
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP

View file

@ -43,6 +43,13 @@ test ! -d $final_path \
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
@ -90,13 +97,14 @@ chown -R $app:www-data "$datadir"
#=================================================
# SPECIFIC RESTORATION
#=================================================
#=================================================
# RESTORE THE NGINX CONFIGURATION
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_script_progression --message="Reinstalling dependencies..." --weight=7
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
# Define and install dependencies
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
ynh_use_nodejs
#=================================================
# RESTORE VARIOUS FILES
@ -104,6 +112,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_script_progression --message="Restoring various files..."
ynh_add_config --template="../conf/settings_base.json" --destination="$final_path/settings_base.json"
chmod 600 "$final_path/settings_base.json"
#=================================================
# RESTORE SYSTEMD

View file

@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$port --key=port)
#=================================================
# CHECK VERSION
@ -88,16 +89,6 @@ if ynh_legacy_permissions_exists; then
ynh_app_setting_delete --app=$app --key=is_public
fi
if ! ynh_permission_exists --permission="admin"; then
# Create the required permissions
ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin
fi
# Create a permission if needed
if ! ynh_permission_exists --permission="api"; then
ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true"
fi
#=================================================
# CREATE DEDICATED USER
#=================================================