Refactor sync-vps-repos.sh and run-vps-data-production.sh to use native git -c core.sshCommand="..." for infallible deploy key authentication

This commit is contained in:
Hermes Agent committed 2026-12-02 12:24:37 +00:00
1 parent 2242cf4ecb
commit fff43cca6d
3 files changed
+24 -21

No files matched your search

+2 -2
View File
@@ -3,8 +3,8 @@
<!-- HS-COMMIT-STATUS:START --> <!-- HS-COMMIT-STATUS:START -->
> **Gitea Commit & Release Telemetry (`v2.17.1` • Namespace `urn:io:hyperstitionstud`)** > **Gitea Commit & Release Telemetry (`v2.17.1` • Namespace `urn:io:hyperstitionstud`)**
> - **Repository Role & Public Route:** Shared PEP 420 Python core library (`hyperstitionstud_io.*`), MCP/REST server, `/quant/`, `/learn/`, `/engineering/`, `/math/`, & `/donate/` webroots &rarr; [`https://hyperstitionstud.io/`](https://hyperstitionstud.io/) > - **Repository Role & Public Route:** Shared PEP 420 Python core library (`hyperstitionstud_io.*`), MCP/REST server, `/quant/`, `/learn/`, `/engineering/`, `/math/`, & `/donate/` webroots &rarr; [`https://hyperstitionstud.io/`](https://hyperstitionstud.io/)
> - **Latest Commit Scope (`hyperstitionstudio-core`):** Synchronized v2.17.1 release state across 1 tracked module/artifact surface(s) > - **Latest Commit Scope (`hyperstitionstudio-core`):** Synchronized v2.17.1 release state across 2 tracked module/artifact surface(s)
> - **Touched Files / Surfaces:** `deploy/sync-vps-repos.sh` > - **Touched Files / Surfaces:** `deploy/run-vps-data-production.sh`, `deploy/sync-vps-repos.sh`
> - **Live Verified Ecosystem Metrics (`v2.17.1`):** `6` Repositories • `17` CLI Entrypoints • `20` MCP/REST Tools • `14` URN Resources • `63` Verified Web Routes • `388` KG Nodes / `1,282` Edges • `282` Glossary Entries • `4,943` Offline CMUdict Phonetics • `0` Synthetic Data > - **Live Verified Ecosystem Metrics (`v2.17.1`):** `6` Repositories • `17` CLI Entrypoints • `20` MCP/REST Tools • `14` URN Resources • `63` Verified Web Routes • `388` KG Nodes / `1,282` Edges • `282` Glossary Entries • `4,943` Offline CMUdict Phonetics • `0` Synthetic Data
<!-- HS-COMMIT-STATUS:END --> <!-- HS-COMMIT-STATUS:END -->
+12 -10
View File
@@ -129,25 +129,27 @@ fi
if [[ "${DO_PUSH}" -eq 1 ]] && [[ -f "/etc/hyperstitionstud.io/id_ed25519_git_libre_audio" ]]; then if [[ "${DO_PUSH}" -eq 1 ]] && [[ -f "/etc/hyperstitionstud.io/id_ed25519_git_libre_audio" ]]; then
echo "[4/5] Committing and pushing automated VPS telemetry updates to git.libre.audio..." echo "[4/5] Committing and pushing automated VPS telemetry updates to git.libre.audio..."
run_checked "hs-readme-sync --all" "${PYTHON_BIN}" -m hyperstitionstud_io.publishing.readme_sync --all run_checked "hs-readme-sync --all" "${PYTHON_BIN}" -m hyperstitionstud_io.publishing.readme_sync --all
export GIT_SSH_COMMAND="ssh -i /etc/hyperstitionstud.io/id_ed25519_git_libre_audio -p 2222 -o StrictHostKeyChecking=accept-new" DEPLOY_KEY="/etc/hyperstitionstud.io/id_ed25519_git_libre_audio"
GIT_SSH_CMD="ssh -i ${DEPLOY_KEY} -p 2222 -o IdentitiesOnly=yes -o IdentityAgent=none -o BatchMode=yes -o StrictHostKeyChecking=accept-new"
GIT_SSH_FLAGS=(-c "core.sshCommand=${GIT_SSH_CMD}")
STAMP_UTC="$(date -u +%Y-%m-%dT%H:%M:%SZ)" STAMP_UTC="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
for r in hyperstitionstudio-core ingglish-hyperdope-gematria encyclopedia-knowledge-graph; do for r in hyperstitionstudio-core ingglish-hyperdope-gematria encyclopedia-knowledge-graph; do
if [[ -d "${REPOS_ROOT}/${r}/.git" ]]; then if [[ -d "${REPOS_ROOT}/${r}/.git" ]]; then
if [[ "${PUSH_ONLY}" -eq 1 ]]; then if [[ "${PUSH_ONLY}" -eq 1 ]]; then
echo " -> Inspecting ${r} for telemetry updates..." echo " -> Inspecting ${r} for telemetry updates..."
fi fi
if ! git -C "${REPOS_ROOT}/${r}" config user.name 2>&1; then if ! git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" config user.name 2>&1; then
git -C "${REPOS_ROOT}/${r}" config user.name "Hyperstition VPS Bot" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" config user.name "Hyperstition VPS Bot"
git -C "${REPOS_ROOT}/${r}" config user.email "vps-bot@hyperstitionstud.io" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" config user.email "vps-bot@hyperstitionstud.io"
fi fi
forge_ssh="ssh://git@git.libre.audio:2222/seasharp" forge_ssh="ssh://git@git.libre.audio:2222/seasharp"
git -C "${REPOS_ROOT}/${r}" remote set-url origin "${forge_ssh}/${r}.git" || true git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" remote set-url origin "${forge_ssh}/${r}.git" || true
git -C "${REPOS_ROOT}/${r}" add -A git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" add -A
if ! git -C "${REPOS_ROOT}/${r}" diff --cached --quiet; then if ! git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" diff --cached --quiet; then
if [[ "${PUSH_ONLY}" -eq 1 ]]; then if [[ "${PUSH_ONLY}" -eq 1 ]]; then
echo " [commit] Committing new telemetry changes in ${r}..." echo " [commit] Committing new telemetry changes in ${r}..."
fi fi
run_checked "git commit (${r})" git -C "${REPOS_ROOT}/${r}" commit -m "chore(telemetry): automated VPS ${WINDOW_MODE} harvest (${STAMP_UTC})" || true run_checked "git commit (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" commit -m "chore(telemetry): automated VPS ${WINDOW_MODE} harvest (${STAMP_UTC})" || true
else else
if [[ "${PUSH_ONLY}" -eq 1 ]]; then if [[ "${PUSH_ONLY}" -eq 1 ]]; then
echo " [clean] Repository ${r} working tree is clean (no new local telemetry changes to commit)." echo " [clean] Repository ${r} working tree is clean (no new local telemetry changes to commit)."
@@ -156,11 +158,11 @@ if [[ "${DO_PUSH}" -eq 1 ]] && [[ -f "/etc/hyperstitionstud.io/id_ed25519_git_li
if [[ "${PUSH_ONLY}" -eq 1 ]]; then if [[ "${PUSH_ONLY}" -eq 1 ]]; then
echo " [sync] Pulling and rebasing origin/main for ${r}..." echo " [sync] Pulling and rebasing origin/main for ${r}..."
fi fi
run_checked "git pull --rebase --autostash (${r})" git -C "${REPOS_ROOT}/${r}" pull --rebase --autostash origin main || true run_checked "git pull --rebase --autostash (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" pull --rebase --autostash origin main || true
if [[ "${PUSH_ONLY}" -eq 1 ]]; then if [[ "${PUSH_ONLY}" -eq 1 ]]; then
echo " [push] Pushing ${r} to git.libre.audio..." echo " [push] Pushing ${r} to git.libre.audio..."
fi fi
run_checked "git push (${r})" git -C "${REPOS_ROOT}/${r}" push origin main || true run_checked "git push (${r})" git "${GIT_SSH_FLAGS[@]}" -C "${REPOS_ROOT}/${r}" push origin main || true
if [[ "${PUSH_ONLY}" -eq 1 ]]; then if [[ "${PUSH_ONLY}" -eq 1 ]]; then
echo " [ok] Repository ${r} successfully pushed to git.libre.audio." echo " [ok] Repository ${r} successfully pushed to git.libre.audio."
fi fi
+10 -9
View File
@@ -45,10 +45,11 @@ export REPOS_ROOT="${REPOS_ROOT:-${DEFAULT_REPOS_ROOT}}"
export LIVE_REPOS="${LIVE_REPOS:-/var/www/hyperstitionstud.io/repos}" export LIVE_REPOS="${LIVE_REPOS:-/var/www/hyperstitionstud.io/repos}"
DEPLOY_KEY="/etc/hyperstitionstud.io/id_ed25519_git_libre_audio" DEPLOY_KEY="/etc/hyperstitionstud.io/id_ed25519_git_libre_audio"
GIT_SSH_FLAGS=()
if [[ -f "${DEPLOY_KEY}" ]]; then if [[ -f "${DEPLOY_KEY}" ]]; then
# Force OpenSSH to use only the deploy key (ignore forwarded ssh-agent / default ~/.ssh keys that exhaust MaxAuthTries) # Force OpenSSH to use only the deploy key (ignore forwarded ssh-agent / default ~/.ssh keys that exhaust MaxAuthTries)
export GIT_SSH_COMMAND="ssh -i ${DEPLOY_KEY} -p 2222 -o IdentitiesOnly=yes -o IdentityAgent=none -o BatchMode=yes -o StrictHostKeyChecking=accept-new" GIT_SSH_CMD="ssh -i ${DEPLOY_KEY} -p 2222 -o IdentitiesOnly=yes -o IdentityAgent=none -o BatchMode=yes -o StrictHostKeyChecking=accept-new"
unset SSH_AUTH_SOCK || true GIT_SSH_FLAGS=(-c "core.sshCommand=${GIT_SSH_CMD}")
fi fi
TARGET_REPO="all" TARGET_REPO="all"
@@ -110,7 +111,7 @@ if [[ "${DO_PULL}" -eq 1 ]]; then
GIT_PULL_PREFIX=() GIT_PULL_PREFIX=()
if [[ -f "${DEPLOY_KEY}" ]] && [[ ! -r "${DEPLOY_KEY}" ]]; then if [[ -f "${DEPLOY_KEY}" ]] && [[ ! -r "${DEPLOY_KEY}" ]]; then
if [[ -n "${SUDO}" ]]; then if [[ -n "${SUDO}" ]]; then
GIT_PULL_PREFIX=("${SUDO}" env "GIT_SSH_COMMAND=${GIT_SSH_COMMAND}") GIT_PULL_PREFIX=("${SUDO}")
else else
echo "[ERROR] Deploy key ${DEPLOY_KEY} is not readable by $(id -un) and sudo is unavailable." >&2 echo "[ERROR] Deploy key ${DEPLOY_KEY} is not readable by $(id -un) and sudo is unavailable." >&2
exit 1 exit 1
@@ -124,7 +125,7 @@ if [[ "${DO_PULL}" -eq 1 ]]; then
fi fi
if [[ -d "${REPOS_ROOT}/${repo}/.git" ]]; then if [[ -d "${REPOS_ROOT}/${repo}/.git" ]]; then
remote_name="origin" remote_name="origin"
if [[ "${repo}" == "haiperdohp-jemaytreeah" ]] && git -C "${REPOS_ROOT}/${repo}" remote | grep -qx "downstream"; then if [[ "${repo}" == "haiperdohp-jemaytreeah" ]] && git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/${repo}" remote | grep -qx "downstream"; then
remote_name="downstream" remote_name="downstream"
fi fi
forge_ssh="ssh://git@git.libre.audio:2222/seasharp" forge_ssh="ssh://git@git.libre.audio:2222/seasharp"
@@ -132,15 +133,15 @@ if [[ "${DO_PULL}" -eq 1 ]]; then
if [[ "${repo}" == "hyperdope-ci-build" || "${repo}" == "ingglish-hyperdope-ci" ]]; then if [[ "${repo}" == "hyperdope-ci-build" || "${repo}" == "ingglish-hyperdope-ci" ]]; then
slug="ingglish-hyperdope-ci" slug="ingglish-hyperdope-ci"
fi fi
git -C "${REPOS_ROOT}/${repo}" remote set-url "${remote_name}" "${forge_ssh}/${slug}.git" || true git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/${repo}" remote set-url "${remote_name}" "${forge_ssh}/${slug}.git" || true
echo "[1/5] Updating ${REPOS_ROOT}/${repo} (${remote_name}/${branch}) with autostash rebase..." echo "[1/5] Updating ${REPOS_ROOT}/${repo} (${remote_name}/${branch}) with autostash rebase..."
prev_head="$(git -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)" prev_head="$(git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)"
if [[ "${#GIT_PULL_PREFIX[@]}" -gt 0 ]]; then if [[ "${#GIT_PULL_PREFIX[@]}" -gt 0 ]]; then
run_checked "git pull --rebase --autostash ${repo}" "${GIT_PULL_PREFIX[@]}" git -c "safe.directory=${REPOS_ROOT}/${repo}" -C "${REPOS_ROOT}/${repo}" pull --rebase --autostash "${remote_name}" "${branch}" run_checked "git pull --rebase --autostash ${repo}" "${GIT_PULL_PREFIX[@]}" git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -c "safe.directory=${REPOS_ROOT}/${repo}" -C "${REPOS_ROOT}/${repo}" pull --rebase --autostash "${remote_name}" "${branch}"
else else
run_checked "git pull --rebase --autostash ${repo}" git -C "${REPOS_ROOT}/${repo}" pull --rebase --autostash "${remote_name}" "${branch}" run_checked "git pull --rebase --autostash ${repo}" git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/${repo}" pull --rebase --autostash "${remote_name}" "${branch}"
fi fi
new_head="$(git -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)" new_head="$(git ${GIT_SSH_FLAGS[@]+"${GIT_SSH_FLAGS[@]}"} -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)"
if [[ "${repo}" == "hyperstitionstudio-core" && "${prev_head}" != "${new_head}" && -z "${HYPERSTITION_SYNC_REEXEC:-}" ]]; then if [[ "${repo}" == "hyperstitionstudio-core" && "${prev_head}" != "${new_head}" && -z "${HYPERSTITION_SYNC_REEXEC:-}" ]]; then
echo "[1/5] hyperstitionstudio-core updated (${prev_head:0:7} -> ${new_head:0:7}); re-executing updated sync-vps-repos.sh..." echo "[1/5] hyperstitionstudio-core updated (${prev_head:0:7} -> ${new_head:0:7}); re-executing updated sync-vps-repos.sh..."
export HYPERSTITION_SYNC_REEXEC=1 export HYPERSTITION_SYNC_REEXEC=1