1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mattermost_ynh.git synced 2024-09-03 19:36:29 +02:00
mattermost_ynh/conf/systemd.service
Éric Gaspar ec8fa5570a
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>
2023-03-06 22:26:35 +01:00

49 lines
1.6 KiB
Desktop File

[Unit]
Description=Mattermost
After=network.target
Requires=postgresql.service
[Service]
Type=notify
User=__APP__
Group=__APP__
ExecStart=__FINALPATH__/bin/mattermost
TimeoutStartSec=3600
Restart=always
RestartSec=10
WorkingDirectory=__FINALPATH__
RuntimeDirectory=__APP__
LimitNOFILE=49152
# Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these
# .. but this should be a good baseline
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
RestrictNamespaces=yes
RestrictRealtime=yes
DevicePolicy=closed
ProtectSystem=full
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
LockPersonality=yes
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap
# Denying access to capabilities that should not be relevant for webapps
# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html
CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD
CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE
CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT
CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK
CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM
CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG
CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE
CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW
CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG
[Install]
WantedBy=multi-user.target