GTO-Custom-AI commited on
Commit
d75f749
·
verified ·
1 Parent(s): f34bdbb

Upload start.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. start.sh +8 -30
start.sh CHANGED
@@ -1,30 +1,8 @@
1
- #!/usr/bin/env bash
2
- # ==============================================================================
3
- # start.sh – Bootstrap script for n8n on Hugging Face Spaces
4
- #
5
- # Runs as root (PID 1 is tini), fixes the permission wall, then drops
6
- # privileges to uid 1000 before executing n8n.
7
- # ==============================================================================
8
- set -euo pipefail
9
-
10
- N8N_DATA="/data/.n8n"
11
-
12
- echo "▸ [start.sh] Ensuring data directory exists …"
13
- mkdir -p "${N8N_DATA}"
14
-
15
- # ---------- Fix the Permission Wall -------------------------------------------
16
- # HF mounts /data owned by a different uid. n8n refuses to start if config
17
- # files are readable by group/other (requires 0600 / 0700).
18
- echo "▸ [start.sh] Fixing ownership → 1000:1000 …"
19
- chown -R 1000:1000 /data
20
-
21
- echo "▸ [start.sh] Fixing permissions → dirs 0700, files 0600 …"
22
- find "${N8N_DATA}" -type d -exec chmod 0700 {} +
23
- find "${N8N_DATA}" -type f -exec chmod 0600 {} +
24
-
25
- # ---------- Drop Privileges & Launch ------------------------------------------
26
- echo "▸ [start.sh] Dropping to user node (1000), starting n8n on port ${N8N_PORT:-7860} …"
27
-
28
- # su-exec replaces the current process (no intermediate shell).
29
- # Call n8n via its full path to bypass the broken global symlink.
30
- exec su-exec node node /usr/local/lib/node_modules/n8n/bin/n8n start
 
1
+ #!/bin/sh
2
+ echo "Surgical Permission Fix starting..."
3
+ # Fix permissions on the persistent volume
4
+ chown -R 1000:1000 /data/.n8n
5
+ chmod -R 700 /data/.n8n
6
+
7
+ echo "Launching n8n..."
8
+ exec n8n start