Spaces:
Sleeping
Sleeping
Upload start.sh with huggingface_hub
Browse files
start.sh
CHANGED
|
@@ -1,30 +1,8 @@
|
|
| 1 |
-
#!/
|
| 2 |
-
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|