Merge pull request #2666 from Yomanz/patch-1

Use app key from environment
This commit is contained in:
Dane Everitt 2020-11-08 11:47:26 -08:00 committed by GitHub
commit ce425435d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 5 deletions

View File

@ -20,10 +20,15 @@ else
touch /app/var/.env touch /app/var/.env
## manually generate a key because key generate --force fails ## manually generate a key because key generate --force fails
echo -e "Generating key." if [ -z $APP_KEY ]; then
APP_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) echo -e "Generating key."
echo -e "Generated app key: $APP_KEY" APP_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
echo -e "APP_KEY=$APP_KEY" > /app/var/.env echo -e "Generated app key: $APP_KEY"
echo -e "APP_KEY=$APP_KEY" > /app/var/.env
else
echo -e "APP_KEY exists in environment, using that."
echo -e "APP_KEY=$APP_KEY" > /app/var/.env
fi
ln -s /app/var/.env /app/ ln -s /app/var/.env /app/
fi fi
@ -77,4 +82,4 @@ yarn add cross-env
yarn run build:production yarn run build:production
echo -e "Starting supervisord." echo -e "Starting supervisord."
exec "$@" exec "$@"