aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Zellner <johannes@cloudron.io>2018-05-17 16:17:28 +0200
committerJohannes Zellner <johannes@cloudron.io>2018-05-17 16:17:28 +0200
commit824da8dd5ab3f3104a6d4dbe8d7b18d8c8436cef (patch)
tree91c81562a39f68f1cc95a45095eca387a1fe7711
parentf43b3c162f5a0857d9fd56f4d8005763fcdca4cc (diff)
downloadSurfer-824da8dd5ab3f3104a6d4dbe8d7b18d8c8436cef.tar.gz
Surfer-824da8dd5ab3f3104a6d4dbe8d7b18d8c8436cef.tar.zst
Surfer-824da8dd5ab3f3104a6d4dbe8d7b18d8c8436cef.zip
Move root folder to /app/data/surfer_root to not clash with the config file
-rwxr-xr-xstart.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/start.sh b/start.sh
index 6d36f6d..562eb84 100755
--- a/start.sh
+++ b/start.sh
@@ -4,6 +4,25 @@ set -eu
4 4
5export NODE_ENV=production 5export NODE_ENV=production
6 6
7if [[ ! -d "/app/data/surfer_root" ]]; then
8 echo "=> Migrating root folder from /app/data to /app/data/surfer_root"
9
10 mkdir -p /app/data/surfer_root
11 for file in `find /app/data -maxdepth 1 -mindepth 1 -type f -printf "%f\n"`; do
12 echo " => Moving /app/data/${file}"
13 mv "/app/data/${file}" /app/data/surfer_root
14 done
15
16 for dir in `find /app/data -maxdepth 1 -mindepth 1 -type d -printf "%f\n"`; do
17 if [[ "$dir" != "surfer_root" ]]; then
18 echo " => Moving /app/data/${dir}"
19 mv "/app/data/${dir}" /app/data/surfer_root
20 fi
21 done
22fi
23
24echo "=> Ensure permissions"
7chown -R cloudron:cloudron /app/data 25chown -R cloudron:cloudron /app/data
8 26
9exec /usr/local/bin/gosu cloudron:cloudron node /app/code/server.js /app/data 27echo "=> Start the server"
28exec /usr/local/bin/gosu cloudron:cloudron node /app/code/server.js /app/data/surfer_root /app/data/.surfer.json