Configuration, Goals & Webhooks
Declarative boot and auth settings live in TOML; Day-2 sites, goals, and webhooks can live in TOML or SQLite.
Starter server.toml
/etc/quarkd/server.toml
mode = "standalone" # "standalone" | "server" | "agent" [server] bind = "127.0.0.1:8090" db_path = "/var/lib/quarkd/quarkd.db" retention_days = 90 flush_interval_ms = 1000 flush_batch_size = 500 dedup_window_secs = 10 admin_token = "qkd_adm_replace_me" agent_tokens = ["qkd_agt_replace_me"] # trusted_proxies = ["10.0.0.0/8", "172.16.0.0/12"] geoip_db_path = "/var/lib/quarkd/dbip-city-lite.mmdb" auto_update_geoip = true [[sites]] id = "mysite" domains = ["example.com", "www.example.com"] [[sites.goals]] name = "Signup" event = "signup" [[sites.goals]] name = "Pricing Viewed" path = "/pricing"
[server] keys
| Key | Default | Description |
|---|---|---|
bind | 127.0.0.1:8090 | HTTP listen address for dashboard, ingest, API, and POST /mcp. |
db_path | ./quarkd.db | Path to the WAL-mode SQLite database file. |
retention_days | 90 | Days to retain raw events before automatic pruning. |
dedup_window_secs | 10 | Window for upgrading a server log hit + JS beacon into a single hybrid view. |
admin_token | empty | Bearer token for REST API, POST /mcp, and optional dashboard login. Leave both admin_token and admin_password_hash empty only for localhost development. |
admin_password_hash | empty | Optional Argon2id PHC password hash (generated with quarkd hash-password) for human dashboard login via POST /login. |
agent_tokens | [] | Allowed bearer tokens for incoming quarkd agent batch pushes and salt syncs. |
trusted_proxies | [] | CIDRs trusted to supply X-Forwarded-For / X-Real-IP (loopback is always trusted). |
geoip_db_path | optional | Path to dbip-city-lite.mmdb. Sibling dbip-asn-lite.mmdb is auto-detected. |
auto_update_geoip | true | Checks monthly and hot-swaps updated GeoIP/ASN files in memory with zero restart. |
TOML vs. DB ownership
Every site, goal, webhook, and dashboard password has an explicit source: "toml" or "db".
- TOML always wins on collision and is strictly read-only at runtime. Attempting to overwrite or delete a TOML-owned entry (or mint a password setup link when
admin_password_hashis set inserver.toml) returns409 Conflict. - Password login (agent-safe): Coding agents can call
create_password_linkover MCP to generate a single-use, 2-minute/setup-passwordURL so you can set your dashboard password directly in the browser without sharing plaintext with the agent. Signed-in users can also update their DB password in/settings. - DB-owned goals can attach to TOML-owned sites, so you can keep base site declarations in git while adding campaign goals live over MCP.
- To move existing TOML entries into SQLite for UI/MCP management, run
quarkd config-importand then remove those blocks fromserver.toml.
Webhooks (Discord & HMAC-SHA256)
Supported event triggers: goal_hit, agent_offline, agent_recovered, 5xx_spike, or "*" for all.
Declarative webhook examples in server.toml
# Discord webhooks auto-format as rich embeds [[server.webhooks]] url = "https://discord.com/api/webhooks/123456789/replace_me" events = ["goal_hit", "agent_offline", "5xx_spike"] sites = [] # empty = all sites # Generic JSON webhook signed with HMAC-SHA256 [[server.webhooks]] url = "https://hooks.example.com/quarkd" secret = "whsec_replace_me" # sends X-Quarkd-Signature: sha256=<hex> events = ["*"] sites = ["mysite"]
Security guarantees: Outbound webhook deliveries enforce DNS-pinned public-IP validation (blocking loopback, link-local, and RFC1918 targets against SSRF) and redact full webhook URLs from error logs so Discord tokens never leak.