diff options
author | Johannes Zellner <johannes@cloudron.io> | 2018-05-17 16:17:28 +0200 |
---|---|---|
committer | Johannes Zellner <johannes@cloudron.io> | 2018-05-17 16:17:28 +0200 |
commit | 824da8dd5ab3f3104a6d4dbe8d7b18d8c8436cef (patch) | |
tree | 91c81562a39f68f1cc95a45095eca387a1fe7711 | |
parent | f43b3c162f5a0857d9fd56f4d8005763fcdca4cc (diff) | |
download | Surfer-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-x | start.sh | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -4,6 +4,25 @@ set -eu | |||
4 | 4 | ||
5 | export NODE_ENV=production | 5 | export NODE_ENV=production |
6 | 6 | ||
7 | if [[ ! -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 | ||
22 | fi | ||
23 | |||
24 | echo "=> Ensure permissions" | ||
7 | chown -R cloudron:cloudron /app/data | 25 | chown -R cloudron:cloudron /app/data |
8 | 26 | ||
9 | exec /usr/local/bin/gosu cloudron:cloudron node /app/code/server.js /app/data | 27 | echo "=> Start the server" |
28 | exec /usr/local/bin/gosu cloudron:cloudron node /app/code/server.js /app/data/surfer_root /app/data/.surfer.json | ||