Skip to content
Snippets Groups Projects
Commit 61578a10 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #20193 from owncloud/redis-password

Add support for Redis password auth
parents 6911d8f0 78cad94f
Branches
No related tags found
No related merge requests found
......@@ -879,11 +879,16 @@ $CONFIG = array(
/**
* Connection details for redis to use for memory caching.
*
* For enhanced security it is recommended to configure Redis
* to require a password. See http://redis.io/topics/security
* for more information.
*/
'redis' => array(
'host' => 'localhost', // can also be a unix domain socket: '/tmp/redis.sock'
'port' => 6379,
'timeout' => 0.0,
'password' => '', // Optional, if not defined no password will be used.
'dbindex' => 0, // Optional, if undefined SELECT will not run and will use Redis Server's default DB Index.
),
......
......@@ -56,6 +56,9 @@ class Redis extends Cache implements IMemcache {
}
self::$cache->connect($host, $port, $timeout);
if(isset($config['password']) && $config['password'] !== '') {
self::$cache->auth($config['password']);
}
if (isset($config['dbindex'])) {
self::$cache->select($config['dbindex']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment