diff --git a/scripts/deploy.sh b/scripts/deploy.sh index d253b9d..bc88700 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -89,18 +89,24 @@ COMPOSE_PROFILES="${COMPOSE_PROFILES}" prn() { printf ' · %s\n' "\$*"; } -# 2a. pre-trust the Gitea SSH host key so the first clone doesn't fail with -# 'Host key verification failed'. This is TOFU — we accept whatever the -# server currently presents. If you want to verify the fingerprint -# manually, do so once and place it in ~/.ssh/known_hosts yourself. +# 2a. preflight: check the Gitea SSH host is trusted (read-only check; we +# do NOT modify your ~/.ssh contents — handle host trust yourself once). if [[ -n "\$GIT_HOST" ]]; then - mkdir -p ~/.ssh && chmod 700 ~/.ssh KH_ENTRY="[\$GIT_HOST]:\$GIT_PORT" if ! ssh-keygen -F "\$KH_ENTRY" -f ~/.ssh/known_hosts >/dev/null 2>&1; then - prn "adding \$KH_ENTRY to ~/.ssh/known_hosts (first time on this prod box)" - ssh-keyscan -T 5 -p "\$GIT_PORT" "\$GIT_HOST" 2>/dev/null >> ~/.ssh/known_hosts \ - || { echo "[deploy] could not reach \$GIT_HOST:\$GIT_PORT from this box" >&2; exit 1; } - chmod 600 ~/.ssh/known_hosts + cat >&2 <&2 </dev/null + (none?) → ssh-keygen -t ed25519 + then: cat ~/.ssh/id_ed25519.pub # paste into Gitea → Settings → SSH Keys + • Repo URL wrong or you're not a collaborator on m17hr1l/psyc. +deploy.sh will NOT modify ~/.ssh — fix it once and re-run. HINT exit 1 fi