# systemd-Unit für it-connect # Installation: siehe SETUP.md, Teil 7 # sudo cp deploy/it-connect.service /etc/systemd/system/ # sudo systemctl daemon-reload && sudo systemctl enable --now it-connect [Unit] Description=it-connect (FastAPI) After=network.target [Service] Type=simple User=itconnect Group=itconnect WorkingDirectory=/opt/it-connect/backend EnvironmentFile=/opt/it-connect/.env # Nur lokal lauschen: von außen ist die App ausschließlich über Caddy (HTTPS) erreichbar. # uvicorn übernimmt die Client-IP aus X-Forwarded-For nur von 127.0.0.1 (Caddy). ExecStart=/opt/it-connect/.venv/bin/uvicorn app.main:app \ --host 127.0.0.1 --port 8000 \ --proxy-headers --forwarded-allow-ips 127.0.0.1 \ --no-server-header Restart=on-failure RestartSec=3 # Datenbankverzeichnis /var/lib/it-connect (wird von systemd angelegt, gehört itconnect) StateDirectory=it-connect StateDirectoryMode=0750 UMask=0077 # Härtung NoNewPrivileges=true ProtectSystem=strict ProtectHome=true PrivateTmp=true PrivateDevices=true ProtectKernelTunables=true ProtectKernelModules=true ProtectKernelLogs=true ProtectControlGroups=true ProtectClock=true ProtectHostname=true RestrictNamespaces=true RestrictRealtime=true RestrictSUIDSGID=true LockPersonality=true RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX CapabilityBoundingSet= SystemCallArchitectures=native [Install] WantedBy=multi-user.target