Update sync-vps-repos.sh to export GIT_SSH_COMMAND and enforce SSH forge remote URLs for deploy key authentication

This commit is contained in:
Hermes Agent committed 2026-12-02 12:08:13 +00:00
1 parent 2c05f8e708
commit f1792478b6
2 files changed
+9 -1

No files matched your search

+8
View File
@@ -44,6 +44,10 @@ DEFAULT_REPOS_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
export REPOS_ROOT="${REPOS_ROOT:-${DEFAULT_REPOS_ROOT}}"
export LIVE_REPOS="${LIVE_REPOS:-/var/www/hyperstitionstud.io/repos}"
if [[ -f "/etc/hyperstitionstud.io/id_ed25519_git_libre_audio" ]]; then
export GIT_SSH_COMMAND="ssh -i /etc/hyperstitionstud.io/id_ed25519_git_libre_audio -o StrictHostKeyChecking=accept-new"
fi
TARGET_REPO="all"
DO_PULL=1
DO_CADDY=1
@@ -111,6 +115,10 @@ if [[ "${DO_PULL}" -eq 1 ]]; then
if [[ "${repo}" == "haiperdohp-jemaytreeah" ]] && git -C "${REPOS_ROOT}/${repo}" remote | grep -qx "downstream"; then
remote_name="downstream"
fi
if [[ "${remote_name}" == "origin" ]]; then
forge_ssh="ssh://git@git.libre.audio:2222/seasharp"
git -C "${REPOS_ROOT}/${repo}" remote set-url origin "${forge_ssh}/${repo}.git" || true
fi
echo "[1/5] Updating ${REPOS_ROOT}/${repo} (${remote_name}/${branch}) with autostash rebase..."
prev_head="$(git -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)"
run_checked "git pull --rebase --autostash ${repo}" git -C "${REPOS_ROOT}/${repo}" pull --rebase --autostash "${remote_name}" "${branch}"