Skip to main content

Requirements and architecture

You can run tmspec for your team on your own Docker server, behind your own reverse proxy. This part is for operators; end users do not need to read it.

What you need to prepare​

ItemNote
A Linux server running Docker and Docker ComposeOne machine is enough; two releases run side by side on it during an upgrade (Upgrade)
A domain, and three DNS names pointing at the reverse proxyOne for the web, one for the API (the CLI uses it), one for the sign-in service. The sign-in service cannot live under a path, so it needs its own name
A reverse proxy with TLSCaddy, nginx or Traefik. The release has tested examples for all three; Caddy is the path supported for automatic switching
A TLS certificate that browsers, the CLI and the containers all trustLet's Encrypt through the proxy is the simple way. A company's private CA works too (Install)
systemd, gpgFor the daily backup schedule and the encrypted off-machine copy (Backup and restore)
(Optional) a key from an LLM providerOnly when you turn on the AI service

The release ships no reverse proxy; TLS and routing are done by your proxy. How much memory, CPU and disk you need depends on the number of users; there are no official figures yet, so start with a modest machine and watch it.

Components​

An installation has two parts, each a group of containers:

reverse proxy (TLS, three DNS names)
↓ ↓
the running color the other color (used during an upgrade)
web · API (specd) · sign-in (auth) · worker · AI (optional)
↓
shared infrastructure: Postgres · Valkey · signing key · autoheal
  • Infrastructure runs once and lives through upgrades: the Postgres database (holding specs, accounts and AI data), Valkey (counts the sign-in service's rate limits), the token signing key and autoheal (restarts a hung container). The data sits in this part's volumes.
  • A release is a set of services that run together, called a color (blue or green): web, API, the sign-in service, the background worker, and the AI service if turned on. During an upgrade, the new release starts in the empty color next to the running one, then the proxy switches to it; people using it are not signed out.

All services of a release share one version number (for example 0.2.0); no service has its own number.

Three DNS names​

Suppose your domain is acme.example:

VariableExampleServes
TMSPEC_WEB_HOSTtmspec.acme.exampleThe web app, where users open
TMSPEC_API_HOSTapi.tmspec.acme.exampleThe API, called by the CLI and integrations
TMSPEC_AUTH_HOSTauth.tmspec.acme.exampleThe sign-in page and token issuing

The sign-in service's name is the issuer of every token. Changing it later invalidates every identity already created, so choose the final name from the start (see Backup and restore when moving machines).

What the proxy must do​

  1. Terminate TLS for all three names, and redirect http to https.
  2. Keep the Host header as it is and set X-Forwarded-Proto: https.
  3. Set X-Forwarded-For to the client's real address and drop the value the client sent. The sign-in service counts failed sign-ins per address, and trusts this header only from the addresses in TMSPEC_TRUSTED_PROXIES.
  4. Do not buffer responses: pages that load progressively and server-sent events must arrive on time. Keep the read timeout at a few minutes.
  5. Accept bodies of at least 1 MiB.
  6. Answer the containers too: web, API and AI call https://<sign-in name> themselves, so the proxy must listen on an address the containers can reach and the machine's firewall must let the Docker network in.

The release has a guide with example configurations and a way to check from the server.

Next step​

Install and the first owner.