Skip to content

Firefly III: a personal finances manager

Fix #3642

James Cole2a3651013cbb
diff --git a/.env.example b/.env.example
index 67e573fc3d..04956596df 100644
--- a/.env.example
+++ b/.env.example
@@ -93,9 +93,18 @@ SESSION_DRIVER=file
# If you set either of these to 'redis', you might want to update these settings too
# If you use Docker or similar, you can set REDIS_HOST_FILE, REDIS_PASSWORD_FILE or
# REDIS_PORT_FILE to set the value from a file instead of from an environment variable
+
+# can be tcp, unix or http
+REDIS_SCHEME=tcp
+
+# use only when using 'unix' for REDIS_SCHEME. Leave empty otherwise.
+REDIS_PATH=
+
+# use only when using 'tcp' or 'http' for REDIS_SCHEME. Leave empty otherwise.
REDIS_HOST=127.0.0.1
-REDIS_PASSWORD=null
REDIS_PORT=6379
+
+REDIS_PASSWORD=null
# always use quotes and make sure redis db "0" and "1" exists. Otherwise change accordingly.
REDIS_DB="0"
REDIS_CACHE_DB="1"
diff --git a/config/database.php b/config/database.php
index e5609829c6..f4af35dec9 100644
--- a/config/database.php
+++ b/config/database.php
@@ -144,17 +144,21 @@ return [
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
],
'default' => [
- 'url' => env('REDIS_URL'),
- 'host' => env('REDIS_HOST', '127.0.0.1'),
+ 'scheme' => envNonEmpty('REDIS_SCHEME', 'tcp'),
+ 'url' => envNonEmpty('REDIS_URL'),
+ 'path' => envNonEmpty('REDIS_PATH'),
+ 'host' => envNonEmpty('REDIS_HOST', '127.0.0.1'),
+ 'port' => envNonEmpty('REDIS_PORT', 6379),
'password' => env('REDIS_PASSWORD', null),
- 'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DB', '0'),
],
'cache' => [
- 'url' => env('REDIS_URL'),
- 'host' => env('REDIS_HOST', '127.0.0.1'),
+ 'scheme' => envNonEmpty('REDIS_SCHEME', 'tcp'),
+ 'url' => envNonEmpty('REDIS_URL'),
+ 'path' => envNonEmpty('REDIS_PATH'),
+ 'host' => envNonEmpty('REDIS_HOST', '127.0.0.1'),
+ 'port' => envNonEmpty('REDIS_PORT', 6379),
'password' => env('REDIS_PASSWORD', null),
- 'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_CACHE_DB', '1'),
],
],