Default config files

In an effort to make upgrading the constantly changing config files
easier, Shift defaulted them and merged your true customizations -
where ENV variables may not be used.
This commit is contained in:
Laravel Shift 2021-06-10 20:18:10 +00:00
parent cc3c59bf97
commit 7e93086dd4
6 changed files with 148 additions and 161 deletions

View file

@ -1,13 +1,5 @@
<?php <?php
/*
|--------------------------------------------------------------------------
| DO NOT EDIT THIS FILE DIRECTLY.
|--------------------------------------------------------------------------
| This file reads from your .env configuration file and should not
| be modified directly.
*/
return [ return [
/* /*
@ -79,6 +71,10 @@ return [
'model' => App\Models\User::class, 'model' => App\Models\User::class,
], ],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
], ],
/* /*
@ -102,10 +98,11 @@ return [
'email' => 'auth.emails.password', 'email' => 'auth.emails.password',
'table' => 'password_resets', 'table' => 'password_resets',
'expire' => env('RESET_PASSWORD_LINK_EXPIRES', 900), 'expire' => env('RESET_PASSWORD_LINK_EXPIRES', 900),
'throttle' => [ 'throttle' => 60,
'max_attempts' => env('LOGIN_MAX_ATTEMPTS', 5), 'max_attempts' => env('LOGIN_MAX_ATTEMPTS', 5),
'lockout_duration' => env('LOGIN_LOCKOUT_DURATION', 60), 'lockout_duration' => env('LOGIN_LOCKOUT_DURATION', 60),
],
], ],
], ],

View file

@ -1,13 +1,5 @@
<?php <?php
/*
|--------------------------------------------------------------------------
| DO NOT EDIT THIS FILE DIRECTLY.
|--------------------------------------------------------------------------
| This file reads from your .env configuration file and should not
| be modified directly.
*/
return [ return [
/* /*
@ -19,9 +11,11 @@ return [
| framework when an event needs to be broadcast. You may set this to | framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below. | any of the connections defined in the "connections" array below.
| |
| Supported: "pusher", "ably", "redis", "log", "null"
|
*/ */
'default' => env('BROADCAST_DRIVER', 'pusher'), 'default' => env('BROADCAST_DRIVER', 'null'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -38,14 +32,20 @@ return [
'pusher' => [ 'pusher' => [
'driver' => 'pusher', 'driver' => 'pusher',
'key' => env('PUSHER_KEY'), 'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_SECRET'), 'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'), 'app_id' => env('PUSHER_APP_ID'),
'options' => [ 'options' => [
// 'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true,
], ],
], ],
'ably' => [
'driver' => 'ably',
'key' => env('ABLY_KEY'),
],
'redis' => [ 'redis' => [
'driver' => 'redis', 'driver' => 'redis',
'connection' => 'default', 'connection' => 'default',
@ -55,6 +55,10 @@ return [
'driver' => 'log', 'driver' => 'log',
], ],
'null' => [
'driver' => 'null',
],
], ],
]; ];

View file

@ -1,12 +1,6 @@
<?php <?php
/* use Illuminate\Support\Str;
|--------------------------------------------------------------------------
| DO NOT EDIT THIS FILE DIRECTLY.
|--------------------------------------------------------------------------
| This file reads from your .env configuration file and should not
| be modified directly.
*/
return [ return [
@ -32,6 +26,9 @@ return [
| well as their drivers. You may even define multiple stores for the | well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches. | same cache driver to group types of items stored in your caches.
| |
| Supported drivers: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb", "null"
|
*/ */
'stores' => [ 'stores' => [
@ -42,12 +39,14 @@ return [
'array' => [ 'array' => [
'driver' => 'array', 'driver' => 'array',
'serialize' => false,
], ],
'database' => [ 'database' => [
'driver' => 'database', 'driver' => 'database',
'table' => 'cache', 'table' => 'cache',
'connection' => null, 'connection' => null,
'lock_connection' => null,
], ],
'file' => [ 'file' => [
@ -56,7 +55,15 @@ return [
], ],
'memcached' => [ 'memcached' => [
'driver' => 'memcached', 'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [ 'servers' => [
[ [
'host' => env('MEMCACHED_HOST', '127.0.0.1'), 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
@ -69,6 +76,16 @@ return [
'redis' => [ 'redis' => [
'driver' => 'redis', 'driver' => 'redis',
'connection' => 'default', 'connection' => 'default',
'lock_connection' => 'default',
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
], ],
], ],
@ -84,6 +101,6 @@ return [
| |
*/ */
'prefix' => env('CACHE_PREFIX', 'snipeit'), 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
]; ];

View file

@ -1,45 +1,44 @@
<?php <?php
/**
* ---------------------------------------------------------------------
* THIS IS $allowed_origins code IS NOT PART OF THE ORIGINAL CORS PACKAGE.
* IT IS A MODIFICATION BY SNIPE-IT TO ALLOW ADDING ALLOWED ORIGINS VIA THE ENV.
* ---------------------------------------------------------------------
*
* Since we don't really want people editing config files (lest they get
* overwritten later), this enables the person managing the Snipe-IT
* installation to modify these values without modifying the code.
*
* If APP_CORS_ALLOWED_ORIGINS is not set in the .env (for example if no one added it
* after an upgrade from a previous version that didn't include it in the .env.example) or is null,
* set it to * to allow all. If there is a value, either a single url or a comma-delimited
* list of urls, explode that out into an array to whitelist just those urls.
*/
$allowed_origins = env('CORS_ALLOWED_ORIGINS') !== null ?
explode(',', env('CORS_ALLOWED_ORIGINS')) : [];
/**
* Original Laravel CORS package config file modifications end here
*/
return [ return [
'supportsCredentials' => false,
'allowedOrigins' => $allowed_origins,
'allowedHeaders' => ['*'],
'allowedMethods' => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'],
'maxAge' => 0,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Laravel CORS | Cross-Origin Resource Sharing (CORS) Configuration
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| allowedOrigins, allowedHeaders and allowedMethods can be set to array('*') | Here you may configure your settings for cross-origin resource sharing
| to accept any value. | or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
| |
*/ */
'supportsCredentials' => false, 'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowedOrigins' => $allowed_origins,
'allowedOriginsPatterns' => [], 'allowed_methods' => ['*'],
'allowedHeaders' => ['*'],
'allowedMethods' => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'], 'allowed_origins' => ['*'],
'exposedHeaders' => [],
'maxAge' => 0, 'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,
]; ];

View file

@ -1,6 +1,6 @@
<?php <?php
$config = [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -13,20 +13,7 @@ $config = [
| |
*/ */
'default' => env('PRIVATE_FILESYSTEM_DISK', 'local'), 'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -37,7 +24,7 @@ $config = [
| may even configure multiple disks of the same driver. Defaults have | may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options. | been setup for each driver as an example of the required options.
| |
| Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace" | Supported Drivers: "local", "ftp", "sftp", "s3"
| |
*/ */
@ -45,64 +32,41 @@ $config = [
'local' => [ 'local' => [
'driver' => 'local', 'driver' => 'local',
'root' => storage_path(),
],
// This applies the LOCAL public only, not S3/FTP/etc
'local_public' => [
'driver' => 'local',
'root' => public_path('uploads'),
'url' => env('APP_URL').'/uploads',
'visibility' => 'public',
],
's3_public' => [
'driver' => 's3',
'key' => env('PUBLIC_AWS_ACCESS_KEY_ID'),
'secret' => env('PUBLIC_AWS_SECRET_ACCESS_KEY'),
'region' => env('PUBLIC_AWS_DEFAULT_REGION'),
'bucket' => env('PUBLIC_AWS_BUCKET'),
'url' => env('PUBLIC_AWS_URL'),
'root' => env('PUBLIC_AWS_BUCKET_ROOT'),
'visibility' => 'public',
],
's3_private' => [
// This bucket (if different than the 's3' bucket above) can be
// configured within AWS to *never* permit public documents
// For security reasons, its best to use separate buckets for
// public and private documents in S3
'driver' => 's3',
'key' => env('PRIVATE_AWS_ACCESS_KEY_ID'),
'secret' => env('PRIVATE_AWS_SECRET_ACCESS_KEY'),
'region' => env('PRIVATE_AWS_DEFAULT_REGION'),
'bucket' => env('PRIVATE_AWS_BUCKET'),
'url' => env('PRIVATE_AWS_URL'),
'root' => env('PRIVATE_AWS_BUCKET_ROOT'),
'visibility' => 'private',
],
'rackspace' => [
'driver' => 'rackspace',
'username' => env('RACKSPACE_USERNAME'),
'key' => env('RACKSPACE_KEY'),
'container' => env('RACKSPACE_CONTAINER'),
'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
'region' => env('RACKSPACE_REGION'),
'url_type' => env('RACKSPACE_URL_TYPE'),
],
'backup' => [
'driver' => env('PRIVATE_FILESYSTEM_DISK', 'local'),
'root' => storage_path('app'), 'root' => storage_path('app'),
], ],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
],
],
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('storage') => storage_path('app/public'),
], ],
]; ];
// copy the selected PUBLIC_FILESYSTEM_DISK's configuration to the 'public' key for easy use
// (by default, the PUBLIC_FILESYSTEM DISK is 'local_public', in the public/uploads directory)
$config['disks']['public'] = $config['disks'][env('PUBLIC_FILESYSTEM_DISK', 'local_public')];
return $config;

View file

@ -1,8 +1,10 @@
<?php <?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler; use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
$config = [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -14,6 +16,7 @@ $config = [
| one of the channels defined in the "channels" configuration array. | one of the channels defined in the "channels" configuration array.
| |
*/ */
'default' => env('LOG_CHANNEL', 'stack'), 'default' => env('LOG_CHANNEL', 'stack'),
/* /*
@ -35,26 +38,20 @@ $config = [
'stack' => [ 'stack' => [
'driver' => 'stack', 'driver' => 'stack',
'channels' => ['single'], 'channels' => ['single'],
'ignore_exceptions' => false,
], ],
'single' => [ 'single' => [
'driver' => 'single', 'driver' => 'single',
'path' => storage_path('logs/laravel.log'), 'path' => storage_path('logs/laravel.log'),
'level' => env('APP_LOG_LEVEL', 'error'), 'level' => env('LOG_LEVEL', 'debug'),
], ],
'daily' => [ 'daily' => [
'driver' => 'daily', 'driver' => 'daily',
'path' => storage_path('logs/laravel.log'), 'path' => storage_path('logs/laravel.log'),
'level' => 'debug', 'level' => env('LOG_LEVEL', 'debug'),
'days' => env('APP_LOG_MAX_FILES', 5), 'days' => 14,
],
'rollbar' => [
'driver' => 'monolog',
'handler' => \Rollbar\Laravel\MonologHandler::class,
'access_token' => env('ROLLBAR_TOKEN'),
'level' => env('APP_LOG_LEVEL', 'debug'),
], ],
'slack' => [ 'slack' => [
@ -62,38 +59,47 @@ $config = [
'url' => env('LOG_SLACK_WEBHOOK_URL'), 'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log', 'username' => 'Laravel Log',
'emoji' => ':boom:', 'emoji' => ':boom:',
'level' => 'critical', 'level' => env('LOG_LEVEL', 'critical'),
],
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
],
], ],
'stderr' => [ 'stderr' => [
'driver' => 'monolog', 'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class, 'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [ 'with' => [
'stream' => 'php://stderr', 'stream' => 'php://stderr',
], ],
], ],
'stdout' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'with' => ['stream' => 'php://stdout'],
],
'syslog' => [ 'syslog' => [
'driver' => 'syslog', 'driver' => 'syslog',
'level' => env('APP_LOG_LEVEL', 'error'), 'level' => env('LOG_LEVEL', 'debug'),
], ],
'errorlog' => [ 'errorlog' => [
'driver' => 'errorlog', 'driver' => 'errorlog',
'level' => env('APP_LOG_LEVEL', 'error'), 'level' => env('LOG_LEVEL', 'debug'),
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
], ],
], ],
]; ];
if ((env('APP_ENV') == 'production') && env('ROLLBAR_TOKEN')) {
array_push($config['channels']['stack']['channels'], 'rollbar');
}
return $config;