Merge pull request #70 from investbrainapp/use-correct-storage-path
refactor: use correct storage path for app key check
This commit is contained in:
+2
-1
@@ -100,7 +100,8 @@ return [
|
||||
|
||||
'cipher' => 'AES-256-CBC',
|
||||
|
||||
'key' => env('APP_KEY') ?: when(file_exists('storage/app/.key'), fn () => trim(file_get_contents('storage/app/.key'))),
|
||||
'key' => env('APP_KEY')
|
||||
?: when(file_exists(storage_path('app/.key')), fn () => trim(file_get_contents(storage_path('app/.key')))),
|
||||
|
||||
'previous_keys' => [
|
||||
...array_filter(
|
||||
|
||||
+1
-2
@@ -10,7 +10,6 @@ services:
|
||||
ports:
|
||||
- 8000:80
|
||||
environment: # You can either use these properties OR an .env file. Do not use both!
|
||||
APP_KEY: "" # Generate a key using `echo base64:$(openssl rand -base64 32)`
|
||||
APP_URL: "http://localhost:8000"
|
||||
ASSET_URL: "http://localhost:8000"
|
||||
DB_CONNECTION: mysql
|
||||
@@ -25,7 +24,7 @@ services:
|
||||
REDIS_HOST: investbrain-redis
|
||||
volumes:
|
||||
- investbrain-storage:/var/app/storage # You can use a volume...
|
||||
# - /path/to/storage:/var/app/storage # ...or you can use a path on host
|
||||
# - /path/to/storage:/var/app/storage:delegated # ...or you can use a path on host
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
|
||||
@@ -14,11 +14,13 @@ mkdir -p storage/framework/cache \
|
||||
storage/app \
|
||||
storage/logs
|
||||
|
||||
echo -e "\n > Storage directory scaffolding is OK... "
|
||||
|
||||
# Ensure storage directory is permissioned for www-data
|
||||
chmod -R 775 storage
|
||||
chown -R www-data:www-data storage
|
||||
|
||||
echo -e "\n > Storage directory scaffolding is OK... "
|
||||
echo -e "\n > Permissions are OK... "
|
||||
|
||||
# Ensure app key exists / generate if required
|
||||
KEY_FILE="storage/app/.key"
|
||||
@@ -36,7 +38,7 @@ if [ -z "$APP_KEY" ] && [ ! -s "$KEY_FILE" ]; then
|
||||
|
||||
export APP_KEY="$(php artisan key:generate --show)"
|
||||
|
||||
echo -e "\n > Oops! The required APP_KEY configuration is missing! Generated app key and saved in $KEY_FILE ."
|
||||
echo -e "\n > Oops! The required APP_KEY configuration is missing! Generated app key and saved in $KEY_FILE"
|
||||
|
||||
echo "$APP_KEY" > "$KEY_FILE"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user