mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
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:
parent
cc3c59bf97
commit
7e93086dd4
|
@ -1,13 +1,5 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DO NOT EDIT THIS FILE DIRECTLY.
|
||||
|--------------------------------------------------------------------------
|
||||
| This file reads from your .env configuration file and should not
|
||||
| be modified directly.
|
||||
*/
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|
@ -79,6 +71,10 @@ return [
|
|||
'model' => App\Models\User::class,
|
||||
],
|
||||
|
||||
// 'users' => [
|
||||
// 'driver' => 'database',
|
||||
// 'table' => 'users',
|
||||
// ],
|
||||
],
|
||||
|
||||
/*
|
||||
|
@ -102,10 +98,11 @@ return [
|
|||
'email' => 'auth.emails.password',
|
||||
'table' => 'password_resets',
|
||||
'expire' => env('RESET_PASSWORD_LINK_EXPIRES', 900),
|
||||
'throttle' => [
|
||||
'throttle' => 60,
|
||||
'max_attempts' => env('LOGIN_MAX_ATTEMPTS', 5),
|
||||
|
||||
'lockout_duration' => env('LOGIN_LOCKOUT_DURATION', 60),
|
||||
],
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DO NOT EDIT THIS FILE DIRECTLY.
|
||||
|--------------------------------------------------------------------------
|
||||
| This file reads from your .env configuration file and should not
|
||||
| be modified directly.
|
||||
*/
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|
@ -19,9 +11,11 @@ return [
|
|||
| framework when an event needs to be broadcast. You may set this to
|
||||
| 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' => [
|
||||
'driver' => 'pusher',
|
||||
'key' => env('PUSHER_KEY'),
|
||||
'secret' => env('PUSHER_SECRET'),
|
||||
'key' => env('PUSHER_APP_KEY'),
|
||||
'secret' => env('PUSHER_APP_SECRET'),
|
||||
'app_id' => env('PUSHER_APP_ID'),
|
||||
'options' => [
|
||||
//
|
||||
'cluster' => env('PUSHER_APP_CLUSTER'),
|
||||
'useTLS' => true,
|
||||
],
|
||||
],
|
||||
|
||||
'ably' => [
|
||||
'driver' => 'ably',
|
||||
'key' => env('ABLY_KEY'),
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'default',
|
||||
|
@ -55,6 +55,10 @@ return [
|
|||
'driver' => 'log',
|
||||
],
|
||||
|
||||
'null' => [
|
||||
'driver' => 'null',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DO NOT EDIT THIS FILE DIRECTLY.
|
||||
|--------------------------------------------------------------------------
|
||||
| This file reads from your .env configuration file and should not
|
||||
| be modified directly.
|
||||
*/
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
|
@ -32,6 +26,9 @@ return [
|
|||
| well as their drivers. You may even define multiple stores for the
|
||||
| same cache driver to group types of items stored in your caches.
|
||||
|
|
||||
| Supported drivers: "apc", "array", "database", "file",
|
||||
| "memcached", "redis", "dynamodb", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'stores' => [
|
||||
|
@ -42,12 +39,14 @@ return [
|
|||
|
||||
'array' => [
|
||||
'driver' => 'array',
|
||||
'serialize' => false,
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'table' => 'cache',
|
||||
'table' => 'cache',
|
||||
'connection' => null,
|
||||
'lock_connection' => null,
|
||||
],
|
||||
|
||||
'file' => [
|
||||
|
@ -56,7 +55,15 @@ return [
|
|||
],
|
||||
|
||||
'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' => [
|
||||
[
|
||||
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
|
||||
|
@ -69,6 +76,16 @@ return [
|
|||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'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'),
|
||||
|
||||
];
|
||||
|
|
|
@ -1,45 +1,44 @@
|
|||
<?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 [
|
||||
|
||||
'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('*')
|
||||
| to accept any value.
|
||||
| Here you may configure your settings for cross-origin resource sharing
|
||||
| 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,
|
||||
'allowedOrigins' => $allowed_origins,
|
||||
'allowedOriginsPatterns' => [],
|
||||
'allowedHeaders' => ['*'],
|
||||
'allowedMethods' => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'],
|
||||
'exposedHeaders' => [],
|
||||
'maxAge' => 0,
|
||||
'paths' => ['api/*', 'sanctum/csrf-cookie'],
|
||||
|
||||
'allowed_methods' => ['*'],
|
||||
|
||||
'allowed_origins' => ['*'],
|
||||
|
||||
'allowed_origins_patterns' => [],
|
||||
|
||||
'allowed_headers' => ['*'],
|
||||
|
||||
'exposed_headers' => [],
|
||||
|
||||
'max_age' => 0,
|
||||
|
||||
'supports_credentials' => false,
|
||||
|
||||
];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
$config = [
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -13,20 +13,7 @@ $config = [
|
|||
|
|
||||
*/
|
||||
|
||||
'default' => env('PRIVATE_FILESYSTEM_DISK', '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'),
|
||||
'default' => env('FILESYSTEM_DRIVER', 'local'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -37,7 +24,7 @@ $config = [
|
|||
| may even configure multiple disks of the same driver. Defaults have
|
||||
| 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' => [
|
||||
'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'),
|
||||
],
|
||||
|
||||
'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;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?php
|
||||
|
||||
use Monolog\Handler\NullHandler;
|
||||
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.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('LOG_CHANNEL', 'stack'),
|
||||
|
||||
/*
|
||||
|
@ -35,26 +38,20 @@ $config = [
|
|||
'stack' => [
|
||||
'driver' => 'stack',
|
||||
'channels' => ['single'],
|
||||
'ignore_exceptions' => false,
|
||||
],
|
||||
|
||||
'single' => [
|
||||
'driver' => 'single',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('APP_LOG_LEVEL', 'error'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
],
|
||||
|
||||
'daily' => [
|
||||
'driver' => 'daily',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => 'debug',
|
||||
'days' => env('APP_LOG_MAX_FILES', 5),
|
||||
],
|
||||
|
||||
'rollbar' => [
|
||||
'driver' => 'monolog',
|
||||
'handler' => \Rollbar\Laravel\MonologHandler::class,
|
||||
'access_token' => env('ROLLBAR_TOKEN'),
|
||||
'level' => env('APP_LOG_LEVEL', 'debug'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'days' => 14,
|
||||
],
|
||||
|
||||
'slack' => [
|
||||
|
@ -62,38 +59,47 @@ $config = [
|
|||
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||
'username' => 'Laravel Log',
|
||||
'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' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => StreamHandler::class,
|
||||
'formatter' => env('LOG_STDERR_FORMATTER'),
|
||||
'with' => [
|
||||
'stream' => 'php://stderr',
|
||||
],
|
||||
],
|
||||
|
||||
'stdout' => [
|
||||
'driver' => 'monolog',
|
||||
'handler' => StreamHandler::class,
|
||||
'with' => ['stream' => 'php://stdout'],
|
||||
],
|
||||
|
||||
'syslog' => [
|
||||
'driver' => 'syslog',
|
||||
'level' => env('APP_LOG_LEVEL', 'error'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
],
|
||||
|
||||
'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;
|
||||
|
|
Loading…
Reference in a new issue