Demo mode
./bin/form-gateway -demoDemo mode makes a fresh instance playable in a single step: mail output, tenants, and site keys are available immediately, without having to set anything up in the admin UI. Meant for trying things out, for demos, and for local development — not for production use.
Everything the mode creates is ordinary configuration: after startup, the routes and tenants can be viewed and changed in the admin UI just like any other.
What happens at startup
Section titled “What happens at startup”An embedded SMTP sink listens on 127.0.0.1:2525 (if the port is
taken, it automatically picks another). It accepts every mail but
forwards nothing — instead it saves it as an .eml file under
<data-directory>/demo-mails/. Nothing leaves the machine.
Two SMTP routes point to this sink, so both delivery paths can be tried out:
| Route | Role |
|---|---|
| Demo-Postfach (geteilte Default-Route) | serves all tenants without a dedicated route |
| Demo-Firmenserver (eigene Route) | permanently assigned to one tenant |
Two tenants, deliberately different from each other:
| Tenant | Origins | Route | PoW bits | Quota |
|---|---|---|---|---|
| Astro-Demo | http://localhost:4321, http://localhost:4322 | shared default route | 8 | 500/day |
| Demo-Firmenseite | https://www.firma.example | dedicated route | 12 | 100/day |
The second origin set isn’t arbitrary: it demonstrates tenant
isolation. A form on localhost:4321 cannot submit using the
Demo-Firmenseite site key — the origin doesn’t match.
Output at startup
Section titled “Output at startup”The console output shows the sink port, the storage directory, and the
site keys for both tenants — plus the two lines that go straight
into the Astro-Demo’s .env:
PUBLIC_GATEWAY_URL=http://localhost:8080PUBLIC_SITE_KEY=site_…The output appears on every startup of demo mode, not just the first — so the site keys aren’t lost if the terminal gets closed.
Take it for a spin
Section titled “Take it for a spin”- Start
./bin/form-gateway -demoand copy the output. - Write the two lines into
examples/astro-demo/.env, then start the Astro-Demo. - Submit a form.
- Seconds later, the
.emlfile appears in<data-directory>/demo-mails/— open it with any mail client or a text editor.
It’s also worth checking the admin UI at the same time: under the Astro-Demo tenant, the submission shows up with its status and history.
The runnable Astro site with forms covering every field type lives in
the repository under
examples/astro-demo.
Restarting
Section titled “Restarting”Seeding is idempotent: a second startup doesn’t create anything twice and doesn’t overwrite any changes made in the admin UI. It just prints the site keys again.
Why this isn’t for production
Section titled “Why this isn’t for production”Demo mode is deliberately simplistic so you can get moving quickly:
- The demo routes speak unencrypted SMTP (
plain) to the local sink. - The sink delivers nothing — it just writes files.
- The demo tenants use made-up recipient addresses (
…@demo.local,…@firma.local) and low protection thresholds.
For real-world use, create your own route with TLS and your own tenant
(see Operation) and start
the gateway without -demo. The demo objects can then be deleted in
the admin UI.