#!/bin/bash set -e # Configuration UNRAID_HOST="root@192.168.2.61" REMOTE_PATH="/boot/config/plugins/compose.manager/projects/subspace-tv" GIT_HOST="git.michaelsimard.ca" GIT_PORT="28" GIT_REPO="git@git.michaelsimard.ca:msimard/subspace-tv.git" echo "=== Subspace TV - Unraid Setup ===" echo "" # Check local .env exists if [ ! -f ".env" ]; then echo "ERROR: Local .env file not found" echo "Copy .env.example to .env and configure it first" exit 1 fi echo "Step 1: Checking SSH connectivity to Unraid..." if ! ssh -o ConnectTimeout=5 "$UNRAID_HOST" "echo 'Connected'" 2>/dev/null; then echo "ERROR: Cannot connect to Unraid at $UNRAID_HOST" echo "Ensure SSH is enabled and key-based auth is configured" exit 1 fi echo " Connected to Unraid" echo "" echo "Step 2: Configuring SSH for git server on Unraid..." ssh "$UNRAID_HOST" bash </dev/null; then echo " Adding git server to SSH config..." cat >> ~/.ssh/config <&1 | grep -q 'successfully authenticated'"; then echo " Git server accessible" else echo "" echo "WARNING: Git authentication may not be configured" echo "Ensure the Unraid SSH public key is added to Gitea" echo "" echo "To view the public key, run:" echo " ssh $UNRAID_HOST 'cat ~/.ssh/id_ed25519.pub'" fi echo "" echo "=== Setup Complete ===" echo "" echo "Next steps:" echo " 1. Ensure git push is up to date" echo " 2. Run ./deploy.sh to deploy"