2017-10-12 12:47:51 +02:00
|
|
|
[Unit]
|
|
|
|
Description=Mattermost
|
2022-08-06 22:38:35 +02:00
|
|
|
After=network.target
|
2022-06-22 10:50:57 +02:00
|
|
|
Requires=postgresql.service
|
2017-10-12 12:47:51 +02:00
|
|
|
|
|
|
|
[Service]
|
2018-02-16 05:13:55 +01:00
|
|
|
Type=notify
|
2022-06-29 00:26:50 +02:00
|
|
|
User=__APP__
|
|
|
|
Group=__APP__
|
2023-02-07 22:27:23 +01:00
|
|
|
ExecStart=__INSTALL_DIR__/bin/mattermost
|
2018-03-01 13:36:55 +01:00
|
|
|
TimeoutStartSec=3600
|
2017-10-12 12:47:51 +02:00
|
|
|
Restart=always
|
|
|
|
RestartSec=10
|
2023-02-07 22:27:23 +01:00
|
|
|
WorkingDirectory=__INSTALL_DIR__
|
2021-11-01 11:24:00 +01:00
|
|
|
RuntimeDirectory=__APP__
|
2017-10-12 12:47:51 +02:00
|
|
|
LimitNOFILE=49152
|
|
|
|
|
2021-09-09 23:45:22 +02:00
|
|
|
# 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
|
2022-04-12 08:30:58 +02:00
|
|
|
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
|
2021-09-09 23:45:22 +02:00
|
|
|
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
|
|
|
|
|
2017-10-12 12:47:51 +02:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|