From 3de8bbb0b2b6cfd3995d5eb8c0498380ceb758f3 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 31 Oct 2023 14:21:49 +0000 Subject: [PATCH 1/7] Auto-update README --- README.md | 3 ++- README_fr.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 04e65eb..e5235c6 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ It shall NOT be edited by hand. # Matterbridge for YunoHost [![Integration level](https://dash.yunohost.org/integration/matterbridge.svg)](https://dash.yunohost.org/appci/app/matterbridge) ![Working status](https://ci-apps.yunohost.org/ci/badges/matterbridge.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/matterbridge.maintain.svg) + [![Install Matterbridge with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=matterbridge) *[Lire ce readme en français.](./README_fr.md)* @@ -28,7 +29,7 @@ How to configure this app: a plain file with SSH `/opt/yunohost/matterbridge/mat * Official admin documentation: * Upstream app code repository: -* YunoHost documentation for this app: +* YunoHost Store: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index 54086f2..414b674 100644 --- a/README_fr.md +++ b/README_fr.md @@ -6,6 +6,7 @@ It shall NOT be edited by hand. # Matterbridge pour YunoHost [![Niveau d’intégration](https://dash.yunohost.org/integration/matterbridge.svg)](https://dash.yunohost.org/appci/app/matterbridge) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/matterbridge.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/matterbridge.maintain.svg) + [![Installer Matterbridge avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=matterbridge) *[Read this readme in english.](./README.md)* @@ -28,7 +29,7 @@ Comment configurer cette application : un fichier brut en SSH `/opt/yunohost/mat * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : -* Documentation YunoHost pour cette app : +* YunoHost Store: * Signaler un bug : ## Informations pour les développeurs From c6f1d849377d3d2c59d749feab9b90a0c0f00bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 14 Feb 2024 09:50:10 +0100 Subject: [PATCH 2/7] Packaging v2 --- .github/workflows/updater.sh | 140 -------------------------- .github/workflows/updater.yml | 50 --------- check_process | 21 ---- conf/amd64.src | 6 -- conf/arm64.src | 6 -- conf/armhf.src | 6 -- conf/systemd.service | 4 +- doc/{DISCLAIMER.md => ADMIN.md} | 0 doc/{DISCLAIMER_fr.md => ADMIN_fr.md} | 0 doc/DESCRIPTION.md | 3 + doc/DESCRIPTION_fr.md | 3 + manifest.json | 30 ------ manifest.toml | 52 ++++++++++ scripts/backup | 18 +--- scripts/install | 56 ++--------- scripts/remove | 43 +------- scripts/restore | 49 ++------- scripts/upgrade | 70 ++----------- tests.toml | 11 ++ 19 files changed, 104 insertions(+), 464 deletions(-) delete mode 100755 .github/workflows/updater.sh delete mode 100644 .github/workflows/updater.yml delete mode 100644 check_process delete mode 100644 conf/amd64.src delete mode 100644 conf/arm64.src delete mode 100644 conf/armhf.src rename doc/{DISCLAIMER.md => ADMIN.md} (100%) rename doc/{DISCLAIMER_fr.md => ADMIN_fr.md} (100%) create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DESCRIPTION_fr.md delete mode 100644 manifest.json create mode 100644 manifest.toml create mode 100644 tests.toml diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh deleted file mode 100755 index 4613221..0000000 --- a/.github/workflows/updater.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/bash - -#================================================= -# PACKAGE UPDATING HELPER -#================================================= - -# This script is meant to be run by GitHub Actions -# The YunoHost-Apps organisation offers a template Action to run this script periodically -# Since each app is different, maintainers can adapt its contents so as to perform -# automatic actions when a new upstream release is detected. - -# Remove this exit command when you are ready to run this Action -#exit 1 - -#================================================= -# FETCHING LATEST RELEASE AND ITS ASSETS -#================================================= - -# Fetching information -current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') -repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') -# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) -version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) -assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'")) - -# Later down the script, we assume the version has only digits and dots -# Sometimes the release name starts with a "v", so let's filter it out. -# You may need more tweaks here if the upstream repository has different naming conventions. -if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then - version=${version:1} -fi - -# Setting up the environment variables -echo "Current version: $current_version" -echo "Latest release from upstream: $version" -echo "VERSION=$version" >> $GITHUB_ENV -echo "REPO=$repo" >> $GITHUB_ENV -# For the time being, let's assume the script will fail -echo "PROCEED=false" >> $GITHUB_ENV - -# Proceed only if the retrieved version is greater than the current one -if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then - echo "::warning ::No new version available" - exit 0 -# Proceed only if a PR for this new version does not already exist -elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then - echo "::warning ::A branch already exists for this update" - exit 0 -fi - -# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) -echo "${#assets[@]} available asset(s)" - -#================================================= -# UPDATE SOURCE FILES -#================================================= - -# Here we use the $assets variable to get the resources published in the upstream release. -# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like. - -# Let's loop over the array of assets URLs -for asset_url in ${assets[@]}; do - -echo "Handling asset at $asset_url" - -# Assign the asset to a source file in conf/ directory -# Here we base the source file name upon a unique keyword in the assets url (admin vs. update) -# Leave $src empty to ignore the asset -case $asset_url in - "matterbridge-"*"-linux-64bit") - src="amd64" - ;; - "matterbridge-"*"-linux-arm64") - src="arm64" - ;; - "matterbridge-"*"-linux-armv7") - src="armhf" - ;; - *) - src="" - ;; -esac - -# If $src is not empty, let's process the asset -if [ ! -z "$src" ]; then - -# Create the temporary directory -tempdir="$(mktemp -d)" - -# Download sources and calculate checksum -filename=${asset_url##*/} -curl --silent -4 -L $asset_url -o "$tempdir/$filename" -checksum=$(sha256sum "$tempdir/$filename" | head -c 64) - -# Delete temporary directory -rm -rf $tempdir - -# Get extension -if [[ $filename == *.tar.gz ]]; then - extension=tar.gz -else - extension=${filename##*.} -fi - -# Rewrite source file -cat < conf/$src.src -SOURCE_URL=$asset_url -SOURCE_SUM=$checksum -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=$extension -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -EOT -echo "... conf/$src.src updated" - -else -echo "... asset ignored" -fi - -done - -#================================================= -# SPECIFIC UPDATE STEPS -#================================================= - -# Any action on the app's source code can be done. -# The GitHub Action workflow takes care of committing all changes after this script ends. - -#================================================= -# GENERIC FINALIZATION -#================================================= - -# Replace new version in manifest -echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json - -# No need to update the README, yunohost-bot takes care of it - -# The Action will proceed only if the PROCEED environment variable is set to true -echo "PROCEED=true" >> $GITHUB_ENV -exit 0 diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml deleted file mode 100644 index 4363d38..0000000 --- a/.github/workflows/updater.yml +++ /dev/null @@ -1,50 +0,0 @@ -# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. -# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. -# This file should be enough by itself, but feel free to tune it to your needs. -# It calls updater.sh, which is where you should put the app-specific update steps. -name: Check for new upstream releases -on: - # Allow to manually trigger the workflow - workflow_dispatch: - # Run it every day at 6:00 UTC - schedule: - - cron: '0 6 * * *' -jobs: - updater: - runs-on: ubuntu-latest - steps: - - name: Fetch the source code - uses: actions/checkout@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Run the updater script - id: run_updater - run: | - # Setting up Git user - git config --global user.name 'yunohost-bot' - git config --global user.email 'yunohost-bot@users.noreply.github.com' - # Run the updater script - /bin/bash .github/workflows/updater.sh - - name: Commit changes - id: commit - if: ${{ env.PROCEED == 'true' }} - run: | - git commit -am "Upgrade to v$VERSION" - - name: Create Pull Request - id: cpr - if: ${{ env.PROCEED == 'true' }} - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Update to version ${{ env.VERSION }} - committer: 'yunohost-bot ' - author: 'yunohost-bot ' - signoff: false - base: testing - branch: ci-auto-update-v${{ env.VERSION }} - delete-branch: true - title: 'Upgrade to version ${{ env.VERSION }}' - body: | - Upgrade to v${{ env.VERSION }} - [See upstream release page](https://github.com/${{ env.REPO }}/releases/tag/v${{ env.VERSION }}) - draft: false diff --git a/check_process b/check_process deleted file mode 100644 index 51abe64..0000000 --- a/check_process +++ /dev/null @@ -1,21 +0,0 @@ -;; Test complet - ; Manifest - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=0 - setup_nourl=1 - setup_private=0 - setup_public=0 - upgrade=1 - upgrade=1 from_commit=58cf8e614d7b4396816b4073f58af75c5c4b075f - backup_restore=1 - multi_instance=0 -;;; Options -Email= -Notification=none -;;; Upgrade options - ; commit=58cf8e614d7b4396816b4073f58af75c5c4b075f - name=Merge pull request #5 from YunoHost-Apps/testing - manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& - diff --git a/conf/amd64.src b/conf/amd64.src deleted file mode 100644 index bb12fda..0000000 --- a/conf/amd64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/42wim/matterbridge/releases/download/v1.26.0/matterbridge-1.26.0-linux-64bit -SOURCE_SUM=7f5a74b9b7cbf395b8873f3f3f418d90c61197e3cc677882e70b7faeef4c35b0 -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=matterbridge -SOURCE_EXTRACT=false diff --git a/conf/arm64.src b/conf/arm64.src deleted file mode 100644 index fe4e463..0000000 --- a/conf/arm64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/42wim/matterbridge/releases/download/v1.26.0/matterbridge-1.26.0-linux-arm64 -SOURCE_SUM=3d922187ce3e792f9cf896e209c828d3466e3b2453f3a133f7f610f9d6937587 -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=matterbridge -SOURCE_EXTRACT=false diff --git a/conf/armhf.src b/conf/armhf.src deleted file mode 100644 index 9f23a61..0000000 --- a/conf/armhf.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/42wim/matterbridge/releases/download/v1.26.0/matterbridge-1.26.0-linux-armv6 -SOURCE_SUM=fee25dc50c96508147c88c0da05c6143681f8c88bdbef1c42a91bf9388aa13f9 -SOURCE_SUM_PRG=sha256sum -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME=matterbridge -SOURCE_EXTRACT=false diff --git a/conf/systemd.service b/conf/systemd.service index 1c964f4..0b31af7 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,9 +6,9 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__FINALPATH__/ +WorkingDirectory=__INSTALL_DIR__/ UMask=000 -ExecStart=__FINALPATH__/matterbridge -conf __FINALPATH__/matterbridge.toml +ExecStart=__INSTALL_DIR__/matterbridge -conf __INSTALL_DIR__/matterbridge.toml RestartSec=30 Restart=always diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 100% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md diff --git a/doc/DISCLAIMER_fr.md b/doc/ADMIN_fr.md similarity index 100% rename from doc/DISCLAIMER_fr.md rename to doc/ADMIN_fr.md diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..2b16a46 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1,3 @@ +A simple chat bridge between a growing number of protocols: + +Discord, Gitter, IRC, Keybase, Matrix, Mattermost, MSTeams, Rocket.Chat, Slack, Telegram, Twitch, WhatsApp, XMPP, Zulip, And more... diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..b471de2 --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1,3 @@ +Un connecteur de messagerie simple entre un nombre croissant de protocoles : + +Discord, Gitter, IRC, Keybase, Matrix, Mattermost, MSTeams, Rocket.Chat, Slack, Telegram, Twitch, WhatsApp, XMPP, Zulip, Et plus... diff --git a/manifest.json b/manifest.json deleted file mode 100644 index d3999c9..0000000 --- a/manifest.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "Matterbridge", - "id": "matterbridge", - "packaging_format": 1, - "description": { - "en": "Multi-protocols bridge for online communications", - "fr": "Connecteur entre une série de protocoles de discussion" - }, - "version": "1.26.0~ynh1", - "url": "https://github.com/42wim/matterbridge", - "upstream": { - "license": "Apache-2.0", - "admindoc": "https://github.com/42wim/matterbridge/wiki", - "code": "https://github.com/42wim/matterbridge" - }, - "license": "Apache-2.0", - "maintainer": { - "name": "liberodark", - "email": "liberodark@gmail.com" - }, - "requirements": { - "yunohost": ">= 11.0.9" - }, - "multi_instance": false, - "services": [], - "arguments": { - "install" : [ - ] - } -} diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..d964c24 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,52 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + +packaging_format = 2 + +id = "matterbridge" +name = "Matterbridge" +description.en = "Multi-protocols bridge for online communications" +description.fr = "Connecteur entre une série de protocoles de discussion" + +version = "1.26.0~ynh1" + +maintainers = ["liberodark"] + +[upstream] +license = "Apache-2.0" +admindoc = "https://github.com/42wim/matterbridge/wiki" +code = "https://github.com/42wim/matterbridge" +website = "https://github.com/42wim/matterbridge" + +[integration] +yunohost = ">= 11.0.9" +architectures = ["amd64", "arm64", "armhf"] +multi_instance = false +ldap = "not_relevant" +sso = "not_relevant" +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +[install] + +[resources] + [resources.sources.main] + in_subdir = false + amd64.url = "https://github.com/42wim/matterbridge/releases/download/v1.26.0/matterbridge-1.26.0-linux-64bit" + amd64.sha256 = "7f5a74b9b7cbf395b8873f3f3f418d90c61197e3cc677882e70b7faeef4c35b0" + arm64.url = "https://github.com/42wim/matterbridge/releases/download/v1.26.0/matterbridge-1.26.0-linux-arm64" + arm64.sha256 = "3d922187ce3e792f9cf896e209c828d3466e3b2453f3a133f7f610f9d6937587" + armhf.url = "https://github.com/42wim/matterbridge/releases/download/v1.26.0/matterbridge-1.26.0-linux-armv6" + armhf.sha256 = "fee25dc50c96508147c88c0da05c6143681f8c88bdbef1c42a91bf9388aa13f9" + + extract = false + rename = "matterbridge" + + autoupdate.strategy = "latest_github_release" + autoupdate.asset.amd64 = "matterbridge-.*-linux-64bit" + autoupdate.asset.arm64 = "matterbridge-.*-linux-arm64" + autoupdate.asset.armhf = "matterbridge-.*-linux-armv6" + + [resources.system_user] + + [resources.install_dir] diff --git a/scripts/backup b/scripts/backup index 2850990..ac5b947 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,22 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_print_info --message="Loading installation settings..." - -app=$YNH_APP_INSTANCE_NAME - -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= @@ -35,7 +19,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP SYSTEMD diff --git a/scripts/install b/scripts/install index 148293c..7175a2a 100644 --- a/scripts/install +++ b/scripts/install @@ -9,78 +9,40 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -# Retrieve arguments -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 - -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 #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -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=$YNH_ARCH +ynh_setup_source --dest_dir="$install_dir" +chmod +x "$install_dir/matterbridge" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" -chmod +x $final_path/matterbridge +chmod -R o-rwX "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # MODIFY A CONFIG FILE #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/matterbridge.toml" --destination="$final_path/matterbridge.toml" +ynh_add_config --template="matterbridge.toml" --destination="$install_dir/matterbridge.toml" #================================================= -# SETUP SYSTEMD +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Multi-protocols bridge for online communications" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Multi-protocols bridge for online communications" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -# Reload services -ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app" --action=start --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index ad14bd1..329ce86 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,53 +10,18 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -app=$YNH_APP_INSTANCE_NAME - -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEM CONFIGURATIONS #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null -then - ynh_script_progression --message="Removing $app service integration..." --weight=1 - yunohost service remove $app +if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then + yunohost service remove "$app" fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=2 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE APP MAIN DIR -#================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 - -# Remove the app directory securely -ynh_secure_remove --file="$final_path" - -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=2 - -# Delete a system user -ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index a4429f9..da7cba1 100644 --- a/scripts/restore +++ b/scripts/restore @@ -9,65 +9,32 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -app=$YNH_APP_INSTANCE_NAME - -final_path=$(ynh_app_setting_get --app=$app --key=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 --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 -#================================================= +ynh_restore_file --origin_path="$install_dir" # Restore permissions on app files -chmod +x $final_path/$app -chown -R $app: $final_path +chmod -R o-rwX "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service --quiet - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Multi-protocols bridge for online communications" --log="/var/log/$app/$app.log" +systemctl enable "$app.service" --quiet +yunohost service add "$app" --description="Multi-protocols bridge for online communications" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app" --action=start --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index b563367..a1bccfe 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,21 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -app=$YNH_APP_INSTANCE_NAME - -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -31,68 +16,35 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= 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" - -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# 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" +ynh_systemd_action --service_name="$app" --action=stop --log_path="/var/log/$app/$app.log" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=2 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=2 +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="matterbridge.toml" +chmod +x "$install_dir/matterbridge" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH --keep="matterbridge.toml" -fi - -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" -chmod +x $final_path/matterbridge +chmod -R o-rwX "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= -# SETUP SYSTEMD +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Multi-protocols bridge for online communications" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Multi-protocols bridge for online communications" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app" --action=start --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..9857a1e --- /dev/null +++ b/tests.toml @@ -0,0 +1,11 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json + +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ + + test_upgrade_from.58cf8e614d7b4396816b4073f58af75c5c4b075f.name = "Merge pull request #5 from YunoHost-Apps/testing" From 2dbac7c95dc55b0dbd1ae06030c7521a39d3479f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 14 Feb 2024 08:50:22 +0000 Subject: [PATCH 3/7] Auto-update README --- README.md | 12 +++++------- README_fr.md | 12 +++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e5235c6..5ef7685 100644 --- a/README.md +++ b/README.md @@ -16,17 +16,15 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Multi-protocols bridge for online communications +A simple chat bridge between a growing number of protocols: + +Discord, Gitter, IRC, Keybase, Matrix, Mattermost, MSTeams, Rocket.Chat, Slack, Telegram, Twitch, WhatsApp, XMPP, Zulip, And more... + **Shipped version:** 1.26.0~ynh1 -## Disclaimers / important information - -## Configuration - -How to configure this app: a plain file with SSH `/opt/yunohost/matterbridge/matterbridge.toml`. You can follow this [doc](https://github.com/42wim/matterbridge/wiki/How-to-create-your-config) on how to create your config. - ## Documentation and resources +* Official app website: * Official admin documentation: * Upstream app code repository: * YunoHost Store: diff --git a/README_fr.md b/README_fr.md index 414b674..273d986 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,17 +16,15 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -Connecteur entre une série de protocoles de discussion +Un connecteur de messagerie simple entre un nombre croissant de protocoles : + +Discord, Gitter, IRC, Keybase, Matrix, Mattermost, MSTeams, Rocket.Chat, Slack, Telegram, Twitch, WhatsApp, XMPP, Zulip, Et plus... + **Version incluse :** 1.26.0~ynh1 -## Avertissements / informations importantes - -## Configuration - -Comment configurer cette application : un fichier brut en SSH `/opt/yunohost/matterbridge/matterbridge.toml`. Vous pouvez suivre cette [documentation](https://github.com/42wim/matterbridge/wiki/How-to-create-your-config) sur la façon de créer votre config. - ## Documentations et ressources +* Site officiel de l’app : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : * YunoHost Store: From 07ea8dda2b8a0d205a84e2591baa797965a4ee9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 14 Feb 2024 10:12:10 +0100 Subject: [PATCH 4/7] Remove fixmes from manifest --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index d964c24..2bfbb36 100644 --- a/manifest.toml +++ b/manifest.toml @@ -23,9 +23,9 @@ architectures = ["amd64", "arm64", "armhf"] multi_instance = false ldap = "not_relevant" sso = "not_relevant" -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +disk = "60M" +ram.build = "50M" +ram.runtime = "50M" [install] From 94645d91536acec422d8d75ab830db5200d8fcdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 14 Feb 2024 10:35:06 +0100 Subject: [PATCH 5/7] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 2bfbb36..538981c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -9,7 +9,7 @@ description.fr = "Connecteur entre une série de protocoles de discussion" version = "1.26.0~ynh1" -maintainers = ["liberodark"] +maintainers = [] [upstream] license = "Apache-2.0" From e5e4cb88d11f8483e6506649414f9447ce1bfec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 14 Feb 2024 10:47:46 +0100 Subject: [PATCH 6/7] Remove website from manifest as it's a link to the repository --- manifest.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 538981c..f0dcc71 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,7 +15,6 @@ maintainers = [] license = "Apache-2.0" admindoc = "https://github.com/42wim/matterbridge/wiki" code = "https://github.com/42wim/matterbridge" -website = "https://github.com/42wim/matterbridge" [integration] yunohost = ">= 11.0.9" From 50b77b64b50ef1b89adf38866707e749a386195c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 14 Feb 2024 09:47:53 +0000 Subject: [PATCH 7/7] Auto-update README --- README.md | 1 - README_fr.md | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index 5ef7685..429d220 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ Discord, Gitter, IRC, Keybase, Matrix, Mattermost, MSTeams, Rocket.Chat, Slack, **Shipped version:** 1.26.0~ynh1 ## Documentation and resources -* Official app website: * Official admin documentation: * Upstream app code repository: * YunoHost Store: diff --git a/README_fr.md b/README_fr.md index 273d986..ee9cddd 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,7 +24,6 @@ Discord, Gitter, IRC, Keybase, Matrix, Mattermost, MSTeams, Rocket.Chat, Slack, **Version incluse :** 1.26.0~ynh1 ## Documentations et ressources -* Site officiel de l’app : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : * YunoHost Store: