Skip to content

Commit

Permalink
Fixes #16, checks for OPENAI_API_KEY before writing to .env, same wit…
Browse files Browse the repository at this point in the history
…h PHP configs
  • Loading branch information
aschmelyun committed Apr 16, 2023
1 parent 923ef67 commit cef96d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_VERSION=1.0.7
APP_VERSION=1.0.8

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
Expand Down
10 changes: 6 additions & 4 deletions startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ if [ -z "$MEMORY_LIMIT" ]; then
MEMORY_LIMIT="512M"
fi

echo "OPENAI_API_KEY=$OPENAI_API_KEY" >> .env
# Only add this line if it's not present in the .env file
grep -qxF "OPENAI_API_KEY=$OPENAI_API_KEY" .env || echo "OPENAI_API_KEY=$OPENAI_API_KEY" >> .env

echo "memory_limit = $MEMORY_LIMIT" >> /usr/local/etc/php/php.ini
echo "upload_max_filesize = $UPLOAD_MAX_FILESIZE" >> /usr/local/etc/php/php.ini
echo "post_max_size = $UPLOAD_MAX_FILESIZE" >> /usr/local/etc/php/php.ini
# Only add these lines if they're not present in the php.ini file
grep -qxF "memory_limit = $MEMORY_LIMIT" /usr/local/etc/php/php.ini || echo "memory_limit = $MEMORY_LIMIT" >> /usr/local/etc/php/php.ini
grep -qxF "upload_max_filesize = $UPLOAD_MAX_FILESIZE" /usr/local/etc/php/php.ini || echo "upload_max_filesize = $UPLOAD_MAX_FILESIZE" >> /usr/local/etc/php/php.ini
grep -qxF "post_max_size = $UPLOAD_MAX_FILESIZE" /usr/local/etc/php/php.ini || echo "post_max_size = $UPLOAD_MAX_FILESIZE" >> /usr/local/etc/php/php.ini

php artisan key:generate

Expand Down

0 comments on commit cef96d6

Please sign in to comment.