Skip to content

Commit 01df9e2

Browse files
committed
Fix public disk to use s3 in serverless
Fix s3 config
1 parent 4c5eb45 commit 01df9e2

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

config/app.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,6 @@
297297
'multitenancy' => env('MULTITENANCY', false),
298298

299299
'resources_core_path' => base_path('resources-core'),
300+
301+
'serverless' => env('SERVERLESS', false),
300302
];

config/filesystems.php

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,25 @@
5656
'root' => env('PROCESS_TEMPLATES_PATH') ? base_path(env('PROCESS_TEMPLATES_PATH')) : database_path('processes/templates'),
5757
],
5858

59-
'public' => [ // used throught the system
60-
'driver' => 'local',
61-
'root' => storage_path('app/public'),
62-
'url' => env('APP_URL') . '/storage',
63-
'visibility' => 'public',
64-
'throw' => false,
65-
],
59+
'public' => config('app.serverless') ?
60+
[
61+
'driver' => 's3',
62+
'key' => env('AWS_ACCESS_KEY_ID'),
63+
'secret' => env('AWS_SECRET_ACCESS_KEY'),
64+
'region' => env('AWS_DEFAULT_REGION'),
65+
'bucket' => env('AWS_PUBLIC_BUCKET'),
66+
'url' => env('AWS_URL'),
67+
'endpoint' => env('AWS_ENDPOINT'),
68+
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
69+
'throw' => false,
70+
] :
71+
[ // used through the system
72+
'driver' => 'local',
73+
'root' => storage_path('app/public'),
74+
'url' => env('APP_URL') . '/storage',
75+
'visibility' => 'public',
76+
'throw' => false,
77+
],
6678

6779
's3' => [ // DownloadSecurityLog
6880
'driver' => 's3',

0 commit comments

Comments
 (0)