mirror of
https://github.com/nestriness/nestri.git
synced 2026-09-19 09:15:19 +03:00
feat(deploy): drop the IaC layer, and make both apps runnable as containers
Moving the issuer's state into Postgres removed the last thing that tied either app to one hosting provider. What was left was a deployment tool describing resources that no longer existed — so this replaces it with `wrangler`, which is what actually deploys a Worker, and adds a second way to run each app that involves no provider at all. Each app now has a `wrangler.jsonc` with an environment per stage, and a `Dockerfile` beside it. The handler is the same one in both cases; what differs is only where its settings come from. Two of them gained a second spelling so that nothing has to branch on the runtime: Postgres arrives as a pooled binding or as `DATABASE_URL`, and the route to the issuer is a service binding or `AUTH_INTERNAL_URL`. That last one is new, and it is a split the binding was already making without saying so. `AUTH_ISSUER_URL` has to be the issuer's public name, because it is compared literally against every token's `iss` claim — but the public name is often not routable from inside a deployment. So the name and the route are two settings now rather than one that cannot be both. DNS moves out of code and into `docs/dns.md`, which lists every hostname and what it is for. Six records that change roughly never did not need a tool, and the table outlives whatever is answering the names — which is the point, since some of them will stop being Workers. The sandbox hostnames are hyphenated rather than nested for the same reason: a certificate covering `*.nestri.io` covers one label and not two, so `api-sandbox.nestri.io` can become an ordinary origin later without a certificate having to be ordered for it first. Also drops `EMAIL_DEV_LOG` from committed configuration into `.dev.vars`, which `wrangler deploy` cannot upload. Printing a live sign-in code to a log should not be one forgotten override away from production.
This commit is contained in:
25
.env.example
25
.env.example
@@ -1,9 +1,24 @@
|
||||
STEAM_API_KEY=
|
||||
DATABASE_PASSWORD=
|
||||
DATABASE_HOST=
|
||||
# Local development database (docker compose up postgres)
|
||||
DATABASE_URL=postgres://postgres:postgres@localhost:5432/nestri
|
||||
|
||||
# Isolated database for tests. Required by DB-backed tests; unset tests fail.
|
||||
TEST_DATABASE_URL=
|
||||
|
||||
# Local development database (docker-compose)
|
||||
DATABASE_URL=
|
||||
# The issuer's public URL — the address a token's `iss` claim will carry.
|
||||
AUTH_ISSUER_URL=http://localhost:1337
|
||||
# Where to reach the issuer, if that is not where it lives. Unset unless the
|
||||
# public name is unroutable from where the API runs; docker compose sets it.
|
||||
AUTH_INTERNAL_URL=
|
||||
|
||||
# Linking a Steam account
|
||||
STEAM_API_KEY=
|
||||
|
||||
# Operator access to the API
|
||||
ADMIN_SHARED_SECRET=
|
||||
|
||||
# Mail delivery. All three together, or none of them plus EMAIL_DEV_LOG=true,
|
||||
# which prints sign-in codes to the log instead of sending them.
|
||||
EMAIL_SEND_URL=
|
||||
EMAIL_API_KEY=
|
||||
EMAIL_FROM=
|
||||
EMAIL_DEV_LOG=
|
||||
|
||||
Reference in New Issue
Block a user