📚 Encyclopedia

Servers & Hosting · updated 2026-10-30

jhampton.io: one home domain, an index, and a wildcard certificate

jhampton.iosubdomainswildcard-dnswildcard-certificatecertbotdns-01linodenginxredirectsindex

By late October 2026 Justin had about 45 URLs across 8 domains, plus apps living at paths on unrelated sites (jhampton.io/cal, justinahampton.com/encyclopedia, tldrcom.com/spectre). Finding anything meant remembering where it had happened to land. The fix was two things that support each other: a naming convention so most URLs can be guessed, and an index generated from a registry so the rest can be found.

The convention

Moved on 2026-10-30: jhampton.io/cal → cal.jhampton.io, justinahampton.com/encyclopedia → wiki.jhampton.io, 3d.justinahampton.com → 3d.jhampton.io, videos.justinahampton.com → videos.jhampton.io (videos.jhampton.io (private video site architecture)), tldrcom.com/spectre → spectre.jhampton.io, and justinahampton.com/fun/experiments/umlol → umlol.jhampton.io.

The index

https://jhampton.io/ is generated from one registry file, ~/dev/hub/sites.json (name, URL, description, tags, repo, deploy command, server path, data folder, planned move, public or private). Type to filter; Enter opens the top match. Public entries show to everyone. A passcode (bcrypt hash plus an HMAC-signed 30-day cookie, with a per-IP throttle) unlocks the private entries and every entry's ops details. A cron job on the server requests every URL every 10 minutes and shows a green or red dot; any HTTP answer below 500 counts as up, because an API root's 404 or a login page's 401 still means the site is serving.

The registry only stays true if updating it is part of shipping, so the rule is: anything that goes live or moves gets its sites.json entry in the same change.

Wildcard DNS needs a catch-all first

A * A/AAAA record makes every name under the domain resolve to the server. nginx then picks a server block by name, and for a name it doesn't know it falls back to the first block loaded, certificate and all. On this server that was 3d.justinahampton.com, so every typo'd subdomain showed the 3D site behind a certificate warning. Add a catch-all before (or right after) the record:

server { listen 80 default_server;  listen [::]:80 default_server;  server_name _; return 444; }
server { listen 443 ssl default_server; listen [::]:443 ssl default_server; server_name _; ssl_reject_handshake on; }

ssl_reject_handshake (nginx 1.19.4+) refuses the TLS handshake, so no certificate is shown at all. Exact server_names always win over a *.domain block, which always wins over the default, so a *.jhampton.io block can send unknown names to the index without touching named sites.

The wildcard certificate (DNS-01 on Linode)

Let's Encrypt only issues wildcards over DNS-01, which means certbot must write TXT records itself. With DNS on Linode: install python3-certbot-dns-linode (EPEL), create a Personal Access Token with Domains: Read/Write only (Linode can't limit it to one domain) and no expiry (renewal needs it), store it root-only, then:

certbot certonly --dns-linode --dns-linode-credentials /root/.secrets/certbot-linode.ini \
  --dns-linode-propagation-seconds 180 --cert-name wildcard.jhampton.io -d '*.jhampton.io' -d jhampton.io

certonly with a DNS plugin does not reload nginx on renewal; add a deploy hook (/etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh) or the renewed certificate is never served. Confirm with certbot renew --cert-name … --dry-run. A new <name>.jhampton.io site then needs no certbot run: its nginx block points at /etc/letsencrypt/live/wildcard.jhampton.io/.

Moving a host without breaking it

Linked from

Sources: hub memory (hub-index), justinahampton memory (moved-to-jhampton-io), umlol memory (umlol-hosting), global CLAUDE.md "Where things go, 2026-10-30