diff options
author | Girish Ramakrishnan <girish@cloudron.io> | 2019-10-17 15:10:20 -0700 |
---|---|---|
committer | Girish Ramakrishnan <girish@cloudron.io> | 2019-10-17 15:10:20 -0700 |
commit | 8878114409ad6de95d62029e5fa8f0eaefc8bf40 (patch) | |
tree | 25ced1ef20bec9cc8f648e7b8d9b4ccad373830b | |
parent | 8a6c431c9283674711ecaaf50d8d829919d9ceb0 (diff) | |
download | Surfer-8878114409ad6de95d62029e5fa8f0eaefc8bf40.tar.gz Surfer-8878114409ad6de95d62029e5fa8f0eaefc8bf40.tar.zst Surfer-8878114409ad6de95d62029e5fa8f0eaefc8bf40.zip |
Rename surfer_root to public
-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 |