# --- archive.org access (defaults are polite; raising them risks a rate-limit) --- # # Who to contact about this instance's traffic. Folded into the User-Agent that # every archive.org request carries, so a human at the Internet Archive can # reach you instead of only being able to block you. Their guidance asks # automated clients to identify themselves clearly; an email or a URL both work. # Left empty, the User-Agent falls back to the project URL, which still # identifies WayTrace but is a slower way to reach anyone. OPERATOR_CONTACT= # # WayTrace self-tunes its archive.org request rate with an AIMD governor: it # starts at ARCHIVE_RATE_PER_MINUTE, creeps up while responses stay clean, and # halves the instant archive.org refuses a connection. The rate always stays # within [ARCHIVE_RATE_MIN, ARCHIVE_RATE_MAX]. You rarely need to touch these. ARCHIVE_RATE_PER_MINUTE=75 # starting rate (req/min); 75 = 1.25 req/s ARCHIVE_RATE_MIN=60 # floor the adaptive rate never drops below (1 req/s) ARCHIVE_RATE_MAX=80 # ceiling it never climbs above (~1.33 req/s) ARCHIVE_RATE_STEP=15 # additive increase per clean interval (req/min) ARCHIVE_RATE_INCREASE_INTERVAL=90 # seconds of clean responses before a bump ARCHIVE_RATE_DECREASE_FACTOR=0.5 # multiply the rate by this on a refusal ARCHIVE_RATE_BURST=6 # token-bucket burst allowance # Hard-block (connection-refusal) cooldown: short on a first/isolated refusal, # doubling only if refusals recur close together, capped at the max. ARCHIVE_HARD_COOLDOWN_BASE=120 # first hard-block pause (s) ARCHIVE_HARD_COOLDOWN_MAX=1800 # ceiling for repeated back-to-back blocks (s) ARCHIVE_HARD_STREAK_RESET=900 # quiet gap (s) that resets the escalation ARCHIVE_GLOBAL_CONCURRENCY=3 # max simultaneous archive.org connections (all scans) MAX_CONCURRENT_SCRAPES=4 # per-scan parallel requests (1-50) SCRAPE_DELAY_MIN=0.5 # per-request jitter, low bound (s) SCRAPE_DELAY_MAX=1.2 # per-request jitter, high bound (s) ARCHIVE_REQUEST_TIMEOUT=60 # per-request timeout (s, 5-120) # --- scans & jobs --- MAX_ACTIVE_TOTAL=1 # one scan at a time; the rest queue MAX_QUEUE_TOTAL=100 # deep waiting queue (waiting jobs send archive.org nothing) MAX_ACTIVE_PER_IP=2 # abuse net only (kept high so shared/CGNAT IPs are safe) SCAN_TIMEOUT_SECONDS=3600 # hard per-scan timeout (s) SCAN_RETENTION_DAYS=14 # how long a stored scan is kept (and reused by the guardrail); 0 = keep forever HOSTED_SNAPSHOT_CEILING=3000 # per-scan snapshot cap; 0 = unlimited (full self-hosted scans) # --- server --- CORS_ORIGINS=http://localhost:5173,http://localhost:3000 LOG_LEVEL=INFO # DEBUG / INFO / WARNING / ERROR # Database path. Docker images set DATABASE_URL=/data/waytrace.db themselves; # outside Docker it defaults to waytrace.db at the project root. Override only # to relocate it. # DATABASE_URL=/data/waytrace.db