Paul van Tilburg
69f34e3243
* Add the required metadata to `Cargo.toml` * Add a systemd service unit file * Use `Rocket.toml.example` as the default configuration
47 lines
960 B
Desktop File
47 lines
960 B
Desktop File
[Unit]
|
|
Description=Solar Grabber API web server
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
|
|
AmbientCapabilities=
|
|
CapabilityBoundingSet=
|
|
DynamicUser=yes
|
|
LoadCredential=solar-grabber.toml:/etc/solar-grabber.toml
|
|
LockPersonality=yes
|
|
MemoryDenyWriteExecute=yes
|
|
NoNewPrivileges=yes
|
|
ProtectClock=yes
|
|
ProtectControlGroups=yes
|
|
ProtectHome=yes
|
|
ProtectHostname=yes
|
|
ProtectKernelLogs=yes
|
|
ProtectKernelModules=yes
|
|
ProtectKernelTunables=yes
|
|
ProtectProc=noaccess
|
|
ProtectSystem=strict
|
|
PrivateDevices=yes
|
|
PrivateMounts=yes
|
|
PrivateTmp=yes
|
|
PrivateUsers=yes
|
|
RemoveIPC=yes
|
|
RestrictAddressFamilies=AF_INET AF_INET6
|
|
RestrictNamespaces=yes
|
|
RestrictRealtime=yes
|
|
RestrictSUIDSGID=yes
|
|
SystemCallArchitectures=native
|
|
SystemCallFilter=@system-service
|
|
SystemCallErrorNumber=EPERM
|
|
UMask=0077
|
|
|
|
ExecStart=/usr/sbin/solar-grabber
|
|
Restart=on-failure
|
|
RestartSec=10
|
|
StartLimitInterval=1m
|
|
StartLimitBurst=5
|
|
|
|
Environment="ROCKET_CONFIG=%d/solar-grabber.toml"
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|