Repository navigation
feat: selvage on twill, a new app vm - #95
Merged
Merged
Conversation
…orker on the web image, safe secrets script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Selvage, the Patchwork Slack bot, on a new app VM
twill(VMID 363, 10.100.90.63, 3 GB, 20 GB disk). Production only: there is no Selvage staging instance yet.What changes
modules/selvage(exported asnixosModules.selvage): two containers fromghcr.io/patchworklabsorg/selvage:main.selvage-webruns./bin/rails db:migrate(both databases) in a one-off container, then./bin/rails serveron127.0.0.1:3009.selvage-workerrunsbundle exec good_job starton the image of the running web container, after/upanswers.CENTRAL_DATABASE_URL,RESTRICTED_DATABASE_URL,SECRET_KEY_BASE,SLACK_SIGNING_SECRETorSLACK_BOT_TOKENis empty. An empty signing secret would let anyone sign a Slack request.hosts/twill: the host, nginx ontailscale0:80that passes onlyPOST /slack/*andGET /up(every other path is 404), and skein and seam pinned innetworking.hosts.hosts/central-db-schema.nix:selvageinrestricted.apps, with no shared schemas. hem:5433 also gets the role, with no password.hosts/alastor/edge.nix: routeselvage-twillforselvage.patchworklabs.org.bin/new-selvage-secrets: writesrestricted-prod-selvage.age,selvage-env.ageandselvage-ghcr-token.age. It decrypts the existingcentral-prod-selvage.age(andquilt-ghcr-token.age) with your age identity, into variables only. It prints no value and writes no empty key.secrets/secrets.nix,ad/org.json(twill,twill-admins), Terraformvms, README.The secrets are not in this PR. twill builds without them: each secret is declared only when its
.agefile exists.Order of operations
README.md, "Selvage on twill", "Go live" has every step. In short: tailnet policy (jaspermayone/infra) and DNS (patchworklabsorg/dns) first, then
bin/install-host twill, the host key intosecrets.nix,bin/new-selvage-secrets, re-encryptad-join.agealone (notagenix -r, which restarts Stash and Krater), Slack values, then merge. The merge deploys seam and twill. alastor needsnix flake update patchwork-infraand a deploy in jaspermayone/infra.Checks
nix flake check --no-build --all-systems: passed.checks.aarch64-darwin.ad-org,terraform-fmt,ansible-filters: built and passed.nix evaloftwillandseamtopleveldrvPath: passed, also with stand-in secret files present.bin/new-selvage-secrets: run against throwaway keys and files. Checked the output, a failed decrypt (no file left behind) and the stop on an existing file.shellcheck: clean.Related