1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nodebb_ynh.git synced 2024-09-03 19:46:29 +02:00
nodebb_ynh/conf/systemd.service

54 lines
1.8 KiB
SYSTEMD
Raw Normal View History

2017-04-20 00:12:05 +02:00
[Unit]
2021-09-23 09:55:25 +02:00
Description=NodeBB: Forum software
2021-03-25 17:00:29 +01:00
Documentation=https://docs.nodebb.org
2021-07-02 08:11:53 +02:00
After=system.slice multi-user.target
2017-04-20 00:12:05 +02:00
[Service]
2021-03-25 17:00:29 +01:00
Type=forking
User=__APP__
2021-05-30 09:34:35 +02:00
Group=__APP__
2021-04-07 19:47:26 +02:00
Environment=NODE_ENV=production
2023-03-16 22:28:23 +01:00
WorkingDirectory=__INSTALL_DIR__/
#PIDFile=__INSTALL_DIR__/pidfile
2024-06-24 14:16:00 +02:00
Environment="PATH=__PATH_WITH_NODEJS__"
ExecStart=__NODEJS_DIR__/node __INSTALL_DIR__/nodebb start
2021-08-31 23:19:28 +02:00
#loader.js
2017-04-20 00:12:05 +02:00
Restart=always
2021-08-31 17:05:07 +02:00
2021-05-30 09:34:35 +02:00
StandardOutput=syslog
StandardError=syslog
2021-07-01 23:31:36 +02:00
SyslogIdentifier=__APP__
2017-04-20 00:12:05 +02:00
2022-10-01 09:03:02 +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
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
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-04-20 00:12:05 +02:00
[Install]
WantedBy=multi-user.target