Repository navigation
Conversation
This branch has not been deployed
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.
Moves every deploy off the org secrets
SSH_PRIVATE_KEY,SSH_USER,SSH_HOST_PREVIEW/PROD,GHCR_USERandGHCR_TOKEN, and off the servers' own age keys, onto the KF console's deploy-secrets route (kf-console #81).kf.project.jsonc:production(tags/v*,infra/.env.enc) andsandbox(heads/main,infra/.env.sandbox.enc), each deployed elsewhere bydeploy-stack.yml.reset-preview-envson main), never by a pull request's run. The console refusespull_requestruns, and an environment owns its ref, so sandbox and previews (both on main) are one environment. A preview runs the PR's code with those values, so they must be disposable.on_prlosesdeploy-preview(already off) andclose-preview;reset-preview-envsnow prunes the stacks of closed or unlabeled PRs..env.preview.encis no longer read.deploy-stack.yml: takesenvironmentand runs its job in that GitHub Environment, with the only OIDC token in these workflows. It runskf ci ssh-agentand pipeskf ci secrets --runtimeover ssh. No GitHub secret butGITHUB_TOKEN, which also does the image pull. Inputs are checked before they reach the server's command line. Actions pinned by SHA.infra/deploy-remote.sh(on the server, was the heredoc): reads the values into memory and hands them todocker stack deployas its environment. Which services get which keys is a compose file of names only, generated and given on stdin before the stack file, so the stack file's ownenvironment:still wins, as it did overenv_file. Nothing is written to disk, and the old.env.<stack>is deleted. Caddy now gets onlyPUBSTAR_HOSTNAMEand Postgres only its three, not the whole file. On a failed rollout it no longer printsservice inspect --pretty, which shows the values.on_taganddeploy-manual(production, on a tag, the tag's own image) andon_main_2,deploy-manualandreset-preview-envs(sandbox, on main).deploy-manualsays up front when it is dispatched on a ref the console would refuse. No workflow hasid-token: writeat the top any more.Checked:
actionlint(only the existingif: falsenote, plus existing shellcheck notes in steps this doesn't touch),shellcheck,biome ci,kf checkfrom #81's CLI (manifest valid), anddocker stack configon the generated file plusstack.ymlandstack.preview.ymlwith fake values. A dry run of the server script with stubbed sudo, git and docker covered production and sandbox, the refused names, and a bad prune list. Not run against a real console or server.Merge only after the console's deploy-secrets route is in production and this repo's environments are set up in the console. (kf-console #81 merged and deployed,
kf0.7.0 published.)