aboutsummaryrefslogtreecommitdiffstats
path: root/docker/entrypoint.sh
diff options
context:
space:
mode:
authorLibravatar Michal Kostewicz <m.kostewicz84@gmail.com>2021-02-07 16:26:58 +0100
committerLibravatar Michal Kostewicz <m.kostewicz84@gmail.com>2021-02-07 16:26:58 +0100
commitbbd2132feede2d8c5e214c4d8a436f5505b9a766 (patch)
treee92dce863e9a573e2160da570c75178af687ed93 /docker/entrypoint.sh
parentRevert line which choose DB folder using env. Move Dockerfile to root. Simpli... (diff)
downloadferdium-server-bbd2132feede2d8c5e214c4d8a436f5505b9a766.tar.gz
ferdium-server-bbd2132feede2d8c5e214c4d8a436f5505b9a766.tar.zst
ferdium-server-bbd2132feede2d8c5e214c4d8a436f5505b9a766.zip
Add script which will use config.txt if exist
Diffstat (limited to 'docker/entrypoint.sh')
-rwxr-xr-xdocker/entrypoint.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index 667196e..0bbcb9d 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -14,13 +14,26 @@ Support our Open Collective at:
14https://opencollective.com/getferdi/ 14https://opencollective.com/getferdi/
15EOL 15EOL
16 16
17# if config.txt doesn't exist then create one with default values
18if [ ! -f /config/config.txt ]; then
19 cp /app/.env.example /config/config.txt
20fi
21
22# use config.txt default values as .env file
23if [ -f /app/.env ]; then
24 rm /app/.env
25 ln -s /config/config.txt /app/.env
26elif [ ! -f /app/.env ]; then
27 ln -s /config/config.txt /app/.env
28fi
29
17# Create APP key if needed 30# Create APP key if needed
18if [ ! -f "/config/FERDI_APP_KEY.txt" ]; 31if [ ! -f "/config/FERDI_APP_KEY.txt" ];
19 then 32 then
20 echo " " 33 echo " "
21 echo "**** Generating Ferdi-server app key for first run ****" 34 echo "**** Generating Ferdi-server app key for first run ****"
22 adonis key:generate 35 adonis key:generate
23 source .env 36 APP_KEY=$(grep APP_KEY .env | cut -d '=' -f2)
24 echo $APP_KEY > /config/FERDI_APP_KEY.txt 37 echo $APP_KEY > /config/FERDI_APP_KEY.txt
25 echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****" 38 echo "**** App Key set to $APP_KEY you can modify FERDI_APP_KEY.txt to update your key ****"
26 sed -i "s/APP_KEY=/APP_KEY=$APP_KEY/g" /config/config.txt 39 sed -i "s/APP_KEY=/APP_KEY=$APP_KEY/g" /config/config.txt