Files
qapi/asset/nginx/qapi.internal.conf
rob thijssen 99483d90ca feat: rename to the qapi console, and deploy it to oolon
The console is now **qapi console**, served at https://qapi.blackbeard.observer.
The papi logo and the upstream licence stay: this is a fork of
polkadot-api/papi-console, not a rewrite, and the sidebar link points at our
fork rather than theirs.

Deployment follows architecture/deployment-gitea-actions.md — the workflow is
the source of infra truth, and one-time host provisioning is an operator script:

  script/infra-setup.sh   dns  -> the Cloudflare CNAME to bl.thgttg.com
                          cert -> Let's Encrypt, DNS-01, ECDSA
                          edge -> gitea_ci, scoped sudoers, webroot, vhosts

  .gitea/workflows/deploy.yaml   build (pnpm) -> rsync the bundle -> reload

The roles run in that order because certbot uses a DNS-01 challenge and nginx
fails its config test on a missing ssl_certificate — which would block every
reload on a SHARED proxy, not just this vhost. The same reasoning bounds what CI
may do: the sudoers drop-in grants rsync into one webroot, restorecon on it,
a config test and a reload. No certbot, no /etc/letsencrypt, no sites-available
write, no useradd.

Two vhosts, per architecture/reverse-proxies.md: the public one on the https
tier at 127.0.0.1:14443 behind the stream SNI router that owns TCP 443 (binding
443 directly is undetectable by `nginx -t` and ends with nginx silently serving
stale certificates), and a qapi.internal one for mesh clients, which stays
disabled until someone mints its internal certificate.

There is no application host and no upstream: the console is a static SPA that
opens WebSockets straight from the browser to the chains' own RPC endpoints.

The build gate is `pnpm build` (tsc -b + vite build) plus a check that the
signers-common patch is applied to the copy node actually resolves. Without that
patch every signing attempt dies with `Unkown signer` in a browser, after
deploy, in front of a user — and a lockfile drift is all it would take.

`pnpm lint` is deliberately not in the gate: it is broken upstream and was
before this fork touched anything (typescript-eslint 8.69 refuses to load
against the TypeScript 7.0 this repo resolves).

Live and verified: the public name answers 200 with this console's title over
the WAN address, serving the Let's Encrypt certificate for it, and the whole
deploy path — rsync as gitea_ci through the scoped sudoers, restorecon, config
test, reload, fetch — has been run by hand end to end.

Refs #3

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012uDUodEcRbBwNRi3UCmw8f
2026-09-16 08:42:06 +03:00

46 lines
1.6 KiB
Plaintext

# Mesh vhost for the qapi console, on the oolon edge proxy.
#
# This exists because a public name does not hairpin. From inside the mesh,
# qapi.blackbeard.observer resolves via public DNS to the site's WAN address, so
# the packet arrives on the OPNsense LAN interface — which forwards :443 inbound
# from the WAN only. The connection dead-ends (architecture/reverse-proxies.md §2).
# Operators testing the console from a workstation need this name, not the public
# one.
#
# Cert: the internal `lair` CA, 24-hour lifetime, renewed by step@qapi.timer
# (architecture/internal-tls.md). infra-setup.sh skips enabling this vhost
# entirely when the certificate is absent — nginx -t fails on a missing
# ssl_certificate and that would block every reload on this shared proxy, not
# just ours.
server {
listen 127.0.0.1:14443 ssl proxy_protocol;
http2 on;
server_name qapi.internal;
ssl_certificate /etc/nginx/tls/cert/qapi.internal.pem;
ssl_certificate_key /etc/nginx/tls/key/qapi.internal.pem;
ssl_trusted_certificate /etc/pki/ca-trust/source/anchors/root-internal.pem;
# Mesh-only, so the audience is a controlled fleet and 1.3 is safe to pin.
ssl_protocols TLSv1.3;
absolute_redirect off;
# One webroot, two vhosts. The deploy ships the bundle once.
root /var/www/qapi.blackbeard.observer;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
location = /index.html {
add_header Cache-Control "no-cache";
}
}