config: add ssl/tls options for mysql and redis

This commit is contained in:
Matthew Penner 2021-07-11 14:57:56 -06:00
parent 682ca6cecd
commit 7776436d18
4 changed files with 48 additions and 8 deletions

View file

@ -14,6 +14,7 @@
"php": "^7.4 || ^8.0",
"ext-json": "*",
"ext-mbstring": "*",
"ext-pdo": "*",
"ext-pdo_mysql": "*",
"ext-zip": "*",
"aws/aws-sdk-php": "^3.171",

View file

@ -10,7 +10,7 @@ return [
| 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"
| Supported: "apc", "array", "database", "file", "memcached", "redis", "octane"
|
*/
@ -34,12 +34,14 @@ return [
'array' => [
'driver' => 'array',
'serialize' => false,
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
'lock_connection' => null,
],
'file' => [
@ -69,6 +71,7 @@ return [
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'lock_connection' => 'default',
],
'sessions' => [
@ -76,6 +79,10 @@ return [
'table' => 'sessions',
'connection' => env('SESSION_DRIVER') === 'redis' ? 'sessions' : null,
],
'octane' => [
'driver' => 'octane',
],
],
/*

View file

@ -1,5 +1,6 @@
<?php
use Illuminate\Support\Str;
use Pterodactyl\Helpers\Time;
return [
@ -35,17 +36,26 @@ return [
'connections' => [
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'unix_socket' => env('DB_SOCKET'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'panel'),
'username' => env('DB_USERNAME', 'pterodactyl'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => env('DB_PREFIX', ''),
'prefix_indexes' => true,
'strict' => env('DB_STRICT_MODE', false),
'timezone' => env('DB_TIMEZONE', Time::getMySQLTimezoneOffset(env('APP_TIMEZONE', 'UTC'))),
'sslmode' => env('DB_SSLMODE', 'prefer'),
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
PDO::MYSQL_ATTR_SSL_CERT => env('MYSQL_ATTR_SSL_CERT'),
PDO::MYSQL_ATTR_SSL_KEY => env('MYSQL_ATTR_SSL_KEY'),
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => env('MYSQL_ATTR_SSL_VERIFY_SERVER_CERT', true),
]) : [],
],
/*
@ -97,24 +107,47 @@ return [
*/
'redis' => [
'client' => 'predis',
'client' => env('REDIS_CLIENT', 'predis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'default' => [
'scheme' => env('REDIS_SCHEME', 'tcp'),
'path' => env('REDIS_PATH', '/run/redis/redis.sock'),
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DATABASE', 0),
'context' => extension_loaded('redis') && env('REDIS_CLIENT') === 'phpredis' ? [
'stream' => array_filter([
'verify_peer' => env('REDIS_VERIFY_PEER', true),
'verify_peer_name' => env('REDIS_VERIFY_PEER_NAME', true),
'cafile' => env('REDIS_CAFILE'),
'local_cert' => env('REDIS_LOCAL_CERT'),
'local_pk' => env('REDIS_LOCAL_PK'),
]),
] : [],
],
'sessions' => [
'scheme' => env('REDIS_SCHEME', 'tcp'),
'path' => env('REDIS_PATH', '/run/redis/redis.sock'),
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DATABASE_SESSIONS', 1),
'context' => extension_loaded('redis') && env('REDIS_CLIENT') === 'phpredis' ? [
'stream' => array_filter([
'verify_peer' => env('REDIS_VERIFY_PEER', true),
'verify_peer_name' => env('REDIS_VERIFY_PEER_NAME', true),
'cafile' => env('REDIS_CAFILE'),
'local_cert' => env('REDIS_LOCAL_CERT'),
'local_pk' => env('REDIS_LOCAL_PK'),
]),
] : [],
],
],
];

View file

@ -10,8 +10,7 @@ return [
| 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", "array"
| Supported: "file", "cookie", "database", "apc", "memcached", "redis", "array"
|
*/
@ -147,7 +146,7 @@ return [
|
*/
'domain' => env('SESSION_DOMAIN', null),
'domain' => env('SESSION_DOMAIN'),
/*
|--------------------------------------------------------------------------