Files
archy/apps/qortal/ui/nginx.conf
ssmithxandClaude Opus 5.5 9fa58ef6a8 qortal: companion status UI, pasta network, spike-measured sizing
Companion UI: nginx inside the qortal image serves apps/qortal/ui on
12390 (gated, now interfaces.main): sync height vs best peer, chain/QDN
peers, version/uptime, Hub connection URL and a gateway launcher. Its
/core/ proxy is a GET-only allowlist of four public Core endpoints and
never carries the API key. start.sh supervises Core + nginx and exits
when either dies; SIGTERM reaches Core (clean shutdown in ~7s).

Spike findings on archy-x250-pa3:
- network: pasta. On a rootless bridge every forwarded connection
  appears to come from the container's own IP, so inbound p2p peers
  would all look identical; Core needs no other app.
- API whitelist off + apiRestricted pinned true (start.sh refuses
  otherwise). Forwarded connections arrive from a dynamic address no
  static whitelist can name; the key guards every state-changing route.
- Bootstrap + sync: 6.8 GB, ~17 min. QDN capped at 20 GiB via
  maxStorageCapacity; storage 40Gi.

API key reveal deliberately left out: the UI cannot verify the
dashboard session from a container, and the gate may be switched to
open at runtime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 01:08:13 +00:00

48 lines
1.5 KiB
Nginx Configuration File

# Companion status UI, served from inside the qortal container.
#
# Runs as the image's uid 1000 on a read-only root: every writable path is
# under the /tmp tmpfs. Published on 127.0.0.1:12390 only; the app gate
# fronts and authenticates it (manifest: auth: gated).
worker_processes 1;
pid /tmp/nginx/nginx.pid;
error_log stderr warn;
events { worker_connections 64; }
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
server_tokens off;
client_body_temp_path /tmp/nginx/body;
proxy_temp_path /tmp/nginx/proxy;
fastcgi_temp_path /tmp/nginx/fastcgi;
uwsgi_temp_path /tmp/nginx/uwsgi;
scgi_temp_path /tmp/nginx/scgi;
server {
listen 12390;
listen [::]:12390;
root /usr/share/qortal-ui;
# Read-only window onto Core's public API, limited to exactly what the
# page renders. Nothing here carries the API key, so even a wider
# list could not reach a key-guarded route.
location ~ ^/core/(admin/status|admin/info|peers|blocks/height)$ {
limit_except GET { deny all; }
proxy_pass http://127.0.0.1:12391/$1;
proxy_set_header X-API-KEY "";
proxy_connect_timeout 3s;
proxy_read_timeout 15s;
add_header Cache-Control "no-store" always;
}
location /core/ { return 404; }
location / {
add_header Cache-Control "no-cache";
try_files $uri /index.html;
}
}
}