diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 91bc692..8a84226 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -26,10 +26,12 @@ if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then version=${version:1} fi -# x86-64 and enterprise assets are hosted on Mattermost's servers. +# x86-64 team, x86-64 enterprise, ARM64 team and ARM64 enterprise assets are hosted on Mattermost's servers. assets=() assets+=("https://releases.mattermost.com/$version/mattermost-team-$version-linux-amd64.tar.gz") assets+=("https://releases.mattermost.com/$version/mattermost-enterprise-$version-linux-amd64.tar.gz") +assets+=("https://releases.mattermost.com/$version/mattermost-team-$version-linux-arm64.tar.gz") +assets+=("https://releases.mattermost.com/$version/mattermost-enterprise-$version-linux-arm64.tar.gz") # ARM and ARM64 are published in another repository (with a leading "v" for version tags) other_repo="SmartHoneybee/ubiquitous-memory" @@ -79,16 +81,19 @@ echo "Handling asset at $asset_url" # Leave $src empty to ignore the asset case $asset_url in *"mattermost-"*"-linux-arm.tar.gz") - src="armhf" + src="team_armhf" ;; - *"mattermost-"*"-linux-arm64.tar.gz") - src="arm64" - ;; - *"mattermost-team-"*"-linux-amd64.tar.gz") - src="amd64" + *"mattermost-team-"*"-linux-arm64.tar.gz") + src="team_arm64" ;; *"mattermost-enterprise-"*"-linux-amd64.tar.gz") - src="enterprise" + src="enterprise_amd64" + ;; + *"mattermost-team-"*"-linux-amd64.tar.gz") + src="team_amd64" + ;; + *"mattermost-enterprise-"*"-linux-amd64.tar.gz") + src="enterprise_amd64" ;; *) src="" diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml index fd6ed60..609c284 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Fetch the source code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Run the updater script @@ -33,7 +33,7 @@ jobs: - name: Create Pull Request id: cpr if: ${{ env.PROCEED == 'true' }} - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: Update to version ${{ env.VERSION }} diff --git a/README.md b/README.md index 62bf308..08dc734 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Mattermost for YunoHost -[![Integration level](https://dash.yunohost.org/integration/mattermost.svg)](https://dash.yunohost.org/appci/app/mattermost) ![Working status](https://ci-apps.yunohost.org/ci/badges/mattermost.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/mattermost.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/mattermost.svg)](https://dash.yunohost.org/appci/app/mattermost) ![Working status](https://ci-apps.yunohost.org/ci/badges/mattermost.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/mattermost.maintain.svg) + [![Install Mattermost with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mattermost) *[Lire ce readme en français.](./README_fr.md)* @@ -24,7 +25,6 @@ To explore the benefits of Mattermost’s enterprise features, you can replace t ## Features include: - One-to-one and group messaging, file sharing, and unlimited search history -- Native apps for iOS, Android, Windows, Mac, Linux - Threaded messaging, emoji, and custom emoji - Tools for custom branding - Continuous archiving @@ -34,11 +34,9 @@ To explore the benefits of Mattermost’s enterprise features, you can replace t - Easily scalable to dozens of users per team - Runtime profiling data and system monitoring reports - New features and improvements released regularly -- Multiple languages including U.S. English, Australian English, Bulgarian, Chinese (Simplified and Traditional), Dutch, French, German, Hungarian, Italian, Japanese, Korean, Polish, Brazilian Portuguese, Romanian, Russian, Turkish, Spanish, Swedish, and Ukrainian -**Shipped version:** 7.2.0~ynh1 - +**Shipped version:** 7.5.2~ynh1 ## Screenshots @@ -49,7 +47,7 @@ To explore the benefits of Mattermost’s enterprise features, you can replace t ## Configuration * How to configure this app: From an admin panel, a plain file with SSH. -* How to change from edition version to another (Team<->Enterprise) : Modify the `settings.yml` in the apps directory `/etc/yunohost/apps/mattermost_instance/settings.yml` and replace the version to wich you whant : Team or Enterprise. Update your apps and verify the *About* on your mattermost +* How to change from edition version to another (Team<->Enterprise): Modify the `settings.yml` in the apps directory `/etc/yunohost/apps/mattermost_instance/settings.yml` and replace the version to wich you whant: Team or Enterprise. Update your apps and verify the *About* on your Mattermost ## YunoHost specific features @@ -63,7 +61,7 @@ Mattermost Mobile and Desktop Apps are available [here](https://mattermost.com/d ## Additional information -* This package can by installed on `ARM`, `ARM64` and `x86-64` architecture (only `x86-64` if you choose to install the *Entreprise Edition*). +* This package can by installed on `ARM`, `ARM64` and `x86-64` architecture (only `x86-64` and `ARM64` if you choose to install the *Entreprise Edition*). ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 9cc74b3..341ed50 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,15 +5,16 @@ It shall NOT be edited by hand. # Mattermost pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/mattermost.svg)](https://dash.yunohost.org/appci/app/mattermost) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/mattermost.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/mattermost.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/mattermost.svg)](https://dash.yunohost.org/appci/app/mattermost) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/mattermost.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/mattermost.maintain.svg) + [![Installer Mattermost avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mattermost) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Mattermost rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Mattermost rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble ## Mattermost Team Edition Une alternative gratuite, open source et auto-hébergée à la messagerie SaaS propriétaire. Team Edition est votre « bureau virtuel » open source, offrant tous les principaux avantages de productivité des solutions SaaS concurrentes. @@ -24,7 +25,6 @@ Pour explorer les avantages des fonctionnalités d'entreprise de Mattermost, vou ## Les fonctionnalités incluent: - Messagerie individuelle et de groupe, partage de fichiers et historique de recherche illimité -- Applications natives pour iOS, Android, Windows, Mac, Linux - Messagerie, emoji et emoji personnalisés - Outils pour une image de marque personnalisée - Archivage continu @@ -34,15 +34,13 @@ Pour explorer les avantages des fonctionnalités d'entreprise de Mattermost, vou - Facilement évolutif à des dizaines d'utilisateurs par équipe - Données de profilage d'exécution et rapports de surveillance du système - Nouvelles fonctionnalités et améliorations publiées régulièrement -- Plusieurs langues dont l'anglais américain, l'anglais australien, le bulgare, le chinois (simplifié et traditionnel), le néerlandais, le français, l'allemand, le hongrois, l'italien, le japonais, le coréen, le polonais, le portugais brésilien, le roumain, le russe, le turc, l'espagnol, le suédois et l'ukrainien -**Version incluse :** 7.2.0~ynh1 +**Version incluse :** 7.5.2~ynh1 +## Captures d’écran -## Captures d'écran - -![Capture d'écran de Mattermost](./doc/screenshots/screenshot.png) +![Capture d’écran de Mattermost](./doc/screenshots/screenshot.png) ## Avertissements / informations importantes @@ -61,14 +59,14 @@ Ce paquet peut installer la version [*Entreprise Edition*](https://docs.mattermo ## Informations additionnelles -Ce paquet peut être installé sur les architectures `ARM`, `ARM64` et `x86-64` (mais uniquement `x86-64` si vous choisissez d'installer la version *Enterprise Edition*). +Ce paquet peut être installé sur les architectures `ARM`, `ARM64` et `x86-64` (mais uniquement `x86-64` et `ARM64` si vous choisissez d'installer la version *Enterprise Edition*). ## Documentations et ressources -* Site officiel de l'app : +* Site officiel de l’app : * Documentation officielle utilisateur : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -84,4 +82,4 @@ ou sudo yunohost app upgrade mattermost -u https://github.com/YunoHost-Apps/mattermost_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file diff --git a/bump-mattermost.rb b/bump-mattermost.rb index 34f8f13..b5d5f05 100755 --- a/bump-mattermost.rb +++ b/bump-mattermost.rb @@ -36,9 +36,9 @@ module Mattermost def retrieve_release_data case @variant - when :amd64, :enterprise + when :team_amd64, :team_arm64, :enterprise_amd64, :enterprise_arm64 retrieve_first_party_release_data - when :armhf, :arm64 + when :team_armhf retrieve_smart_honeybee_release_data else raise "Unsupported variant '{#release_desc.variant}'" @@ -47,21 +47,29 @@ module Mattermost def retrieve_first_party_release_data edition = { - amd64: 'team', - enterprise: 'enterprise' + team_amd64: 'team', + team_arm64: 'team', + enterprise_amd64: 'enterprise', + enterprise_arm64: 'enterprise' }.fetch(variant) - @url = "https://releases.mattermost.com/#{version}/mattermost-#{edition}-#{version}-linux-amd64.tar.gz" + arch = { + team_amd64: 'amd64', + team_arm64: 'arm64', + enterprise_amd64: 'amd64', + enterprise_arm64: 'arm64' + }.fetch(variant) - puts "Downloading release #{version}-#{variant} for computing checksum…" + @url = "https://releases.mattermost.com/#{version}/mattermost-#{edition}-#{version}-linux-#{arch}.tar.gz" + + puts "Downloading release #{version}-#{edition}-#{arch} for computing checksum…" release_file = URI.parse(@url).read @sum = Digest::SHA256.hexdigest(release_file) end def retrieve_smart_honeybee_release_data arch = { - armhf: 'arm', - arm64: 'arm64' + team_armhf: 'arm', }.fetch(variant) @url = "https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v#{version}/mattermost-v#{version}-linux-#{arch}.tar.gz" @@ -127,7 +135,7 @@ if version.nil? abort("ERROR: The Mattermost release version must be provided.\nExample: ./bump-mattermost.sh 5.33.1") end -VARIANTS = %i[amd64 enterprise armhf arm64] +VARIANTS = %i[team_amd64 enterprise_amd64 enterprise_arm64 team_arm64 team_armhf] # Compute releases URLs and sums releases = VARIANTS diff --git a/check_process b/check_process index de67898..d98d3a0 100644 --- a/check_process +++ b/check_process @@ -19,7 +19,10 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=4fa3ee4ad82a6154f2eb858a3da285a35afecef8 + # 7.2.0 + upgrade=1 from_commit=738ba505f581ddd72889c889dcb34406250fea35 + # 7.3.0 + upgrade=1 from_commit=1677cb9fa9d95ab788a6acd5b310b09c7d2ab7df backup_restore=1 multi_instance=1 port_already_use=0 @@ -43,11 +46,16 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=4fa3ee4ad82a6154f2eb858a3da285a35afecef8 + # 7.2.0 + upgrade=1 from_commit=738ba505f581ddd72889c889dcb34406250fea35 + # 7.3.0 + upgrade=1 from_commit=1677cb9fa9d95ab788a6acd5b310b09c7d2ab7df ;;; Options Email=kemenaran@gmail.com Notification=none ;;; Upgrade options - ; commit=4fa3ee4ad82a6154f2eb858a3da285a35afecef8 - name= Merge pull request #268 from YunoHost-Apps/testing + ; commit=738ba505f581ddd72889c889dcb34406250fea35 + name=7.2.0 + ; commit=1677cb9fa9d95ab788a6acd5b310b09c7d2ab7df + name=7.3.0 \ No newline at end of file diff --git a/conf/amd64.src b/conf/amd64.src deleted file mode 100644 index 13f8284..0000000 --- a/conf/amd64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://releases.mattermost.com/7.2.0/mattermost-team-7.2.0-linux-amd64.tar.gz -SOURCE_SUM=185eecbcee8bdfc10f9c99f04a294912269701da86a6217eb48cc761207fca80 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=mattermost.tar.gz diff --git a/conf/arm64.src b/conf/arm64.src deleted file mode 100644 index 01c41cf..0000000 --- a/conf/arm64.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v7.2.0/mattermost-v7.2.0-linux-arm64.tar.gz -SOURCE_SUM=d5ff399f4e025a77c8d009ed0c64d029ecba3a3d5ab8271fca6d5aabf25d97d8 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=mattermost.tar.gz diff --git a/conf/config.json b/conf/config.json index d36406e..98b910e 100644 --- a/conf/config.json +++ b/conf/config.json @@ -79,6 +79,7 @@ "ExperimentalEnableDefaultChannelLeaveJoinMessages": true, "ExperimentalGroupUnreadChannels": "disabled", "EnableAPITeamDeletion": false, + "EnableAPITriggerAdminNotifications": false, "EnableAPIUserDeletion": false, "ExperimentalEnableHardenedMode": false, "ExperimentalStrictCSRFEnforcement": false, @@ -88,6 +89,7 @@ "EnableSVGs": false, "EnableLatex": false, "EnableInlineLatex": true, + "PostPriority": false, "EnableAPIChannelDeletion": false, "EnableLocalMode": true, "LocalModeSocketLocation": "/var/run/__APP__/mattermost_local.socket", @@ -112,6 +114,7 @@ "CustomBrandText": "", "CustomDescriptionText": "", "RestrictDirectMessage": "any", + "EnableLastActiveTime": true, "UserStatusAwayTimeout": 300, "MaxChannelsPerTeam": 2000, "MaxNotificationsPerChannel": 1000, @@ -130,8 +133,8 @@ "IosMinVersion": "" }, "SqlSettings": { - "DriverName": "mysql", - "DataSource": "__DB_USER__:__DB_PWD__@tcp(localhost:3306)/__DB_NAME__?charset=utf8mb4,utf8", + "DriverName": "postgres", + "DataSource": "postgres://__DB_USER__:__DB_PWD__@127.0.0.1:5432/__DB_NAME__?sslmode=disable&connect_timeout=10", "DataSourceReplicas": [], "DataSourceSearchReplicas": [], "MaxIdleConns": 20, @@ -210,7 +213,8 @@ "AmazonS3SSL": true, "AmazonS3SignV2": false, "AmazonS3SSE": false, - "AmazonS3Trace": false + "AmazonS3Trace": false, + "AmazonS3RequestTimeoutMilliseconds": 30000 }, "EmailSettings": { "EnableSignUpWithEmail": true, @@ -455,7 +459,6 @@ "LinkMetadataTimeoutMilliseconds": 5000, "RestrictSystemAdmin": false, "UseNewSAMLLibrary": false, - "CloudBilling": false, "EnableSharedChannels": false, "EnableRemoteClusterService": false, "EnableAppBar": false @@ -524,6 +527,9 @@ "CleanupJobsThresholdDays": -1, "CleanupConfigThresholdDays": -1 }, + "ProductSettings": { + "EnablePublicSharedBoards": false + }, "PluginSettings": { "Enable": true, "EnableUploads": false, @@ -601,10 +607,9 @@ "GraphQL": false, "InsightsEnabled": true, "CommandPalette": false, - "PostForwarding": true, - "AdvancedTextEditor": true, "BoardsProduct": false, - "PlanUpgradeButtonText": "Upgrade" + "SendWelcomePost": true, + "PostPriority": false }, "ImportSettings": { "Directory": "./import", diff --git a/conf/enterprise.src b/conf/enterprise.src deleted file mode 100644 index 2d2f7ed..0000000 --- a/conf/enterprise.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://releases.mattermost.com/7.2.0/mattermost-enterprise-7.2.0-linux-amd64.tar.gz -SOURCE_SUM=1404ed3bac456bf6cac32c3284a105660ae57b440f29923c0506eb0372253d18 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=mattermost.tar.gz diff --git a/conf/enterprise_amd64.src b/conf/enterprise_amd64.src new file mode 100644 index 0000000..e96d292 --- /dev/null +++ b/conf/enterprise_amd64.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://releases.mattermost.com/7.5.2/mattermost-enterprise-7.5.2-linux-amd64.tar.gz +SOURCE_SUM=66fce67ba3a0fcb2ec4f85f2143010b1c3603be8c2c30cc30f2b583a8e2a3345 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=mattermost.tar.gz diff --git a/conf/enterprise_arm64.src b/conf/enterprise_arm64.src new file mode 100644 index 0000000..9937231 --- /dev/null +++ b/conf/enterprise_arm64.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://releases.mattermost.com/7.5.2/mattermost-enterprise-7.5.2-linux-arm64.tar.gz +SOURCE_SUM=2aa9aaf3d599a38682dbb9a2c76b277c85976dd0d331f2d563b51dd58ac141aa +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=mattermost.tar.gz diff --git a/conf/systemd.service b/conf/systemd.service index 53b1f6a..1215b5d 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,19 +1,18 @@ [Unit] Description=Mattermost After=network.target -After=mysql.service -Requires=mysql.service +Requires=postgresql.service [Service] Type=notify +User=__APP__ +Group=__APP__ ExecStart=__FINALPATH__/bin/mattermost TimeoutStartSec=3600 Restart=always RestartSec=10 WorkingDirectory=__FINALPATH__ RuntimeDirectory=__APP__ -User=__APP__ -Group=__APP__ LimitNOFILE=49152 # Sandboxing options to harden security diff --git a/conf/team_amd64.src b/conf/team_amd64.src new file mode 100644 index 0000000..581650b --- /dev/null +++ b/conf/team_amd64.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://releases.mattermost.com/7.5.2/mattermost-team-7.5.2-linux-amd64.tar.gz +SOURCE_SUM=b2162bc12b0b8763809f0795f429bc59018c712b14461db63158b453710fa885 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=mattermost.tar.gz diff --git a/conf/team_arm64.src b/conf/team_arm64.src new file mode 100644 index 0000000..dd10985 --- /dev/null +++ b/conf/team_arm64.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://releases.mattermost.com/7.5.2/mattermost-team-7.5.2-linux-arm64.tar.gz +SOURCE_SUM=39281870a69eccd7876f3c25c69ffae2b87a6920519b74a8eed25c553e06e80c +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=mattermost.tar.gz \ No newline at end of file diff --git a/conf/armhf.src b/conf/team_armhf.src similarity index 55% rename from conf/armhf.src rename to conf/team_armhf.src index 1655c18..1caa889 100644 --- a/conf/armhf.src +++ b/conf/team_armhf.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v7.2.0/mattermost-v7.2.0-linux-arm.tar.gz -SOURCE_SUM=f5a1697242c6064276107085dabc80db442365244bc9ddc8f19010b4522591dd +SOURCE_URL=https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v7.5.2/mattermost-v7.5.2-linux-arm.tar.gz +SOURCE_SUM=b26a4b676ee92ac848fa2993aa67559238ba7d8c1d0e6f7ffdd79ad8fb4942f3 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 38c93a3..db6e3ae 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -7,7 +7,6 @@ To explore the benefits of Mattermost’s enterprise features, you can replace t ## Features include: - One-to-one and group messaging, file sharing, and unlimited search history -- Native apps for iOS, Android, Windows, Mac, Linux - Threaded messaging, emoji, and custom emoji - Tools for custom branding - Continuous archiving @@ -17,4 +16,3 @@ To explore the benefits of Mattermost’s enterprise features, you can replace t - Easily scalable to dozens of users per team - Runtime profiling data and system monitoring reports - New features and improvements released regularly -- Multiple languages including U.S. English, Australian English, Bulgarian, Chinese (Simplified and Traditional), Dutch, French, German, Hungarian, Italian, Japanese, Korean, Polish, Brazilian Portuguese, Romanian, Russian, Turkish, Spanish, Swedish, and Ukrainian diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index c876146..3dd7b3d 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -7,7 +7,6 @@ Pour explorer les avantages des fonctionnalités d'entreprise de Mattermost, vou ## Les fonctionnalités incluent: - Messagerie individuelle et de groupe, partage de fichiers et historique de recherche illimité -- Applications natives pour iOS, Android, Windows, Mac, Linux - Messagerie, emoji et emoji personnalisés - Outils pour une image de marque personnalisée - Archivage continu @@ -17,4 +16,3 @@ Pour explorer les avantages des fonctionnalités d'entreprise de Mattermost, vou - Facilement évolutif à des dizaines d'utilisateurs par équipe - Données de profilage d'exécution et rapports de surveillance du système - Nouvelles fonctionnalités et améliorations publiées régulièrement -- Plusieurs langues dont l'anglais américain, l'anglais australien, le bulgare, le chinois (simplifié et traditionnel), le néerlandais, le français, l'allemand, le hongrois, l'italien, le japonais, le coréen, le polonais, le portugais brésilien, le roumain, le russe, le turc, l'espagnol, le suédois et l'ukrainien diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 61d3931..e0fa03b 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,7 +1,7 @@ ## Configuration * How to configure this app: From an admin panel, a plain file with SSH. -* How to change from edition version to another (Team<->Enterprise) : Modify the `settings.yml` in the apps directory `/etc/yunohost/apps/mattermost_instance/settings.yml` and replace the version to wich you whant : Team or Enterprise. Update your apps and verify the *About* on your mattermost +* How to change from edition version to another (Team<->Enterprise): Modify the `settings.yml` in the apps directory `/etc/yunohost/apps/mattermost_instance/settings.yml` and replace the version to wich you whant: Team or Enterprise. Update your apps and verify the *About* on your Mattermost ## YunoHost specific features @@ -15,4 +15,4 @@ Mattermost Mobile and Desktop Apps are available [here](https://mattermost.com/d ## Additional information -* This package can by installed on `ARM`, `ARM64` and `x86-64` architecture (only `x86-64` if you choose to install the *Entreprise Edition*). +* This package can by installed on `ARM`, `ARM64` and `x86-64` architecture (only `x86-64` and `ARM64` if you choose to install the *Entreprise Edition*). diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index 385d4bb..cd3857e 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -13,4 +13,4 @@ Ce paquet peut installer la version [*Entreprise Edition*](https://docs.mattermo ## Informations additionnelles -Ce paquet peut être installé sur les architectures `ARM`, `ARM64` et `x86-64` (mais uniquement `x86-64` si vous choisissez d'installer la version *Enterprise Edition*). +Ce paquet peut être installé sur les architectures `ARM`, `ARM64` et `x86-64` (mais uniquement `x86-64` et `ARM64` si vous choisissez d'installer la version *Enterprise Edition*). diff --git a/manifest.json b/manifest.json index 69b305c..7c79493 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Open source collaboration platform built for developers", "fr": "Plateforme de collaboration open source conçue pour les développeurs" }, - "version": "7.2.0~ynh1", + "version": "7.5.2~ynh1", "url": "http://www.mattermost.org/", "upstream": { "license": "GPL-3.0-only", @@ -27,7 +27,7 @@ "mysql" ], "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.1.6" }, "arguments": { "install": [ @@ -39,7 +39,7 @@ "name": "path", "type": "path", "example": "/mattermost", - "default": "/chat" + "default": "/mattermost" }, { "name": "is_public", @@ -104,4 +104,4 @@ } ] } -} \ No newline at end of file +} diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..1412e11 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,10 +4,98 @@ # COMMON VARIABLES #================================================= +# dependencies used by the app +pkg_dependencies="postgresql postgresql-contrib pgloader" + #================================================= # PERSONAL HELPERS #================================================= +mariadb-to-pg() { + + ynh_print_info --message="Migrating to PostgreSQL database..." + + mysqlpwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) + + # In old instance db_user is `mmuser` + mysql_db_user="$db_user" + if ynh_mysql_connect_as --user="mmuser" --password="$mysqlpwd" 2> /dev/null <<< ";"; then + mysql_db_user="mmuser" + fi + + # Initialize PostgreSQL database + ynh_psql_test_if_first_run + ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$mysqlpwd + psqlpwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) + + # Configure the new database and run Mattermost in order to create tables + ynh_write_var_in_file --file="$final_path/config/config.json" --key="DriverName" --value="postgres" --after="SqlSettings" + ynh_write_var_in_file --file="$final_path/config/config.json" --key="DataSource" --value="postgres://$db_user:$psqlpwd@localhost:5432/$db_name?sslmode=disable&connect_timeout=10" --after="SqlSettings" + cat "$final_path/config/config.json" + pushd $final_path + ynh_systemd_action --service_name="$app" --action="stop" + set +e + sudo -u mattermost timeout --preserve-status 180 "./bin/mattermost" + if [ "$?" != "0" ] && [ "$?" != "143" ] ; then + ynh_die --message="Failed to run Mattermost to create PostgreSQL database tables" --ret_code=1 + fi + set -e + popd + + # Some fixes to let the MariaDB -> PostgreSQL conversion working + ynh_psql_execute_as_root --sql='DROP INDEX public.idx_fileinfo_content_txt;' --database=$db_name + ynh_psql_execute_as_root --sql='DROP INDEX public.idx_posts_message_txt;' --database=$db_name + ynh_mysql_execute_as_root --sql="ALTER TABLE mattermost.Users DROP COLUMN IF EXISTS acceptedtermsofserviceid;" --database=$db_name + ynh_mysql_execute_as_root --sql="ALTER TABLE mattermost.SharedChannelRemotes DROP COLUMN IF EXISTS description;" --database=$db_name + ynh_mysql_execute_as_root --sql="ALTER TABLE mattermost.SharedChannelRemotes DROP COLUMN IF EXISTS nextsyncat;" --database=$db_name + + # Focalboard is broken in Mattermost 7.3.0 + if ynh_compare_current_package_version --comparison eq --version 7.3.0~ynh1 + then + # Remove Focalboard tables + # Command from https://stackoverflow.com/a/1589324 + cmd=$(ynh_mysql_execute_as_root --sql="SELECT CONCAT( 'DROP TABLE ', GROUP_CONCAT(table_name) , ';' ) AS statement FROM information_schema.tables WHERE table_schema = '$db_name' AND table_name LIKE 'focalboard_%';" --database=$db_name | tail -n 1) + ynh_mysql_execute_as_root --sql="$cmd" --database=$db_name + fi + + # Use pgloader to migrate database content from MariaDB to PostgreSQL + tmpdir="$(mktemp -d)" + + cat < $tmpdir/commands.load +LOAD DATABASE + FROM mysql://$mysql_db_user:$mysqlpwd@127.0.0.1:3306/$db_name + INTO postgresql://$db_user:$psqlpwd@127.0.0.1:5432/$db_name + +WITH include no drop, truncate, create no tables, + create no indexes, preserve index names, no foreign keys, + data only, workers = 16, concurrency = 1 + +SET MySQL PARAMETERS +net_read_timeout = '90', +net_write_timeout = '180' + +ALTER SCHEMA '$db_name' RENAME TO 'public' + +; +EOT + pgloader $tmpdir/commands.load + + # Rebuild INDEX + ynh_psql_execute_as_root --sql='CREATE INDEX idx_fileinfo_content_txt ON public.fileinfo USING gin (to_tsvector('\''english'\''::regconfig, content))' --database=$db_name + ynh_psql_execute_as_root --sql='CREATE INDEX idx_posts_message_txt ON public.posts USING gin (to_tsvector('\''english'\''::regconfig, (message)::text));' --database=$db_name + + + if ynh_compare_current_package_version --comparison eq --version 7.3.0~ynh1 + then + # There is a problem with version 7.3.0 and the database migration. + # More information here: https://forum.mattermost.com/t/migrating-from-mariadb-to-postgresql-db/14194/6 + ynh_psql_execute_as_root --sql="DELETE FROM db_migrations WHERE version=92;" --database=$db_name + fi + # Remove the MariaDB database + ynh_mysql_remove_db --db_user=$mysql_db_user --db_name=$db_name + +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index fd92d5e..7aa0fef 100755 --- a/scripts/backup +++ b/scripts/backup @@ -66,9 +66,9 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= # BACKUP THE DATABASE #================================================= -ynh_print_info --message="Backing up the MySQL database..." +ynh_print_info --message="Backing up the database..." -ynh_mysql_dump_db --database="$db_name" > db.sql +ynh_psql_dump_db --database="$db_name" > db.sql #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index c59cbb0..2416b9c 100644 --- a/scripts/install +++ b/scripts/install @@ -68,6 +68,13 @@ ynh_script_progression --message="Finding an available port..." --weight=3 port=$(ynh_find_port --port=8065) ynh_app_setting_set --app=$app --key=port --value=$port +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=10 + +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies + #================================================= # CREATE DEDICATED USER #================================================= @@ -77,14 +84,15 @@ ynh_script_progression --message="Configuring system user..." --weight=3 ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= -# CREATE A MYSQL DATABASE +# CREATE A DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." --weight=10 +ynh_script_progression --message="Creating a database..." --weight=10 db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name +ynh_psql_test_if_first_run +ynh_psql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -96,10 +104,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path if [ "$version" = "Enterprise" ]; then # Get Enterprise binary path - ynh_setup_source --dest_dir="$final_path" --source_id="enterprise" + ynh_setup_source --dest_dir="$final_path" --source_id="enterprise_$YNH_ARCH" elif [ "$version" = "Team" ]; then # Get Team binary path - ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" + ynh_setup_source --dest_dir="$final_path" --source_id="team_$YNH_ARCH" fi chmod 750 "$final_path" @@ -141,6 +149,7 @@ ynh_script_progression --message="Modifying a config file..." --weight=3 smtp_user_pwd=$(ynh_string_random --length=24) url=https://$domain$path_url +db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) ynh_add_config --template="../conf/config.json" --destination="$final_path/config/config.json" diff --git a/scripts/remove b/scripts/remove index 4aaf73b..aa3f444 100755 --- a/scripts/remove +++ b/scripts/remove @@ -44,12 +44,28 @@ ynh_script_progression --message="Stopping and removing the systemd service..." ynh_remove_systemd_config #================================================= -# REMOVE THE MySQL DATABASE +# REMOVE LOGROTATE CONFIGURATION #================================================= -ynh_script_progression --message="Removing the MySQL database..." --weight=2 +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 + +# Remove the app-specific logrotate config +ynh_remove_logrotate + +#================================================= +# REMOVE THE DATABASE +#================================================= +ynh_script_progression --message="Removing the database..." --weight=2 # Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +ynh_psql_remove_db --db_user=$db_user --db_name=$db_name + +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=3 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR @@ -79,16 +95,11 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- ynh_remove_nginx_config #================================================= -# REMOVE LOGROTATE CONFIGURATION +# SPECIFIC REMOVE #================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - -# Remove the app-specific logrotate config -ynh_remove_logrotate - -#================================================= -# REMOVE LOG FILE +# REMOVE VARIOUS FILES #================================================= +ynh_script_progression --message="Removing various files..." --weight=1 ynh_secure_remove --file="/var/log/$app" diff --git a/scripts/restore b/scripts/restore index a5d42d6..87ea3d5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -47,6 +47,7 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -83,13 +84,22 @@ chmod -R o-rwx "$data_path" chown -R $app:www-data "$data_path" #================================================= -# RESTORE THE MYSQL DATABASE +# REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=6 +ynh_script_progression --message="Reinstalling dependencies..." --weight=10 -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +# Define and install dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies + +#================================================= +# RESTORE THE DATABASE +#================================================= +ynh_script_progression --message="Restoring the database..." --weight=6 + +db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) +ynh_psql_test_if_first_run +ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= # RESTORE USER RIGHTS diff --git a/scripts/upgrade b/scripts/upgrade index 1b5bdd2..aeb0f14 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,9 +31,14 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) port=$(ynh_app_setting_get --app=$app --key=port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) version=$(ynh_app_setting_get --app=$app --key=version) data_path=$(ynh_app_setting_get --app=$app --key=data_path) +team_display_name=$(ynh_app_setting_get --app=$app --key=team_display_name) +admin=$(ynh_app_setting_get --app=$app --key=admin) +password=$(ynh_app_setting_get --app=$app --key=password) +email=$(ynh_user_get_info --username=$admin --key=mail) +db_name=$(ynh_sanitize_dbid --db_name=$app) +db_user=$db_name #================================================= # CHECK VERSION @@ -51,6 +56,10 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + # Remove the PostgreSQL db in case of error during the migration. + if [ -n "$remove_psql_in_case_of_error" ]; then + ynh_psql_remove_db --db_user=$db_user --db_name=$db_name + fi # Restore it if the upgrade fails ynh_restore_upgradebackup } @@ -97,6 +106,26 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=10 + +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies + +#================================================= +# MIGRATING DATABASE +#================================================= + +# Check if using MariaDB +# This migration should be done before the upgrade +if mysqlshow | grep -q "^| $db_name "; then + # Mattermost only support MySQL and PostgreSQL (not MariaDB...) + # Migrate the database from MariaDB to PostgreSQL + remove_psql_in_case_of_error=1 + mariadb-to-pg +fi + #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -133,9 +162,9 @@ then ynh_secure_remove --file="$final_path" if [ "$version" = "Enterprise" ]; then - ynh_setup_source --dest_dir="$final_path" --source_id="enterprise" + ynh_setup_source --dest_dir="$final_path" --source_id="enterprise_$YNH_ARCH" elif [ "$version" = "Team" ]; then - ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" + ynh_setup_source --dest_dir="$final_path" --source_id="team_$YNH_ARCH" fi # Copy the admin saved settings and plugins from tmp directory to final path @@ -166,6 +195,31 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=2 # Create a dedicated systemd config ynh_add_systemd_config +#================================================= +# Fix old migrations +#================================================= +# Crazy fix for old unupgraded version +# IMPORTANT: THIS fix should be done after setup new sources and running mattermost +if ynh_compare_current_package_version --comparison lt --version 5.37.1~ynh1 +then + read -r -d '' fix_old_version_sql << EOM +ALTER TABLE ChannelMembers ALTER COLUMN mentioncountroot SET DEFAULT '0'::bigint; +UPDATE ChannelMembers SET mentioncountroot=0 WHERE mentioncountroot IS NULL; +ALTER TABLE ChannelMembers ALTER COLUMN msgcountroot SET DEFAULT '0'::bigint; +UPDATE ChannelMembers SET msgcountroot=0 WHERE msgcountroot IS NULL; +ALTER TABLE Channels ALTER COLUMN totalmsgcountroot SET DEFAULT '0'::bigint; +UPDATE Channels SET totalmsgcountroot=0 WHERE totalmsgcountroot IS NULL; +UPDATE SidebarCategories SET collapsed=False where collapsed IS NULL; +UPDATE SidebarCategories SET muted=False where muted IS NULL; +UPDATE SidebarCategories set sorting = 'manual' where sorting=''; +UPDATE SidebarCategories set sorting = 'manual' where sorting IS NULL; +EOM + ynh_psql_execute_as_root --sql="$fix_old_version_sql" --database=$db_name + + # Note: it's possible that some instances need other fixes + # If nothing is displayed in the sidebar it may be needed to change the Id of SidebarCategories... +fi + #================================================= # SETUP LOGROTATE #================================================= @@ -186,12 +240,6 @@ yunohost service add $app --description="Collaboration platform built for develo #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -# A lengthy database migration runs when upgrading from a version < 6.0. -if dpkg --compare-versions "$previous_upstream_version" lt "6.0.0" -then - ynh_print_warn --message="Lengthy database migrations will now run. This may take a while..." -fi - # Start a systemd service ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Started Mattermost"