First try

This commit is contained in:
lapineige 2023-06-25 20:35:35 +02:00 committed by GitHub
parent ed73461c83
commit 3244cbf17e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,15 +1,20 @@
[Unit] [Unit]
Description=Small description of the service Description=PeerTube Remote Runner daemon
After=network.target After=network.target
[Service] [Service]
Type=simple Type=simple
Environment=NODE_ENV=production
Environment=NODE_CONFIG_DIR=__INSTALL_DIR__/config
Environment="__YNH_NODE_LOAD_PATH__"
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
ExecStart=__YNH_NODE__ __INSTALL_DIR__/peertube-runner server
WorkingDirectory=__INSTALL_DIR__/ WorkingDirectory=__INSTALL_DIR__/
ExecStart=__INSTALL_DIR__/script StandardOutput=syslog
StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=syslog
StandardError=inherit SyslogIdentifier=__APP__
Restart=always
# Sandboxing options to harden security # Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these # Depending on specificities of your service/app, you may need to tweak these
@ -17,21 +22,18 @@ StandardError=inherit
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html # Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
NoNewPrivileges=yes NoNewPrivileges=yes
PrivateTmp=yes PrivateTmp=yes
PrivateDevices=yes #PrivateDevices=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
RestrictNamespaces=yes RestrictNamespaces=yes
RestrictRealtime=yes RestrictRealtime=yes
DevicePolicy=closed DevicePolicy=closed
ProtectClock=yes DeviceAllow=/dev/dri/renderD128
ProtectHostname=yes
ProtectProc=invisible
ProtectSystem=full ProtectSystem=full
ProtectControlGroups=yes ProtectControlGroups=yes
ProtectKernelModules=yes ProtectKernelModules=yes
ProtectKernelTunables=yes ProtectKernelTunables=yes
LockPersonality=yes LockPersonality=yes
SystemCallArchitectures=native SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap @cpu-emulation @privileged
# Denying access to capabilities that should not be relevant for webapps # Denying access to capabilities that should not be relevant for webapps
# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html # Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html