feat: add SSH access via Cloudflare Tunnel

- Add ssh.mana.how route to cloudflared config
- Add client setup script for SSH via tunnel

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2026-01-22 19:27:39 +01:00
parent 4ebe3ec574
commit 4023390c0c
2 changed files with 52 additions and 0 deletions

View file

@ -2,6 +2,11 @@ tunnel: bb0ea86d-8253-4a54-838b-107bb7945be9
credentials-file: /Users/mana/.cloudflared/bb0ea86d-8253-4a54-838b-107bb7945be9.json credentials-file: /Users/mana/.cloudflared/bb0ea86d-8253-4a54-838b-107bb7945be9.json
ingress: ingress:
# SSH Access (requires cloudflared on client)
- hostname: ssh.mana.how
service: ssh://localhost:22
# Web Services
- hostname: auth.mana.how - hostname: auth.mana.how
service: http://localhost:3001 service: http://localhost:3001
- hostname: mana.how - hostname: mana.how

View file

@ -0,0 +1,47 @@
#!/bin/bash
# Setup SSH access to Mac Mini via Cloudflare Tunnel
# Run this on your LOCAL machine (not on Mac Mini)
set -e
echo "=== SSH Client Setup for Mac Mini ==="
echo ""
# Check if cloudflared is installed
if ! command -v cloudflared &> /dev/null; then
echo "Installing cloudflared..."
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install cloudflared
else
echo "Please install cloudflared manually: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/"
exit 1
fi
fi
# Create SSH config directory
mkdir -p ~/.ssh
# Add SSH config for Mac Mini
if ! grep -q "Host mac-mini" ~/.ssh/config 2>/dev/null; then
echo "" >> ~/.ssh/config
cat >> ~/.ssh/config << 'EOF'
# Mac Mini via Cloudflare Tunnel
Host mac-mini
HostName ssh.mana.how
User mana
ProxyCommand cloudflared access ssh --hostname %h
EOF
echo "Added mac-mini to ~/.ssh/config"
else
echo "mac-mini already in ~/.ssh/config"
fi
echo ""
echo "=== Setup Complete ==="
echo ""
echo "You can now connect with:"
echo " ssh mac-mini"
echo ""
echo "First connection will open browser for Cloudflare Access login."
echo ""