How it fits together
A few words come up on every page of the console. Here's what they mean and how the pieces talk to each other.
The console
The console is a Next.js app with a SQLite database, running on the deployer VM behind Caddy. It keeps the list of servers, projects and services, the settings, people and the access log. Secrets it has to keep (app secret settings, registry tokens, bucket keys, SMTP password, two-step sign-in secrets) are encrypted with AES-256-GCM under DEPLOYER_SECRET_KEY.
It doesn't run your apps. Every change becomes an operation that it carries out on a server over SSH.
Servers
A server is any Ubuntu VM that has been prepared with agent/setup-clubs-vm.sh. That script installs Docker, Caddy and clubctl, and creates a deployer user whose SSH key may only run clubctl. The console saves each server's host key when you add it and refuses to talk to a server that presents a different one.
Each server has a memory figure and a limit on how many services it holds, so new services only go where they fit. See Servers.
clubctl
clubctl is a Bash tool on each server that does the real work, with a fixed list of commands: create, configure, deploy, pause, resume, back up, restore, remove, status and logs, plus database commands (create, stats, credentials, rotate, read-only, upgrade). Each service is a Docker Compose project in its own folder under AGENT_ROOT, with containers named <namespace>-<service>.
Caddy on the same server serves every web address over HTTPS and asks Let's Encrypt for a certificate per address.
Projects
Projects is the console's home page: you land there after signing in, and /admin opens it. The flat list of every service is Services (/admin/services), just below it in the side menu.
A project groups the services that make up one product: for example a web app, a worker and a database. Every project runs on one server and has its own Docker network, where each service is reachable by its name (shop-db:5432). Services in one project can't reach services in another.
Inside a project, the console draws the services as a diagram in three rows:
- On the web: apps with a web address.
- Inside the project: services with no address, such as a worker or Redis. Only the project's other services reach them.
- Data: the project's PostgreSQL databases and S3 storage.
A line runs from each app to the databases and storage it uses. Click a service to see its status, addresses, image or version, size, memory and links beside the diagram; Open service goes to its own page. On a phone the diagram becomes a list. The Projects list shows a small map of each project, its health and, with the AWS plugin, a monthly estimate; Needs attention filters to projects with a failed or stopped service or a nearly full database.
Services
A service is one running thing in a project. The core has four kinds:
| Kind | Comes from | Page |
|---|---|---|
| App from GitHub | A repo and branch with a Dockerfile, built on GitHub Actions | Apps from GitHub |
| Docker image | A ready-made image from any registry | Docker images |
| PostgreSQL | The official postgres image, managed for you | PostgreSQL |
| S3 storage | MinIO with buckets, managed for you | S3 storage |
Plugins can add their own kinds (Plugins).
Every service has a page with its status, Logs (latest lines or Live, with secrets masked), History (every change with its output and who made it), Pause/Resume and Settings.
Operations
Creating, deploying, configuring, pausing, backing up and removing are queued as operations. One operation runs at a time across all servers, so two changes never fight over the same service. App builds run on GitHub, outside that queue, and only the deploy that follows is queued.
Each operation's output is kept in the service's History, and Activity → Changes lists every operation with who started it.
What lives where
| Thing | Where it lives |
|---|---|
| Services, settings, people, access log | Console's SQLite database, /opt/deployer/data |
| App secret settings, tokens, bucket keys | Console database, encrypted |
| Database passwords | Only on the services VM. Shown in the console on request, and every reveal is logged. |
| Containers, volumes, certificates | Services VM, under AGENT_ROOT |
| App images | Your registry (ghcr.io for GitHub builds) |
| Backups | Your S3 bucket, encrypted with the backup key |