[Unit]
Description=Beszel Agent Service
Wants=network-online.target
After=network-online.target

[Service]
EnvironmentFile=/etc/beszel/agent.conf
EnvironmentFile=-/etc/beszel/agent.conf.d/*.conf
ExecStart=/usr/bin/beszel-agent
User=_beszel-agent
Restart=always
StateDirectory=beszel-agent

AmbientCapabilities=CAP_SYS_RAWIO CAP_SYS_ADMIN
CapabilityBoundingSet=CAP_SYS_RAWIO CAP_SYS_ADMIN

KeyringMode=private
LockPersonality=yes
ProtectClock=yes
ProtectHome=read-only
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectSystem=strict
RemoveIPC=yes
RestrictSUIDSGID=true

[Install]
WantedBy=multi-user.target
