- Organized 252 files across project - Root directory: 187 → 2 files (98.9% reduction) - Moved configuration guides to docs/04-configuration/ - Moved troubleshooting guides to docs/09-troubleshooting/ - Moved quick start guides to docs/01-getting-started/ - Moved reports to reports/ directory - Archived temporary files - Generated comprehensive reports and documentation - Created maintenance scripts and guides All files organized according to established standards.
61 lines
1.7 KiB
Bash
61 lines
1.7 KiB
Bash
#!/bin/bash
|
|
# Install Cloudflare Tunnel and Verify Complete Setup
|
|
# Run this on pve2 node
|
|
|
|
set -e
|
|
|
|
VMID=5000
|
|
TUNNEL_TOKEN="eyJhIjoiNTJhZDU3YTcxNjcxYzVmYzAwOWVkZjA3NDQ2NTgxOTYiLCJ0IjoiYjAyZmUxZmUtY2I3ZC00ODRlLTkwOWItN2NjNDEyOThlYmU4IiwicyI6Ik5HTmtOV0kwWXpNdFpUVmxaUzAwTVRFMkxXRXdNMk10WlRJNU1ETTFaRFF4TURBMiJ9"
|
|
|
|
# Colors
|
|
GREEN='\033[0;32m'
|
|
BLUE='\033[0;34m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m'
|
|
|
|
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
|
log_success() { echo -e "${GREEN}[✓]${NC} $1"; }
|
|
log_warn() { echo -e "${YELLOW}[⚠]${NC} $1"; }
|
|
|
|
echo ""
|
|
log_info "Installing Cloudflare Tunnel in container $VMID"
|
|
echo ""
|
|
|
|
# Check container
|
|
CONTAINER_STATUS=$(pct status $VMID 2>/dev/null | awk '{print $2}' || echo "unknown")
|
|
if [ "$CONTAINER_STATUS" != "running" ]; then
|
|
log_info "Starting container..."
|
|
pct start $VMID
|
|
sleep 5
|
|
fi
|
|
|
|
# Install cloudflared if needed
|
|
if ! pct exec $VMID -- command -v cloudflared >/dev/null 2>&1; then
|
|
log_info "Installing cloudflared..."
|
|
pct exec $VMID -- bash -c "cd /tmp && wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && dpkg -i cloudflared-linux-amd64.deb || apt install -f -y"
|
|
fi
|
|
|
|
# Install service
|
|
log_info "Installing tunnel service..."
|
|
pct exec $VMID -- cloudflared service install "$TUNNEL_TOKEN" 2>&1
|
|
|
|
# Start service
|
|
log_info "Starting cloudflared service..."
|
|
pct exec $VMID -- systemctl start cloudflared
|
|
pct exec $VMID -- systemctl enable cloudflared
|
|
|
|
sleep 5
|
|
|
|
# Check status
|
|
log_info "Service status:"
|
|
pct exec $VMID -- systemctl status cloudflared --no-pager -l | head -10
|
|
|
|
# Get tunnel info
|
|
log_info "Tunnel information:"
|
|
pct exec $VMID -- cloudflared tunnel list 2>&1
|
|
|
|
echo ""
|
|
log_success "Tunnel service installed!"
|
|
echo ""
|
|
|