No description
  • Python 96.6%
  • Jinja 2.6%
  • Shell 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-16 22:41:51 -08:00
examples docs: rewrite the README around the four verbs and add the Garage chapter 2026-11-09 18:54:24 -08:00
server boot: a garage node needs all three ports, not any one 2026-11-11 15:19:08 -08:00
ssc cluster: publish the registry snapshot the page draws 2026-11-16 22:41:41 -08:00
templates cluster: publish the registry snapshot the page draws 2026-11-16 22:41:41 -08:00
tests cluster: publish the registry snapshot the page draws 2026-11-16 22:41:41 -08:00
.gitignore homepage: the shared page, its renderer, and a local preview 2026-11-05 17:42:40 -08:00
pyproject.toml implement registry, render, dns modules (M2 wave 1) 2026-10-22 10:03:32 -07:00
README.md docs: the cluster page, its snapshot, and how it is registered 2026-11-16 22:41:43 -08:00

Dust Deploy — the ssc command

ssc keeps a small fleet of servers doing what you told it to: serving websites and running containerized apps. You describe what should exist — which machines, which websites, which apps — in one small git repository, and ssc sync makes the machines match that description.

It runs on the gateway, the one machine that receives traffic and forwards it to the right server. The machines behind it are content servers: they hold the files and run the containers.

  • The tool is this repository (dust-deploy): the Python CLI, Jinja2 templates, static server files, and sanitized examples.
  • The state is a separate git repository (ssc-data, default /opt/ssc-data): servers, sites, apps, secrets, deploy keys. ssc writes it; you normally change it through ssc, not by hand.

That split keeps the tool open-source-able and lets several gateways run the same tool against their own state.

New here? Start with Quick start. It gets one website live without the details. The rest of the file is in chapters: the idea, then one chapter per kind of thing you manage, then a reference you can search.

Contents

  1. Quick start
  2. How it works
  3. The gateway
  4. Servers
  5. Websites
  6. Apps
  7. Server homepages
  8. The cluster page
  9. Running the cluster
  10. Troubleshooting

Reference:


1. Quick start

What you need

  • A gateway you can log into as root: a small VPS with a public IP and Caddy ≥ 2.4 installed.
  • One or more content machines, already on the private network between your machines (the "tailnet"), each with a user called ssc that can run Docker. Preparing a machine to that point (OS, Docker, tailnet membership) is outside ssc; this document assumes it.
  • A domain (or subdomain) whose DNS you can edit.
  • A git repository per website or app. For a website, the repository is served as-is, so it must contain the finished files, including an index.html at the top level.

Step 1 — Install on the gateway

git clone <this-repo-url> /opt/dust-deploy
cd /opt/dust-deploy
python3 -m venv .venv
.venv/bin/pip install -e .
ln -s /opt/dust-deploy/.venv/bin/ssc /usr/local/bin/ssc

Run these as root (the next step writes /etc). The editable install (-e) is required: the templates and server files live beside the code, not inside the installed package. The symlink makes ssc available before ssc init runs; if you skip it, call .venv/bin/ssc directly.

Step 2 — Set the gateway up

ssc init

Answer the questions:

Question What to type
Gateway public IP the VPS's public IPv4 address
State directory Enter, for /opt/ssc-data
Remote Git URL for the state repo Enter to skip, or the URL of an empty repo to keep a copy
Git URL of the server-homepages repo Enter to skip unless you want per-machine homepages

That creates the state repository, writes the gateway's config, and points the web server at it.

Step 3 — Add a machine

ssc server add

Give it a short name (potato) and the machine's private address on the tailnet. It will ask for the ssc user's password once; after that it uses a key. When it finishes, the web server on that machine is already running — there is no separate "start it" step.

Step 4 — Put a website on it

ssc site new

Answer: the domain (example.com), an owner name (optional — just for the records), the git repository URL, and which server number should serve it. Then create the DNS record it prints (A @ → <gateway IP>) at your registrar, press Enter, and wait for the check to pass.

If the repository is private, ssc prints a deploy key before continuing: add it to that repository in Forgejo, then press Enter.

Step 5 — Check it

ssc site list
ssc server status
curl -I https://example.com

Then open the domain in a browser. When things are well, ssc server status shows ssh ok and nginx running, and the page is the one you pushed.

Step 6 — Keep it current

ssc sync

That is the command to remember. It applies the saved description to every machine and is safe to run twice: the second run does nothing.

If something looks wrong

  • ssc server status — is the machine reachable, is its web server running?
  • ssc sync --dry-run — what does ssc think is out of date?
  • Read the name: error line under the table, fix that, and run the same command again.
  • More in Troubleshooting.

2. How it works

SSC Sync

You keep a description, ssc makes the machines match it.

   you                 state repo                 machines
 ssc site new  ──▶  sites/example.com.yaml  ──▶  gateway (Caddy) ──▶ content server (nginx)
 ssc app new   ──▶  apps/ladle.yaml          ──▶  gateway (Caddy) ──▶ container
 ssc sync      ──▶  everything, again        ──▶  everything that is behind

Nothing on a machine is edited by hand. You change the description (usually through ssc) and run ssc sync; that is the whole loop. A command that registers or edits something saves the change and then applies it straight away, so ssc sync is mostly for catching up — new commits, a machine that was asleep, a file that drifted.

Glossary

Word Means
gateway The always-on machine visitors reach. Runs Caddy, which gets certificates and forwards each domain to a content server.
server, machine, node A content machine holding files and containers. Runs nginx in Docker.
site, website A git repository served as static files by nginx. ssc site …
app A program that keeps running in a Docker container, defined by the app's own docker-compose.yml. ssc app …
storage node, Garage A content machine that also runs Garage, object storage the cluster can use. Off unless the entry carries a garage: role. ssc garage …
registry, state repo The git repository describing servers, sites, and apps. Default /opt/ssc-data.
sync, converge Make a machine match the description. Never installs anything twice.
tailnet IP A machine's private address inside the cluster (100.x.y.z). Not its public address.
deploy key A per-site or per-app SSH key that lets one machine read one private repository.
alias A second hostname that redirects to a site's canonical domain (www.example.com).

A website is a site in command names; website and site mean the same thing here.

What one ssc sync does

In order:

  1. The content servers — the ones the registry says should serve something. Clones or updates each checkout, writes nginx/sites.conf, writes the footer fragment, reloads nginx. A machine hosting the cluster page also gets the registry snapshot beside it, on a byte diff. Servers work in parallel; a machine the tailnet reports as off is skipped rather than waiting for a timeout.
  2. Enabled apps — build, start, wait for the app's health path, record the deployed commit.
  3. The gateway — renders the whole static-site and app routing from the registry, validates it, installs it, reloads Caddy. Rendering is never scoped: a partial sync must not leave a partial configuration live.
  4. Disabled apps — stopped only after the gateway has stopped routing to them.

Storage is deliberately not a sync step. A machine with a garage: role converges only from ssc garage converge, ssc server config, and ssc server provision — storage must not move because a website deploy ran.

One failed server or app does not stop the rest. Its row is marked failed with the reason under the table, and the other machines still converge. A failed app keeps its previously live gateway block for the rest of that run, so a bad edit does not take a working app offline.

Rules that make it safe

  • Validate before write. Every change is checked against the whole registry first. If the input is invalid, nothing is written, committed, or deployed.
  • One transaction per edit. A command saves once, commits that to the state repo, and then applies only what changed. A no-op edit writes and commits nothing.
  • Unknown fields are refused. A misspelled key in the YAML fails the load with a suggestion (unknown field 'enable' — did you mean 'enabled'?) instead of being silently ignored.
  • Idempotent. A second ssc sync straight after a successful one does no work.
  • Safe to resume. site delete, app delete, and a failed site new/app new leave the registry entry in place so the same command can be run again to finish.
  • --dry-run explains, never touches. It reads state and prints what it would do; it does not upload or build anything.
  • Git failures are warnings. A state-repo commit or push that fails is reported but does not abort a deploy.
  • stdout is for results, stderr for progress. The results table is the only thing on stdout, so ssc sync | tail -1 still works; steps stream to stderr as - <step> lines.

What ssc does not do

  • It does not install the OS, the ssc user, Docker, or tailnet membership on a content machine.
  • It does not build a website. Commit the built files; nginx serves the repository root.
  • It does not run an app on more than one server. One app, one machine, today.
  • It does not copy app data when you move an app; it prints the command for you to do it.
  • It does not manage shared services (Forgejo, Etherpad, …). Those are hand-written Caddy snippets in the state repo's services/ directory, which ssc never touches.
  • It does not create DNS records. It tells you exactly which record to create and checks it.
  • It does not manage Garage's layout, buckets, or data. It writes a storage node's two config files and starts the container; assigning capacities and zones, creating buckets, and retiring a node stay human steps.
  • It does not run privileged commands. sudo on a content machine wants a password, so the one file that needs it — the boot unit in /etc/systemd/system/ — is installed by hand, once.
  • It has no undo. The state repo's history is the record of what changed.

3. The gateway

Requirements

  • Python ≥ 3.11, git, ssh and ssh-copy-id, ssh-keygen.
  • Caddy ≥ 2.4, running. The generated config uses the health_headers block, added in v2.4.0. ssc also uses the caddy binary to validate a config before installing it.
  • Root access for the install and for ssc init (it writes /etc).
  • Optional: tailscale on the gateway, so ssc server list/status can report liveness without an SSH attempt. Without it, liveness shows unknown and everything still works.

Install

git clone <this-repo-url> /opt/dust-deploy
cd /opt/dust-deploy
python3 -m venv .venv
.venv/bin/pip install -e .
ln -s /opt/dust-deploy/.venv/bin/ssc /usr/local/bin/ssc   # put ssc on PATH
ssc init

The install must be editable (pip install -e .): templates/ and server/ are located at runtime by walking up from the package to pyproject.toml, not shipped inside the package. A non-editable pip install . copies only the Python package and breaks config rendering and ssc server add.

The symlink is needed before ssc init: init's own symlink step can only help if ssc already runs, and pip install -e . puts the entrypoint in .venv/bin/, which is not on PATH by default. Alternatively run /opt/dust-deploy/.venv/bin/ssc init directly once.

ssc init in detail

It asks four questions (each with a skip or a default) and then:

  • Scaffolds the state directory with sites/, apps/, autogen/, services/, keys/, secrets/, a .gitignore, .gitkeep files, and a schema-only servers.yaml.
  • Creates the three files the Caddyfile imports by exact path — autogen/static-sites.caddy, autogen/apps.caddy, autogen/garage.caddy — each holding one comment line until a sync renders into it. Caddy treats an import of a missing specific file as a configuration error, so they must exist before the first deploy; an existing file is never touched.
  • Initializes git in the state directory and makes the first commit.
  • Writes /etc/dust-deploy.env with SSC_GATEWAY_IP, SSC_STATE_DIR, SSC_HOMEPAGES_REPO, and SSC_CLUSTER_DOMAIN.
  • Writes /etc/caddy/Caddyfile importing the generated and hand-edited snippets — but only if the file does not already exist; if it does, it prints the four import lines to check.
  • Creates /usr/local/bin/ssc if missing, and optionally ~/dust/ links to the repo, state, Caddyfile, and env file.
  • If a state-repo remote URL was given: adds origin, pushes the first commit, and warns (without aborting) if the push fails.

After init, the gateway is ready to register servers, websites, and apps. Re-running it is not needed; it is a bootstrap, not a maintenance command.

The gateway's environment file

/etc/dust-deploy.env holds the settings every ssc invocation reads. Real environment variables win over the file; the file wins over built-in defaults; a missing file is not an error. See Environment variables for the full list.

Keeping the gateway tool current

cd /opt/dust-deploy
git pull
.venv/bin/pip install -e .   # only when dependencies or packaging change
ssc sync

ssc sync also keeps each content server's contract current (folders, docker-compose.yml, nginx.conf, the boot unit, the nginx container). If you changed server/nginx.conf, server/docker-compose.yml or server/boot.sh in the tool repo, ssc sync or ssc server provision --all is enough; the contract pushes only files whose bytes differ and recreates the container only when docker-compose.yml changed or the container is not running.


4. Servers

A server entry is a name, its tailnet IP, and optional presentation details. The name is the hostname used for DNS and for the machine's own page.

Add a server

ssc server add

You answer:

  • Name — lowercase hostname (potato).
  • Tailnet IP — the machine's private address. An address another server already claims is refused and asked again: one address is one machine, and two names on it would converge the same nginx and Garage containers from two different desired states.

ssc then:

  1. Copies the gateway's SSH public key to ssc@<ip> (ssh-copy-id asks for the password once).
  2. Applies the server contract: directories, docker-compose.yml, nginx.conf, the boot script and unit, an empty sites.conf, the footer placeholder, and the nginx container, started.
  3. Creates <name>/homepage.md in the homepages repo when one is configured (warning only if the gateway cannot reach the repo).
  4. Syncs that server, which installs its default configuration.

On a deployment that runs Garage it then asks one last thing — whether this machine should also be a storage node. The default is no, and no ends the command exactly where it used to end. A storage failure there is a warning with the rerun named, never a lost web node.

--no-sync stops after registering and provisioning, and reports the sync it skipped. The machine is still prepared; only its first converge is deferred.

Re-running ssc server add for a name that already exists offers to provision it again — that is the repair path after a failed first attempt. Nothing else is re-registered.

Re-provision a server

ssc server provision <name>     # one machine
ssc server provision --all      # every registered machine (the default)
ssc server provision --all --dry-run

This re-applies the server contract without touching site checkouts or the gateway. It is the targeted version of the contract step that every sync already runs.

Make a machine's apps survive a reboot

A machine's app ports bind to its tailnet address, and Docker restores containers at boot before that address exists — so after a reboot an app sits dead until something converges it. The server contract ships a one-shot boot unit that waits for the address and then starts each app the registry says should be running.

The unit itself lives in /etc/systemd/system/, which needs sudo, and sudo on these machines asks for a password — so it is installed once, by hand, and ssc never tries. ssc server provision prints the line when a machine does not have it yet:

sudo install -m 0644 /home/ssc/dust/ssc/ssc-boot.service /etc/systemd/system/ \
  && sudo systemctl daemon-reload && sudo systemctl enable --now ssc-boot.service

That is the only manual step, ever: the unit runs /home/ssc/dust/ssc/boot.sh, and boot.sh is pushed by every sync like the other contract files, so changing boot behaviour is an ordinary deploy. journalctl -u ssc-boot says what it started and how long it waited; systemctl start ssc-boot re-runs it on a healthy machine and does nothing.

The script does not trust "started": after up -d it checks that each app's port is really published, and force-recreates a container that came back without it. That state is reachable — Docker's own boot restore can lose the tailnet race first, leaving a container Up and healthy with no endpoint, where a plain start changes nothing and only a recreate repairs it.

Server settings

ssc server config potato --steward whisper
ssc server config potato --location "Highland Park, LA"
ssc server config potato --no-homepage
ssc server config potato --ip 100.64.0.9
ssc server config potato --edit      # open servers.yaml
  • --steward NAME adds a steward; it does not replace the list. Remove one through --edit.
  • --location is free text shown on the machine's page.
  • --homepage / --no-homepage turns the machine's own page on or off (on by default, when homepages are enabled for the deployment).
  • --ip is a typo fix, not a migration: no checkouts, keys, or app data move. If the address really is a different machine, it will clone the assigned work there.
  • --edit opens servers.yaml in $EDITOR (else nano, else vi) and validates on save. It works even when the registry currently will not load, which is usually why you are editing it. It cannot be combined with the field flags.
  • --no-sync saves the registry change without converging.

The base directory for everything on a machine is /home/ssc/dust. Override it per server with dir: in servers.yaml (use --edit).

Make a machine a storage node (Garage)

Optional, and only where the deployment runs Garage. A garage: role on the entry turns the machine into a Garage node; without one, none of this exists and nothing extra is installed.

ssc server config potato --garage-zone gallery --garage-capacity 3T

Both flags are required to create the role; either one alone edits an existing one. ssc writes the role, converges that node, then converges the gateway that publishes it — node before upstream, so Caddy never lists a node that is not answering. zone and capacity are recorded for the layout, not applied by it: layout assign and layout apply are typed by a human.

To re-apply a node after a cluster constant changed (the image, replication_factor, something in garage.yaml):

ssc garage converge potato        # one machine
ssc garage converge --all         # every storage node
ssc garage converge --all --dry-run

The files live at /home/ssc/garage/garage.toml and …/docker-compose.yml — outside the machine's <base> folder, because storage has its own lifecycle. Object data goes to /mnt/disk-1/garage; the metadata directory /home/ssc/garage/meta holds the node ID and must survive a move.

ssc never stops, deletes, or wipes anything here. Removing the garage: role (through --edit) stops managing the node and says what is still running — the machine keeps serving its replicas. Retiring it is layout remove, layout apply, then docker compose down, by hand. The full bring-up order lives in the service's own manual, not here.

Check server state

ssc server list              # name, IP, tailnet liveness, steward, location
ssc server status [name]     # SSH, nginx, and the sites assigned to each machine
ssc server sites <name>      # the websites assigned to one machine
ssc server apps <name>       # the apps assigned to one machine

list reads liveness from one local tailscale status --json call, with no SSH. status probes each machine in parallel and exits non-zero if any selected machine is offline or unreachable, so it can gate a script. A powered-off machine shows ssh fail and nginx unknown.


5. Websites

A website is a git repository cloned onto one or more content servers. nginx serves the repository root as the document root: commit the files you want served, including index.html at the top level. There is no build step in ssc.

The gateway terminates TLS and decides which machine answers. If one machine is down, Caddy fails over to another that serves the same site.

Deploy a new website

  1. Add the server first if the machine is new (Servers).

  2. Register the website:

    ssc site new
    
    Question Notes
    Domain e.g. example.com. Must not already be a site, alias, or app domain.
    Owner Optional, for the records only.
    Git repository URL https://, ssh://, or git@host:path. A schemeless URL is refused.
    Which servers Comma-separated numbers or names. More than one gives failover.

    The registry entry is written and committed at this point. If the same domain is already registered, the command offers to resume that deploy instead of starting over — useful after a failed first run.

  3. Create the DNS record the command prints:

    A     @    → <gateway IP>
    

    Press Enter when done. ssc checks resolution; if it is not there yet it offers to wait and re-check, or to continue. A domain that also publishes an AAAA (IPv6) record gets a warning, because IPv6 visitors would bypass the gateway.

  4. Add the deploy key for a private repository. ssc generates a per-site key, uploads the private half to each hosting server, and prints the public key: add it as a deploy key on the repository in Forgejo, then press Enter. An https:// repository skips this entirely and must be publicly readable.

  5. It deploys. ssc converges the site's servers and then the gateway. It prints a row per server and a gateway row; all ok means the site is live.

--no-sync saves the registration without deploying; run ssc sync later.

Ship a change

Commit and push to the website's repository, then:

ssc site update example.com

This fetches the latest commit on each server and refreshes the site. ssc sync does the same for every site at once.

Change where or how it runs

ssc site config example.com --add-server potato
ssc site config example.com --remove-server testnode-a
ssc site config example.com --repo https://git.example.com/owner/site.git
ssc site config example.com --owner june

Adding a server converges it before the gateway starts sending it traffic; removing one converges the gateway first and the dropped server afterwards, so no request lands on a machine that has just stopped serving the site.

Removing a server leaves that machine's checkout in place, reported as an orphaned checkout on later syncs. Delete it with ssc sync --prune (preview with --dry-run).

Aliases

ssc site config example.com --alias www.example.com
ssc site config example.com --remove-alias www.example.com

Each alias is a gateway redirect to the canonical domain, preserving path and query string, and is served over HTTPS once its DNS record points at the gateway. Add that record yourself — a CNAME from the alias to the site's domain works. ssc site new prints the records for aliases only when it is resuming an existing registration; adding an alias later does not print a handoff.

Aliases must be unique across the whole registry: no other site's domain or alias, and no app domain, may reuse one.

The line at the bottom of a website

Every website gets one quiet sentence appended to its front page:

This site is being hosted on Potato, a node in the Stone Soup Cluster.

  • It is not in your repository. The sentence is a small file on the server (<base>/ssc/footer.html), added when the page is served. Your repository stays exactly what you wrote, and ssc sync never changes a file in the checkout.
  • It names the machine that answered. The fragment lives on the server itself, so when the gateway fails over, the line changes with it.
  • It is one sentence on the front page only — not on other pages, images, or error pages.
  • The server name is a link to that machine's own page (https://potato.secretserver.club) when server homepages are enabled for the deployment and for that machine. Without them, the name is plain text.
  • The cluster name is plain text today. It becomes a link when a cluster page exists.
  • To turn it off, add footer: false to the site's entry (sites/<domain>.yaml) and run ssc sync. The site is then served exactly as before, without the line.
  • Which server answered is visible without looking at the page: curl -sI https://example.com | grep -i x-ssc-served-by.

Take it offline, bring it back

ssc site disable example.com   # stop serving it; keep the files
ssc site enable example.com    # serve it again

Disabling removes the site from nginx and the gateway but leaves the checkout on every server. Enabling reuses that checkout rather than cloning again. Enabling an already-enabled site (or disabling a disabled one) is a reported no-op: no write, no commit, no sync. Both take --no-sync.

Delete a website

ssc site delete example.com
ssc site delete example.com --dry-run   # print the plan
ssc site delete example.com --yes       # no confirmation prompt

Unlike disable, this removes the files. It lists what will be removed and asks you to type the domain to confirm. The order is deliberate:

  1. Gateway stops serving the domain (and its aliases).
  2. Each server drops it from nginx and removes its checkout and deploy key.
  3. The registry entry is removed, and finally the local copies of the deploy key are deleted from the state repo.

If a server fails (for example it is offline), the site stays registered: fix the problem and run the same command again. Until then, a plain ssc sync puts the site back on the gateway.

A website is failing

  • ssc site list — is it registered, on the servers you expect?
  • ssc server sites <name> — does the machine that should host it list it?
  • ssc sync --site example.com --dry-run — what would the next attempt change?
  • Private repository? The deploy key must be present in Forgejo and on the server (<base>/keys/example.com_deploy).
  • Wrong content? The repository root is the document root; confirm index.html is at the top level of the branch you deploy.

6. Apps

An app is a program that keeps running in a container, as opposed to a website, which is a folder of files. The app's repository must already contain a Dockerfile and a docker-compose.yml with exactly one service — usually called app.

ssc does not own that compose file. It validates the single service and layers a generated compose.override.yml on top to add the published port, the rendered environment file, the data mount, and restart: unless-stopped. See the app contract.

Before you register

Ask the app's maintainer for:

  • the port the image listens on inside the container (container_port, default 3000),
  • a URL path that returns a 2xx status once the app is ready (health, default /),
  • the folder inside the container that must survive restarts (data_path; often /app/data).

You also need a registered server.

Deploy a new app

ssc app new
Question Notes
Name Lowercase slug (temporary-archive). Becomes the registry filename.
Domain Must not collide with any site domain or alias, or another app.
Owner Optional, for the records only.
Git repository URL Same rules as a site.
Server Exactly one.
Published port Port on the server's tailnet IP. Default 40404; must be unique per server.
Container port What the image listens on. Default 3000.
Health path Default /. Checked before the gateway routes to the app.
Data path One persistent folder inside the container. Type a path; - (or Enter) means none.
Compose service The single service name in the app repo. Default app.

Then: create the DNS record, add the deploy key for a private repository, and let it deploy. ssc builds the image, starts the container, waits for the health path, and only then gives the gateway the route. --no-sync saves the registration without deploying.

If the same name is already registered, the command offers to resume that deploy.

Ship a new version

ssc app update temporary-archive

Fetches the app repository's latest commit, rebuilds, restarts, waits for readiness, then refreshes the gateway. A broken build leaves the previous container running. A container that starts but never becomes ready is reported as an outage, not handed to the gateway.

Change settings

ssc app config temporary-archive --port 40404
ssc app config temporary-archive --health /healthz
ssc app config temporary-archive --data-path /app/data
ssc app config temporary-archive --env NODE_ENV=production
ssc app config temporary-archive --unset-env NODE_ENV
ssc app config temporary-archive --domain new.example.com

--domain walks you through pointing the new domain's DNS at the gateway before syncing (with --no-sync, it only reminds you). --data-path - removes the data mount. Every flag edit is validated against the whole registry before anything is written, and a no-op edit writes nothing.

Use --edit to open the app's YAML directly. As with sites and servers, it works even when the registry will not load, validates on save, and reopens on a rejected edit.

Secrets and environment

  • env: in the app YAML (or --env) is for non-secret values. It is committed to the state repo.
  • Secrets live in /opt/ssc-data/secrets/<name>.env — local-only, never in git — which ssc merges over the registry's env: into <base>/appenv/<name>.env (mode 0600) on the server.

A secret cannot be committed by ssc, whatever .gitignore says. state.commit() stages with git add -A -- . ':(exclude)secrets' …, so no command can carry a file under secrets/ into a commit; a scaffolded state dir also ignores keys/* and secrets/*. The state repo's remote therefore never has them, and a fresh clone has no secrets/ directory at all — recreate it (install -d -m 700 secrets) and re-issue the values, which by design cannot be recovered from git. Rotate by editing the file and converging, never through the registry:

$EDITOR /opt/ssc-data/secrets/temporary-archive.env
ssc app update temporary-archive

The change is detected (the env hash covers it) and the container restarted. Secret files are plain KEY=VALUE lines. The cluster's own pair (secrets/garage.env) rotates the same way with ssc garage converge --all — one pass, so a cluster never half-holds the old rpc_secret.

Move an app to another server

Data is not copied for you.

ssc app config temporary-archive --add-server testnode-b --remove-server testnode-a

The app is deployed on the new machine and the gateway is switched to it first; only if that succeeds is the old container removed, along with the old checkout, env file, and deploy key. The old data folder is kept, and ssc prints an rsync command for copying it across. If the new deploy fails, the old server is left untouched.

With data, the safe order keeps the app offline while the data moves, so the new copy never serves (or writes) an empty data folder:

ssc app disable temporary-archive
ssc app config temporary-archive --add-server testnode-b --remove-server testnode-a
# as root on testnode-a: copy data/ to testnode-b, keeping numeric owners and replacing what is there
rsync -a --numeric-ids --delete <base>/apps/temporary-archive/data/ <testnode-b>:<base>/apps/temporary-archive/data/
ssc app enable temporary-archive

With --no-sync, nothing on either server changes: tear the old copy down by hand (docker compose -p ssc-<name> down on the old server) after syncing. A later ssc app update does not clean up the old server.

Take it offline, bring it back

ssc app disable temporary-archive
ssc app enable temporary-archive

disable removes the public route first, then stops the container. Files, data, and secrets stay on the server. enable rebuilds and starts the container, waits for readiness, then restores the route.

If the server is offline during disable, the route is still removed and the app row fails with "container not stopped"; run ssc sync --app temporary-archive once the machine is back.

Stop, start, or restart the container

ssc app stop temporary-archive
ssc app start temporary-archive
ssc app restart temporary-archive

These touch the container only — no registry change, no gateway change. stop on an enabled app is temporary: the gateway reports it down, and the next ssc sync or ssc app update starts it again (a warning says so). Use disable to keep it down. start and restart refuse a disabled app; use ssc app enable.

Delete an app

ssc app delete temporary-archive
ssc app delete temporary-archive --dry-run
ssc app delete temporary-archive --keep-data
ssc app delete temporary-archive --no-backup
ssc app delete temporary-archive --yes

It asks you to type the app name. The order is: remove the gateway route, then the container and its local images, then the data, then every file ssc put on the server, and last the registry entry plus the local secrets and deploy key.

Before the data folder is removed, it is archived to <base>/backups/<name>-<UTC timestamp>.tar.gz on the server (a tar of the folder's contents) unless you pass --no-backup; --keep-data leaves the data folder in place instead.

To restore a backup, extract it into an empty data folder through a helper container so the files keep the app's ownership (plain tar as ssc would not):

docker run --rm \
  -v <base>/apps/<name>/data:/data \
  -v <base>/backups:/backups \
  busybox:stable tar xzf /backups/<file> -C /data

If a step fails (for example the server is offline), the app stays registered: fix the problem and run the same command again, which picks up where it stopped. Until then, a plain ssc sync puts the app back on the gateway.

Check app health

ssc app list              # registry only, no SSH
ssc app status [name]     # container state and deployed commit, over SSH

app status shows enabled/disabled, the container state (running, stopped, absent, or unknown when the server is unreachable), and the deployed commit. Restarting, paused, created, and dead containers show as stopped. It exits non-zero if any state is unknown.


7. Server homepages

Every machine can serve its own page at <server>.<zone> (e.g. potato.secretserver.club). Turn the feature on for the whole deployment by setting SSC_HOMEPAGES_REPO (asked during ssc init). Leave it unset and no homepage is cloned, served, or routed — nothing else changes.

Two sources, never mixed:

Part of the page Comes from Written by
name, steward, location, the served sites and apps the registry ssc
tagline, photo, photo alt, the prose <server>/homepage.md and <server>/media/ in the homepages repo whoever looks after the machine, by direct commit

Each content machine gets a sparse checkout of the homepages repo containing only its own folder, read-only from the machine's side (the usual setup is an anonymous HTTPS URL, since the content is public by definition). ssc sync reads that file, renders index.html, and pushes it only when the bytes change. The page is never written inside a site checkout, so git status there stays clean.

Create a machine's page

ssc server add does this automatically when a homepages repo is configured. To add one later:

ssc homepage new <server>

This creates <server>/homepage.md and <server>/media/.gitkeep in the homepages repo. The starter file is comments and an empty body — every field is commented out so a new page can only publish its member's own words. It exits non-zero if the gateway cannot clone or push the repo (an explicit ask should not fail quietly); ssc server add only warns and carries on.

Write the page

homepage.md is front matter plus paragraphs, and nothing else:

---
tagline: a small computer somewhere in the house
photo: media/potato.jpg
photo_alt: a beige tower PC on a shelf
---
Potato is one of six recycled business PCs. A blank line starts a new paragraph.

Links are the only formatting: [text in your own words](https://example.com) or a bare
https://example.com. Anything else stays plain text.
  • No Markdown in the prose: no **bold**, no headings, no images.
  • Links are allowlisted by scheme (http, https, mailto) and open in a new tab. A target outside that list is shown as literal text rather than failing the sync.
  • The tagline stays plain text.
  • A commented-out photo: line in the starter is the opt-in for a photo. A page without one is a normal page, not a broken one.

Commit the change in the homepages repo; the next ssc sync on that machine fetches it and rebuilds the page.

Preview without deploying

ssc homepage preview                        # the starter page, as a new server gets it
ssc homepage preview potato --open          # a registered server, opened in the browser
ssc homepage preview potato --content ~/homepages/potato/homepage.md
ssc homepage preview --empty --no-sites     # a machine with nothing written yet
ssc homepage preview potato --sample        # force the sample registry
ssc homepage preview potato --out /tmp/page

It writes ./preview/index.html (or --out) and touches nothing else: no transport, no state write, no deploy. It calls the same renderer a sync does, so what you see is what would be pushed.

It also runs away from the gateway. With no state directory (or --sample) it falls back to a sample registry — one machine, two sites, one app — which is what makes the shared template iterable: edit templates/homepage/index.html.j2, re-run the command, reload the browser. The default preview name is potato.

--content also links the media/ folder beside that file into the preview, so a committed photo resolves the way nginx serves it. A photo: path with no file behind it is reported rather than published. --open on a machine with no browser (the gateway) says so instead of failing silently. Naming a machine that is not in the registry stops and suggests --sample.

How it is served

The machine's nginx serves the generated page and aliases /media/ into the checkout. The gateway proxies <server>.<zone> to it with the same failover tuning as a site. If the machine is off, the gateway serves a shared "Potato is offline" page instead of a bare 502 (5xx only; 4xx stays Caddy's, because that is the visitor's problem).

Homepages carry no cluster footer: the footer names the machine that answered, and on that machine's own page it would be silly.

ssc server config <name> --no-homepage opts one machine out. --homepage turns it back on.


8. The cluster page

cluster.<zone> (cluster.secretserver.club) draws the whole cluster as one mesh: a disc per machine, a line between every pair — the tailnet, drawn as a picture rather than claimed — a menu that lists what the cluster serves, and a sheet of facts behind each disc.

The page is its own website in its own repo (cluster-homepage). It is not a template in this tool: every visual change is a commit there, and a club member can make one. ssc's only part is data.

Part Lives Who changes it
the drawing index.html, app.js, style.css in the page's repo anyone with a Forgejo login
the facts cluster.json, rendered by ssc from the registry nobody — it is derived
the prose the About sheet, written as HTML in index.html whoever is writing it

The snapshot

Every sync renders cluster.json from the registry and pushes it to the machines that host the page — and to no others, so no member site ever serves it. The page fetches it as /_ssc/cluster.json, where nginx aliases /srv/ssc/cluster.json inside the page's own server block only.

ssc cluster preview              # print the snapshot a sync would publish
ssc cluster preview --out /tmp/cluster.json | jq '.servers[].name'

What it contains, and what it deliberately does not:

  • Servers, sites, apps, places — the registry, sorted, plus each machine's homepage URL. A machine's steward and location are published exactly as typed.
  • photo — an absolute URL on that machine's own page (https://potato.<zone>/media/potato.jpg), or null. The path comes from the photo: line of its homepage.md, which only that machine can read; the sync records it in <state>/cluster/photos.json so the mesh can draw a machine that is offline right now, and so a photo is published without the gateway ever cloning the homepages repo.
  • No timestamps and no counts. The push is a byte diff: anything that changed without the registry changing would rewrite the file on every sync. The same registry always renders the same bytes.

Consequences worth knowing:

  • A machine added to servers.yaml appears as a disc on the next sync, with no commit to the page's repo. Add a site and it appears in the menu and in the sheets of its machines.
  • A photo first read during a sync is published by the next one. The snapshot is rendered once per run, before the machines converge, so every page host publishes exactly the same bytes.
  • ssc app commands do not converge the page's hosts (same shape as stale server homepages): an app added or enabled shows up after the next full or --server sync of a page host.

Register it

An ordinary site, nothing new in the schema:

# sites/cluster.secretserver.club.yaml
domain: cluster.secretserver.club
owner: ssc
repo: https://git.example/Secret-Server-Club/cluster-homepage.git
servers: [bones, salt, celery]
enabled: true

ssc sync then clones it like any site, publishes the snapshot beside it, and Caddy fails over between those machines as usual. SSC_CLUSTER_PAGE_DOMAIN names the page (cluster.<zone> by default); it is a deployment constant, not a registry field. ssc site config cluster.secretserver.club --add-server noodle moves it.

While the page is a registered, enabled site, two other things point at it: every site footer (the sentence at the bottom of a hosted site) and every machine homepage's kicker. Without the site, both stay plain text rather than linking to a 404.


9. Running the cluster

Find the command

I want to… Run
deploy a new website ssc site new
ship a website change push to your git repo, then ssc site update <domain>
deploy a new app ssc app new
ship a new app version push, then ssc app update <name>
change a setting ssc server config / ssc site config / ssc app config
take something offline ssc site disable <domain> / ssc app disable <name>
delete something ssc site delete <domain> / ssc app delete <name>
add a machine ssc server add
repair a machine's setup ssc server provision <name>
make a machine a storage node ssc server config <name> --garage-zone Z --garage-capacity C
re-apply a storage node ssc garage converge <name> (or --all)
see what is running ssc server status, ssc app status
see what a sync would change ssc sync --dry-run
catch everything up ssc sync
edit the YAML directly any config command with --edit

Scope a sync

ssc sync --server potato          # one machine: its contract, its sites, and its apps
ssc sync --site example.com       # one website: its servers, then the gateway
ssc sync --app temporary-archive  # one app: its server, then the gateway
ssc sync --dry-run                # print the plan, change nothing
ssc sync --prune                  # delete orphaned site checkouts, not just report them

--site and --app are mutually exclusive. --server can be combined with either to narrow further to one machine inside that site or app).

--prune permanently deletes a checkout that no longer belongs to a machine (usually after a site config --remove-server). Preview it with --dry-run first.

Preview a change

ssc sync --dry-run

Prints what a sync would do without changing anything: no uploads, no builds, no state writes. The app tier reads the deployed state rather than the upstream repository, so a brand-new upstream commit is only discovered by a real sync.

Use it before a risky change, or after editing the state by hand.

Edit a registration in your editor

server config, site config, and app config all take --edit:

ssc server config potato --edit
ssc site config example.com --edit
ssc app config ladle --edit

It opens the file in $EDITOR (else nano, else vi), validates the whole registry on save, and reopens if something is wrong. Quitting without saving changes nothing; abandoning a rejected edit puts the file back exactly as it was. --edit cannot be combined with the field flags.

The state is written back in one canonical shape, so a flag edit and an editor edit leave the same file behind. Do not put comments in the state YAML: it is re-serialised on every write.

Read the output

Commands that touch the cluster end with a table (a --no-sync change prints what was skipped instead):

Server   Status  Actions
-------- ------- --------------------------------------
potato   ok      update example.com (git fetch + reset --hard @{u})
                 push sites.conf
gateway  ok      install static-sites.caddy
                 reload caddy
  • ok means the thing is in the desired state; failed comes with a name: error line underneath.
  • Actions lists the steps that actually ran (or, with --dry-run, that would run), one per line.
  • Progress streams to stderr as - <step> lines while the work happens, for ssc sync and for the slow ssc server commands (provision, add, status). Servers converge in parallel, so lines from different machines interleave and each one names its machine.
  • stdout carries only the results table, so ssc sync | tail -1 still parses. Redirect 2>/dev/null to mute the progress lines.
  • Every command that fails exits non-zero.

Gateway maintenance

ssc caddy regen     # regenerate the gateway's config from the registry
ssc caddy reload    # validate and reload the gateway's web-server config

Rarely needed: ssc sync does both. They exist for when a sync failed at the gateway step, or after changing the main Caddyfile by hand.

Take a copy of the state

The state repository is ordinary git. Commit and push from /opt/ssc-data, or configure a remote during ssc init and let each change push itself. .ssc.lock is an advisory lock, never committed; deleting it while ssc is running is not safe.


10. Troubleshooting

Start with these three:

ssc server status
ssc sync --dry-run
ssc site list        # or: ssc app list

Then read the name: error line under the table. Every failure is designed to be fixed and retried with the same command.

Messages and what to do

Message What it means
No state directory found. Set SSC_STATE_DIR … or run ssc init The gateway was never bootstrapped (or SSC_STATE_DIR points nowhere). Run ssc init, or set the variable in /etc/dust-deploy.env.
SSC_GATEWAY_IP environment variable not set site new / app new need the gateway's public IP for the DNS handoff. Add it to /etc/dust-deploy.env and re-run.
Gateway public key not found at …pub ssc server add needs the public half of the gateway's SSH key. Create one (ssh-keygen -t ed25519) or set SSC_SSH_KEY.
ssh-copy-id failed — server is registered but NOT provisioned The gateway could not log into the new machine. Check the ssc user, the password, and that the machine is reachable, then re-run ssc server add.
Server 'x' is not provisioned — run: ssc server add The machine lacks its base directories. Provision it, then retry the site/app registration.
<ip> is offline (tailnet) The tailnet says the machine is down; ssc skipped the SSH attempt. Fix the machine, then run the same command.
expected exactly one compose service 'app', found: … The app repo's docker-compose.yml has zero or several services. Fix the repo or set --service.
docker daemon unreachable Docker is not running on the content machine (or the ssc user is not in the docker group).
caddy binary not found - SKIPPING validation The tool installed the gateway config without validating it. Install Caddy on the gateway, run ssc caddy reload to validate.
unknown field 'enable' — did you mean 'enabled'? A typo in the state YAML. Fix it with --edit.
App 'x' is disabled; run ssc app enable x start/restart refuse a disabled app on purpose.
warning: x is still enabled: Caddy will report … down app stop is temporary. Use ssc app disable to keep it down.
The site is still registered. … re-run ssc site delete A server failed during deletion. Fix it and re-run; until then a sync restores the site.
The app is still registered. … re-run ssc app delete Same, for an app.
photo 'media/…' is referenced but not found A homepage preview (or a committed page) points at a photo that is not committed beside homepage.md.
no browser on this machine homepage preview --open on the headless gateway. Copy the file, or open the printed path elsewhere.
servers.yaml: potato has a garage: role but …/garage.yaml is missing A machine claims to be a storage node but the cluster's constants file is absent. Create garage.yaml (see Make a machine a storage node) or remove the role.
…/secrets/garage.env is missing GARAGE_RPC_SECRET The two cluster secrets do not exist yet. The message prints the openssl line that creates them; every node in the cluster shares the same two values.
/mnt/disk-1/garage is not writable by ssc Create the data directory once as root, then converge again: sudo install -d -o ssc -g ssc /mnt/disk-1/garage.
garage restart loop (the row fails after a recreate) The toml is valid enough to start and wrong enough to crash. Read the container log: docker logs --tail 30 garage.

Common situations

  • A command looks stuck. It is not: the last - <step> line names what it is waiting on. Ctrl-C is safe — every step is idempotent, so the next run picks up.
  • A machine was asleep during a sync. Its rows failed; run ssc sync (or the same scoped command) once it is back. Nothing else remembers the failure.
  • Two people ran ssc at once. Registry writes take a lock and the state repo is committed one change at a time; one run waits. If you killed a run, deleting .ssc.lock while no ssc is running is safe.
  • The site serves stale content. Pushing to the repository is not enough: run ssc site update <domain> or ssc sync. Confirm with git -C <base>/sites/<domain> log -1 on the server.
  • The certificate does not appear. DNS must point at the gateway before Caddy can issue it. ssc site new verifies this; for an edited domain, check the A record and re-run ssc caddy reload.
  • An app's data moved to a new server. Stop the app, rsync -a --numeric-ids --delete the old data folder over the new one as root, then start it. The data is owned by the app's uid/gid (1000:1000 by default); --numeric-ids keeps that.
  • You edited a state file and now nothing loads. Every config --edit reopens on a rejected edit, and quitting restores the original bytes. If the file is already broken, open it with --edit anyway (it works while the registry is unreadable) or fix it in git.

A. Command reference

Run these on the gateway, as root.

Gateway

Command What it does
ssc init Set up a new gateway (run once).
ssc sync Apply the saved description to every machine.
ssc sync --server NAME Only that server. Combine with --site or --app to narrow further.
ssc sync --site DOMAIN Only that website (its servers and the gateway).
ssc sync --app NAME Only that app (its server and the gateway).
ssc sync --dry-run Show what would change, without changing it.
ssc sync --prune Delete orphaned site checkouts instead of only reporting them.
ssc caddy regen Regenerate the gateway's web-server config from the registry.
ssc caddy reload Validate and reload the gateway's web-server config.

Servers

Command What it does
ssc server add Register a machine: install the gateway key, apply the contract, create its homepage. --no-sync skips the follow-up sync (provisioning still runs).
ssc server provision [NAME] Re-apply the contract (folders, docker-compose.yml, nginx.conf, boot unit, container) without touching sites, and print the one-time sudo line when a machine's boot unit is not installed. --all is the default; --dry-run prints the plan.
ssc server config <name> … Edit a machine: --steward, --location, --homepage/--no-homepage, --ip, --garage-zone/--garage-capacity, --edit, --no-sync.
ssc server list Name, IP, tailnet liveness, steward, location.
ssc server status [name] SSH, nginx, and assigned sites; exits non-zero if any selected machine is unreachable.
ssc server sites <name> Websites assigned to one machine.
ssc server apps <name> Apps assigned to one machine.

Storage (Garage)

Command What it does
ssc garage converge <name> Re-apply one machine's Garage node from the registry. --all for every storage node, --dry-run to print the plan.
ssc server config <name> --garage-zone Z --garage-capacity C Make an existing machine a storage node. Both flags create the role; either one edits it.

ssc sync never runs either. A storage node's two files and container are converged only by these, by server provision, and by the question at the end of server add.

Websites

Command What it does
ssc site list List registered websites.
ssc site new Register a website (interactive; resumes an existing registration). --no-sync saves without deploying.
ssc site update <domain> Fetch the latest commit and refresh that website.
ssc site config <domain> … Change its settings (see below), or --edit.
ssc site enable <domain> Serve a disabled website again. --no-sync saves without converging.
ssc site disable <domain> Stop serving it but keep its files. --no-sync.
ssc site delete <domain> Remove it from the gateway, its servers (checkout and deploy key), and the registry. --yes, --dry-run. Safe to re-run after a failure.

site config options:

Option Meaning
--add-server NAME Also serve the website from this machine (repeatable).
--remove-server NAME Stop serving it from this machine (repeatable); checkout is left as an orphan.
--owner X Change the owner name (for the records).
--repo URL Change the git repository.
--alias HOST Add a nickname that redirects to the main domain (repeatable).
--remove-alias HOST Remove a nickname (repeatable).
--edit Open sites/<domain>.yaml in $EDITOR.
--no-sync Save the change without applying it.

Apps

Command What it does
ssc app list List registered apps, from the registry (no SSH).
ssc app status [name] Container state and deployed commit, over SSH. Exits non-zero when any state is unknown.
ssc app new Register an app (interactive; resumes an existing registration). --no-sync.
ssc app update <name> Rebuild and restart that app, then refresh the gateway.
ssc app config <name> … Change its settings (see below), or --edit.
ssc app enable <name> Start a disabled app and serve it once it is ready. --no-sync.
ssc app disable <name> Remove it from the gateway, then stop its container. Files, data, and secrets are kept. --no-sync.
ssc app stop <name> Stop the container only. An enabled app is started again by the next sync.
ssc app start <name> Start an enabled app's stopped container.
ssc app restart <name> Restart an enabled app's container.
ssc app delete <name> Remove it from the gateway, its server, and the registry; backs up the data before removing it. --keep-data, --no-backup, --yes, --dry-run. Safe to re-run after a failure.

app config options:

Option Meaning
--domain HOST Change the domain; walks through the DNS handoff before syncing.
--repo URL Change the git repository.
--port N Change the published port on the server.
--container-port N Change the port the container listens on.
--health PATH Change the readiness check (2xx, no redirect; default /).
--data-path PATH Change the persistent folder (- removes it).
--service NAME Change the compose service name (default app).
--env KEY=VALUE Set a non-secret environment value (repeatable).
--unset-env KEY Remove an environment value (repeatable).
--add-server NAME / --remove-server NAME Move the app (one server today): add the new one and remove the old one together. Data is kept, not copied.
--owner X Change the owner name (for the records).
--edit Open apps/<name>.yaml in $EDITOR.
--no-sync Save the change without applying it.

Homepages

Command What it does
ssc homepage preview [NAME] Render a page to ./preview/index.html without deploying. --content PATH, --empty, --no-sites, --sample, --out DIR, --open. Default name: potato.
ssc homepage new <server> Create <server>/homepage.md and <server>/media/.gitkeep in the homepages repo.

The cluster page

Command What it does
ssc cluster preview Print the cluster.json a sync would publish. --out PATH writes it to a file instead. Changes nothing.

B. Configuration reference

servers.yaml

potato:
  ip: 100.64.0.9          # required, tailnet IP
  dir: /home/ssc/dust     # optional base-directory override
  steward: [whisper]      # optional, shown on the machine's page
  location: Highland Park, LA
  homepage: true          # optional, default true
  garage:                 # optional; makes this machine a Garage storage node
    zone: gallery         # a layout label; recorded, never applied by ssc
    capacity: 3T          # a Garage capacity string (B, KB, MB, GB, TB, PB)

Unknown fields are refused. A server name is a hostname (lowercase letters, digits, hyphens).

sites/<domain>.yaml

domain: example.com       # required; must equal the filename
owner: whisper            # required (may be empty)
repo: https://git.example.com/owner/site.git   # required
servers: [potato, celery] # required; one or more
enabled: true             # optional; false keeps the checkout but stops serving
aliases: [www.example.com]# optional; each must be unique across the registry
footer: true              # optional; false drops the cluster footer line

The repository root is the document root. A schemeless repository URL is refused.

apps/<name>.yaml

name: temporary-archive   # required; must equal the filename
domain: archive.example.com
owner: whisper
repo: https://git.example.com/owner/archive.git
servers: [potato]         # required; exactly one today
port: 40404               # required; published on the server's tailnet IP, unique per server
container_port: 3000      # optional, default 3000
health: /                 # optional; absolute path, no whitespace, default /
data_path: /app/data      # optional; '-' or omit for no persistent folder
service: app              # optional; the single compose service, default app
env:                      # optional; non-secret only
  NODE_ENV: production
uid: 1000                 # optional; owner of <base>/apps/<name>/data
gid: 1000
enabled: true             # optional

App domains must not collide with any site domain or alias, or another app.

garage.yaml

Cluster constants, one file per deployment, hand-edited — ssc never writes it. Absent means this deployment has no Garage and the whole feature is inert; a garage: role without the file is a load error, because the machine claims to be a storage node of a cluster that does not exist.

image: dxflrs/garage:v2.5.0@sha256:<64 hex>   # required; a tag AND a digest
replication_factor: 3      # required; every node must agree before any layout apply
block_size: 1M             # required; a number with an optional K, M or G suffix
db_engine: lmdb            # required; lmdb, sqlite or fjall
s3_region: stonesoup       # required; one token, no whitespace
public_endpoint: https://garage.example.com   # required; https and a bare host: the gateway's Caddy block is built from it

image must pin both a tag and a digest: a tag alone is a moving target for a cluster whose members must run the same version. Every field is required — the tool is deployment-agnostic, so it has no cluster-specific defaults.

The state repository

  • servers.yaml — server registry.
  • sites/ — one YAML file per site.
  • apps/ — one YAML file per app.
  • garage.yaml — the Garage cluster's constants (see above). Absent when the deployment has no Garage.
  • autogen/ — generated files, committed, never hand-edited: static-sites.caddy, apps.caddy, garage.caddy, and public/homepages-down/<server>.html (the offline pages the gateway serves). The three snippets exist from ssc init and hold a single comment line until a sync renders into them — Caddy refuses an exact import whose file is missing.
  • services/ — hand-edited Caddy snippets. ssc never writes here.
  • keys/ — private deploy keys (git-ignored, except .gitkeep).
  • secrets/ — per-app secret env files and garage.env (the cluster's two secrets). Local-only: ssc excludes this directory from every commit, ignored or not, so it never reaches the state remote. App values are merged over the registry's env:.
  • .ssc.lock — advisory lock held during registry writes. Never committed.

⚠ autogen/ is generated; manual edits are overwritten. ⚠ services/ is for manual Caddy snippets only.


C. Environment variables

Variable Default Meaning
SSC_GATEWAY_IP — The gateway's public IPv4. Required for site new and app new (the DNS handoff).
SSC_STATE_DIR /opt/ssc-data when it exists The state repository. Unset and absent: ssc explains and stops.
SSC_SSH_KEY ~/.ssh/id_ed25519 Private key for reaching content machines as user ssc. The public half is used by server add.
SSC_CADDYFILE /etc/caddy/Caddyfile The gateway's Caddyfile, used by init, sync, and caddy reload.
SSC_CADDYFILE_MAIN — Older, init-only spelling; honoured when SSC_CADDYFILE is unset.
SSC_APP_READY_TIMEOUT 90 Seconds to wait for an app's health path after starting it.
SSC_ENV_FILE /etc/dust-deploy.env The file ssc loads defaults from at startup.
SSC_HOMEPAGES_REPO empty Git URL of the server-homepages repo. Empty means homepages are off. Required for homepage new.
SSC_CLUSTER_DOMAIN secretserver.club Zone for machine pages: <server>.<zone>.
SSC_CLUSTER_PAGE_DOMAIN cluster.<SSC_CLUSTER_DOMAIN> Hostname of the cluster page, where /_ssc/cluster.json is served. Always taken, whatever the registry says.

On the gateway these live in a single config file, loaded automatically at startup (KEY=VALUE lines, # comments):

# /etc/dust-deploy.env
SSC_GATEWAY_IP=<your-vps-public-ip>
SSC_STATE_DIR=/opt/ssc-data
#SSC_SSH_KEY=/root/.ssh/id_ed25519
#SSC_CADDYFILE=/etc/caddy/Caddyfile
#SSC_HOMEPAGES_REPO=https://git.example/whisper/server-homepages.git
#SSC_CLUSTER_DOMAIN=secretserver.club
#SSC_CLUSTER_PAGE_DOMAIN=cluster.secretserver.club

Precedence: real environment variables win over the file; the file wins over built-in defaults. Amissing file is not an error. EDITOR (used by every --edit) is read from the environment, with nano and then vi as fallbacks.


D. Directory layouts

Tool repository (dust-deploy)

  • ssc/ — Python package: CLI flows, registry, state, transport, render, DNS, config, init.
  • templates/ — Jinja2 templates for nginx and Caddy configs, templates/garage/ (a storage node's garage.toml and docker-compose.yml), and templates/homepage/ (the generated page plus the homepage.md starter and the shipped scaffold).
  • server/ — static files pushed to each content machine (Docker Compose + nginx config).
  • examples/ — sanitized sample registries and environment file (TEST-NET-2 IPs).
  • pyproject.toml, README.md.

State repository (ssc-data)

See the state repository above. Beside the registry it holds cluster/photos.json — the last-known photo: path per machine, which is what lets the cluster page draw a machine that is offline — and autogen/, the generated Caddy snippets.

Content machine (<base>, default /home/ssc/dust)

Everything ssc puts on a machine lives in one visible folder:

/home/ssc/dust/
├── docker-compose.yml   # nginx container, relative bind mounts
├── nginx/
│   ├── nginx.conf       # converged from the tool repo's server/ by ssc
│   └── sites.conf       # generated per server by ssc
├── ssc/
│   ├── footer.html      # the "hosted on <server>" sentence, appended to
│   │                    # each site's front page when served
│   ├── boot.sh          # run at boot: wait for the tailnet address, then
│   ├── ssc-boot.service # start each app in apps.boot (unit installed by hand)
│   ├── apps.boot        # generated: <project> <port> <compose files> per app
│   └── cluster.json     # the registry snapshot the cluster page draws; only
│                        # on the machines hosting that page
├── keys/                # per-site/per-app deploy private keys (0600)
├── homepages/<server>/  # content/ = sparse checkout of this machine's
│                        # folder in the homepages repo; site/index.html =
│                        # the page ssc generates. Served at <server>.<zone>.
├── sites/<domain>/      # git checkouts, bind-mounted into nginx
├── apps/<name>/         # repo/ (checkout), data/ (bind-mounted state),
│                        # compose.override.yml, deployed.json
├── appenv/<name>.env    # rendered env file (0600), from env: + secrets/
└── backups/             # <name>-<UTC timestamp>.tar.gz from ssc app delete (0700)

A storage node also has /home/ssc/garage/, outside <base> — the one deliberate exception, because storage is a second role with its own lifecycle rather than part of the web tier:

/home/ssc/garage/
├── garage.toml          # rendered by ssc from templates/garage/ + the role
├── docker-compose.yml   # ditto; the image comes from garage.yaml
└── meta/                # Garage's metadata dir — the node ID, the data marker's twin

Object data lives at /mnt/disk-1/garage (the HDD), mounted into the container as /var/lib/garage/data. ssc only ever creates these directories; nothing here is ever deleted.


E. Server and app contracts

The server contract

A full ssc sync (and server add / server provision) brings a machine to this state. An app-only sync touches the app, not the server contract.

  • The base folder and the directories it needs up front: nginx/, ssc/, keys/, sites/, and homepages/. App convergence adds apps/ and appenv/; the first app delete creates backups/.
  • docker-compose.yml and nginx/nginx.conf, from the tool repo's server/ directory. Only files whose bytes differ are pushed.
  • A placeholder nginx/sites.conf and ssc/footer.html when missing (so nginx never 403s or 404s a subrequest).
  • The nginx container, started. It is recreated when docker-compose.yml changed or the container is stopped; a nginx.conf-only change is validated (nginx -t) and reloaded.

The machine's own sites.conf is rendered on every server convergence from the full desired set, validated with nginx -t, and only then reloaded. If nginx rejects it, the previous file is restored and the server row fails.

The storage role (Garage)

A machine with a garage: role also runs one Garage container, from the two files ssc renders into /home/ssc/garage/. Converging it is never part of ssc sync.

  • Four changes, four actions. A rendered-toml change pushes the file and recreates the container (up -d --force-recreate); a compose change is a plain up -d; nothing changed and the container running means no compose call at all, so StartedAt is untouched; a stopped or absent container gets up -d. up -d alone is not enough for a toml change — compose compares its own config, not the contents of a bind mount, so it would report success while Garage served the previous config.
  • After a recreate, ssc confirms the container is still running: a bad toml crash-loops and up -d still exits 0.
  • Permissions. ~/garage and ~/garage/meta belong to ssc. /mnt/disk-1/garage gets an install -d attempt; where the mount is not ssc-writable, that node's row fails with the sudo install -d -o ssc -g ssc /mnt/disk-1/garage to run, rather than letting Docker create a root-owned directory behind our backs.
  • Secrets. The toml carries rpc_secret and admin_token from secrets/garage.env and is pushed 0600. No command prints those values and none reaches a --dry-run report.
  • The gateway. Every gateway convergence writes autogen/garage.caddy — one reverse_proxy listing every server with a role, health checks against Garage's admin port — but only when garage.yaml exists. Adding or retiring a node changes exactly that list.
  • Never a teardown. No compose down, no rm of either data directory, no layout change. Removing the role stops managing a node; the node keeps serving.

The app contract

An app is a registry entry plus a repository that already builds a container. ssc does not own the app's docker-compose.yml: it requires exactly one service (registry service:, default app), validates it with docker compose config --services, and layers a generated compose.override.yml that adds:

  • ports: "<server tailnet ip>:<port>:<container_port>" (never 0.0.0.0),
  • env_file: <base>/appenv/<name>.env (mode 0600),
  • volumes: <base>/apps/<name>/data:<data_path> (when data_path is set),
  • restart: unless-stopped.

Convergence is build → up -d → poll http://<ip>:<port><health> until it answers 2xx (bounded by SSC_APP_READY_TIMEOUT) → only then render the gateway. Readiness does not follow redirects: a health path that answers 3xx counts as not ready.

A broken build leaves the previous container running; a container that starts but never becomes ready is reported as an outage. <base>/apps/<name>/data is created before the first start and handed to the app's uid/gid (default 1000:1000) with a throwaway busybox:stable container (ssc is not root on the server), so the machine must be able to pull that image.

An unchanged checkout rev, env, override, and running container is a no-op. --dry-run never uploads or builds; it reads the deployed state, so a brand-new upstream commit is discovered by the real sync.

Failures and the gateway. One failed app never blocks the gateway. A sync runs servers → enabled apps → the gateway → disabled apps. An app that fails keeps its previously live block in apps.caddy, copied verbatim (its old container is still serving), even if the failed edit changed its domain or port; an app that has never been live is left out until it becomes ready. The block is kept only within the run in which the app failed: any later gateway convergence (another command, ssc caddy regen) re-renders the app from the registry, so fix or disable a failed app promptly. Blocks are found by the # ssc-app: <name> marker line ssc writes above each one; an apps.caddy generated before those markers existed has no blocks to keep.

Disabled apps converge after the gateway has dropped them: a running container is stopped with docker compose stop (container, checkout, data, and env are kept). If the gateway failed, disabled apps are left running (their rows fail with "gateway did not converge; container not stopped"), since the live Caddy config may still route to them.


F. Things done by hand

Very little, on purpose. The remaining cases:

  • Deploy keys for private repositories. During site new/app new the public key is printed; add it as a deploy key in Forgejo, then press Enter. HTTPS repositories skip this and must be publicly readable.

  • Older gateways with newer snippet imports. A gateway created before the app tier or the storage role needs those lines added to its main Caddyfile by hand; new ssc init runs write all four import lines. The two an older gateway may lack:

    import /opt/ssc-data/autogen/apps.caddy      # the app tier
    import /opt/ssc-data/autogen/garage.caddy    # the Garage route
    

    The import is not harmless on its own: Caddy rejects a configuration that imports a specific file which does not exist (only an empty glob is fine), which is why ssc init creates all three files, and why a gateway created before it did must create them too:

    touch /opt/ssc-data/autogen/apps.caddy /opt/ssc-data/autogen/garage.caddy
    

    Re-running ssc init does the same thing and leaves a rendered snippet untouched.

  • The Garage layout. garage layout assign -z <zone> -c <capacity> <node-id> and garage layout apply --version N are typed inside a node by a human. ssc records the zone/capacity the layout uses and never applies it, because every apply bumps a version and triggers a rebalance.

  • Moving app data. ssc keeps the old folder and prints the rsync command; it does not run it. See Move an app.

  • Restoring a deleted app's data. Extracting the backup needs a helper container so ownership survives; the command is in Delete an app.

  • Homepages repo access. ssc homepage new (and the scaffold during server add) clones and the homepages repo with the gateway's git credential. If it cannot, server add warns and carries on; homepage new exits non-zero and says what is missing.

  • Removing a steward, editing services/. Use server config --edit; --steward only adds. services/ snippets are yours, and ssc never touches them.

  • Starting nginx. Never: server add, server provision, and every sync bring the container up as part of the contract.