Download scripts/start/cloudflared-start.sh from hftestx/2798e29d: direct link, hf CLI and curl.
- Browser
- Download file 717 Bytes
-
https://huggingface.co/spaces/hftestx/2798e29d/resolve/main/scripts/start/cloudflared-start.sh
- Command line
-
hf download hf://spaces/hftestx/2798e29d/scripts/start/cloudflared-start.sh
-
curl -L -o cloudflared-start.sh https://huggingface.co/spaces/hftestx/2798e29d/resolve/main/scripts/start/cloudflared-start.sh
717 Bytes
| set -e | |
| # Log function | |
| log() { | |
| echo "[$(date '+%Y-%m-%d %H:%M:%S')] [CLOUDFLARED] $*" | |
| } | |
| # Check if Cloudflared is enabled and token is provided | |
| if [[ "${CLOUDFLARED_ENABLED:-false}" == "true" && -n "$CLOUDFLARED_TUNNEL_TOKEN" ]]; then | |
| log "Starting Cloudflare tunnel..." | |
| log "Token: ${CLOUDFLARED_TUNNEL_TOKEN:0:10}..." | |
| # Check if cloudflared binary exists | |
| if ! command -v cloudflared &> /dev/null; then | |
| log "ERROR: cloudflared binary not found in PATH" | |
| exit 1 | |
| fi | |
| # Start cloudflared in background | |
| exec cloudflared tunnel run --token "$CLOUDFLARED_TUNNEL_TOKEN" | |
| else | |
| log "Cloudflared is disabled or CLOUDFLARED_TUNNEL_TOKEN is not set" | |
| exit 0 | |
| fi |