lore-forge/deploy/systemd/lore-forge.service

45 lines
1.1 KiB
SYSTEMD

[Unit]
Description=lore-forge: accounts, tokens and the forge for Lore
Documentation=file:///opt/lore-forge/README.md
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=lore-forge
Group=lore-forge
EnvironmentFile=/etc/lore-forge/lore-forge.env
Environment=LORE_FORGE_DATA_DIR=/var/lib/lore-forge
# The key that encrypts the token signing keys, handed over as a credential so the service
# user cannot read the file itself. lore-forge finds it in $CREDENTIALS_DIRECTORY.
LoadCredential=secret-key:/etc/lore-forge/secret.key
ExecStart=/opt/lore-forge/bin/lore-forge serve
Restart=on-failure
RestartSec=5
StateDirectory=lore-forge
StateDirectoryMode=0700
UMask=0077
NoNewPrivileges=yes
CapabilityBoundingSet=
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
ProtectClock=yes
ProtectHostname=yes
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
LockPersonality=yes
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
[Install]
WantedBy=multi-user.target