55 lines
1.6 KiB
Desktop File
55 lines
1.6 KiB
Desktop File
[Unit]
|
|
Description=checkbot (Checkmk-Bot mit Web-UI)
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
AssertPathExists=/etc/checkbot/master.key
|
|
AssertPathExists=/etc/checkbot/session.secret
|
|
StartLimitIntervalSec=300
|
|
StartLimitBurst=5
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=checkbot
|
|
Group=checkbot
|
|
WorkingDirectory=/opt/checkbot
|
|
Environment=CHECKBOT_BIND_HOST=127.0.0.1
|
|
Environment=CHECKBOT_BIND_PORT=8080
|
|
Environment=PYTHONDONTWRITEBYTECODE=1
|
|
Environment=PYTHONUNBUFFERED=1
|
|
EnvironmentFile=/etc/checkbot/checkbot.env
|
|
# Genau ein Worker: Login-Rate-Limiter, TOTP-Einrichtung und Downtime-Bestätigungen liegen im
|
|
# Prozessspeicher, außerdem würden mehrere Prozesse den Poller doppelt ausführen.
|
|
# Kein Zugriffslog von uvicorn: Caddy protokolliert, und /health wird minütlich abgefragt.
|
|
ExecStart=/opt/checkbot/.venv/bin/uvicorn app.main:create_app --factory --host ${CHECKBOT_BIND_HOST} --port ${CHECKBOT_BIND_PORT} --workers 1 --no-access-log
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
# Pipeline-Drain beim Beenden dauert bis zu 15 s.
|
|
TimeoutStopSec=30
|
|
|
|
MemoryHigh=600M
|
|
MemoryMax=768M
|
|
|
|
NoNewPrivileges=yes
|
|
ProtectSystem=strict
|
|
ReadWritePaths=/var/lib/checkbot
|
|
ProtectHome=yes
|
|
PrivateTmp=yes
|
|
ProtectKernelTunables=yes
|
|
ProtectKernelModules=yes
|
|
ProtectKernelLogs=yes
|
|
ProtectControlGroups=yes
|
|
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
|
|
RestrictNamespaces=yes
|
|
RestrictRealtime=yes
|
|
RestrictSUIDSGID=yes
|
|
LockPersonality=yes
|
|
# MemoryDenyWriteExecute bewusst nicht gesetzt: cffi/cryptography legen ausführbare Speicherseiten an.
|
|
CapabilityBoundingSet=
|
|
SystemCallArchitectures=native
|
|
SystemCallFilter=@system-service
|
|
SystemCallErrorNumber=EPERM
|
|
UMask=0077
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|