forked from syntaxbullet/AuroraBot-discord
feat: Add script and configuration for remote Drizzle Studio access via SSH tunnel.
This commit is contained in:
25
scripts/remote-studio.sh
Executable file
25
scripts/remote-studio.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load environment variables
|
||||
if [ -f .env ]; then
|
||||
# export $(grep -v '^#' .env | xargs) # Use a safer way if possible, but for simple .env this often works.
|
||||
# Better way to source .env without exporting everything to shell if we just want to use them in script:
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
fi
|
||||
|
||||
if [ -z "$VPS_HOST" ] || [ -z "$VPS_USER" ]; then
|
||||
echo "Error: VPS_HOST and VPS_USER must be set in .env"
|
||||
echo "Please add them to your .env file:"
|
||||
echo "VPS_USER=your-username"
|
||||
echo "VPS_HOST=your-ip-address"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🔮 Establishing secure tunnel to Drizzle Studio..."
|
||||
echo "📚 Studio will be accessible at: https://local.drizzle.studio"
|
||||
echo "Press Ctrl+C to stop the connection."
|
||||
|
||||
# -N means "Do not execute a remote command". -L is for local port forwarding.
|
||||
ssh -N -L 4983:127.0.0.1:4983 $VPS_USER@$VPS_HOST
|
||||
Reference in New Issue
Block a user