Consolidate GITEA_HOST_KEY/DEPLOY_HOST_KEY into one KNOWN_HOSTS var

No technical need for separate vars; one holding both known_hosts
lines (pasted straight from an existing trusted known_hosts file) is
simpler to configure.
This commit is contained in:
2026-08-13 15:48:26 +00:00
parent 8bb88d0faa
commit 443012e3c7
+6 -8
View File
@@ -23,20 +23,18 @@ jobs:
- name: Set up SSH key and pinned host keys - name: Set up SSH key and pinned host keys
# Same key used both as the theme repo's deploy key (Gitea) and for # Same key used both as the theme repo's deploy key (Gitea) and for
# the webserver login (below) — one secret, two authorized_keys entries. # the webserver login (below) — one secret, two authorized_keys entries.
# Host keys are pinned via vars (each a full known_hosts-format line, # Host keys are pinned via a var (known_hosts-format lines, pasted
# e.g. from the server's own /etc/ssh/ssh_host_rsa_key.pub) rather # directly from a known_hosts file that already trusts both hosts)
# than fetched via ssh-keyscan — no extra network calls, no TOFU, and # rather than fetched via ssh-keyscan — no extra network calls, no
# no risk of tripping aquaria's connection-rate limiting. # TOFU, and no risk of tripping aquaria's connection-rate limiting.
env: env:
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
GITEA_HOST_KEY: ${{ vars.GITEA_HOST_KEY }} KNOWN_HOSTS: ${{ vars.KNOWN_HOSTS }}
DEPLOY_HOST_KEY: ${{ vars.DEPLOY_HOST_KEY }}
run: | run: |
mkdir -p ~/.ssh mkdir -p ~/.ssh
printf '%s\n' "$DEPLOY_SSH_KEY" > ~/.ssh/deploy_key printf '%s\n' "$DEPLOY_SSH_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key chmod 600 ~/.ssh/deploy_key
printf '%s\n' "$GITEA_HOST_KEY" >> ~/.ssh/known_hosts printf '%s\n' "$KNOWN_HOSTS" >> ~/.ssh/known_hosts
printf '%s\n' "$DEPLOY_HOST_KEY" >> ~/.ssh/known_hosts
- name: Fetch theme submodule - name: Fetch theme submodule
run: | run: |