diff --git a/README.md b/README.md index 4fb3aff..8bcb631 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview Matterbridge is a bridge between a series of chat protocols and offers a REST-API. Supported protocols are among others IRC, XMPP, Gitter, Mattermost, Slack, Discord, Telegram, Rocket.Chat, Hipchat(via xmpp), Matrix, Steam, ssh-chat and Zulip. -**Shipped version:** 1.21.0 +**Shipped version:** 1.22.0 ## Configuration diff --git a/README_fr.md b/README_fr.md index bdacef3..46c2c7f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install ## Vue d'ensemble Matterbridge est un pont entre une série de protocoles de discussion et propose une REST-API. Les protocoles pris en charge sont entre autres IRC, XMPP, Gitter, Mattermost, Slack, Discord, Telegram, Rocket.Chat, Hipchat (via xmpp), Matrix, Steam, ssh-chat et Zulip. -**Version incluse :** 1.21.0 +**Version incluse :** 1.22.0 ## Configuration diff --git a/conf/arm.src b/conf/arm.src index 9b250c9..9881dad 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/42wim/matterbridge/releases/download/v1.21.0/matterbridge-1.21.0-linux-armv6 -SOURCE_SUM=0082baafa52f22e54378927d95442b98c4494a70998dd59d34eabea39aea9b04 +SOURCE_URL=https://github.com/42wim/matterbridge/releases/download/v1.22.0/matterbridge-1.22.0-linux-armv6 +SOURCE_SUM=3c0d42c2dbd487b0918282db28276cb20253ca4dc653eaec2fda9612bb2d9e2f SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=matterbridge diff --git a/conf/arm64.src b/conf/arm64.src index ba41e27..ef42f9f 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/42wim/matterbridge/releases/download/v1.21.0/matterbridge-1.21.0-linux-arm64 -SOURCE_SUM=214485475aa8e4d7c767e871459f3712026741ba09809ff041fee5b4ed731608 +SOURCE_URL=https://github.com/42wim/matterbridge/releases/download/v1.22.0/matterbridge-1.22.0-linux-arm64 +SOURCE_SUM=6f441fe5fd716423385db6a61a8e1b27edca11554d5449e839755356e17231bf SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=matterbridge diff --git a/conf/x86-64.src b/conf/x86-64.src index 1c227ee..570db2f 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/42wim/matterbridge/releases/download/v1.21.0/matterbridge-1.21.0-linux-64bit -SOURCE_SUM=0a321cbc90ba467d05c1bd5ec7a1c3b10fb2ba142710311b015f5e8235d39fe6 +SOURCE_URL=https://github.com/42wim/matterbridge/releases/download/v1.22.0/matterbridge-1.22.0-linux-64bit +SOURCE_SUM=3093ed10309dd1ab474b76c5680e773e227aff1dc5ce1c78d29361284a301799 SOURCE_SUM_PRG=sha256sum SOURCE_IN_SUBDIR=false SOURCE_FILENAME=matterbridge diff --git a/manifest.json b/manifest.json index 5325c71..eb85bc2 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Multi-protocols bridge for online communications", "fr": "Connecteur entre une série de protocoles de discussion" }, - "version": "1.21.0~ynh1", + "version": "1.22.0~ynh1", "url": "https://github.com/42wim/matterbridge", "license": "Apache-2.0", "maintainer": { @@ -14,7 +14,7 @@ "email": "liberodark@gmail.com" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.1.7" }, "multi_instance": false, "services": [], diff --git a/scripts/install b/scripts/install index 0fcd99f..ef94df5 100644 --- a/scripts/install +++ b/scripts/install @@ -32,6 +32,14 @@ ynh_script_progression --message="Validating installation parameters..." --weigh final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=5 + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -41,14 +49,6 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=5 - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # MODIFY A CONFIG FILE #================================================= diff --git a/scripts/restore b/scripts/restore index 6eeec54..a4429f9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -24,20 +24,20 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) -#================================================= -# RESTORE THE APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=1 - -ynh_restore_file --origin_path="$final_path" - #================================================= # RECREATE THE DEDICATED USER #================================================= ynh_script_progression --message="Recreating the dedicated system user..." --weight=4 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="$final_path" + +#================================================= +# RESTORE THE APP MAIN DIR +#================================================= +ynh_script_progression --message="Restoring the app main directory..." --weight=1 + +ynh_restore_file --origin_path="$final_path" #================================================= # RESTORE USER RIGHTS diff --git a/scripts/upgrade b/scripts/upgrade index ea67284..0472cf6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -48,6 +48,14 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=4 + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -56,18 +64,25 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=2 + # Create a temporary directory + tmpdir="$(mktemp -d)" + + # Backup the config file in the temp dir + cp -a "$final_path/matterbridge.toml" "$tmpdir/matterbridge.toml" + + # Remove the app directory securely + ynh_secure_remove --file="$final_path" + # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" + + # Copy the admin saved settings from tmp directory to final path + cp -a "$tmpdir/matterbridge.toml" "$final_path/matterbridge.toml" + + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" fi -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=4 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app - #================================================= # SETUP SYSTEMD #=================================================