config.example.toml 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # PPS Quarantine Manager — example config.
  2. # Copy to config.toml and fill in real values. config.toml is gitignored and is written
  3. # back by the admin panel, so keep comments meaningful — they are preserved on save.
  4. #
  5. # Zones: (S) server-only, edit this file directly, never shown/written by the panel.
  6. # (A) admin-editable in the panel. (W) write-only secret (never returned).
  7. [pps] # (A) PPS connection
  8. # Base URL of the PPS admin service (REST APIs live on the admin port, default 10000).
  9. base_url = "https://pps.example.com:10000"
  10. # API user (admin account with an API Role that has the Quarantine module enabled).
  11. username = "admin"
  12. password = "secret" # (W) plaintext on disk (0600); rotate via panel.
  13. # PPS admin certs are frequently self-signed. false skips TLS verification, or set a path
  14. # to a CA bundle to verify against it.
  15. verify_tls = false
  16. timeout = 120 # seconds per PPS call (5..600)
  17. # Mutual TLS client cert — only if PPS/nginx requires one ("400 No required SSL
  18. # certificate"). Leave BOTH empty otherwise (the file must exist if set).
  19. client_cert = "" # path to a combined cert+key PEM, or a cert with client_key
  20. client_key = ""
  21. [quarantine] # (A)
  22. default_folder = "Quarantine" # folder shown on first load (per-user overridable)
  23. # Full folder list — the API cannot enumerate folders, so this is the source of truth for
  24. # the switcher, the Move dropdown, and the delete/report targets. Names MUST match PPS
  25. # exactly (case- and space-sensitive) and may not contain commas.
  26. folders = ["Quarantine", "Attachment Defense", "Debugging - Josef", "Deleted"]
  27. deleted_folder = "Deleted" # where Delete sends messages
  28. default_limit = 200 # UI default row count, 1..1000 (per-user overridable)
  29. # The search API requires a from/rcpt/subject filter — a bare wildcard means "everything
  30. # in the folder". Change if your PPS doesn't treat this as match-all (e.g. "rcpt=@you.com").
  31. list_query = "from=*"
  32. default_days_back = 7 # startdate window (API alone only returns last 24h)
  33. chunk_size = 25 # localguids per PPS POST when the worker batches
  34. default_sort_field = "subject" # subject|date|from|rcpt (per-user overridable)
  35. default_sort_dir = "asc" # asc|desc (per-user overridable)
  36. [quarantine.report_release] # (A) "Report & Release" pipeline
  37. # Steps run in the FIXED order move -> release; pick either or both.
  38. # move relocates the mail to move_target; release then delivers it from there.
  39. # Deleting is NOT part of this pipeline — Delete is its own action/button.
  40. steps = ["move", "release"]
  41. move_target = "Debugging - Josef" # must be one of `folders`
  42. # Seconds to wait between steps on the same message so PPS's eventually-consistent
  43. # backend settles. After the wait the worker re-reads where the messages actually are
  44. # (by their stable guid) instead of reusing handles from before the move. 0..3600;
  45. # 0 disables both the wait and the re-read. A waiting job is parked back on the queue,
  46. # so it blocks neither the HTTP request nor other queued jobs.
  47. step_delay_seconds = 60
  48. [app] # (S) restart required for changes here
  49. # Session signing key: >= 32 chars. Generate with:
  50. # python -c "import secrets; print(secrets.token_urlsafe(48))"
  51. secret_key = "change-me-to-a-random-string"
  52. listen = "127.0.0.1"
  53. port = 8080
  54. db_path = "jobs.db" # SQLite: job queue + per-user prefs
  55. log_level = "INFO" # (A, live) DEBUG for full request tracing
  56. worker_log = "worker.log" # audit log: one line per message acted on
  57. app_log = "app.log" # application log (errors visible in the panel)
  58. cookie_secure = true # false only for plain-http localhost dev
  59. [auth] # authentication
  60. # (S) "oidc" for production Okta, "static" for local dev. NOT editable in the panel.
  61. mode = "oidc"
  62. # (A) shown to users who authenticate but aren't on the allowed list.
  63. denied_message = "Your account is not authorised to use the PPS Quarantine Manager. Contact IT."
  64. # (A) allowed users. role is "admin" or "user".
  65. [[auth.users]]
  66. email = "alice@example.com"
  67. role = "admin"
  68. [[auth.users]]
  69. email = "bob@example.com"
  70. role = "user"
  71. # (S) DEV ONLY — the shared account used when mode = "static". Ignored under oidc.
  72. [auth.static]
  73. username = "admin"
  74. password = "admin"
  75. email = "dev-admin@example.invalid"
  76. role = "admin"
  77. [okta] # (S) entire section, restart-only, never in panel
  78. issuer = "https://example.okta.com/oauth2/default"
  79. client_id = "0oaEXAMPLE"
  80. client_secret = "EXAMPLE-SECRET" # (W)
  81. # Must EXACTLY match the redirect URI registered in the Okta app.
  82. redirect_uri = "https://ppsq.internal.example.com/authorize"