1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mattermost_ynh.git synced 2024-09-03 19:36:29 +02:00

Merge testing into master (migration to PostgreSQL, change arm64 source, Matermost v7.5.2) (#411)

* Upgrade to v7.3.0

* Auto-update README

* Update config.json

* Upgrade auto-updater (#407)

* [autopatch] Upgrade auto-updater

* Auto-update README

---------

Co-authored-by: tituspijean <titus@pijean.ovh>

* Transition to PostgreSQL (#377)

* backup script for PostgreSQL (#376)

Inspired from https://github.com/YunoHost-Apps/moodle_ynh/blob/master/scripts/backup

* Adapt to PostgreSQL (#375)

Question: in https://docs.mattermost.com/install/install-debian.html#install-postgresql-database-server, I see `BindsTo=postgresql.service` while in the original file here I find `Requires=mysql.service`. I don't know which one makes sense, so I keep the orinigal Yunohost version (Requires)

* config.json for PostgreSQL (#374)

Inspired from the original MySQL config.json and from Mattermost documentation https://docs.mattermost.com/install/install-debian.html#install-postgresql-database-server

* Install with PostgreSQL (#373)

I took inspiration from https://github.com/YunoHost-Apps/commento_ynh/blob/master/scripts/install

* install postgresql

* Reordering

* reset config file

* Update _common.sh

* Update config.json

* Fix

* Migration (#382)

* add migration

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Fix

* Fix

* Fix

* Update install

* Update upgrade

* Fix

* Update install

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update upgrade

* Update install

* Fix

* Fix

* Fix

* Update upgrade

* Cleaning up

* Update upgrade

* Update _common.sh

* Update check_process

* Update _common.sh

* Fix

* Update mysql-to-pg.conf

* Update upgrade

* Update systemd.service

* Cleaning

* Update _common.sh

* Fix

* Update upgrade

* Update _common.sh

* Update upgrade

* Update backup

* Fix

* Fix

* Update upgrade

* Update upgrade

* Update systemd.service

* Update _common.sh

* Revert "Update _common.sh"

This reverts commit d880150af9.

* Cleaning

* Fix

* Update check_process

* Fix

* Update _common.sh

* Fix

* Update _common.sh

* Fix

* Update manifest.json

* Update install

* Update _common.sh

* Update upgrade

* Fix

* Update _common.sh

* Update _common.sh

* Update _common.sh

* Update _common.sh

* Update _common.sh

* Update _common.sh

* Update _common.sh

* Update _common.sh

* Auto-update README

* Update _common.sh

* Upgrade to v7.4.0

* Auto-update README

* Upgrade to v7.5.2

* Auto-update README

* Update config.json

* [fix] mariadb to postgres migration

* Auto-update README

* [fix] Update manifest requirements

* Update manifest.json

* Update config.json

* upgrade config to upstream

* Fix linter

* Update _common.sh

* Fix typo

* Auto-update README

* Update upgrade

* Update scripts/upgrade

Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>

* [enh] Indentation

* Apply suggestions from code review

Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>

* [enh] COmments

* Increase timeout for table creation

Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>

* test upgrade from 7.2.0

* Auto-update README

* fix db_name in case of multi_instance

* Fix 7.3.0 migration

* delete only the problematic value in db_migrations

* Added explanation for migration management from 7.3.0

* mariadb-to-pg: drop stray columns

These should have been removed in a previous migration, but weren't.

See https://github.com/mattermost/mattermost-server/issues/18351#issuecomment-1325648058

* mariadb-to-pg: increase mattermost timeout

On a small VPS the 2 mn timeout is almost reached.
Increase it to 3 mn.

---------

Co-authored-by: biva <biva@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: yunohost-bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: ljf <ljf+git@grimaud.me>
Co-authored-by: ljf (zamentur) <zamentur@users.noreply.github.com>
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
Co-authored-by: Kay0u <pierre@kayou.io>

* Change arm64 source (#409)

* add entreprise for arm64, use the official build for arm64

* Auto-update README

* update auto-updater script

---------

Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* delete the psql db if the migration fails

* Drop all Focalbard tables if mattermost is in 7.3.0

---------

Co-authored-by: yunohost-bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
Co-authored-by: tituspijean <titus@pijean.ovh>
Co-authored-by: biva <biva@users.noreply.github.com>
Co-authored-by: ljf <ljf+git@grimaud.me>
Co-authored-by: ljf (zamentur) <zamentur@users.noreply.github.com>
Co-authored-by: Kay0u <pierre@kayou.io>
This commit is contained in:
Éric Gaspar 2023-03-14 11:16:39 +01:00 committed by GitHub
parent 738ba505f5
commit c88d6ea78f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 308 additions and 119 deletions

View file

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

View file

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

View file

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

View file

@ -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 dinté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 dinstaller Mattermost rapidement et simplement sur un serveur YunoHost.
Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment linstaller et en profiter.*
## Vue d'ensemble
## Vue densemble
## 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 : <http://www.mattermost.org/>
* Site officiel de lapp : <http://www.mattermost.org/>
* Documentation officielle utilisateur : <https://docs.mattermost.com/guides/messaging.html>
* Documentation officielle de l'admin : <https://docs.mattermost.com/guides/deployment.html>
* Dépôt de code officiel de l'app : <https://github.com/mattermost/mattermost-server>
* Documentation officielle de ladmin : <https://docs.mattermost.com/guides/deployment.html>
* Dépôt de code officiel de lapp : <https://github.com/mattermost/mattermost-server>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_mattermost>
* Signaler un bug : <https://github.com/YunoHost-Apps/mattermost_ynh/issues>
@ -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 :** <https://yunohost.org/packaging_apps>
**Plus dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

6
conf/team_amd64.src Normal file
View file

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

6
conf/team_arm64.src Normal file
View file

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

View file

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

View file

@ -7,7 +7,6 @@ To explore the benefits of Mattermosts 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 Mattermosts 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

View file

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

View file

@ -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*).

View file

@ -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*).

View file

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

View file

@ -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 <<EOT > $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
#=================================================

View file

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

View file

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

View file

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

View file

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

View file

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