diff --git a/config/app.php b/config/app.php index f4dc53ee74..1d7345bbb5 100644 --- a/config/app.php +++ b/config/app.php @@ -297,4 +297,6 @@ 'multitenancy' => env('MULTITENANCY', false), 'resources_core_path' => base_path('resources-core'), + + 'serverless' => env('SERVERLESS', false), ]; diff --git a/config/filesystems.php b/config/filesystems.php index e79015155f..ded99923cf 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -56,13 +56,25 @@ 'root' => env('PROCESS_TEMPLATES_PATH') ? base_path(env('PROCESS_TEMPLATES_PATH')) : database_path('processes/templates'), ], - 'public' => [ // used throught the system - 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL') . '/storage', - 'visibility' => 'public', - 'throw' => false, - ], + 'public' => config('app.serverless') ? + [ + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_PUBLIC_BUCKET'), + 'url' => env('AWS_URL'), + 'endpoint' => env('AWS_ENDPOINT'), + 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), + 'throw' => false, + ] : + [ // used through the system + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL') . '/storage', + 'visibility' => 'public', + 'throw' => false, + ], 's3' => [ // DownloadSecurityLog 'driver' => 's3',