Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
dont copy production env file, no longer exists
  • Loading branch information
alexjustesen committed Jun 7, 2024
commit 9df787bf5aeb2f5af8e7011f6ef9454904609a70
36 changes: 17 additions & 19 deletions root/etc/s6-overlay/s6-rc.d/init-speedtest-tracker-config/run
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,28 @@ lsiown -R abc:abc \
/app/www/storage

# Check for env file
if [[ ! -f /config/.env ]]; then
cp /app/www/.env.production /config/.env
fi

# create symlinks
symlinks=( \
/app/www/.env \
)
if [[ -f /config/.env ]]; then
# create symlinks
symlinks=( \
/app/www/.env \
)

for i in "${symlinks[@]}"
do
if [[ -e "$i" && ! -L "$i" ]]; then
rm -rf "$i"
fi
if [[ ! -L "$i" ]]; then
ln -s /config/"$(basename "$i")" "$i"
fi
done
for i in "${symlinks[@]}"
do
if [[ -e "$i" && ! -L "$i" ]]; then
rm -rf "$i"
fi
if [[ ! -L "$i" ]]; then
ln -s /config/"$(basename "$i")" "$i"
fi
done
fi

# Check for app key
if [[ -z ${APP_KEY} ]]; then
if ! grep -E "APP_KEY=[0-9A-Za-z:+\/=]{1,}" /app/www/.env > /dev/null; then
if ! grep -qE "APP_KEY=[0-9A-Za-z:+\/=]{1,}" /app/www/.env 2> /dev/null; then
echo "An application key is missing!"
echo "Go to https://speedtest-tracker.dev/ generate an application key."
echo "You can generate a key at https://speedtest-tracker.dev/."
fi
fi

Expand Down