Regress needs to live at podsteadr.atobitcoin.io/regress/ since / is already podsteadr. Two coordinated pieces: - VITE_BASE build arg (frontend asset/script paths, %BASE_URL% in index.html for the nostr-provider.js script tag) - ROUTE_PREFIX runtime env (backend routes registered under the prefix via Fastify's plugin-encapsulation, including /api/health) The nginx location must forward the prefix unstripped (proxy_pass with no trailing path) — NIP-98 login signs the exact URL it calls, so a stripped prefix makes the backend reconstruct a different URL than what was signed and every login fails. Caught this with a real nginx+docker integration test locally before it could break the live migration, then fixed a matching bug in auth.ts (it was signing the unprefixed URL while api.ts fetched the prefixed one). New routePrefix.test.ts proves the prefix is actually enforced, including a negative case. 40 tests passing. Also fixes a latent bug: import.meta.env usage had no vite/client type reference, so it only ever passed typecheck by accident in earlier local runs — added the standard vite-env.d.ts.
24 lines
1.0 KiB
HTML
24 lines
1.0 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Regress</title>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Share+Tech+Mono&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
<!-- No-op outside an Archipelago iframe (see nostr-provider.js's own
|
|
window === window.top guard) — safe to always include. Provides
|
|
window.nostr + auto sign-in via the node's selected nostr identity
|
|
when opened inside the Archipelago shell. -->
|
|
<script src="%BASE_URL%nostr-provider.js" data-session-url="%BASE_URL%api/auth/login" data-session-mode="cookie" data-me-url="%BASE_URL%api/auth/me" data-health-url="%BASE_URL%api/health"></script>
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
<script type="module" src="/src/main.ts"></script>
|
|
</body>
|
|
</html>
|