This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
token-gated-economy/scripts/push-to-hermes.sh
Replit Agent cdb104e34f 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
2026-03-20 02:25:40 +00:00

33 lines
1.1 KiB
Bash
Executable File

#!/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}"