A workstation as production

This guide sets up FlowAssembly on one Windows machine as a stand-in for production, and connects a project’s pipeline to it. It is for demonstrations and for proving the delivery path end to end. It is not for real people’s data:

  • it runs on one machine, only while the machine is on, with no backup;

  • its stand-ins replace the policy registry and mail server;

  • one person may approve their own changes, which the production trust file allows openly (allowSelfApproval). Every such deployment is recorded as self-approved. That is not separation of duties.

Everything runs inside WSL2: a kind cluster for FlowAssembly, and a GitHub Actions runner that carries out the pipeline’s production step. GitHub never needs to reach the machine; the runner calls out to GitHub.

What you need

  • Windows with WSL2 and Docker Desktop, with WSL integration turned on for your Linux distribution (Docker Desktop: Settings, Resources, WSL integration). About 8 GB of memory to spare.

  • In WSL: git, curl, openssl and, ideally, the GitHub CLI gh, signed in (gh auth login).

  • A clone of the FlowAssembly repository in WSL.

  • A GitHub token that can read packages (GitHub: Settings, Developer settings, Personal access tokens, with the read:packages scope). The setup asks for it once and hands it to Docker; it is never written into any file here. Do not paste it anywhere else.

1. Set up FlowAssembly

In WSL, in the FlowAssembly clone, on the latest main:

bash deploy/workstation/setup.sh --user <your GitHub user name> \
  --runner <owner>/<a project repository> \
  --runner <owner>/<another project repository>

Give --runner once for each project repository whose pipeline deploys here.

It will:

  1. install pinned, checked copies of kind and kubectl if you do not have them;

  2. make a kind cluster, flowassembly-production;

  3. pull the signed FlowAssembly images and load them into the cluster;

  4. make the instance’s secrets on this machine (deploy/kubernetes/overlays/workstation.local/, never committed);

  5. start FlowAssembly, with a database that keeps its data, a volume for the files people add to cases, and ClamAV to check them (it takes a minute or so to load its virus definitions);

  6. make your user, asking for a password;

  7. register a GitHub Actions runner for each project repository, labelled flowassembly-production, and start them as services if WSL runs systemd. Otherwise it tells you how to start them.

To add a project repository later, run it again with one more --runner.

Run it again whenever you like: it keeps the cluster, database and secrets, and brings images and settings up to date.

Open FlowAssembly with kubectl port-forward svc/flowassembly-web 8080:80 and http://localhost:8080. No project is deployed until the pipeline deploys one.

2. Make your approver key

In a clone of the project repository, in WSL:

scripts/approver-key.sh

It makes your approver key in ~/.flowassembly/keys (it never leaves the machine) and copies the public half into deploy/keys/, named by the email you commit with. Add it to deploy/production.trust.yaml under approvers, with the account you sign in to FlowAssembly with, then commit and push:

approvers:
  you@example.com:
    key: keys/you@example.com.pub
    account: local:<your username>

Production checks that account each time it relies on your approval: it must still exist and hold release approval. The first trust file production is given becomes the trust it holds.

Changing production’s trust

To add an approver, replace a key or revoke a lost one, change deploy/production.trust.yaml, then, from the project clone:

scripts/approve-trust.sh

It signs the file with your approver key, commits the signature as deploy/production.trust.approval.json and pushes; the push applies it on your runner. Production takes the change only with a signature from an approver it already trusts, so editing the file alone changes nothing. To replace a key, list both while you switch (key: [keys/old.pub, keys/new.pub]), then only the new one. To revoke one:

revoked:
  - {key: keys/you@example.com.pub, reason: The laptop holding it was lost}

A revoked key is refused from then on and cannot be taken off the list. If every approver key is lost, fa trust reset production --project <project> --reason "..." run in the cluster (with the instance’s own settings) lets the next trust file be adopted again; it is audited. Production holds each project’s trust separately, so each trust file names its project (project: agent-recruitment).

Protecting the repository on GitHub

From the project clone, once:

scripts/protect-repository.sh

It makes main change only through pull requests whose checks pass, stops force pushes and deleting it, and lets the production jobs run only from main. You administer the repository, so you can still push approvals and trust changes yourself; GitHub records each such push as going around the pull request rule. A private repository needs GitHub Pro for this.

3. Release

  1. Merge a change to the project’s main. The pipeline packages and signs the bundle, deploys it to a development database made for the run, and runs the smoke tests. The run’s summary shows its run id.

  2. Approve it, from the project clone: scripts/approve.sh <run id>. It signs an approval for exactly that bundle and its development report, commits it to approvals/ and pushes.

  3. That push starts the production step on your runner. It deploys the same bundle into the workstation’s cluster. FlowAssembly checks the signature, the approval and the development evidence first, and refuses otherwise. The run’s summary notes that the deployment was self-approved.

Where things are

What

Where

The cluster

kind cluster flowassembly-production (kubectl config use-context kind-flowassembly-production)

The instance’s secrets

deploy/kubernetes/overlays/workstation.local/ in the FlowAssembly clone

Your approver key

~/.flowassembly/keys/approver.key

The runners

~/actions-runner-<repository>, one for each project repository (a runner set up earlier stays in ~/actions-runner)

When a second person joins

Give them their own approver key with scripts/approver-key.sh on their machine, add them and their account to deploy/production.trust.yaml, remove allowSelfApproval, and sign the change with scripts/approve-trust.sh. From then on, a deployment needs someone other than its author to approve it. Then run REQUIRED_REVIEWS=1 scripts/protect-repository.sh, so a pull request also needs the other person’s review. Required reviewers on the production environment itself need GitHub Team or Enterprise for a private repository; FlowAssembly’s signed approval is the check that production makes either way.