bunch of shit
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
# ./switchToClone.sh key -> creates a deploy key and prints the public half (add it in Gitea: repo → Settings → Deploy keys, read-only)
|
||||
# ./switchToClone.sh clone -> clones over ssh (port 2222), moves .env + generated files + plugin zips into it
|
||||
set -euo pipefail
|
||||
REPO_SSH="${REPO_SSH:-ssh://git@git.dumpstervigilantes.rip:2222/techy/Media-Server-Setup.git}"
|
||||
REPO_SSH="${REPO_SSH:-ssh://git@git.vng.one:2222/techy/Media-Server-Setup.git}"
|
||||
DIR="$HOME/vanguard-stream"; KEY="$HOME/.ssh/vanguard-deploy"
|
||||
case "${1:-}" in
|
||||
key)
|
||||
[[ -f $KEY ]] || ssh-keygen -t ed25519 -N "" -C "vanguard-deploy@$(hostname)" -f "$KEY" >/dev/null
|
||||
cat > "$HOME/.ssh/config.vanguard" <<CFG
|
||||
Host git.dumpstervigilantes.rip
|
||||
Host git.vng.one
|
||||
Port 2222
|
||||
User git
|
||||
IdentityFile $KEY
|
||||
@@ -19,7 +19,7 @@ CFG
|
||||
echo "Add this as a READ-ONLY deploy key on the repo (Gitea → repo → Settings → Deploy Keys):"; echo; cat "$KEY.pub" ;;
|
||||
clone)
|
||||
[[ -d $DIR/.git ]] && { echo "$DIR is already a clone"; exit 0; }
|
||||
ssh -o StrictHostKeyChecking=accept-new -p 2222 git@git.dumpstervigilantes.rip 2>&1 | grep -qi "successfully authenticated\|Hi there" || { echo "deploy key not accepted yet — run './switchToClone.sh key' and add it in Gitea"; exit 1; }
|
||||
ssh -o StrictHostKeyChecking=accept-new -p 2222 git@git.vng.one 2>&1 | grep -qi "successfully authenticated\|Hi there" || { echo "deploy key not accepted yet — run './switchToClone.sh key' and add it in Gitea"; exit 1; }
|
||||
mv "$DIR" "$DIR.old"
|
||||
git clone --quiet "$REPO_SSH" "$DIR"
|
||||
for f in .env Caddyfile mediamtx.yml copyparty.conf stream-token.secret deploy.env; do [[ -f $DIR.old/$f ]] && cp -a "$DIR.old/$f" "$DIR/$f"; done
|
||||
|
||||
Reference in New Issue
Block a user