You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2026. It is now read-only.
The Visitor Analytics module must work in offline/LAN mode without internet, while online deployments may optionally enrich visitor data with trusted proxy or Cloudflare headers.
AWCMS-Mini must not trust spoofable proxy headers by default. Online geolocation must be gated explicitly and must never become required for local/offline/LAN operation.
Objective
Add optional trusted online IP/geolocation enrichment for visitor analytics, using only trusted request headers or local data and never calling external geolocation APIs in the request path.
Scope
Add infrastructure helpers under:
src/modules/visitor-analytics/infrastructure/
Suggested files:
client-ip.ts
geo-enrichment.ts
Supported sources:
Direct client address from the runtime.
Trusted reverse proxy headers only when VISITOR_ANALYTICS_TRUST_PROXY=true.
Trusted Cloudflare headers only when VISITOR_ANALYTICS_TRUST_CLOUDFLARE=true.
Country code from Cloudflare-style headers where available.
Region/city/timezone only if provided by a trusted source or a local/offline database configured later.
CF-Ray or equivalent request diagnostic may be stored only as non-secret operational metadata if useful.
Context
The Visitor Analytics module must work in offline/LAN mode without internet, while online deployments may optionally enrich visitor data with trusted proxy or Cloudflare headers.
AWCMS-Mini must not trust spoofable proxy headers by default. Online geolocation must be gated explicitly and must never become required for local/offline/LAN operation.
Objective
Add optional trusted online IP/geolocation enrichment for visitor analytics, using only trusted request headers or local data and never calling external geolocation APIs in the request path.
Scope
Add infrastructure helpers under:
Suggested files:
client-ip.tsgeo-enrichment.tsSupported sources:
VISITOR_ANALYTICS_TRUST_PROXY=true.VISITOR_ANALYTICS_TRUST_CLOUDFLARE=true.CF-Rayor equivalent request diagnostic may be stored only as non-secret operational metadata if useful.Configuration:
Runtime behavior:
APP_ENV=productionwith trusted proxy or trusted Cloudflare.Out of scope
Acceptance criteria
X-Forwarded-Foror any provider header.X-Forwarded-Foris ignored when trust proxy is false.VISITOR_ANALYTICS_TRUST_CLOUDFLARE=true.VISITOR_ANALYTICS_GEO_ENABLED=false.bun testpasses.bun run checkpasses.Security and privacy notes
Dependencies
Depends on #617, #619, and #620. It can be implemented after the MVP offline/LAN collector is working.