8900 commited on
Commit
bf1f380
Β·
verified Β·
1 Parent(s): 080dc72

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +5 -18
entrypoint.sh CHANGED
@@ -2,12 +2,7 @@
2
 
3
  # OpenClaw HF Spaces - Production Entrypoint
4
 
5
- #
6
- # SETUP_MARKER lives in /tmp.
7
- # /tmp is wiped on container restart but survives gateway restart.
8
- # So setup only runs once per container lifetime.
9
-
10
- SETUP_MARKER="/tmp/.openclaw-setup-done"
11
 
12
  # –– resolve writable home β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
13
 
@@ -38,21 +33,13 @@ done
38
 
39
  export HF_TOKEN="${HF_TOKEN:-}"
40
 
41
- # –– run setup only on first boot –––––––––––––
42
-
43
- # Gateway restart reuses /tmp, so marker survives -> setup skipped.
44
- # Container restart wipes /tmp, marker gone -> setup runs once.
45
 
46
- if [ ! -f "$SETUP_MARKER" ]; then
47
- echo "[entrypoint] First boot - running setup…"
48
  node /app/spaces/huggingface/setup-hf-config.mjs || true
49
- touch "$SETUP_MARKER"
50
- echo "[entrypoint] Setup done (marker created)"
51
- else
52
- echo "[entrypoint] Gateway restart - setup skipped (settings preserved)"
53
- fi
54
 
55
- # –– security audit (non-fatal) ––––––––––––––
56
 
57
  if [ -f /app/security-check.sh ]; then
58
  sh /app/security-check.sh || true
 
2
 
3
  # OpenClaw HF Spaces - Production Entrypoint
4
 
5
+ # Setup always runs - but setup.mjs patches existing config, never overwrites.
 
 
 
 
 
6
 
7
  # –– resolve writable home β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
8
 
 
33
 
34
  export HF_TOKEN="${HF_TOKEN:-}"
35
 
36
+ # –– run setup β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
 
 
 
37
 
38
+ echo "[entrypoint] Running setup…"
 
39
  node /app/spaces/huggingface/setup-hf-config.mjs || true
40
+ echo "[entrypoint] Setup done."
 
 
 
 
41
 
42
+ # –– security audit ––––––––––––––––––––
43
 
44
  if [ -f /app/security-check.sh ]; then
45
  sh /app/security-check.sh || true