From f0665ba9562c202872f40f62b1a813ec0b28aed9 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 10 Sep 2026 00:21:42 +0200 Subject: [PATCH] ADR 0056: selectable ACME issuer, step-ca init from operator root, route labels Piece A + B of ADR 0056, completing the internal-CA work in ff01ada. Selectable issuer. acme-ca is now a role two providers can satisfy: step-ca (internal CA) or the new public-acme (a fact-only module, no container/listen) that serves Let's Encrypt production. A mesh assigns one or the other to satisfy route-proxy's `requires: acme-ca`. One directory shape for both. A provider serves the ACME directory's parts the way the mesh already models any reachable service -- an address (`at`), a `port` and a `path` -- and route-proxy composes `https://:`. step-ca lets the mesh fill `at` (its node) and `port` (its single listen) and serves only `path`; public-acme, not being a mesh service, serves all three (overriding `at` with the public host). Same composition either way. Empty root means the system trust store. Both providers serve `root`: step-ca the operator root PEM (settled per mesh), public-acme an empty string. route-proxy writes it to the CA bundle file unconditionally; the binary now reads an empty bundle as "the root is already trusted by the OS" and falls back to system roots (examples/route-proxy/main.go, committed on the mesh-control ADR-0056 branch). step-ca inits from the operator's root. The operator's root cert, root key and root-key password are mounted at the smallstep entrypoint's default init paths (/run/secrets/root_ca.crt, root_ca_key, root_ca_key_password) with the matching DOCKER_STEPCA_INIT_*_FILE vars, so `step ca init` adopts the operator's root instead of self-generating one -- the CA that signs is the CA route-proxy trusts. Route names are labels, not FQDNs. Every routed module now contributes a `label` (the leftmost subdomain) instead of a full public hostname; the node's public domain composes the name. Apex (novox.be) is left as a full name -- composeName has no empty-label/apex convention yet (mesh-control follow-up). Claude-Session: https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF --- modules/baserow/module.json | 2 +- modules/bazarr/module.json | 2 +- modules/bookshelf/module.json | 2 +- modules/de-spiegel/module.json | 2 +- modules/gitea/module.json | 2 +- modules/grafana/module.json | 2 +- modules/hello-web/module.json | 2 +- modules/home-assistant/module.json | 2 +- modules/invoicing/module.json | 2 +- modules/jackett/module.json | 2 +- modules/keycloak/module.json | 2 +- modules/lidarr/module.json | 2 +- modules/mailu/module.json | 2 +- modules/n8n/module.json | 2 +- modules/nextcloud/module.json | 2 +- modules/nodered/module.json | 2 +- modules/ombi/module.json | 2 +- modules/only-office/module.json | 2 +- modules/photos-eef/module.json | 2 +- modules/photos-filip/module.json | 2 +- modules/photos/module.json | 2 +- modules/public-acme/module.json | 18 ++++++++++++++++++ modules/radarr/module.json | 2 +- modules/registry/module.json | 2 +- modules/route-proxy/module.json | 2 +- modules/searxng/module.json | 2 +- modules/sonarr/module.json | 2 +- modules/step-ca/module.json | 18 ++++++++++++++---- modules/tautulli/module.json | 2 +- modules/umami/module.json | 2 +- modules/verdaccio/module.json | 2 +- 31 files changed, 61 insertions(+), 33 deletions(-) create mode 100644 modules/public-acme/module.json diff --git a/modules/baserow/module.json b/modules/baserow/module.json index 07bbebd..3302e44 100644 --- a/modules/baserow/module.json +++ b/modules/baserow/module.json @@ -14,7 +14,7 @@ "name": "baserow" }, "route": { - "name": "baserow.zurag.be", + "label": "baserow", "port": 80 } }, diff --git a/modules/bazarr/module.json b/modules/bazarr/module.json index e39f715..c116eac 100644 --- a/modules/bazarr/module.json +++ b/modules/bazarr/module.json @@ -109,7 +109,7 @@ ], "contributes": { "route": { - "name": "subs.zurag.be", + "label": "subs", "port": 6767 } }, diff --git a/modules/bookshelf/module.json b/modules/bookshelf/module.json index 11e9804..a6ed293 100644 --- a/modules/bookshelf/module.json +++ b/modules/bookshelf/module.json @@ -85,7 +85,7 @@ ], "contributes": { "route": { - "name": "books.zurag.be", + "label": "books", "port": 8787 } }, diff --git a/modules/de-spiegel/module.json b/modules/de-spiegel/module.json index 14f8245..5fb00cf 100644 --- a/modules/de-spiegel/module.json +++ b/modules/de-spiegel/module.json @@ -10,7 +10,7 @@ ], "contributes": { "route": { - "name": "de-spiegel.novox.be", + "label": "de-spiegel", "port": 35621 } }, diff --git a/modules/gitea/module.json b/modules/gitea/module.json index 5452c2b..93d0816 100644 --- a/modules/gitea/module.json +++ b/modules/gitea/module.json @@ -10,7 +10,7 @@ "name": "gitea" }, "route": { - "name": "git.novox.be", + "label": "git", "port": 3000 } }, diff --git a/modules/grafana/module.json b/modules/grafana/module.json index a772006..60318dd 100644 --- a/modules/grafana/module.json +++ b/modules/grafana/module.json @@ -94,7 +94,7 @@ ], "contributes": { "route": { - "name": "grafana.zurag.be", + "label": "grafana", "port": 3000 } }, diff --git a/modules/hello-web/module.json b/modules/hello-web/module.json index cf69223..fb2dfc3 100644 --- a/modules/hello-web/module.json +++ b/modules/hello-web/module.json @@ -10,7 +10,7 @@ ], "contributes": { "route": { - "name": "hello.example", + "label": "hello", "port": 8080 } }, diff --git a/modules/home-assistant/module.json b/modules/home-assistant/module.json index ef0d33e..4f7704e 100644 --- a/modules/home-assistant/module.json +++ b/modules/home-assistant/module.json @@ -83,7 +83,7 @@ ], "contributes": { "route": { - "name": "home-assistant.zurag.be", + "label": "home-assistant", "port": 8123 } }, diff --git a/modules/invoicing/module.json b/modules/invoicing/module.json index e20e981..ea1f11b 100644 --- a/modules/invoicing/module.json +++ b/modules/invoicing/module.json @@ -17,7 +17,7 @@ "bucket": "invoicing" }, "route": { - "name": "invoicing.novox.be", + "label": "invoicing", "port": 80 } }, diff --git a/modules/jackett/module.json b/modules/jackett/module.json index 4adf1ee..d5f681e 100644 --- a/modules/jackett/module.json +++ b/modules/jackett/module.json @@ -81,7 +81,7 @@ ], "contributes": { "route": { - "name": "indexers.zurag.be", + "label": "indexers", "port": 9117 } }, diff --git a/modules/keycloak/module.json b/modules/keycloak/module.json index 94194cb..fb11901 100644 --- a/modules/keycloak/module.json +++ b/modules/keycloak/module.json @@ -10,7 +10,7 @@ "name": "keycloak" }, "route": { - "name": "keycloak.novox.be", + "label": "keycloak", "port": 8080 } }, diff --git a/modules/lidarr/module.json b/modules/lidarr/module.json index 6a0985b..1533966 100644 --- a/modules/lidarr/module.json +++ b/modules/lidarr/module.json @@ -85,7 +85,7 @@ ], "contributes": { "route": { - "name": "lidarr.zurag.be", + "label": "lidarr", "port": 8686 } }, diff --git a/modules/mailu/module.json b/modules/mailu/module.json index be37236..c7fea17 100644 --- a/modules/mailu/module.json +++ b/modules/mailu/module.json @@ -13,7 +13,7 @@ "name": "mailu" }, "route": { - "name": "mail.novox.be", + "label": "mail", "port": 7080 } }, diff --git a/modules/n8n/module.json b/modules/n8n/module.json index 5816a1c..6d6b299 100644 --- a/modules/n8n/module.json +++ b/modules/n8n/module.json @@ -14,7 +14,7 @@ "name": "n8n" }, "route": { - "name": "n8n.zurag.be", + "label": "n8n", "port": 5682 } }, diff --git a/modules/nextcloud/module.json b/modules/nextcloud/module.json index 7560c5b..f924b43 100644 --- a/modules/nextcloud/module.json +++ b/modules/nextcloud/module.json @@ -14,7 +14,7 @@ "bucket": "nextcloud" }, "route": { - "name": "nextcloud.novox.be", + "label": "nextcloud", "port": 80 } }, diff --git a/modules/nodered/module.json b/modules/nodered/module.json index c2e6886..bc3d95e 100644 --- a/modules/nodered/module.json +++ b/modules/nodered/module.json @@ -80,7 +80,7 @@ ], "contributes": { "route": { - "name": "nodered.zurag.be", + "label": "nodered", "port": 1880 } }, diff --git a/modules/ombi/module.json b/modules/ombi/module.json index df07625..97cff4b 100644 --- a/modules/ombi/module.json +++ b/modules/ombi/module.json @@ -88,7 +88,7 @@ ], "contributes": { "route": { - "name": "ombi.zurag.be", + "label": "ombi", "port": 3579 } }, diff --git a/modules/only-office/module.json b/modules/only-office/module.json index ea48980..c94de42 100644 --- a/modules/only-office/module.json +++ b/modules/only-office/module.json @@ -10,7 +10,7 @@ ], "contributes": { "route": { - "name": "office.novox.be", + "label": "office", "port": 9070 } }, diff --git a/modules/photos-eef/module.json b/modules/photos-eef/module.json index 9e21d0a..6bd86e5 100644 --- a/modules/photos-eef/module.json +++ b/modules/photos-eef/module.json @@ -10,7 +10,7 @@ ], "contributes": { "route": { - "name": "eef.novox.be", + "label": "eef", "port": 4012 } }, diff --git a/modules/photos-filip/module.json b/modules/photos-filip/module.json index 44cef84..4e092f3 100644 --- a/modules/photos-filip/module.json +++ b/modules/photos-filip/module.json @@ -10,7 +10,7 @@ ], "contributes": { "route": { - "name": "filip.novox.be", + "label": "filip", "port": 4013 } }, diff --git a/modules/photos/module.json b/modules/photos/module.json index ada3b85..999acdd 100644 --- a/modules/photos/module.json +++ b/modules/photos/module.json @@ -17,7 +17,7 @@ "name": "photos" }, "route": { - "name": "photos.novox.be", + "label": "photos", "port": 4001 } }, diff --git a/modules/public-acme/module.json b/modules/public-acme/module.json new file mode 100644 index 0000000..b4dddbb --- /dev/null +++ b/modules/public-acme/module.json @@ -0,0 +1,18 @@ +{ + "module": "public-acme", + "version": "1", + "provides": [ + { + "name": "acme-ca", + "scope": "mesh" + } + ], + "serves": { + "acme-ca": { + "at": "acme-v02.api.letsencrypt.org", + "port": 443, + "path": "/directory", + "root": "" + } + } +} diff --git a/modules/radarr/module.json b/modules/radarr/module.json index 25ec7d0..db77f89 100644 --- a/modules/radarr/module.json +++ b/modules/radarr/module.json @@ -85,7 +85,7 @@ ], "contributes": { "route": { - "name": "movies.zurag.be", + "label": "movies", "port": 7878 } }, diff --git a/modules/registry/module.json b/modules/registry/module.json index 23945f5..3b7b590 100644 --- a/modules/registry/module.json +++ b/modules/registry/module.json @@ -60,7 +60,7 @@ ], "contributes": { "route": { - "name": "registry-api.novox.be", + "label": "registry-api", "port": 5000 } }, diff --git a/modules/route-proxy/module.json b/modules/route-proxy/module.json index 6bd23e7..95a8a93 100644 --- a/modules/route-proxy/module.json +++ b/modules/route-proxy/module.json @@ -73,7 +73,7 @@ "type": "file", "path": "/var/lib/route-proxy/acme.env", "mode": "0600", - "content": "ACME_DIRECTORY=https://${bound:acme-ca:at}:${bound:acme-ca:port}/acme/acme/directory\n" + "content": "ACME_DIRECTORY=https://${bound:acme-ca:at}:${bound:acme-ca:port}${bound:acme-ca:path}\n" }, { "id": "server", diff --git a/modules/searxng/module.json b/modules/searxng/module.json index dc6f273..881b37b 100644 --- a/modules/searxng/module.json +++ b/modules/searxng/module.json @@ -105,7 +105,7 @@ ], "contributes": { "route": { - "name": "searxng.zurag.be", + "label": "searxng", "port": 8080 } }, diff --git a/modules/sonarr/module.json b/modules/sonarr/module.json index dba36ca..b203111 100644 --- a/modules/sonarr/module.json +++ b/modules/sonarr/module.json @@ -90,7 +90,7 @@ ], "contributes": { "route": { - "name": "series.zurag.be", + "label": "series", "port": 8989 } }, diff --git a/modules/step-ca/module.json b/modules/step-ca/module.json index eb9d516..013e79d 100644 --- a/modules/step-ca/module.json +++ b/modules/step-ca/module.json @@ -11,7 +11,10 @@ } ], "serves": { - "acme-ca": {} + "acme-ca": { + "path": "/acme/acme/directory", + "root": "" + } }, "listens": [ { @@ -23,7 +26,9 @@ ], "own-secrets": { "password": "/var/lib/mesh/step-ca/password", - "root-key": "/var/lib/mesh/step-ca/root-key" + "root-cert": "/var/lib/mesh/step-ca/root-cert", + "root-key": "/var/lib/mesh/step-ca/root-key", + "root-key-password": "/var/lib/mesh/step-ca/root-key-password" }, "resources": [ { @@ -67,11 +72,16 @@ "DOCKER_STEPCA_INIT_NAME": "Mesh Internal CA", "DOCKER_STEPCA_INIT_DNS_NAMES": "localhost,127.0.0.1", "DOCKER_STEPCA_INIT_ACME": "true", - "DOCKER_STEPCA_INIT_REMOTE_MANAGEMENT": "false" + "DOCKER_STEPCA_INIT_REMOTE_MANAGEMENT": "false", + "DOCKER_STEPCA_INIT_ROOT_FILE": "/run/secrets/root_ca.crt", + "DOCKER_STEPCA_INIT_KEY_FILE": "/run/secrets/root_ca_key", + "DOCKER_STEPCA_INIT_KEY_PASSWORD_FILE": "/run/secrets/root_ca_key_password" }, "volumes": [ "/var/lib/step-ca:/home/step", - "/var/lib/mesh/step-ca/root-key:/run/secrets/root-key:ro", + "/var/lib/mesh/step-ca/root-cert:/run/secrets/root_ca.crt:ro", + "/var/lib/mesh/step-ca/root-key:/run/secrets/root_ca_key:ro", + "/var/lib/mesh/step-ca/root-key-password:/run/secrets/root_ca_key_password:ro", "/var/lib/mesh/step-ca/config.json:/run/config/config.json:ro" ] } diff --git a/modules/tautulli/module.json b/modules/tautulli/module.json index 6732451..478ff6f 100644 --- a/modules/tautulli/module.json +++ b/modules/tautulli/module.json @@ -84,7 +84,7 @@ ], "contributes": { "route": { - "name": "tautulli.zurag.be", + "label": "tautulli", "port": 8181 } }, diff --git a/modules/umami/module.json b/modules/umami/module.json index 862f27e..761baa0 100644 --- a/modules/umami/module.json +++ b/modules/umami/module.json @@ -13,7 +13,7 @@ "name": "umami" }, "route": { - "name": "umami.novox.be", + "label": "umami", "port": 3000 } }, diff --git a/modules/verdaccio/module.json b/modules/verdaccio/module.json index 046c3d1..51e52b9 100644 --- a/modules/verdaccio/module.json +++ b/modules/verdaccio/module.json @@ -92,7 +92,7 @@ ], "contributes": { "route": { - "name": "npm.novox.be", + "label": "npm", "port": 4873 } },