From a022a136fed3eea2d0753a75cced13f8e26eaad9 Mon Sep 17 00:00:00 2001 From: Paul Payne Date: Tue, 30 Jun 2026 19:55:17 -0700 Subject: [PATCH] Retire gateway.tls=internal; host routes use a bare subdomain label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit acme mode fully replaced the internal-CA path (which required installing a private CA on every device — the exact pain, esp. on Android, that acme avoids). Remove `internal` entirely and simplify how services declare host routes. - Generator (caddyfile.py): drop the `tls internal` branch — modes are now `off` | `acme`. In acme mode the published subdomain is the **first DNS label** of `proxy.caddy.host` (a bare `claw`, or a legacy `claw.civil.lan`, both → `claw.`), so services stay domain-agnostic and the declared value is authoritative again (no more silent service-name override). Shared `_host_matcher_block` reused by off-mode and the acme wildcard site. - castle-api: delete `GET /gateway/ca.crt`, `_gateway_ca_pem`, `_ca_fingerprint` and the now-unused imports; drop `ca_fingerprint` from `GatewayInfo` (keep `tls`). - Dashboard: remove the CA-cert download button + unused imports; drop `ca_fingerprint` from the `GatewayInfo` type. - Tests: replace TestCaddyfileTlsInternal with an off-mode class (keeps the runner-agnostic host-route coverage); acme tests assert first-label derivation incl. label-wins-over-service-name; drop the castle-api CA-endpoint test. - Docs: registry.md + dns-and-tls.md — two-mode tables (off|acme), remove the internal sections/CA-download, document the bare-label host convention; note a domain-less node stays on `off`. --- app/src/components/GatewayPanel.tsx | 17 +--- app/src/types/index.ts | 3 +- castle-api/src/castle_api/models.py | 6 +- castle-api/src/castle_api/routes.py | 77 +----------------- castle-api/tests/test_health.py | 8 +- core/src/castle_core/generators/caddyfile.py | 34 +++----- core/tests/test_caddyfile.py | 70 ++++++++--------- docs/dns-and-tls.md | 72 ++++++++--------- docs/registry.md | 83 +++++++------------- 9 files changed, 113 insertions(+), 257 deletions(-) diff --git a/app/src/components/GatewayPanel.tsx b/app/src/components/GatewayPanel.tsx index 1f2a5bc..5cec834 100644 --- a/app/src/components/GatewayPanel.tsx +++ b/app/src/components/GatewayPanel.tsx @@ -1,9 +1,8 @@ import { useMemo, useState } from "react" import { Link } from "react-router-dom" -import { Globe, RefreshCw, FileText, ShieldCheck } from "lucide-react" +import { Globe, RefreshCw, FileText } from "lucide-react" import type { GatewayInfo, HealthStatus } from "@/types" import { useGatewayReload, useCaddyfile } from "@/services/api/hooks" -import { apiClient } from "@/services/api/client" import { HealthBadge } from "./HealthBadge" interface GatewayPanelProps { @@ -34,20 +33,6 @@ export function GatewayPanel({ gateway, statuses }: GatewayPanelProps) {
- {gateway.tls === "internal" && ( - - - CA cert - - )}