ppsq.service 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # systemd unit for the PPS Quarantine Manager.
  2. #
  3. # Install (as root):
  4. # see deploy/README.md for the full walk-through. In short:
  5. # 1. put the app in /opt/ppsq, create a `ppsq` user that owns it
  6. # 2. edit the paths/user below if you used different ones
  7. # 3. cp deploy/ppsq.service /etc/systemd/system/ppsq.service
  8. # 4. systemctl daemon-reload && systemctl enable --now ppsq
  9. #
  10. # IMPORTANT: single process only. Do NOT template this into multiple instances or add
  11. # web-server workers — the background job queue and SQLite live in-process (see AGENTS.md).
  12. [Unit]
  13. Description=PPS Quarantine Manager
  14. After=network-online.target
  15. Wants=network-online.target
  16. [Service]
  17. Type=simple
  18. User=ppsq
  19. Group=ppsq
  20. WorkingDirectory=/opt/ppsq
  21. ExecStart=/opt/ppsq/venv/bin/python wsgi.py
  22. Restart=on-failure
  23. RestartSec=5
  24. # Config path is optional: the app defaults to ./config.toml in WorkingDirectory.
  25. # Uncomment to point elsewhere:
  26. # Environment=PPSQ_CONFIG=/etc/ppsq/config.toml
  27. # --- modest hardening (safe defaults; remove any that get in your way) ---
  28. NoNewPrivileges=true
  29. PrivateTmp=true
  30. ProtectSystem=full
  31. ProtectHome=true
  32. # The app rewrites config.toml + writes jobs.db/*.log in WorkingDirectory, so it must be
  33. # writable. If ProtectSystem hides it, grant it explicitly:
  34. ReadWritePaths=/opt/ppsq
  35. [Install]
  36. WantedBy=multi-user.target