Repository navigation
Replies: 3 comments 1 reply
|
Running self-hosted instances behind Cloudflare's proxy layer often introduces friction with edge bot rules, WAF challenges, and accurate client IP propagation (CF-Connecting-IP vs X-Forwarded-For). Ensuring seamless machine-to-machine communication while bypassing aggressive edge challenges on public verification routes requires robust proxy configuration and origin-unblocking strategies- the exact core architecture utilized by web proxy platforms like CroxyProxy to maintain reliable endpoint access across diverse network layers. |
Thanks for the note re Turnstile. I didn't know that was possible. |
|
Thanks, Sam, that's very helpful. On max-age: 30 minutes sounds right to us for documents that rarely change, but we'd keep status lists shorter:
With 10 minutes on status lists, a revocation shows up everywhere within 10 minutes, which feels like a reasonable trade-off for a CDN in front. A key rotation would take up to 30 minutes to propagate, which seems fine given how rarely that happens. On the tunnel: makes sense, we'll look at it for the instance whose DNS zone we control. The other one runs on a domain whose zone isn't ours, so that one stays direct for now. And thanks for confirming the route list. |
Uh oh!
There was an error while loading. Please reload this page.
We're considering putting our self-hosted instance behind Cloudflare's proxy, mainly for volumetric DDoS protection. It runs the Node runtime in Docker with Caddy in front. CredTrail ships a Workers entry, so you know this ground far better than we do. We have three questions after reading the code at 948a8ca.
1. Client IP
The Node runtime takes the client IP from
X-Forwarded-Foronly when the TCP peer is inTRUSTED_PROXY_CIDRS(runtime/node-request-adapter.ts). Only the Workers entry readsCF-Connecting-IP(worker/create-worker.ts).Our plan: Caddy trusts only Cloudflare's published IP ranges and rewrites
X-Forwarded-ForfromCF-Connecting-IP. The app keeps trusting just Caddy. This matters for the magic-link limiter, which counts attempts per IP.Is that the setup you'd recommend? Or would you prefer the Node adapter to accept a trusted client-IP header directly?
2. Cache headers on public verification documents
These all respond with
Cache-Control: no-store, so a CDN absorbs none of the verifier traffic:Is
no-storedeliberate for all of them? For status lists, a shortmax-ageseems compatible with timely revocation. DID documents and the JSON-LD of an issued credential rarely change.3. Routes that must never be challenged
Behind the proxy, WAF and bot rules can easily start challenging machine clients. These are the routes we would exempt from challenges and blocks:
/.well-known/*/*/did.jsonand/*/jwks.json/credentials/v1/status-lists/*/badges/*/jsonldand/credentials/v1/*/jsonld/credentials/v1/offers/*,/credentials/offerand/credentials/v1/dcc/*/badges/:iditself, because LinkedInBot builds the share preview from itIs that list complete? Do you run WAF or rate-limiting rules for hosted CredTrail that could become a recommended baseline in
docs/SELF_HOST_DOCKER_RUNBOOK.md?Either way, one note for the runbook: the Turnstile captcha on magic links works without proxying through Cloudflare. We run it that way: one widget per hostname and two keys in
.env.All reactions