Subsequently commited on
Commit
be51127
·
verified ·
1 Parent(s): 256a8cb

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +13 -7
entrypoint.sh CHANGED
@@ -2,6 +2,17 @@
2
  # OpenClaw HF Spaces - Production Entrypoint
3
  # Storage: HF Storage Bucket at /data (100 GB persistent)
4
 
 
 
 
 
 
 
 
 
 
 
 
5
  # ----------------------------------------------------------------
6
  # Logging
7
  # ----------------------------------------------------------------
@@ -11,8 +22,6 @@ warn() { echo "[$(ts)] [entrypoint] WARN: $*"; }
11
 
12
  # ----------------------------------------------------------------
13
  # Storage: resolve OPENCLAW_HOME
14
- # Prefer /data (HF Storage Bucket). Fall back to /home/user.
15
- # Retry up to 5s in case the bucket mount is slightly delayed.
16
  # ----------------------------------------------------------------
17
  OPENCLAW_HOME=/home/user
18
  mkdir -p /home/user/.openclaw
@@ -62,15 +71,12 @@ done
62
  export HF_TOKEN="${HF_TOKEN:-}"
63
 
64
  # ----------------------------------------------------------------
65
- # One-time setup (config write, webhook registration, seed files)
66
  # ----------------------------------------------------------------
67
  log "Running setup..."
68
  node /app/spaces/huggingface/setup-hf-config.mjs || true
69
  log "Setup done."
70
 
71
- # ----------------------------------------------------------------
72
- # Security audit (non-fatal)
73
- # ----------------------------------------------------------------
74
  if [ -f /app/security-check.sh ]; then
75
  sh /app/security-check.sh || true
76
  fi
@@ -152,4 +158,4 @@ while true; do
152
 
153
  sleep 1
154
  log "Restarting gateway..."
155
- done
 
2
  # OpenClaw HF Spaces - Production Entrypoint
3
  # Storage: HF Storage Bucket at /data (100 GB persistent)
4
 
5
+ # ── Fix: Force IPv4 for Telegram (IPv6 route broken on HF nodes) ──
6
+ sysctl -w net.ipv6.conf.all.disable_ipv6=1 2>/dev/null || true
7
+ sysctl -w net.ipv6.conf.default.disable_ipv6=1 2>/dev/null || true
8
+ export NODE_OPTIONS="--dns-result-order=ipv4first ${NODE_OPTIONS:-}"
9
+ {
10
+ echo "149.154.167.51 api.telegram.org"
11
+ echo "149.154.167.220 api.telegram.org"
12
+ echo "91.108.56.130 api.telegram.org"
13
+ } >> /etc/hosts 2>/dev/null || true
14
+ echo "[entrypoint] IPv6 disabled, IPv4 forced for Telegram"
15
+
16
  # ----------------------------------------------------------------
17
  # Logging
18
  # ----------------------------------------------------------------
 
22
 
23
  # ----------------------------------------------------------------
24
  # Storage: resolve OPENCLAW_HOME
 
 
25
  # ----------------------------------------------------------------
26
  OPENCLAW_HOME=/home/user
27
  mkdir -p /home/user/.openclaw
 
71
  export HF_TOKEN="${HF_TOKEN:-}"
72
 
73
  # ----------------------------------------------------------------
74
+ # One-time setup
75
  # ----------------------------------------------------------------
76
  log "Running setup..."
77
  node /app/spaces/huggingface/setup-hf-config.mjs || true
78
  log "Setup done."
79
 
 
 
 
80
  if [ -f /app/security-check.sh ]; then
81
  sh /app/security-check.sh || true
82
  fi
 
158
 
159
  sleep 1
160
  log "Restarting gateway..."
161
+ done