aboutsummaryrefslogtreecommitdiffstats
path: root/docker/entrypoint.sh
diff options
context:
space:
mode:
authorLibravatar thursday <xthursdayx@mailbox.org>2021-09-17 08:28:46 +0000
committerLibravatar GitHub <noreply@github.com>2021-09-17 08:28:46 +0000
commit1122af152e71d4d353ff8de36807f8f8d1393244 (patch)
tree4682192078030da39ab85b0b6a2f1664b7a2820f /docker/entrypoint.sh
parentUpdate entrypoint.sh (diff)
downloadferdium-server-1122af152e71d4d353ff8de36807f8f8d1393244.tar.gz
ferdium-server-1122af152e71d4d353ff8de36807f8f8d1393244.tar.zst
ferdium-server-1122af152e71d4d353ff8de36807f8f8d1393244.zip
Fixed shebang and simplfied if statement.
Diffstat (limited to 'docker/entrypoint.sh')
-rwxr-xr-xdocker/entrypoint.sh17
1 files changed, 7 insertions, 10 deletions
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index abd0ed3..2a91839 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -1,6 +1,6 @@
1#!/bin/sh 1#!/bin/bash
2 2
3echo << EOL 3cat << EOL
4------------------------------------- 4-------------------------------------
5 ____ ___ 5 ____ ___
6 / __/__ _______/ (_) 6 / __/__ _______/ (_)
@@ -15,23 +15,20 @@ https://opencollective.com/getferdi/
15EOL 15EOL
16 16
17# Create APP key if needed 17# Create APP key if needed
18if [[ -f "${DATA_DIR}/FERDI_APP_KEY.txt" ]]; then 18if [[ -z ${APP_KEY} && ! -f "${DATA_DIR}/FERDI_APP_KEY.txt" ]]; then
19 echo " "
20 echo "**** App Key found ****"
21 APP_KEY=$(cat "${DATA_DIR}/FERDI_APP_KEY.txt")
22 echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****"
23elif [[ -z "${APP_KEY}" ]]; then
24 echo "**** Generating Ferdi-server app key for first run ****" 19 echo "**** Generating Ferdi-server app key for first run ****"
25 adonis key:generate 20 adonis key:generate
26 APP_KEY=$(grep APP_KEY .env | cut -d '=' -f2) 21 APP_KEY=$(grep APP_KEY .env | cut -d '=' -f2)
27 echo "${APP_KEY}" > "${DATA_DIR}/FERDI_APP_KEY.txt" 22 echo "${APP_KEY}" > "${DATA_DIR}/FERDI_APP_KEY.txt"
28 echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" 23 echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****"
24else APP_KEY=$(cat "${DATA_DIR}/FERDI_APP_KEY.txt")
25 echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****"
29fi 26fi
30 27
31export APP_KEY 28export APP_KEY
32 29
33node ace migration:run --force 30node ace migration:run --force
34 31
35chown -R ${PUID:-1000}:${PGID:-1000} $DATA_DIR /app 32chown -R "${PUID:-1000}":"${PGID:-1000}" "$DATA_DIR" /app
36 33
37su-exec ${PUID:-1000}:${PGID:-1000} node server.js 34su-exec "${PUID:-1000}":"${PGID:-1000}" node server.js#!/bin/bash