Skip to content
Merged
Changes from all commits
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
15 changes: 10 additions & 5 deletions docker/deploy/etc/s6-overlay/scripts/laravel-automations
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,17 @@ echo "✅ Symlinks created."
echo ""

# Check for app key
if grep -E "APP_KEY=[0-9A-Za-z:+\/=]{1,}" $WEBUSER_HOME/.env > /dev/null; then
echo "✅ App key exists"
if [ ! ${APP_KEY} ]; then
if grep -E "APP_KEY=[0-9A-Za-z:+\/=]{1,}" $WEBUSER_HOME/.env > /dev/null; then
echo "✅ An application key exists."
else
echo "⏳ Generating an application key..."
export APP_KEY=$(s6-setuidgid webuser php $WEBUSER_HOME/artisan key:generate --show)
echo "⚠️ An application key was generated at start up, no environment variable was set."
echo "👀 To set an application key that persists, read the docs: https://docs.speedtest-tracker.dev/"
fi
else
echo "⏳ Generating app key..."
s6-setuidgid webuser php $WEBUSER_HOME/artisan key:generate --no-ansi -q
echo "✅ App key generated."
echo "✅ An application key environment variable exists."
fi

echo ""
Expand Down