2018-11-21 19:55:53 +01:00
|
|
|
[Unit]
|
2020-06-22 18:33:34 +02:00
|
|
|
Description=CodiMD: collaborative Markdown notes
|
2021-05-08 11:59:03 +02:00
|
|
|
Documentation=https://github.com/hackmdio/codimd
|
2020-06-22 18:33:34 +02:00
|
|
|
After=network.target postgresql.service
|
2018-11-21 19:55:53 +01:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
2020-05-23 15:16:11 +02:00
|
|
|
User=__APP__
|
|
|
|
Group=__APP__
|
2023-04-27 18:37:24 +02:00
|
|
|
WorkingDirectory=__INSTALL_DIR__
|
2019-11-28 02:05:34 +01:00
|
|
|
Environment="NODE_ENV=production"
|
2021-06-13 15:04:04 +02:00
|
|
|
Environment="__YNH_NODE_LOAD_PATH__"
|
2021-06-21 11:14:57 +02:00
|
|
|
ExecStart=__YNH_NODE__ app.js
|
2018-11-21 19:55:53 +01:00
|
|
|
Restart=always
|
2020-05-21 12:49:24 +02:00
|
|
|
PrivateTmp=true
|
|
|
|
PrivateDevices=true
|
2018-11-21 19:55:53 +01:00
|
|
|
|
2021-09-10 15:46:14 +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
|
2021-06-02 18:17:17 +02:00
|
|
|
|
2021-09-10 15:46:14 +02:00
|
|
|
# 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
|
2021-06-02 18:17:17 +02:00
|
|
|
|
2021-09-10 15:46:14 +02:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|