Repository navigation
HTTPS reverse proxy with automatic certificates: services.edge (#6) - #78
Merged
Merged
Conversation
…ge (DNS-01) The built-in replacement for lucky's "443 + SSL" reverse proxy, off by default. - `mr edge serve` (OpenRC mr-edge, user mr-edge + CAP_NET_BIND_SERVICE, GOMEMLIMIT 24 MiB): TLS 1.2+, HTTP/2 and HTTP/1.1, certificate by SNI (unknown names fail the handshake), Host must match SNI (421), httputil.ReverseProxy with X-Forwarded-* from the connection, WebSocket, 512 connections, 10 s handshake / header timeouts. Reads only gen/edge.json and its certificates. - LAN vs WAN by listener: with `open`, nftables redirects the WANs' port to an internal listener and only redirected traffic reaches it, so `allow: [lan]` cannot be spoofed from outside. - `mr edge renew`: ACME (RFC 8555, stdlib only) with DNS-01 through the DDNS Cloudflare client; waits for the TXT at the authoritative servers, always cleans up; renews at a third of the lifetime, failed automatic runs back off 1 h to 24 h; wildcard certificates per domain. - Status: `mr edge status`, API `sys.edge`, `mr status`, a doctor `certs` check, `cert` events, a 服务 card; the guard's never_expose covers routes to the router's own SSH / web UI / DNS. Verification: Go tests (routing, allow lists on both listeners, WebSocket, reload, a full ACME flow against an in-process RFC 8555 server, backoff, no secret in state or events); tools/ci.d/sys-edge.sh with the real process in network namespaces through the rendered nft lines (IPv4 / IPv6), memory: idle 15 MB RSS (5 MB anonymous), 29 MB after 200 concurrent TLS clients x 20 requests. Interop with Pebble 2.10.1 (Let's Encrypt's test CA): account, wildcard order, DNS-01, finalize, chain, two forced renewals. Binary +1.13 MiB (Go's HTTP/2 + TLS server). Closes #6 Claude-Session: https://claude.ai/code/session_01HWeUjo1dmS7gBkCYHrVjCr
This was referenced Sep 26, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
services.edge, off by default: an HTTPS reverse proxy with Let's Encrypt certificates obtained over DNS-01 (Cloudflare). It is the built-in replacement for lucky's "443 + SSL" proxy.mr edge serve(OpenRCmr-edge)mr-edgewith onlyCAP_NET_BIND_SERVICE; reads onlygen/edge.jsonand its certificates.X-Forwarded-*headers come from the connection.open, nftables redirects the WANs' port to an internal listener, and only redirected traffic reaches it. Soallow: [lan]cannot be spoofed from outside, and afirewall.openof the same port is refused.mr edge renew: ACME (RFC 8555, standard library only) with DNS-01 through the DDNS Cloudflare client.mr edge status, APIsys.edge,mr status, acertscheck inmr doctor,certevents, and a card on the 服务 page.never_exposealso covers routes to the router's own SSH, web UI and DNS ports.services.edgechange is rated high risk.docs/modules/sys.md(反向代理, and 从 lucky 迁移).Not included: port 80 and an HTTP→HTTPS redirect, basic auth per route, and the P3 items (
wan_port, ARI, CNAME delegation).Verification
tools/ci.d/sys-edge.sh:sh tools/ci.sh: ALL CHECKS PASSED.Closes #6
https://claude.ai/code/session_01HWeUjo1dmS7gBkCYHrVjCr