Install
Reference v0.5.1

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
bind127.0.0.1:8090HTTP listen address for dashboard, ingest, API, and POST /mcp.
db_path./quarkd.dbPath to the WAL-mode SQLite database file.
retention_days90Days to retain raw events before automatic pruning.
dedup_window_secs10Window for upgrading a server log hit + JS beacon into a single hybrid view.
admin_tokenemptyBearer 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_hashemptyOptional 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_pathoptionalPath to dbip-city-lite.mmdb. Sibling dbip-asn-lite.mmdb is auto-detected.
auto_update_geoiptrueChecks 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".

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.