Files
proxmox/scripts/archive/consolidated/deploy/install-tunnel-in-container.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

79 lines
2.2 KiB
Bash

#!/bin/bash
set -euo pipefail
# Load IP configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
# Install Cloudflare Tunnel in Container - Run this INSIDE the container
# Usage: Copy this script into container and run it
TUNNEL_TOKEN="eyJhIjoiNTJhZDU3YTcxNjcxYzVmYzAwOWVkZjA3NDQ2NTgxOTYiLCJ0IjoiYjAyZmUxZmUtY2I3ZC00ODRlLTkwOWItN2NjNDEyOThlYmU4IiwicyI6Ik5HTmtOV0kwWXpNdFpUVmxaUzAwTVRFMkxXRXdNMk10WlRJNU1ETTFaRFF4TURBMiJ9"
EXPLORER_IP="${IP_BLOCKSCOUT}"
EXPLORER_DOMAIN="explorer.d-bis.org"
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
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 ==="
echo ""
# Check if cloudflared is installed
if ! command -v cloudflared &> /dev/null; then
log_info "Installing cloudflared..."
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
log_success "cloudflared installed"
else
log_success "cloudflared already installed"
fi
# Install service with token
log_info "Installing cloudflared service with tunnel token..."
cloudflared service install "$TUNNEL_TOKEN"
# Start and enable service
log_info "Starting cloudflared service..."
systemctl start cloudflared
systemctl enable cloudflared
# Wait a moment
sleep 5
# Check status
log_info "Checking service status..."
systemctl status cloudflared --no-pager -l | head -15
# Get tunnel ID
log_info "Getting tunnel information..."
cloudflared tunnel list
# Check config
if [ -f /etc/cloudflared/config.yml ]; then
log_info "Config file:"
cat /etc/cloudflared/config.yml | head -20
fi
echo ""
log_success "Installation complete!"
echo ""
log_info "Next steps:"
echo " 1. Get tunnel ID from: cloudflared tunnel list"
echo " 2. Configure DNS: explorer → <tunnel-id>.cfargotunnel.com (🟠 Proxied)"
echo " 3. Configure tunnel route in Cloudflare Zero Trust dashboard"
echo " 4. Test: curl https://$EXPLORER_DOMAIN/api/v2/stats"
echo ""