# One public surface, gated only by hAPI's own auth; no tunnel to home Persons must reach hAPI from anywhere without a VPN. The home network sits behind ISP CGNAT with a changing IP, so the cluster can never open a connection into the home, and the home IP can't be allowlisted. A CGNAT address is shared with other customers, so allowlisting it would also let them in. We therefore expose **one public surface**, the hAPI API over HTTPS on `:443`, used by Persons and Bots alike, with **hAPI's own authentication as the only gate**. Bots get no separate network path: no VPN, no separate port, no client certificates. Writing a cron job then takes nothing more than `curl` with a token. We chose this over a tunnel for Bots (Tailscale or WireGuard, with a client on every Bot) and over a client-cert-gated Bot port. Both were workable but added setup to every Bot. Client certs stay available as later hardening. ## Considered Options - **A tunnel for every Bot (Tailscale + k8s operator, or plain WireGuard).** Works behind CGNAT because home dials out. Rejected: every Bot needs a client, and the Tailscale operator can't be used with Tailnet Lock, which leaves Tailscale's control plane trusted. - **Client-cert-gated Bot endpoints.** Gateway API enforces client certs per port, not per hostname, so this needs its own port. Home Assistant can present a client cert only over MQTT. Rejected as v1 friction. - **An identity-aware proxy or CDN in front (e.g. Cloudflare).** Rejected: we want no third party in the public request path, meaning no browser challenge pages and no outage when a vendor has one. ## Consequences - **Traffic between the cluster and home only ever starts from home.** hAPI never calls into the house. The job bridge to Home Assistant must be one that HA connects out to (pulls or holds open). - **Every public endpoint is TLS-only and requires per-Principal auth.** No anonymous endpoints, including health: Uptime Kuma is a Bot with a health-only scope. `:80` is closed, so certificates use ACME DNS-01. A broker, if the bridge needs one, may be public under the same rule. - **Bot credentials carry the security a network gate would have.** Each is per-Bot, scoped, individually revocable, and stored hashed. A long-lived JWT that can't be revoked is not acceptable as a Bot credential. - **Owner administration has no HTTP route.** Creating Principals, issuing and revoking credentials, and Household grants are done through an admin CLI inside the hAPI pod, reached only through cluster management access. Persons' own actions, including granting Bindings, stay on the public API. - **Cluster and node management APIs (Kubernetes, Talos) are never public.** They're reachable only over a management-only Tailscale tailnet (node extension plus the Owner's devices) with Tailnet Lock on. This tailnet is not in the public request path, so a Tailscale outage never takes hAPI down. Break-glass: the Linode LISH console, or a temporary firewall rule for the Owner's current IP. - **Never public:** the database, metrics, detailed health, and any internal service.