diff --git a/.env.example b/.env.example index f2d0531763..9cbff6467e 100644 --- a/.env.example +++ b/.env.example @@ -111,7 +111,10 @@ REDIS_PATH= # use only when using 'tcp' or 'http' for REDIS_SCHEME. Leave empty otherwise. REDIS_HOST=127.0.0.1 REDIS_PORT=6379 -REDIS_PASSWORD=null + +# Use only with Redis 6+ with proper ACL set. Leave empty otherwise. +REDIS_USERNAME= +REDIS_PASSWORD= # always use quotes and make sure redis db "0" and "1" exists. Otherwise change accordingly. REDIS_DB="0" diff --git a/config/database.php b/config/database.php index 6d017ae602..c2ed4fbd78 100644 --- a/config/database.php +++ b/config/database.php @@ -159,6 +159,7 @@ return [ 'path' => envNonEmpty('REDIS_PATH'), 'host' => envNonEmpty('REDIS_HOST', '127.0.0.1'), 'port' => envNonEmpty('REDIS_PORT', 6379), + 'username' => env('REDIS_USERNAME'), 'password' => env('REDIS_PASSWORD', null), 'database' => env('REDIS_CACHE_DB', '1'), ],