diff options
-rwxr-xr-x | start.sh | 20 |
1 files changed, 3 insertions, 17 deletions
@@ -5,25 +5,11 @@ set -eu | |||
5 | export NODE_ENV=production | 5 | export NODE_ENV=production |
6 | export TOKENSTORE_FILE=/app/data/tokens.json | 6 | export TOKENSTORE_FILE=/app/data/tokens.json |
7 | 7 | ||
8 | if [[ ! -d "/app/data/surfer_root" ]]; then | 8 | [[ -d /app/data/surfer_root ]] && mv /app/data/surfer_root /app/data/public |
9 | echo "=> Migrating root folder from /app/data to /app/data/surfer_root" | 9 | mkdir -p /app/data/public |
10 | |||
11 | mkdir -p /app/data/surfer_root | ||
12 | for file in `find /app/data -maxdepth 1 -mindepth 1 -type f -printf "%f\n"`; do | ||
13 | echo " => Moving /app/data/${file}" | ||
14 | mv "/app/data/${file}" /app/data/surfer_root | ||
15 | done | ||
16 | |||
17 | for dir in `find /app/data -maxdepth 1 -mindepth 1 -type d -printf "%f\n"`; do | ||
18 | if [[ "$dir" != "surfer_root" ]]; then | ||
19 | echo " => Moving /app/data/${dir}" | ||
20 | mv "/app/data/${dir}" /app/data/surfer_root | ||
21 | fi | ||
22 | done | ||
23 | fi | ||
24 | 10 | ||
25 | echo "=> Ensure permissions" | 11 | echo "=> Ensure permissions" |
26 | chown -R cloudron:cloudron /app/data | 12 | chown -R cloudron:cloudron /app/data |
27 | 13 | ||
28 | echo "=> Start the server" | 14 | echo "=> Start the server" |
29 | exec /usr/local/bin/gosu cloudron:cloudron node /app/code/server.js /app/data/surfer_root /app/data/.surfer.json | 15 | exec /usr/local/bin/gosu cloudron:cloudron node /app/code/server.js /app/data/public /app/data/.surfer.json |