Skip to content

Deploy the public gateway: a role + Compose profile, wildcard-TLS proxy with PUT /_pointer rate limits, metrics and alerts #176

Closed

Description

@thiras

Follow-up to decdn/decdn#2593: the public gateway ships in the decdn image (decdn gateway --public-url https://decdn.link --listen 0.0.0.0:8080 --metrics-listen 127.0.0.1:9100 --publisher-registry-address …, see docker/README.decdn.md § Public gateway in decdn/decdn). Nothing deploys it yet.

Scope. The reusable deploy unit, so any publisher can run a public gateway on their own domain. The domain is a variable, never hardcoded decdn.link. Our own decdn.link deployment (DNS records, the DNS-01 token, the inventory host, Public Suffix List registration) is tracked in decdn/fleet#47.

Ask.

  • A role and a Compose profile for decdn gateway (the role likely in decdn.publisher): keystore + DECDN_KEYSTORE_PASSWORD_FILE, a ~/.decdn state directory (gateway/store for the pool and lanes, gateway/pointers for namespace pointers), the gateway listening on loopback behind the proxy, the metrics listener on loopback.
  • A reverse proxy (Caddy) in front of it. The gateway speaks plain HTTP and builds https:// links from --public-url. Hosts are <hash32>.<domain>, <ns>.<hash32>.<domain> and <ns>.<domain>, so the proxy must answer any depth.
    • TLS: a wildcard for *.<domain> plus a second-level wildcard. Wildcards need ACME DNS-01, and the stock Caddy build has no DNS-provider plugin, so this changes how the role installs Caddy (sponsord_onramp's Caddy is the stock build). Alternative: on-demand TLS per host, with an ask endpoint so arbitrary hostnames can't trigger issuance.
    • Rate limits on PUT /_pointer per client IP. The gateway budgets owner lookups globally (60/min) and per known signer, and deliberately trusts no X-Forwarded-*, so per-client limits belong in the proxy.
  • Firewall: tcp/80 + tcp/443 for the gateway host group, built in ansible/playbooks/group_vars/all.yml (_baseline_service_inbound) and pinned in ansible/tests/firewall-holes/.
  • Monitoring: an Alloy scrape toggle (both runtimes), a dashboard and alert rules in monitoring/ on decdn_gateway_pull_failures_funding_total (pool cannot pay) and decdn_gateway_requests_allowance_exhausted_total, with promtool tests.
  • The usual couplings: cloud-init HOST_GROUPS/secrets if a new group or secret file, compose/tests/*.jq allow-lists, the collection's roles.txt/playbooks.txt, docs in docs/publishers.md. The chart could follow later.

🤖 Generated with Claude Code

Activity

  1. changed the title [-]Deploy the public gateway: wildcard DNS + TLS for `*.decdn.link`, a role, PSL registration, proxy rate limits on PUT /_pointer[/-] [+]Deploy the public gateway: a role + Compose profile, wildcard-TLS proxy with PUT /_pointer rate limits, metrics and alerts[/+] on Oct 30, 2026
  2. self-assigned this
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions