Add hermes Gitea mirror: push-to-hermes.sh + deployment docs

- scripts/push-to-hermes.sh: one-command push to VPS Gitea (fetches
  token via SSH on each run, never stores it in git)
- replit.md: document hermes Gitea setup (PostgreSQL-backed), backup
  instructions, push workflow
This commit is contained in:
Replit Agent
2026-03-20 02:25:40 +00:00
parent 8da43b097a
commit cdb104e34f
2 changed files with 58 additions and 0 deletions

32
scripts/push-to-hermes.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Push current workspace to hermes Gitea (backup / deployment source)
# Usage: bash scripts/push-to-hermes.sh
#
# The hermes remote uses an API token embedded in the URL.
# Token is stored in /root/.gitea-replit-token on the VPS.
# Re-fetch and re-add the remote if this is a fresh Replit session.
set -e
HERMES_IP="143.198.27.163"
GITEA_PORT="3000"
GITEA_USER="admin"
GITEA_REPO="timmy-tower"
SSH_KEY="${HOME}/.ssh/id_ed25519"
# Fetch token from VPS each run (avoids storing token in git)
echo "[hermes] Fetching push token from VPS..."
TOKEN=$(ssh -o StrictHostKeyChecking=no -i "$SSH_KEY" "root@$HERMES_IP" \
"cat /root/.gitea-replit-token")
REMOTE_URL="http://${GITEA_USER}:${TOKEN}@${HERMES_IP}:${GITEA_PORT}/${GITEA_USER}/${GITEA_REPO}.git"
# Add/update remote
git remote remove hermes 2>/dev/null || true
git remote add hermes "$REMOTE_URL"
# Push all branches and tags
echo "[hermes] Pushing all branches..."
git push hermes --all --no-verify
git push hermes --tags --no-verify
echo "[hermes] Done. Gitea UI: http://${HERMES_IP}:${GITEA_PORT}/${GITEA_USER}/${GITEA_REPO}"