refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s

This commit is contained in:
Kroonk
2026-05-22 16:19:55 +02:00
parent 38cc4c09ca
commit a213a1dba0
2215 changed files with 242567 additions and 6015 deletions

65
config/api.php Normal file
View File

@@ -0,0 +1,65 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Limit per page
|--------------------------------------------------------------------------
|
| This is the maximum number of items the API can return per page.
|
*/
'max_limit_per_page' => env('MAX_API_LIMIT_PER_PAGE', 100),
/*
|--------------------------------------------------------------------------
| Format of the timestamp
|--------------------------------------------------------------------------
|
| This defines the format of the timestamp that is returned on most API
| calls.
|
*/
'timestamp_format' => env('API_TIMESTAMP_FORMAT', 'Y-m-d\TH:i:s\Z'),
/*
|--------------------------------------------------------------------------
| Format of the date timestamp
|--------------------------------------------------------------------------
|
| This defines the format of the date that is returned on some API calls
| when it requires a date only.
|
*/
'date_timestamp_format' => env('API_DATE_TIMESTAMP_FORMAT', 'Y-m-d'),
/*
|--------------------------------------------------------------------------
| Error codes for the API
|--------------------------------------------------------------------------
*/
'error_codes' => [
'30' => 'The limit parameter is too big',
'31' => 'The resource has not been found',
'32' => 'Error while trying to save the data',
'33' => 'Too many parameters',
'34' => 'Too many attempts, please slow down the request',
'35' => 'This email address is already taken',
'36' => 'You can\'t set a partner or a child to a partial contact',
'37' => 'Problems parsing JSON',
'38' => 'Date should be in the future',
'39' => 'The sorting criteria is invalid',
'40' => 'Invalid query',
'41' => 'Invalid parameters.',
'42' => 'Not authorized',
],
/*
|--------------------------------------------------------------------------
| The API documentation link
|--------------------------------------------------------------------------
*/
'help' => 'https://www.monicahq.com/api',
];

265
config/app.php Normal file
View File

@@ -0,0 +1,265 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => env('APP_NAME', 'Monica'),
/*
|--------------------------------------------------------------------------
| Application Display Name
|--------------------------------------------------------------------------
|
| This is the name of the application that will be displayed in the notification emails.
|
*/
'display_name' => env('APP_DISPLAY_NAME', env('APP_NAME', 'Monica')),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services your application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
'force_url' => (bool) env('APP_FORCE_URL', false),
/*
|--------------------------------------------------------------------------
| TIMEZONE
|--------------------------------------------------------------------------
|
| Timezone is not configurable in the .env file as everything is stored in
| UTC.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => env('APP_DEFAULT_LOCALE', 'en'),
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Password strength
|--------------------------------------------------------------------------
|
| You can configure password strength requirements here.
| - password_min is the minimum length of the password.
| - password_rules are requirements that can be added on the password:
| mixedCase, letters, numbers, symbols, uncompromised.
| See https://laravel.com/docs/8.x/validation#validating-passwords
|
*/
'password_min' => (int) env('APP_PASSWORD_MIN', 8),
'password_rules' => env('APP_PASSWORD_RULES', 'mixedCase,letters,numbers,symbols,uncompromised'),
/*
|--------------------------------------------------------------------------
| Trust proxies
|--------------------------------------------------------------------------
|
| List of trusted proxies.
| Example: set it to '*' to allow any proxy.
|
*/
'trust_proxies' => env('APP_TRUSTED_PROXIES', env('APP_TRUST_PROXIES')),
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\MacroServiceProvider::class,
Vluzrmos\LanguageDetector\Providers\LanguageDetectorServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Laravel\Socialite\SocialiteServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
Laravel\Cashier\CashierServiceProvider::class,
Laravel\Passport\PassportServiceProvider::class,
Creativeorange\Gravatar\GravatarServiceProvider::class,
App\Providers\DAVServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DateHelper' => App\Helpers\DateHelper::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Debugbar' => Barryvdh\Debugbar\Facade::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Socialite' => Laravel\Socialite\Facades\Socialite::class,
'Image' => Intervention\Image\Facades\Image::class,
'Gravatar' => Creativeorange\Gravatar\Facades\Gravatar::class,
],
];

154
config/auth.php Normal file
View File

@@ -0,0 +1,154 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session", "token"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'passport',
'provider' => 'users',
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User\User::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| Here you may set the options for resetting passwords including the view
| that is your password reset e-mail. You may also set the name of the
| table that maintains all of the reset tokens for your application.
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'email' => 'auth.emails.password',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
/*
| Invitation Email
|--------------------------------------------------------------------------
|
| Parameters for the invitation email send, requested by a user.
| Expire is in days.
|
*/
'invitation' => [
'expire' => 2,
],
/*
|--------------------------------------------------------------------------
| Recovery codes generation
|--------------------------------------------------------------------------
|
| Recovery codes can be used to access your account in the event you lost
| access to the device used to generate or receive two-factor
| authentication codes.
|
| * count: number of recovery codes to generate
| * blocks: number of blocks in one code
| * chars: number of characters per block
|
*/
'recovery' => [
'count' => 8,
'blocks' => 2,
'chars' => 4,
],
];

52
config/broadcasting.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
*/
'default' => env('BROADCAST_DRIVER', 'pusher'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_KEY'),
'secret' => env('PUSHER_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
//
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
],
];

158
config/cache.php Normal file
View File

@@ -0,0 +1,158 @@
<?php
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use function Safe\json_decode;
$config = [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
| Supported: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb"
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
],
'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'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
],
'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'),
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
|
*/
'prefix' => env(
'CACHE_PREFIX',
Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'
),
];
// on fortrabbit: construct credentials from App secrets
if (env('APP_SECRETS')) {
$secrets = json_decode(file_get_contents(env('APP_SECRETS')), true);
if (array_key_exists('MEMCACHE', $secrets)) {
$servers = [[
'host' => $secrets['MEMCACHE']['HOST1'],
'port' => $secrets['MEMCACHE']['PORT1'],
'weight' => 100,
]];
if ($secrets['MEMCACHE']['COUNT'] > 1) {
$servers [] = [
'host' => $secrets['MEMCACHE']['HOST2'],
'port' => $secrets['MEMCACHE']['PORT2'],
'weight' => 100,
];
}
Arr::set($config, 'stores.memcached.servers', $servers);
}
}
if (extension_loaded('memcached')) {
$timeout_ms = 50;
$options = [
// Assure that dead servers are properly removed and ...
\Memcached::OPT_REMOVE_FAILED_SERVERS => true,
// ... retried after a short while (here: 2 seconds)
\Memcached::OPT_RETRY_TIMEOUT => 2,
// KETAMA must be enabled so that replication can be used
\Memcached::OPT_LIBKETAMA_COMPATIBLE => true,
// Replicate the data, write it to both memcached servers
\Memcached::OPT_NUMBER_OF_REPLICAS => 1,
// Those values assure that a dead (due to increased latency or
// really unresponsive) memcached server is dropped fast
\Memcached::OPT_POLL_TIMEOUT => $timeout_ms, // milliseconds
\Memcached::OPT_SEND_TIMEOUT => $timeout_ms * 1000, // microseconds
\Memcached::OPT_RECV_TIMEOUT => $timeout_ms * 1000, // microseconds
\Memcached::OPT_CONNECT_TIMEOUT => $timeout_ms, // milliseconds
// Further performance tuning
\Memcached::OPT_NO_BLOCK => true,
];
Arr::set($config, 'stores.memcached.options', $options);
}
return $config;

88
config/cashier.php Normal file
View File

@@ -0,0 +1,88 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Stripe Keys
|--------------------------------------------------------------------------
|
| The Stripe publishable key and secret key give you access to Stripe's
| API. The "publishable" key is typically used when interacting with
| Stripe.js while the "secret" key accesses private API endpoints.
|
*/
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
/*
|--------------------------------------------------------------------------
| Cashier Path
|--------------------------------------------------------------------------
|
| This is the base URI path where Cashier's views, such as the payment
| verification screen, will be available from. You're free to tweak
| this path according to your preferences and application design.
|
*/
'path' => env('CASHIER_PATH', 'stripe'),
/*
|--------------------------------------------------------------------------
| Stripe Webhooks
|--------------------------------------------------------------------------
|
| Your Stripe webhook secret is used to prevent unauthorized requests to
| your Stripe webhook handling controllers. The tolerance setting will
| check the drift between the current time and the signed request's.
|
*/
'webhook' => [
'secret' => env('STRIPE_WEBHOOK_SECRET'),
'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
],
/*
|--------------------------------------------------------------------------
| Currency
|--------------------------------------------------------------------------
|
| This is the default currency that will be used when generating charges
| from your application. Of course, you are welcome to use any of the
| various world currencies that are currently supported via Stripe.
|
*/
'currency' => env('CASHIER_CURRENCY', 'usd'),
/*
|--------------------------------------------------------------------------
| Currency Locale
|--------------------------------------------------------------------------
|
| This is the default locale in which your money values are formatted in
| for display. To utilize other locales besides the default en locale
| verify you have the "intl" PHP extension installed on the system.
|
*/
'currency_locale' => env('CASHIER_CURRENCY_LOCALE', 'en'),
/*
|--------------------------------------------------------------------------
| Payment Confirmation Notification
|--------------------------------------------------------------------------
|
| If this setting is enabled, Cashier will automatically notify customers
| whose payments require additional verification. You should listen to
| Stripe's webhooks in order for this feature to function correctly.
|
*/
'payment_notification' => env('CASHIER_PAYMENT_NOTIFICATION'),
];

35
config/compile.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Additional Compiled Classes
|--------------------------------------------------------------------------
|
| Here you may specify additional classes to include in the compiled file
| generated by the `artisan optimize` command. These should be classes
| that are included on basically every request into the application.
|
*/
'files' => [
//
],
/*
|--------------------------------------------------------------------------
| Compiled File Providers
|--------------------------------------------------------------------------
|
| Here you may list service providers which define a "compiles" function
| that returns additional files that should be compiled, providing an
| easy way to get common files from any packages you are utilizing.
|
*/
'providers' => [
//
],
];

34
config/cors.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| 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
|
*/
'paths' => ['api/*'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => false,
'max_age' => false,
'supports_credentials' => false,
];

231
config/database.php Normal file
View File

@@ -0,0 +1,231 @@
<?php
use Illuminate\Support\Str;
$db = [
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_CLASS,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
| PostgreSQL users: insert 'pgsql' and edit the 'pgsql' section below.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Use utf8mb4 charset format
|--------------------------------------------------------------------------
|
| Use the new utf8mb4 charset format
| ⚠ be sure your DBMS supports utf8mb4 format
| See https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html
| MySQL > 5.7.7 fully support it.
|
*/
'use_utf8mb4' => env('DB_USE_UTF8MB4', true),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
| PostgreSQL users: comment out host and port for UNIX domain socket
| connections (local file-based connection without the need to edit the
| firewall settings).
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => env('DB_PREFIX', ''),
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_UNIX_SOCKET', ''),
'charset' => env('DB_USE_UTF8MB4', true) ? 'utf8mb4' : 'utf8',
'collation' => env('DB_USE_UTF8MB4', true) ? 'utf8mb4_unicode_ci' : 'utf8_unicode_ci',
'prefix' => env('DB_PREFIX', ''),
'prefix_indexes' => true,
'strict' => false,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'testing' => [
'driver' => env('DB_TEST_DRIVER', 'mysql'),
'host' => env('DB_TEST_HOST'),
'port' => env('DB_TEST_PORT', '3306'),
'unix_socket' => env('DB_TEST_UNIX_SOCKET', ''),
'database' => env('DB_TEST_DATABASE'),
'username' => env('DB_TEST_USERNAME'),
'password' => env('DB_TEST_PASSWORD'),
'charset' => env('DB_USE_UTF8MB4', true) ? 'utf8mb4' : 'utf8',
'collation' => env('DB_USE_UTF8MB4', true) ? 'utf8mb4_unicode_ci' : 'utf8_unicode_ci',
'prefix' => env('DB_TEST_PREFIX', ''),
'prefix_indexes' => true,
'strict' => false,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'prefix' => env('DB_PREFIX', ''),
'charset' => 'utf8',
'schema' => 'public',
],
'pgsqltesting' => [
'driver' => 'pgsql',
'host' => env('DB_TEST_HOST'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_TEST_DATABASE'),
'username' => env('DB_TEST_USERNAME'),
'password' => env('DB_TEST_PASSWORD'),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => (int) env('REDIS_PORT', 6379),
'database' => env('REDIS_DB', env('REDIS_DATABASE', 0)),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => (int) env('REDIS_PORT', 6379),
'database' => env('REDIS_CACHE_DB', 1),
],
],
];
/*
* If the instance is hosted on Heroku, then the database information
* needs to be parsed from the environment variable provided by Heroku.
* This is done below, added to the $db variable and then returned.
*/
if (env('HEROKU')) {
$url = parse_url(env('JAWSDB_URL', env('CLEARDB_DATABASE_URL')));
$db['connections']['heroku'] = [
'driver' => 'mysql',
'host' => $url['host'],
'database' => Str::startsWith($url['path'], '/') ? Str::after($url['path'], '/') : $url['path'],
'username' => $url['user'],
'password' => $url['pass'],
'charset' => env('DB_USE_UTF8MB4', true) ? 'utf8mb4' : 'utf8',
'collation' => env('DB_USE_UTF8MB4', true) ? 'utf8mb4_unicode_ci' : 'utf8_unicode_ci',
'prefix' => env('DB_PREFIX', ''),
'strict' => false,
'schema' => 'public',
];
if (array_key_exists('port', $url)) {
$db['connections']['heroku']['port'] = $url['port'];
}
}
return $db;

13
config/dav.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Gender name for VCard imports
|--------------------------------------------------------------------------
|
*/
'default_gender' => 'vCard',
];

108
config/filesystems.php Normal file
View File

@@ -0,0 +1,108 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. A "local" driver, as well as a variety of cloud
| based drivers are available for your choosing. Just store away!
|
| Supported: "local", "ftp", "sftp", s3"
|
*/
'default' => env('FILESYSTEM_DISK', env('DEFAULT_FILESYSTEM', 'public')),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => true,
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
'throw' => true,
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID', env('AWS_KEY')),
'secret' => env('AWS_SECRET_ACCESS_KEY', env('AWS_SECRET')),
'region' => env('AWS_DEFAULT_REGION', env('AWS_REGION')),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT', env('AWS_SERVER', '') ? 'https://'.env('AWS_SERVER') : null),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', env('S3_PATH_STYLE', false)),
'throw' => true,
],
],
/*
|--------------------------------------------------------------------------
| 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'),
],
/*
|--------------------------------------------------------------------------
| Filesystem visibility
|--------------------------------------------------------------------------
|
| If this is set to private, all files are stored privately, and are
| delivered using a proxy-url by monica, providing access of the files in
| the storage.
| This means only the authenticated user will be able to open the files.
|
| You might store the files publicly if you're on a private instance and if
| you want to make files accessible from the outside - the url files are
| still private and not easy to guess.
|
| Supported: "private", "public"
|
*/
'default_visibility' => env('FILESYSTEM_DEFAULT_VISIBILITY', 'private'),
/*
|--------------------------------------------------------------------------
| Cache control for files
|--------------------------------------------------------------------------
|
| Defines the Cache-Control header used to serve files.
| Default: 'max-age=2628000' for 1 month cache.
|
*/
'default_cache_control' => env('DEFAULT_CACHE_CONTROL', 'private, max-age=2628000'),
];

84
config/google2fa.php Normal file
View File

@@ -0,0 +1,84 @@
<?php
return [
/*
* Enable / disable Google2FA.
*/
'enabled' => env('MFA_ENABLED', env('2FA_ENABLED', true)),
/*
* Lifetime in minutes.
*
* In case you need your users to be asked for a new one time passwords from time to time.
*/
'lifetime' => env('OTP_LIFETIME', 0), // 0 = eternal
/*
* Renew lifetime at every new request.
*/
'keep_alive' => env('OTP_KEEP_ALIVE', true),
/*
* Auth container binding.
*/
'auth' => 'auth',
/*
* Guard.
*/
'guard' => '',
/*
* 2FA verified session var.
*/
'session_var' => 'google2fa',
/*
* One Time Password request input name.
*/
'otp_input' => 'one_time_password',
/*
* One Time Password Window.
*/
'window' => 8,
/*
* Forbid user to reuse One Time Passwords.
*/
'forbid_old_passwords' => false,
/*
* User's table column for google2fa secret.
*/
'otp_secret_column' => 'google2fa_secret',
/*
* One Time Password View.
*/
'view' => 'auth/validate2fa',
/*
* One Time Password error message.
*/
'error_messages' => [
'wrong_otp' => "The 'One Time Password' typed was wrong.",
'cannot_be_empty' => 'One Time Password cannot be empty.',
'unknown' => 'An unknown error has occurred. Please try again.',
],
/*
* Throw exceptions or just fire events?
*/
'throw_exceptions' => env('OTP_THROW_EXCEPTION', true),
/*
* Which image backend to use for generating QR codes?
*
* Supports imagemagick, svg and eps
*/
'qrcode_image_backend' => \PragmaRX\Google2FALaravel\Support\Constants::QRCODE_IMAGE_BACKEND_SVG,
];

59
config/hashids.php Normal file
View File

@@ -0,0 +1,59 @@
<?php
/*
* This file is part of Laravel Hashids.
*
* (c) Vincent Klaiber <hello@vinkla.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
return [
/*
|--------------------------------------------------------------------------
| Default Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the connections below you wish to use as
| your default connection for all work. Of course, you may use many
| connections at once using the manager class.
|
*/
'default' => 'main',
/*
|--------------------------------------------------------------------------
| Hashids Connections
|--------------------------------------------------------------------------
|
| Here are each of the connections setup for your application. Example
| configuration has been included, but you may add as many connections as
| you would like.
|
*/
'connections' => [
'main' => [
'salt' => env('HASH_SALT', 'your-salt-string'),
'length' => env('HASH_LENGTH', 18),
],
'alternative' => [
'salt' => 'your-salt-string',
'length' => 'your-length-integer',
],
],
/*
* Default prefix for ids
*/
'default_prefix' => 'h:',
];

52
config/hashing.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
],
];

20
config/image.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Image Driver
|--------------------------------------------------------------------------
|
| Intervention Image supports "GD Library" and "Imagick" to process images
| internally. You may choose one of them according to your PHP
| configuration. By default PHP's "GD Library" implementation is used.
|
| Supported: "gd", "imagick"
|
*/
'driver' => 'gd',
];

68
config/lang-detector.php Normal file
View File

@@ -0,0 +1,68 @@
<?php
return [
/*
* Indicates whenever should autodetect and apply the language of the request.
*/
'autodetect' => env('LANG_DETECTOR_AUTODETECT', false),
/*
* Default driver to use to detect the request language.
*
* Available: browser, subdomain, uri.
*/
'driver' => env('LANG_DETECTOR_DRIVER', 'browser'),
/*
* Used on subdomain and uri drivers. That indicates which segment should be used
* to verify the language.
*/
'segment' => env('LANG_DETECTOR_SEGMENT', 0),
/**
* Languages available on the application.
*
* You could use parse_langs_to_array to use the string syntax
* or just use the array of languages with its aliases.
*
* @see https://github.com/monicahq/monica/blob/main/docs/contribute/translate.md for translations.
*/
'languages' => parse_langs_to_array(
env('LANG_DETECTOR_LANGUAGES', [
'en',
'ar',
'de',
'el',
'en-GB' => 'en-GB',
'es',
'fr',
'he',
'id',
'it',
'nl',
'no',
'pt-BR' => 'pt-BR',
'ru',
'sv',
'tr',
'vi',
'zh',
'zh-TW' => 'zh-TW',
])
),
/*
* Indicates if should store detected locale on cookies
*/
'cookie' => (bool) env('LANG_DETECTOR_COOKIE', true),
/*
* Indicates if should encrypt cookie
*/
'cookie_encrypt' => (bool) env('LANG_DETECTOR_COOKIE_ENCRYPT', false),
/*
* Cookie name
*/
'cookie_name' => env('LANG_DETECTOR_COOKIE', 'locale'),
];

View File

@@ -0,0 +1,62 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Enable or disable the middleware proxy and the reload
|--------------------------------------------------------------------------
|
| If you set it to false, the middleware and the reload command will never
| be executed.
|
*/
'enabled' => (bool) env('LARAVEL_CLOUDFLARE_ENABLED', env('APP_TRUSTED_CLOUDFLARE', false)),
/*
|--------------------------------------------------------------------------
| Name of the cache to store values of the proxies
|--------------------------------------------------------------------------
|
| This value is the key used in the cache (table, redis, etc.) to store the
| values.
|
*/
'cache' => 'cloudflare.proxies',
/*
|--------------------------------------------------------------------------
| Cloudflare main url
|--------------------------------------------------------------------------
|
| This is the url for the cloudflare api.
|
*/
'url' => 'https://www.cloudflare.com',
/*
|--------------------------------------------------------------------------
| Cloudflare uri for ipv4 ips response
|--------------------------------------------------------------------------
|
| This is the path to get the values of ipv4 ips from Cloudflare.
|
*/
'ipv4-path' => 'ips-v4',
/*
|--------------------------------------------------------------------------
| Cloudflare uri for ipv6 ips response
|--------------------------------------------------------------------------
|
| This is the path to get the values of ipv6 ips from Cloudflare.
|
*/
'ipv6-path' => 'ips-v6',
];

72
config/laravelsabre.php Normal file
View File

@@ -0,0 +1,72 @@
<?php
use LaravelSabre\Http\Middleware\Authorize;
return [
/*
|--------------------------------------------------------------------------
| LaravelSabre Domain
|--------------------------------------------------------------------------
|
| This is the subdomain where LaravelSabre will be accessible from. If the
| setting is null, LaravelSabre will reside under the same domain as the
| application. Otherwise, this value will be used as the subdomain.
|
*/
'domain' => null,
/*
|--------------------------------------------------------------------------
| LaravelSabre Path
|--------------------------------------------------------------------------
|
| This is the URI path where LaravelSabre will be accessible from. Feel free
| to change this path to anything you like.
|
*/
'path' => 'dav',
/*
|--------------------------------------------------------------------------
| LaravelSabre Master Switch
|--------------------------------------------------------------------------
|
| This option may be used to disable LaravelSabre.
|
*/
'enabled' => (bool) env('DAV_ENABLED', (bool) env('CARDDAV_ENABLED', false)),
/*
|--------------------------------------------------------------------------
| LaravelSabre Route Middleware
|--------------------------------------------------------------------------
|
| These middleware will be assigned to every LaravelSabre route, giving you
| the chance to add your own middleware to this list or change any of
| the existing middleware. Or, you can simply stick with this list.
|
*/
'middleware' => [
'api',
'auth.tokenonbasic',
'limitations',
Authorize::class,
],
/*
|--------------------------------------------------------------------------
| Enable access only to these users
|--------------------------------------------------------------------------
|
| A comma-separated list of user's email to enable dav for.
| If null or empty, there will be no restriction.
|
*/
'users' => env('DAV_USERS', null),
];

View File

@@ -0,0 +1,82 @@
<?php
/*
* Set specific configuration variables here
*/
return [
/*
|--------------------------------------------------------------------------
| Image Driver
|--------------------------------------------------------------------------
| Avatar use Intervention Image library to process image.
| Meanwhile, Intervention Image supports "GD Library" and "Imagick" to process images
| internally. You may choose one of them according to your PHP
| configuration. By default PHP's "GD Library" implementation is used.
|
| Supported: "gd", "imagick"
|
*/
'driver' => 'gd',
// Initial generator class
'generator' => \Laravolt\Avatar\Generator\DefaultGenerator::class,
// Whether all characters supplied must be replaced with their closest ASCII counterparts
'ascii' => true,
// Image shape: circle or square
'shape' => 'square',
// Image width, in pixel
'width' => 150,
// Image height, in pixel
'height' => 150,
// Number of characters used as initials. If name consists of single word, the first N character will be used
'chars' => 2,
// font size
'fontSize' => 48,
// convert initial letter in uppercase
'uppercase' => false,
// Fonts used to render text.
// If contains more than one fonts, randomly selected based on name supplied
'fonts' => [__DIR__.'/../../vendor/laravolt/avatar/fonts/OpenSans-Bold.ttf'],
// List of foreground colors to be used, randomly selected based on name supplied
'foregrounds' => [
'#FFFFFF',
],
// List of background colors to be used, randomly selected based on name supplied
'backgrounds' => [
'#f44336',
'#E91E63',
'#9C27B0',
'#673AB7',
'#3F51B5',
'#2196F3',
'#03A9F4',
'#00BCD4',
'#009688',
'#4CAF50',
'#8BC34A',
'#CDDC39',
'#FFC107',
'#FF9800',
'#FF5722',
],
'border' => [
'size' => 1,
// border color, available value are:
// 'foreground' (same as foreground color)
// 'background' (same as background color)
// or any valid hex ('#aabbcc')
'color' => 'foreground',
],
];

153
config/location.php Normal file
View File

@@ -0,0 +1,153 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Ipstack Api key
|--------------------------------------------------------------------------
|
| Get your ipstack apikey here https://ipstack.com/dashboard
|
*/
'ipstack_apikey' => env('IPSTACK_APIKEY', null),
/*
|--------------------------------------------------------------------------
| Driver
|--------------------------------------------------------------------------
|
| The default driver you would like to use for location retrieval.
|
*/
'driver' => App\Http\Location\Drivers\CloudflareDriver::class,
/*
|--------------------------------------------------------------------------
| Driver Fallbacks
|--------------------------------------------------------------------------
|
| The drivers you want to use to retrieve the users location
| if the above selected driver is unavailable.
|
| These will be called upon in order (first to last).
|
*/
'fallbacks' => [
Stevebauman\Location\Drivers\IpInfo::class,
Stevebauman\Location\Drivers\GeoPlugin::class,
Stevebauman\Location\Drivers\MaxMind::class,
],
/*
|--------------------------------------------------------------------------
| Position
|--------------------------------------------------------------------------
|
| Here you may configure the position instance that is created
| and returned from the above drivers. The instance you
| create must extend the built-in Position class.
|
*/
'position' => Stevebauman\Location\Position::class,
/*
|--------------------------------------------------------------------------
| MaxMind Configuration
|--------------------------------------------------------------------------
|
| The configuration for the MaxMind driver.
|
| If web service is enabled, you must fill in your user ID and license key.
|
| If web service is disabled, it will try and retrieve the users location
| from the MaxMind database file located in the local path below.
|
*/
'maxmind' => [
'web' => [
'enabled' => false,
'user_id' => '',
'license_key' => '',
'options' => [
'host' => 'geoip.maxmind.com',
],
],
'local' => [
'path' => database_path('maxmind/GeoLite2-City.mmdb'),
],
],
/*
|--------------------------------------------------------------------------
| IP API Pro Configuration
|--------------------------------------------------------------------------
|
| The configuration for the IP API Pro driver.
|
*/
'ip_api' => [
'token' => env('IP_API_TOKEN'),
],
/*
|--------------------------------------------------------------------------
| IPInfo Configuration
|--------------------------------------------------------------------------
|
| The configuration for the IPInfo driver.
|
*/
'ipinfo' => [
'token' => env('IPINFO_TOKEN'),
],
/*
|--------------------------------------------------------------------------
| IPData Configuration
|--------------------------------------------------------------------------
|
| The configuration for the IPData driver.
|
*/
'ipdata' => [
'token' => env('IPDATA_TOKEN'),
],
/*
|--------------------------------------------------------------------------
| Localhost Testing
|--------------------------------------------------------------------------
|
| If your running your website locally and want to test different
| IP addresses to see location detection, set 'enabled' to true.
|
| The testing IP address is a Google host in the United-States.
|
*/
'testing' => [
'enabled' => env('LOCATION_TESTING', false),
'ip' => '66.102.0.0',
],
/*
|--------------------------------------------------------------------------
| Locationiq API Url
|--------------------------------------------------------------------------
|
| Url to call Locationiq api. See https://locationiq.com/docs
|
*/
'location_iq_url' => env('LOCATIONIQ_URL', 'https://us1.locationiq.com/v1/'),
/*
|--------------------------------------------------------------------------
| Weatherapi Url
|--------------------------------------------------------------------------
|
| Url to call Weatherapi.
|
*/
'weatherapi_url' => env('WEATHERAPI_URL', 'https://api.weatherapi.com/v1/current.json'),
];

106
config/logging.php Normal file
View File

@@ -0,0 +1,106 @@
<?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
'ignore_exceptions' => false,
],
'stackerrorlog' => [
'driver' => 'stack',
'channels' => ['errorlog', 'papertrail', 'sentry'],
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'days' => 7,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
],
'papertrailerrorlog' => [
'driver' => 'stack',
'channels' => ['papertrail', 'errorlog'],
],
'papertrail' => [
'driver' => 'monolog',
'level' => 'debug',
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
],
],
'sentry' => [
'driver' => 'sentry',
'level' => 'debug',
'bubble' => true,
],
'stderr' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'with' => [
'stream' => 'php://stderr',
],
],
'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
],
'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
],
'testing' => [
'driver' => 'errorlog',
'level' => 'emergency',
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
];

107
config/mail.php Normal file
View File

@@ -0,0 +1,107 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Mailer
|--------------------------------------------------------------------------
|
| This option controls the default mailer that is used to send any email
| messages sent by your application. Alternative mailers may be setup
| and used as needed; however, this mailer will be used by default.
|
*/
'default' => env('MAIL_MAILER', env('MAIL_DRIVER', 'smtp')),
/*
|--------------------------------------------------------------------------
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
| Laravel supports a variety of mail "transport" drivers to be used while
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array"
|
*/
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'verify_peer' => env('MAIL_VERIFY_PEER', true),
],
'ses' => [
'transport' => 'ses',
],
'mailgun' => [
'transport' => 'mailgun',
],
'postmark' => [
'transport' => 'postmark',
],
'sendmail' => [
'transport' => 'sendmail',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
],
'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],
'array' => [
'transport' => 'array',
],
],
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS'),
'name' => env('MAIL_FROM_NAME'),
],
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];

287
config/monica.php Normal file
View File

@@ -0,0 +1,287 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Version of the application that you run
|--------------------------------------------------------------------------
|
| This is used to indicate which version of Monica you are running. You
| should not change this setting yourself. DO NOT CHANGE IT YOURSELF. Or
| bad things will happen.
|
*/
'app_version' => trim(trim(is_file(__DIR__.'/.version') ? file_get_contents(__DIR__.'/.version') : (is_dir(__DIR__.'/../.git') ? exec('git --git-dir '.base_path('.git').' describe --abbrev=0 --tags') : ''), 'v')),
/*
|--------------------------------------------------------------------------
| Disable User registration
|--------------------------------------------------------------------------
|
| Disables registration of new users
|
*/
'disable_signup' => env('APP_DISABLE_SIGNUP', false),
/*
|--------------------------------------------------------------------------
| Activate double optin on signup
|--------------------------------------------------------------------------
|
| Activates double optin on signup
|
*/
'signup_double_optin' => env('APP_SIGNUP_DOUBLE_OPTIN', false),
/*
|--------------------------------------------------------------------------
| New User Email Notification
|--------------------------------------------------------------------------
|
| Email to notify when new user registers.
|
*/
'email_new_user_notification' => env('APP_EMAIL_NEW_USERS_NOTIFICATION'),
/*
|--------------------------------------------------------------------------
| User and error tracking
|--------------------------------------------------------------------------
|
| We provide placeholders for Sentry.
|
*/
'sentry_support' => env('SENTRY_SUPPORT', false),
/*
|--------------------------------------------------------------------------
| Ping that checks if a new version is available
|--------------------------------------------------------------------------
|
| This is used to indicate if you allow the ping to be sent to
| version.monicahq.com to check if a new version is available.
|
*/
'check_version' => env('CHECK_VERSION', true),
/*
|--------------------------------------------------------------------------
| Allow access through the API of the public statistics
|--------------------------------------------------------------------------
|
| Your Monica instance has some statistics (number of users, number of
| contacts,...). Those data can be public (they are on MonicaHQ.com).
| This setting lets you access those data through a public API call.
|
*/
'allow_statistics_through_public_api_access' => env('ALLOW_STATISTICS_THROUGH_PUBLIC_API_ACCESS', false),
/*
|--------------------------------------------------------------------------
| URL of the server for the version check
|--------------------------------------------------------------------------
|
| This is the server that is used to ping if a new version is avaialble.
| Do not change this manually.
|
*/
'weekly_ping_server_url' => 'https://version.monicahq.com/ping',
/*
|--------------------------------------------------------------------------
| List of default relationship type group
|--------------------------------------------------------------------------
|
| This is used to populate the relationship type groups table.
|
*/
'default_relationship_type_group' => [
'love',
'family',
'friend',
'work',
],
/*
|--------------------------------------------------------------------------
| Compliance to various international policies.
|--------------------------------------------------------------------------
|
| Indicates whether we should comply to international policies like GDPR or
| CASL. Defaults to false, but if you do, it's at your own risk.
|
*/
'policy_compliant' => env('POLICY_COMPLIANT', true),
/*
|--------------------------------------------------------------------------
| Access to paid features
|--------------------------------------------------------------------------
|
| This value determines if the instance can access the paid features that
| are available on https://monicahq.com, for free.
| If set to false, the instance won't have access to the paid features.
|
| Available Settings: true, false
|
*/
'requires_subscription' => env('REQUIRES_SUBSCRIPTION', false),
/*
|--------------------------------------------------------------------------
| Paid plan settings
|--------------------------------------------------------------------------
|
| This value determines the name and the cost of the paid plan offered
| on https://monicahq.com. These settings make sense only if you do activate
| the `unlock_paid_features` above.
|
|
*/
'paid_plan_monthly_friendly_name' => env('PAID_PLAN_MONTHLY_FRIENDLY_NAME', null),
'paid_plan_monthly_id' => env('PAID_PLAN_MONTHLY_ID', null),
'paid_plan_monthly_price' => env('PAID_PLAN_MONTHLY_PRICE', null),
'paid_plan_annual_friendly_name' => env('PAID_PLAN_ANNUAL_FRIENDLY_NAME', null),
'paid_plan_annual_id' => env('PAID_PLAN_ANNUAL_ID', null),
'paid_plan_annual_price' => env('PAID_PLAN_ANNUAL_PRICE', null),
/*
|--------------------------------------------------------------------------
| Number of allowed contacts
|--------------------------------------------------------------------------
|
| This value determines the number of contacts allowed on a free account.
|
*/
'number_of_allowed_contacts_free_account' => env('NUMBER_OF_ALLOWED_CONTACTS_FREE_ACCOUNT', 10),
/*
|--------------------------------------------------------------------------
| Number of contacts to paginate
|--------------------------------------------------------------------------
|
| This value determines the number of contacts to paginate on the contacts page by default.
|
*/
'number_of_contacts_pagination' => env('NUMBER_OF_CONTACTS_PAGINATION', 30),
/*
|--------------------------------------------------------------------------
| Email address to contact for support
|--------------------------------------------------------------------------
|
| This value will be the email address used in the footer of the application
| to contact support.
|
*/
'support_email_address' => env('SUPPORT_EMAIL_ADDRESS', 'support@monicahq.com'),
/*
|--------------------------------------------------------------------------
| Twitter account for support
|--------------------------------------------------------------------------
|
| This value determines the twitter account shown in case of maintenance in
| progress.
|
*/
'twitter_account' => env('SUPPORT_TWITTER', 'monicaHQ_app'),
/*
|--------------------------------------------------------------------------
| Maximum allowed size for uploaded files, in kilobytes.
|--------------------------------------------------------------------------
|
| This value determines the maximum size when uploading a file, in kilobytes.
|
*/
'max_upload_size' => env('DEFAULT_MAX_UPLOAD_SIZE', 10240),
/*
|--------------------------------------------------------------------------
| Maximum allowed storage size per account, in megabytes.
|--------------------------------------------------------------------------
|
| This the default limit for each new account. Default value: 512Mb.
|
*/
'max_storage_size' => env('DEFAULT_MAX_STORAGE_SIZE', 512),
/*
|--------------------------------------------------------------------------
| Enable geolocation service.
|--------------------------------------------------------------------------
|
| For some features, we need to translate addresses to latitude/longitude
| coordinates. Like getting weather, for instance.
| If you do enable geolocation, you also need to provide a geolocation
| api key as shown below.
|
*/
'enable_geolocation' => env('ENABLE_GEOLOCATION', false),
/*
|--------------------------------------------------------------------------
| API key for geolocation service.
|--------------------------------------------------------------------------
|
| We use LocationIQ (https://locationiq.com/) to translate addresses to
| latitude/longitude coordinates. We could use Google instead but we don't
| want to give anything to Google, ever.
| LocationIQ offers 10,000 free requests per day.
|
*/
'location_iq_api_key' => env('LOCATION_IQ_API_KEY', null),
/*
|--------------------------------------------------------------------------
| Enable weather to be displayed on the contact profile page.
|--------------------------------------------------------------------------
|
| Geolocation needs to be enabled for this feature to work. We need to it
| to translate addresses to long/latitude coordinates.
*/
'enable_weather' => env('ENABLE_WEATHER', false),
/*
|--------------------------------------------------------------------------
| API key for weather data.
|--------------------------------------------------------------------------
|
| To provide weather information, we use WeatherAPI.
| See https://www.weatherapi.com/
*/
'weatherapi_key' => env('WEATHERAPI_KEY', null),
/*
|--------------------------------------------------------------------------
| Configure default rate limit for route services per minute
|--------------------------------------------------------------------------
|
| Configure rate limit for route services per minute
*/
'rate_limit_api' => env('RATE_LIMIT_PER_MINUTE_API', 60),
'rate_limit_oauth' => env('RATE_LIMIT_PER_MINUTE_OAUTH', 5),
/*
|--------------------------------------------------------------------------
| Default avatar size
|--------------------------------------------------------------------------
|
| The default avatar size.
*/
'avatar_size' => 200,
/*
|--------------------------------------------------------------------------
| Export size count
|--------------------------------------------------------------------------
|
| Number of exports available. When the number of exports is reached, the
| oldest export will be deleted.
|
*/
'export_size' => (int) env('EXPORT_SIZE', 5),
];

96
config/passport.php Normal file
View File

@@ -0,0 +1,96 @@
<?php
use function Safe\json_decode;
$passports = [
/*
|--------------------------------------------------------------------------
| Encryption Keys
|--------------------------------------------------------------------------
|
| Passport uses encryption keys while generating secure access tokens for
| your application. By default, the keys are stored as local files but
| can be set via environment variables when that is more convenient.
|
*/
'private_key' => env('PASSPORT_PRIVATE_KEY'),
'public_key' => env('PASSPORT_PUBLIC_KEY'),
/*
|--------------------------------------------------------------------------
| Client UUIDs
|--------------------------------------------------------------------------
|
| By default, Passport uses auto-incrementing primary keys when assigning
| IDs to clients. However, if Passport is installed using the provided
| --uuids switch, this will be set to "true" and UUIDs will be used.
|
*/
'client_uuids' => false,
/*
|--------------------------------------------------------------------------
| Personal Access Client
|--------------------------------------------------------------------------
|
| If you enable client hashing, you should set the personal access client
| ID and unhashed secret within your environment file. The values will
| get used while issuing fresh personal access tokens to your users.
|
*/
'personal_access_client' => [
'id' => env('PASSPORT_PERSONAL_ACCESS_CLIENT_ID'),
'secret' => env('PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET'),
],
/*
|--------------------------------------------------------------------------
| Password Grant Client
|--------------------------------------------------------------------------
|
| Password grant client used for oauth login, and mobile application.
|
*/
'password_grant_client' => [
'id' => env('PASSPORT_PASSWORD_GRANT_CLIENT_ID', env('MOBILE_CLIENT_ID')),
'secret' => env('PASSPORT_PASSWORD_GRANT_CLIENT_SECRET', env('MOBILE_CLIENT_SECRET')),
],
/*
|--------------------------------------------------------------------------
| Passport Storage Driver
|--------------------------------------------------------------------------
|
| This configuration value allows you to customize the storage options
| for Passport, such as the database connection that should be used
| by Passport's internal database models which store tokens, etc.
|
*/
'storage' => [
'database' => [
'connection' => env('DB_CONNECTION', 'mysql'),
],
],
];
// Use fortrabbit secrets
if (env('APP_SECRETS')) {
$secrets = json_decode(file_get_contents(env('APP_SECRETS')), true);
if (isset($secrets['CUSTOM']['PASSPORT_PRIVATE_KEY'])) {
$passports['private_key'] = str_replace('\\\\n', '\\n', $secrets['CUSTOM']['PASSPORT_PRIVATE_KEY']);
}
if (isset($secrets['CUSTOM']['PASSPORT_PUBLIC_KEY'])) {
$passports['public_key'] = str_replace('\\\\n', '\\n', $secrets['CUSTOM']['PASSPORT_PUBLIC_KEY']);
}
}
return $passports;

89
config/queue.php Normal file
View File

@@ -0,0 +1,89 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Connection Name
|--------------------------------------------------------------------------
|
| Laravel's queue API supports an assortment of back-ends via a single
| API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection.
|
*/
'default' => env('QUEUE_CONNECTION', env('QUEUE_DRIVER', 'sync')),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
'block_for' => 0,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'your-queue-name'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
],
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
|
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
];

37
config/sentry-release.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Auth token for api calls
|--------------------------------------------------------------------------
|
| See https://sentry.io/settings/account/api/auth-tokens/
|
*/
'auth_token' => env('SENTRY_AUTH_TOKEN'),
/*
|--------------------------------------------------------------------------
| Organisation slug
|--------------------------------------------------------------------------
*/
'organisation' => env('SENTRY_ORG'),
/*
|--------------------------------------------------------------------------
| Project
|--------------------------------------------------------------------------
*/
'project' => env('SENTRY_PROJECT'),
/*
|--------------------------------------------------------------------------
| Git repository set in sentry
|--------------------------------------------------------------------------
|
| See https://sentry.io/settings/{slug}/repos/
|
*/
'repo' => env('SENTRY_REPO', 'monicahq/monica'),
];

37
config/sentry.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
return [
'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')),
// capture release as git sha
'release' => is_file(__DIR__.'/.release') ? trim(file_get_contents(__DIR__.'/.release')) : (is_dir(__DIR__.'/../.git') ? trim(exec('git --git-dir '.base_path('.git').' log --pretty="%h" -n1 HEAD')) : null),
// When left empty or `null` the Laravel environment will be used
'environment' => env('SENTRY_ENVIRONMENT'),
'breadcrumbs' => [
// Capture Laravel logs in breadcrumbs
'logs' => true,
// Capture SQL queries in breadcrumbs
'sql_queries' => true,
// Capture bindings on SQL queries logged in breadcrumbs
'sql_bindings' => true,
// Capture queue job information in breadcrumbs
'queue_info' => true,
// Capture command information in breadcrumbs
'command_info' => true,
],
// @see: https://docs.sentry.io/platforms/php/data-management/sensitive-data/#personally-identifiable-information-pii
'send_default_pii' => env('SENTRY_DEFAULT_PII', false),
'traces_sample_rate' => (float) env('SENTRY_TRACES_SAMPLE_RATE', 0.0),
'controllers_base_namespace' => env('SENTRY_CONTROLLERS_BASE_NAMESPACE', 'App\\Http\\Controllers'),
];

43
config/services.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID', env('SES_KEY')),
'secret' => env('AWS_SECRET_ACCESS_KEY', env('SES_SECRET')),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'stripe' => [
'model' => App\Models\Account\Account::class,
'key' => env('STRIPE_KEY', null),
'secret' => env('STRIPE_SECRET', null),
'webhook' => [
'secret' => env('STRIPE_WEBHOOK_SECRET', null),
'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
],
],
];

194
config/session.php Normal file
View File

@@ -0,0 +1,194 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
|
*/
'encrypt' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path('framework/sessions'),
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => env('SESSION_CONNECTION', null),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Cache Store | Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc" or "memcached" session drivers, you may specify a
| cache store that should be used for these sessions. This value must
| correspond with one of the application's configured cache stores.
|
*/
'store' => env('SESSION_STORE', null),
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => env('SESSION_COOKIE', 'laravel_session'),
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => env('SESSION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => env('SESSION_SECURE_COOKIE', null),
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. You are free to modify this option if needed.
|
*/
'http_only' => true,
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| do not enable this as other CSRF protection services are in place.
|
| Supported: "lax", "strict"
|
*/
'same_site' => 'lax',
];

36
config/view.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => env(
'VIEW_COMPILED_PATH',
realpath(storage_path('framework/views'))
),
];

306
config/webauthn.php Normal file
View File

@@ -0,0 +1,306 @@
<?php
use LaravelWebauthn\Models\WebauthnKey;
return [
/*
|--------------------------------------------------------------------------
| LaravelWebauthn Master Switch
|--------------------------------------------------------------------------
|
| This option may be used to disable LaravelWebauthn.
|
*/
'enable' => env('MFA_ENABLED', true),
/*
|--------------------------------------------------------------------------
| Webauthn Guard
|--------------------------------------------------------------------------
|
| Here you may specify which authentication guard Webauthn will use while
| authenticating users. This value should correspond with one of your
| guards that is already present in your "auth" configuration file.
|
*/
'guard' => 'web',
/*
|--------------------------------------------------------------------------
| Username / Email
|--------------------------------------------------------------------------
|
| This value defines which model attribute should be considered as your
| application's "username" field. Typically, this might be the email
| address of the users but you are free to change this value here.
|
*/
'username' => 'email',
/*
|--------------------------------------------------------------------------
| Webauthn Routes Prefix / Subdomain
|--------------------------------------------------------------------------
|
| Here you may specify which prefix Webauthn will assign to all the routes
| that it registers with the application. If necessary, you may change
| subdomain under which all of the Webauthn routes will be available.
|
*/
'prefix' => 'webauthn',
'domain' => null,
/*
|--------------------------------------------------------------------------
| Webauthn Routes Middleware
|--------------------------------------------------------------------------
|
| Here you may specify which middleware Webauthn will assign to the routes
| that it registers with the application. If necessary, you may change
| these middleware but typically this provided default is preferred.
|
*/
'middleware' => [
'web',
'auth',
'verified',
],
/*
|--------------------------------------------------------------------------
| Webauthn key model
|--------------------------------------------------------------------------
|
| Here you may specify the model used to create Webauthn keys.
|
*/
'model' => WebauthnKey::class,
/*
|--------------------------------------------------------------------------
| Rate Limiting
|--------------------------------------------------------------------------
|
| By default, Laravel Webauthn will throttle logins to five requests per
| minute for every email and IP address combination. However, if you would
| like to specify a custom rate limiter to call then you may specify it here.
|
*/
'limiters' => [
'login' => null,
],
/*
|--------------------------------------------------------------------------
| Redirect routes
|--------------------------------------------------------------------------
|
| When using navigation, redirects to these url on success:
| - login: after a successfull login.
| - register: after a successfull Webauthn key creation.
|
| Redirects are not used in case of application/json requests.
|
*/
'redirects' => [
'login' => '/dashboard',
'register' => '/settings/security',
],
/*
|--------------------------------------------------------------------------
| View to load after middleware login request.
|--------------------------------------------------------------------------
|
| The name of blade template to load:
| - authenticate: when a user login, and has to validate Webauthn 2nd factor.
| - register: when a user request to create a Webauthn key.
|
| If the views are empty or null, then the route will not be registered.
|
*/
'views' => [
'authenticate' => 'auth.validatewebauthn',
'register' => null,
],
/*
|--------------------------------------------------------------------------
| Webauthn logging
|--------------------------------------------------------------------------
|
| Here you may specify the channel to which Webauthn will log messages.
| This value should correspond with one of your loggers that is already
| present in your "logging" configuration file. If left as null, it will
| use the default logger for the application.
|
*/
'log' => null,
/*
|--------------------------------------------------------------------------
| Session name
|--------------------------------------------------------------------------
|
| Name of the session parameter to store the successful login.
|
*/
'session_name' => 'webauthn_auth',
/*
|--------------------------------------------------------------------------
| Webauthn challenge length
|--------------------------------------------------------------------------
|
| Length of the random string used in the challenge request.
|
*/
'challenge_length' => 32,
/*
|--------------------------------------------------------------------------
| Webauthn timeout (milliseconds)
|--------------------------------------------------------------------------
|
| Time that the caller is willing to wait for the call to complete.
|
*/
'timeout' => 60000,
/*
|--------------------------------------------------------------------------
| Webauthn extension client input
|--------------------------------------------------------------------------
|
| Optional authentication extension.
| See https://www.w3.org/TR/webauthn/#client-extension-input
|
*/
'extensions' => [],
/*
|--------------------------------------------------------------------------
| Webauthn icon
|--------------------------------------------------------------------------
|
| Url which resolves to an image associated with the entity.
| See https://www.w3.org/TR/webauthn/#dom-publickeycredentialentity-icon
|
*/
'icon' => env('WEBAUTHN_ICON'),
/*
|--------------------------------------------------------------------------
| Webauthn Attestation Conveyance
|--------------------------------------------------------------------------
|
| This parameter specify the preference regarding the attestation conveyance
| during credential generation.
| See https://www.w3.org/TR/webauthn/#enum-attestation-convey
|
| Supported: "none", "indirect", "direct", "enterprise".
*/
'attestation_conveyance' => 'none',
/*
|--------------------------------------------------------------------------
| Google Safetynet ApiKey
|--------------------------------------------------------------------------
|
| Api key to use Google Safetynet.
| See https://developer.android.com/training/safetynet/attestation
|
*/
'google_safetynet_api_key' => env('GOOGLE_SAFETYNET_API_KEY'),
/*
|--------------------------------------------------------------------------
| Webauthn Public Key Credential Parameters
|--------------------------------------------------------------------------
|
| List of allowed Cryptographic Algorithm Identifier.
| See https://www.w3.org/TR/webauthn/#sctn-alg-identifier
|
*/
'public_key_credential_parameters' => [
\Cose\Algorithms::COSE_ALGORITHM_ES256, // ECDSA with SHA-256
\Cose\Algorithms::COSE_ALGORITHM_ES512, // ECDSA with SHA-512
\Cose\Algorithms::COSE_ALGORITHM_RS256, // RSASSA-PKCS1-v1_5 with SHA-256
\Cose\Algorithms::COSE_ALGORITHM_EDDSA, // EDDSA
\Cose\Algorithms::COSE_ALGORITHM_ES384, // ECDSA with SHA-384
],
/*
|--------------------------------------------------------------------------
| Credentials Attachment.
|--------------------------------------------------------------------------
|
| Authentication can be tied to the current device (like when using Windows
| Hello or Touch ID) or a cross-platform device (like USB Key). When this
| is "null" the user will decide where to store his authentication info.
|
| See https://www.w3.org/TR/webauthn/#enum-attachment
|
| Supported: "null", "cross-platform", "platform".
|
*/
'attachment_mode' => null,
/*
|--------------------------------------------------------------------------
| User presence and verification
|--------------------------------------------------------------------------
|
| Most authenticators and smartphones will ask the user to actively verify
| themselves for log in. Use "required" to always ask verify, "preferred"
| to ask when possible, and "discouraged" to just ask for user presence.
|
| See https://www.w3.org/TR/webauthn/#enum-userVerificationRequirement
|
| Supported: "required", "preferred", "discouraged".
|
*/
'user_verification' => 'preferred',
/*
|--------------------------------------------------------------------------
| Userless (One touch, Typeless) login
|--------------------------------------------------------------------------
|
| By default, users must input their email to receive a list of credentials
| ID to use for authentication, but they can also login without specifying
| one if the device can remember them, allowing for true one-touch login.
|
| If required or preferred, login verification will be always required.
|
| See https://www.w3.org/TR/webauthn/#enum-residentKeyRequirement
|
| Supported: "null", "required", "preferred", "discouraged".
|
*/
'userless' => null,
];