diff --git a/README.md b/README.md index 761334d..dfd0492 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ > **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 → [`https://hyperstitionstud.io/`](https://hyperstitionstud.io/) -> - **Latest Commit Scope (`hyperstitionstudio-core`):** Synchronized v2.17.1 release state across 2 tracked module/artifact surface(s) -> - **Touched Files / Surfaces:** `deploy/run-vps-data-production.sh`, `deploy/sync-vps-repos.sh` +> - **Latest Commit Scope (`hyperstitionstudio-core`):** Synchronized v2.17.1 release state across 1 tracked module/artifact surface(s) +> - **Touched Files / Surfaces:** `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 diff --git a/deploy/sync-vps-repos.sh b/deploy/sync-vps-repos.sh index 31f8342..c3d6ac1 100755 --- a/deploy/sync-vps-repos.sh +++ b/deploy/sync-vps-repos.sh @@ -44,8 +44,11 @@ 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 -p 2222 -o StrictHostKeyChecking=accept-new" +DEPLOY_KEY="/etc/hyperstitionstud.io/id_ed25519_git_libre_audio" +if [[ -f "${DEPLOY_KEY}" ]]; then + # 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" + unset SSH_AUTH_SOCK || true fi TARGET_REPO="all" @@ -104,6 +107,15 @@ REPOS=( ) if [[ "${DO_PULL}" -eq 1 ]]; then + GIT_PULL_PREFIX=() + if [[ -f "${DEPLOY_KEY}" ]] && [[ ! -r "${DEPLOY_KEY}" ]]; then + if [[ -n "${SUDO}" ]]; then + GIT_PULL_PREFIX=("${SUDO}" env "GIT_SSH_COMMAND=${GIT_SSH_COMMAND}") + else + echo "[ERROR] Deploy key ${DEPLOY_KEY} is not readable by $(id -un) and sudo is unavailable." >&2 + exit 1 + fi + fi for entry in "${REPOS[@]}"; do repo="${entry%%:*}" branch="${entry##*:}" @@ -115,17 +127,19 @@ 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" - slug="${repo}" - if [[ "${repo}" == "hyperdope-ci-build" || "${repo}" == "ingglish-hyperdope-ci" ]]; then - slug="ingglish-hyperdope-ci" - fi - git -C "${REPOS_ROOT}/${repo}" remote set-url origin "${forge_ssh}/${slug}.git" || true + forge_ssh="ssh://git@git.libre.audio:2222/seasharp" + slug="${repo}" + if [[ "${repo}" == "hyperdope-ci-build" || "${repo}" == "ingglish-hyperdope-ci" ]]; then + slug="ingglish-hyperdope-ci" fi + git -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..." 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}" + 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}" + else + run_checked "git pull --rebase --autostash ${repo}" git -C "${REPOS_ROOT}/${repo}" pull --rebase --autostash "${remote_name}" "${branch}" + fi new_head="$(git -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)" 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..."