@@ -27,159 +27,159 @@ |
||
| 27 | 27 | namespace OC; |
| 28 | 28 | |
| 29 | 29 | class RedisFactory { |
| 30 | - public const REDIS_MINIMAL_VERSION = '2.2.5'; |
|
| 31 | - public const REDIS_EXTRA_PARAMETERS_MINIMAL_VERSION = '5.3.0'; |
|
| 32 | - |
|
| 33 | - /** @var \Redis|\RedisCluster */ |
|
| 34 | - private $instance; |
|
| 35 | - |
|
| 36 | - /** @var SystemConfig */ |
|
| 37 | - private $config; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * RedisFactory constructor. |
|
| 41 | - * |
|
| 42 | - * @param SystemConfig $config |
|
| 43 | - */ |
|
| 44 | - public function __construct(SystemConfig $config) { |
|
| 45 | - $this->config = $config; |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - private function create() { |
|
| 49 | - $isCluster = in_array('redis.cluster', $this->config->getKeys()); |
|
| 50 | - $config = $isCluster |
|
| 51 | - ? $this->config->getValue('redis.cluster', []) |
|
| 52 | - : $this->config->getValue('redis', []); |
|
| 53 | - |
|
| 54 | - if (empty($config)) { |
|
| 55 | - throw new \Exception('Redis config is empty'); |
|
| 56 | - } |
|
| 57 | - |
|
| 58 | - if ($isCluster && !class_exists('RedisCluster')) { |
|
| 59 | - throw new \Exception('Redis Cluster support is not available'); |
|
| 60 | - } |
|
| 61 | - |
|
| 62 | - if (isset($config['timeout'])) { |
|
| 63 | - $timeout = $config['timeout']; |
|
| 64 | - } else { |
|
| 65 | - $timeout = 0.0; |
|
| 66 | - } |
|
| 67 | - |
|
| 68 | - if (isset($config['read_timeout'])) { |
|
| 69 | - $readTimeout = $config['read_timeout']; |
|
| 70 | - } else { |
|
| 71 | - $readTimeout = 0.0; |
|
| 72 | - } |
|
| 73 | - |
|
| 74 | - $auth = null; |
|
| 75 | - if (isset($config['password']) && $config['password'] !== '') { |
|
| 76 | - if (isset($config['user']) && $config['user'] !== '') { |
|
| 77 | - $auth = [$config['user'], $config['password']]; |
|
| 78 | - } else { |
|
| 79 | - $auth = $config['password']; |
|
| 80 | - } |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - // # TLS support |
|
| 84 | - // # https://github.com/phpredis/phpredis/issues/1600 |
|
| 85 | - $connectionParameters = $this->getSslContext($config); |
|
| 86 | - |
|
| 87 | - // cluster config |
|
| 88 | - if ($isCluster) { |
|
| 89 | - // Support for older phpredis versions not supporting connectionParameters |
|
| 90 | - if ($connectionParameters !== null) { |
|
| 91 | - $this->instance = new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout, false, $auth, $connectionParameters); |
|
| 92 | - } else { |
|
| 93 | - $this->instance = new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout, false, $auth); |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - if (isset($config['failover_mode'])) { |
|
| 97 | - $this->instance->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, $config['failover_mode']); |
|
| 98 | - } |
|
| 99 | - } else { |
|
| 100 | - $this->instance = new \Redis(); |
|
| 101 | - |
|
| 102 | - if (isset($config['host'])) { |
|
| 103 | - $host = $config['host']; |
|
| 104 | - } else { |
|
| 105 | - $host = '127.0.0.1'; |
|
| 106 | - } |
|
| 107 | - |
|
| 108 | - if (isset($config['port'])) { |
|
| 109 | - $port = $config['port']; |
|
| 110 | - } elseif ($host[0] !== '/') { |
|
| 111 | - $port = 6379; |
|
| 112 | - } else { |
|
| 113 | - $port = null; |
|
| 114 | - } |
|
| 115 | - |
|
| 116 | - // Support for older phpredis versions not supporting connectionParameters |
|
| 117 | - if ($connectionParameters !== null) { |
|
| 118 | - // Non-clustered redis requires connection parameters to be wrapped inside `stream` |
|
| 119 | - $connectionParameters = [ |
|
| 120 | - 'stream' => $this->getSslContext($config) |
|
| 121 | - ]; |
|
| 122 | - $this->instance->connect($host, $port, $timeout, null, 0, $readTimeout, $connectionParameters); |
|
| 123 | - } else { |
|
| 124 | - $this->instance->connect($host, $port, $timeout, null, 0, $readTimeout); |
|
| 125 | - } |
|
| 126 | - |
|
| 127 | - |
|
| 128 | - // Auth if configured |
|
| 129 | - if ($auth !== null) { |
|
| 130 | - $this->instance->auth($auth); |
|
| 131 | - } |
|
| 132 | - |
|
| 133 | - if (isset($config['dbindex'])) { |
|
| 134 | - $this->instance->select($config['dbindex']); |
|
| 135 | - } |
|
| 136 | - } |
|
| 137 | - } |
|
| 138 | - |
|
| 139 | - /** |
|
| 140 | - * Get the ssl context config |
|
| 141 | - * |
|
| 142 | - * @param Array $config the current config |
|
| 143 | - * @return Array|null |
|
| 144 | - * @throws \UnexpectedValueException |
|
| 145 | - */ |
|
| 146 | - private function getSslContext($config) { |
|
| 147 | - if (isset($config['ssl_context'])) { |
|
| 148 | - if (!$this->isConnectionParametersSupported()) { |
|
| 149 | - throw new \UnexpectedValueException(\sprintf( |
|
| 150 | - 'php-redis extension must be version %s or higher to support ssl context', |
|
| 151 | - self::REDIS_EXTRA_PARAMETERS_MINIMAL_VERSION |
|
| 152 | - )); |
|
| 153 | - } |
|
| 154 | - return $config['ssl_context']; |
|
| 155 | - } |
|
| 156 | - return null; |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - public function getInstance() { |
|
| 160 | - if (!$this->isAvailable()) { |
|
| 161 | - throw new \Exception('Redis support is not available'); |
|
| 162 | - } |
|
| 163 | - if (!$this->instance instanceof \Redis) { |
|
| 164 | - $this->create(); |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - return $this->instance; |
|
| 168 | - } |
|
| 169 | - |
|
| 170 | - public function isAvailable() { |
|
| 171 | - return extension_loaded('redis') |
|
| 172 | - && version_compare(phpversion('redis'), '2.2.5', '>='); |
|
| 173 | - } |
|
| 174 | - |
|
| 175 | - /** |
|
| 176 | - * Php redis does support configurable extra parameters since version 5.3.0, see: https://github.com/phpredis/phpredis#connect-open. |
|
| 177 | - * We need to check if the current version supports extra connection parameters, otherwise the connect method will throw an exception |
|
| 178 | - * |
|
| 179 | - * @return boolean |
|
| 180 | - */ |
|
| 181 | - private function isConnectionParametersSupported(): bool { |
|
| 182 | - return \extension_loaded('redis') && |
|
| 183 | - \version_compare(\phpversion('redis'), self::REDIS_EXTRA_PARAMETERS_MINIMAL_VERSION, '>='); |
|
| 184 | - } |
|
| 30 | + public const REDIS_MINIMAL_VERSION = '2.2.5'; |
|
| 31 | + public const REDIS_EXTRA_PARAMETERS_MINIMAL_VERSION = '5.3.0'; |
|
| 32 | + |
|
| 33 | + /** @var \Redis|\RedisCluster */ |
|
| 34 | + private $instance; |
|
| 35 | + |
|
| 36 | + /** @var SystemConfig */ |
|
| 37 | + private $config; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * RedisFactory constructor. |
|
| 41 | + * |
|
| 42 | + * @param SystemConfig $config |
|
| 43 | + */ |
|
| 44 | + public function __construct(SystemConfig $config) { |
|
| 45 | + $this->config = $config; |
|
| 46 | + } |
|
| 47 | + |
|
| 48 | + private function create() { |
|
| 49 | + $isCluster = in_array('redis.cluster', $this->config->getKeys()); |
|
| 50 | + $config = $isCluster |
|
| 51 | + ? $this->config->getValue('redis.cluster', []) |
|
| 52 | + : $this->config->getValue('redis', []); |
|
| 53 | + |
|
| 54 | + if (empty($config)) { |
|
| 55 | + throw new \Exception('Redis config is empty'); |
|
| 56 | + } |
|
| 57 | + |
|
| 58 | + if ($isCluster && !class_exists('RedisCluster')) { |
|
| 59 | + throw new \Exception('Redis Cluster support is not available'); |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + if (isset($config['timeout'])) { |
|
| 63 | + $timeout = $config['timeout']; |
|
| 64 | + } else { |
|
| 65 | + $timeout = 0.0; |
|
| 66 | + } |
|
| 67 | + |
|
| 68 | + if (isset($config['read_timeout'])) { |
|
| 69 | + $readTimeout = $config['read_timeout']; |
|
| 70 | + } else { |
|
| 71 | + $readTimeout = 0.0; |
|
| 72 | + } |
|
| 73 | + |
|
| 74 | + $auth = null; |
|
| 75 | + if (isset($config['password']) && $config['password'] !== '') { |
|
| 76 | + if (isset($config['user']) && $config['user'] !== '') { |
|
| 77 | + $auth = [$config['user'], $config['password']]; |
|
| 78 | + } else { |
|
| 79 | + $auth = $config['password']; |
|
| 80 | + } |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + // # TLS support |
|
| 84 | + // # https://github.com/phpredis/phpredis/issues/1600 |
|
| 85 | + $connectionParameters = $this->getSslContext($config); |
|
| 86 | + |
|
| 87 | + // cluster config |
|
| 88 | + if ($isCluster) { |
|
| 89 | + // Support for older phpredis versions not supporting connectionParameters |
|
| 90 | + if ($connectionParameters !== null) { |
|
| 91 | + $this->instance = new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout, false, $auth, $connectionParameters); |
|
| 92 | + } else { |
|
| 93 | + $this->instance = new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout, false, $auth); |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + if (isset($config['failover_mode'])) { |
|
| 97 | + $this->instance->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, $config['failover_mode']); |
|
| 98 | + } |
|
| 99 | + } else { |
|
| 100 | + $this->instance = new \Redis(); |
|
| 101 | + |
|
| 102 | + if (isset($config['host'])) { |
|
| 103 | + $host = $config['host']; |
|
| 104 | + } else { |
|
| 105 | + $host = '127.0.0.1'; |
|
| 106 | + } |
|
| 107 | + |
|
| 108 | + if (isset($config['port'])) { |
|
| 109 | + $port = $config['port']; |
|
| 110 | + } elseif ($host[0] !== '/') { |
|
| 111 | + $port = 6379; |
|
| 112 | + } else { |
|
| 113 | + $port = null; |
|
| 114 | + } |
|
| 115 | + |
|
| 116 | + // Support for older phpredis versions not supporting connectionParameters |
|
| 117 | + if ($connectionParameters !== null) { |
|
| 118 | + // Non-clustered redis requires connection parameters to be wrapped inside `stream` |
|
| 119 | + $connectionParameters = [ |
|
| 120 | + 'stream' => $this->getSslContext($config) |
|
| 121 | + ]; |
|
| 122 | + $this->instance->connect($host, $port, $timeout, null, 0, $readTimeout, $connectionParameters); |
|
| 123 | + } else { |
|
| 124 | + $this->instance->connect($host, $port, $timeout, null, 0, $readTimeout); |
|
| 125 | + } |
|
| 126 | + |
|
| 127 | + |
|
| 128 | + // Auth if configured |
|
| 129 | + if ($auth !== null) { |
|
| 130 | + $this->instance->auth($auth); |
|
| 131 | + } |
|
| 132 | + |
|
| 133 | + if (isset($config['dbindex'])) { |
|
| 134 | + $this->instance->select($config['dbindex']); |
|
| 135 | + } |
|
| 136 | + } |
|
| 137 | + } |
|
| 138 | + |
|
| 139 | + /** |
|
| 140 | + * Get the ssl context config |
|
| 141 | + * |
|
| 142 | + * @param Array $config the current config |
|
| 143 | + * @return Array|null |
|
| 144 | + * @throws \UnexpectedValueException |
|
| 145 | + */ |
|
| 146 | + private function getSslContext($config) { |
|
| 147 | + if (isset($config['ssl_context'])) { |
|
| 148 | + if (!$this->isConnectionParametersSupported()) { |
|
| 149 | + throw new \UnexpectedValueException(\sprintf( |
|
| 150 | + 'php-redis extension must be version %s or higher to support ssl context', |
|
| 151 | + self::REDIS_EXTRA_PARAMETERS_MINIMAL_VERSION |
|
| 152 | + )); |
|
| 153 | + } |
|
| 154 | + return $config['ssl_context']; |
|
| 155 | + } |
|
| 156 | + return null; |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + public function getInstance() { |
|
| 160 | + if (!$this->isAvailable()) { |
|
| 161 | + throw new \Exception('Redis support is not available'); |
|
| 162 | + } |
|
| 163 | + if (!$this->instance instanceof \Redis) { |
|
| 164 | + $this->create(); |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + return $this->instance; |
|
| 168 | + } |
|
| 169 | + |
|
| 170 | + public function isAvailable() { |
|
| 171 | + return extension_loaded('redis') |
|
| 172 | + && version_compare(phpversion('redis'), '2.2.5', '>='); |
|
| 173 | + } |
|
| 174 | + |
|
| 175 | + /** |
|
| 176 | + * Php redis does support configurable extra parameters since version 5.3.0, see: https://github.com/phpredis/phpredis#connect-open. |
|
| 177 | + * We need to check if the current version supports extra connection parameters, otherwise the connect method will throw an exception |
|
| 178 | + * |
|
| 179 | + * @return boolean |
|
| 180 | + */ |
|
| 181 | + private function isConnectionParametersSupported(): bool { |
|
| 182 | + return \extension_loaded('redis') && |
|
| 183 | + \version_compare(\phpversion('redis'), self::REDIS_EXTRA_PARAMETERS_MINIMAL_VERSION, '>='); |
|
| 184 | + } |
|
| 185 | 185 | } |
@@ -41,17 +41,17 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | 'instanceid' => '', |
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * The salt used to hash all passwords, auto-generated by the Nextcloud |
|
| 46 | - * installer. (There are also per-user salts.) If you lose this salt you lose |
|
| 47 | - * all your passwords. This example is for documentation only, and you should |
|
| 48 | - * never use it. |
|
| 49 | - * |
|
| 50 | - * @deprecated This salt is deprecated and only used for legacy-compatibility, |
|
| 51 | - * developers should *NOT* use this value for anything nowadays. |
|
| 52 | - * |
|
| 53 | - * 'passwordsalt' => 'd3c944a9af095aa08f', |
|
| 54 | - */ |
|
| 44 | + /** |
|
| 45 | + * The salt used to hash all passwords, auto-generated by the Nextcloud |
|
| 46 | + * installer. (There are also per-user salts.) If you lose this salt you lose |
|
| 47 | + * all your passwords. This example is for documentation only, and you should |
|
| 48 | + * never use it. |
|
| 49 | + * |
|
| 50 | + * @deprecated This salt is deprecated and only used for legacy-compatibility, |
|
| 51 | + * developers should *NOT* use this value for anything nowadays. |
|
| 52 | + * |
|
| 53 | + * 'passwordsalt' => 'd3c944a9af095aa08f', |
|
| 54 | + */ |
|
| 55 | 55 | 'passwordsalt' => '', |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -69,12 +69,12 @@ discard block |
||
| 69 | 69 | * Using TLS certificates where commonName=<IP address> is deprecated |
| 70 | 70 | */ |
| 71 | 71 | 'trusted_domains' => |
| 72 | - [ |
|
| 72 | + [ |
|
| 73 | 73 | 'demo.example.org', |
| 74 | 74 | 'otherdomain.example.org', |
| 75 | 75 | '10.111.112.113', |
| 76 | 76 | '[2001:db8::1]' |
| 77 | - ], |
|
| 77 | + ], |
|
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -767,10 +767,10 @@ discard block |
||
| 767 | 767 | * - www.edri.org |
| 768 | 768 | */ |
| 769 | 769 | 'connectivity_check_domains' => [ |
| 770 | - 'www.nextcloud.com', |
|
| 771 | - 'www.startpage.com', |
|
| 772 | - 'www.eff.org', |
|
| 773 | - 'www.edri.org' |
|
| 770 | + 'www.nextcloud.com', |
|
| 771 | + 'www.startpage.com', |
|
| 772 | + 'www.eff.org', |
|
| 773 | + 'www.edri.org' |
|
| 774 | 774 | ], |
| 775 | 775 | |
| 776 | 776 | /** |
@@ -886,9 +886,9 @@ discard block |
||
| 886 | 886 | * Defaults to an empty array. |
| 887 | 887 | */ |
| 888 | 888 | 'log.condition' => [ |
| 889 | - 'shared_secret' => '57b58edb6637fe3059b3595cf9c41b9', |
|
| 890 | - 'users' => ['sample-user'], |
|
| 891 | - 'apps' => ['files'], |
|
| 889 | + 'shared_secret' => '57b58edb6637fe3059b3595cf9c41b9', |
|
| 890 | + 'users' => ['sample-user'], |
|
| 891 | + 'apps' => ['files'], |
|
| 892 | 892 | ], |
| 893 | 893 | |
| 894 | 894 | /** |
@@ -942,18 +942,18 @@ discard block |
||
| 942 | 942 | * - iOS client app id: ``1125420102`` |
| 943 | 943 | */ |
| 944 | 944 | 'customclient_desktop' => |
| 945 | - 'https://nextcloud.com/install/#install-clients', |
|
| 945 | + 'https://nextcloud.com/install/#install-clients', |
|
| 946 | 946 | 'customclient_android' => |
| 947 | - 'https://play.google.com/store/apps/details?id=com.nextcloud.client', |
|
| 947 | + 'https://play.google.com/store/apps/details?id=com.nextcloud.client', |
|
| 948 | 948 | 'customclient_ios' => |
| 949 | - 'https://itunes.apple.com/us/app/nextcloud/id1125420102?mt=8', |
|
| 949 | + 'https://itunes.apple.com/us/app/nextcloud/id1125420102?mt=8', |
|
| 950 | 950 | 'customclient_ios_appid' => |
| 951 | - '1125420102', |
|
| 951 | + '1125420102', |
|
| 952 | 952 | /** |
| 953 | - * Apps |
|
| 954 | - * |
|
| 955 | - * Options for the Apps folder, Apps store, and App code checker. |
|
| 956 | - */ |
|
| 953 | + * Apps |
|
| 954 | + * |
|
| 955 | + * Options for the Apps folder, Apps store, and App code checker. |
|
| 956 | + */ |
|
| 957 | 957 | |
| 958 | 958 | /** |
| 959 | 959 | * When enabled, admins may install apps from the Nextcloud app store. |
@@ -979,11 +979,11 @@ discard block |
||
| 979 | 979 | * indicates if a Web server can write files to that folder. |
| 980 | 980 | */ |
| 981 | 981 | 'apps_paths' => [ |
| 982 | - [ |
|
| 983 | - 'path'=> '/var/www/nextcloud/apps', |
|
| 984 | - 'url' => '/apps', |
|
| 985 | - 'writable' => true, |
|
| 986 | - ], |
|
| 982 | + [ |
|
| 983 | + 'path'=> '/var/www/nextcloud/apps', |
|
| 984 | + 'url' => '/apps', |
|
| 985 | + 'writable' => true, |
|
| 986 | + ], |
|
| 987 | 987 | ], |
| 988 | 988 | |
| 989 | 989 | /** |
@@ -1048,8 +1048,8 @@ discard block |
||
| 1048 | 1048 | * Defaults to ``''`` (empty string) |
| 1049 | 1049 | */ |
| 1050 | 1050 | 'preview_office_cl_parameters' => |
| 1051 | - ' --headless --nologo --nofirststartwizard --invisible --norestore '. |
|
| 1052 | - '--convert-to png --outdir ', |
|
| 1051 | + ' --headless --nologo --nofirststartwizard --invisible --norestore '. |
|
| 1052 | + '--convert-to png --outdir ', |
|
| 1053 | 1053 | |
| 1054 | 1054 | /** |
| 1055 | 1055 | * Only register providers that have been explicitly enabled |
@@ -1086,16 +1086,16 @@ discard block |
||
| 1086 | 1086 | * - OC\Preview\Krita |
| 1087 | 1087 | */ |
| 1088 | 1088 | 'enabledPreviewProviders' => [ |
| 1089 | - 'OC\Preview\PNG', |
|
| 1090 | - 'OC\Preview\JPEG', |
|
| 1091 | - 'OC\Preview\GIF', |
|
| 1092 | - 'OC\Preview\BMP', |
|
| 1093 | - 'OC\Preview\XBitmap', |
|
| 1094 | - 'OC\Preview\MP3', |
|
| 1095 | - 'OC\Preview\TXT', |
|
| 1096 | - 'OC\Preview\MarkDown', |
|
| 1097 | - 'OC\Preview\OpenDocument', |
|
| 1098 | - 'OC\Preview\Krita', |
|
| 1089 | + 'OC\Preview\PNG', |
|
| 1090 | + 'OC\Preview\JPEG', |
|
| 1091 | + 'OC\Preview\GIF', |
|
| 1092 | + 'OC\Preview\BMP', |
|
| 1093 | + 'OC\Preview\XBitmap', |
|
| 1094 | + 'OC\Preview\MP3', |
|
| 1095 | + 'OC\Preview\TXT', |
|
| 1096 | + 'OC\Preview\MarkDown', |
|
| 1097 | + 'OC\Preview\OpenDocument', |
|
| 1098 | + 'OC\Preview\Krita', |
|
| 1099 | 1099 | ], |
| 1100 | 1100 | |
| 1101 | 1101 | /** |
@@ -1171,11 +1171,11 @@ discard block |
||
| 1171 | 1171 | |
| 1172 | 1172 | /** |
| 1173 | 1173 | * Extra SSL options to be used for configuration. |
| 1174 | - * |
|
| 1174 | + * |
|
| 1175 | 1175 | * Defaults to an empty array. |
| 1176 | 1176 | */ |
| 1177 | 1177 | 'openssl' => [ |
| 1178 | - 'config' => '/absolute/location/of/openssl.cnf', |
|
| 1178 | + 'config' => '/absolute/location/of/openssl.cnf', |
|
| 1179 | 1179 | ], |
| 1180 | 1180 | |
| 1181 | 1181 | /** |
@@ -1226,20 +1226,20 @@ discard block |
||
| 1226 | 1226 | * See https://redis.io/topics/encryption for more information. |
| 1227 | 1227 | */ |
| 1228 | 1228 | 'redis' => [ |
| 1229 | - 'host' => 'localhost', // can also be a unix domain socket: '/tmp/redis.sock' |
|
| 1230 | - 'port' => 6379, |
|
| 1231 | - 'timeout' => 0.0, |
|
| 1232 | - 'read_timeout' => 0.0, |
|
| 1233 | - 'user' => '', // Optional, if not defined no password will be used. |
|
| 1234 | - 'password' => '', // Optional, if not defined no password will be used. |
|
| 1235 | - 'dbindex' => 0, // Optional, if undefined SELECT will not run and will use Redis Server's default DB Index. |
|
| 1236 | - // If redis in-transit encryption is enabled, provide certificates |
|
| 1237 | - // SSL context https://www.php.net/manual/en/context.ssl.php |
|
| 1238 | - 'ssl_context' => [ |
|
| 1239 | - 'local_cert' => '/certs/redis.crt', |
|
| 1240 | - 'local_pk' => '/certs/redis.key', |
|
| 1241 | - 'cafile' => '/certs/ca.crt' |
|
| 1242 | - ] |
|
| 1229 | + 'host' => 'localhost', // can also be a unix domain socket: '/tmp/redis.sock' |
|
| 1230 | + 'port' => 6379, |
|
| 1231 | + 'timeout' => 0.0, |
|
| 1232 | + 'read_timeout' => 0.0, |
|
| 1233 | + 'user' => '', // Optional, if not defined no password will be used. |
|
| 1234 | + 'password' => '', // Optional, if not defined no password will be used. |
|
| 1235 | + 'dbindex' => 0, // Optional, if undefined SELECT will not run and will use Redis Server's default DB Index. |
|
| 1236 | + // If redis in-transit encryption is enabled, provide certificates |
|
| 1237 | + // SSL context https://www.php.net/manual/en/context.ssl.php |
|
| 1238 | + 'ssl_context' => [ |
|
| 1239 | + 'local_cert' => '/certs/redis.crt', |
|
| 1240 | + 'local_pk' => '/certs/redis.key', |
|
| 1241 | + 'cafile' => '/certs/ca.crt' |
|
| 1242 | + ] |
|
| 1243 | 1243 | ], |
| 1244 | 1244 | |
| 1245 | 1245 | /** |
@@ -1268,22 +1268,22 @@ discard block |
||
| 1268 | 1268 | * https://github.com/phpredis/phpredis/commit/c5994f2a42b8a348af92d3acb4edff1328ad8ce1 |
| 1269 | 1269 | */ |
| 1270 | 1270 | 'redis.cluster' => [ |
| 1271 | - 'seeds' => [ // provide some/all of the cluster servers to bootstrap discovery, port required |
|
| 1272 | - 'localhost:7000', |
|
| 1273 | - 'localhost:7001', |
|
| 1274 | - ], |
|
| 1275 | - 'timeout' => 0.0, |
|
| 1276 | - 'read_timeout' => 0.0, |
|
| 1277 | - 'failover_mode' => \RedisCluster::FAILOVER_ERROR, |
|
| 1278 | - 'user' => '', // Optional, if not defined no password will be used. |
|
| 1279 | - 'password' => '', // Optional, if not defined no password will be used. |
|
| 1280 | - // If redis in-transit encryption is enabled, provide certificates |
|
| 1281 | - // SSL context https://www.php.net/manual/en/context.ssl.php |
|
| 1282 | - 'ssl_context' => [ |
|
| 1283 | - 'local_cert' => '/certs/redis.crt', |
|
| 1284 | - 'local_pk' => '/certs/redis.key', |
|
| 1285 | - 'cafile' => '/certs/ca.crt' |
|
| 1286 | - ] |
|
| 1271 | + 'seeds' => [ // provide some/all of the cluster servers to bootstrap discovery, port required |
|
| 1272 | + 'localhost:7000', |
|
| 1273 | + 'localhost:7001', |
|
| 1274 | + ], |
|
| 1275 | + 'timeout' => 0.0, |
|
| 1276 | + 'read_timeout' => 0.0, |
|
| 1277 | + 'failover_mode' => \RedisCluster::FAILOVER_ERROR, |
|
| 1278 | + 'user' => '', // Optional, if not defined no password will be used. |
|
| 1279 | + 'password' => '', // Optional, if not defined no password will be used. |
|
| 1280 | + // If redis in-transit encryption is enabled, provide certificates |
|
| 1281 | + // SSL context https://www.php.net/manual/en/context.ssl.php |
|
| 1282 | + 'ssl_context' => [ |
|
| 1283 | + 'local_cert' => '/certs/redis.crt', |
|
| 1284 | + 'local_pk' => '/certs/redis.key', |
|
| 1285 | + 'cafile' => '/certs/ca.crt' |
|
| 1286 | + ] |
|
| 1287 | 1287 | ], |
| 1288 | 1288 | |
| 1289 | 1289 | |
@@ -1291,35 +1291,35 @@ discard block |
||
| 1291 | 1291 | * Server details for one or more memcached servers to use for memory caching. |
| 1292 | 1292 | */ |
| 1293 | 1293 | 'memcached_servers' => [ |
| 1294 | - // hostname, port and optional weight. Also see: |
|
| 1295 | - // https://www.php.net/manual/en/memcached.addservers.php |
|
| 1296 | - // https://www.php.net/manual/en/memcached.addserver.php |
|
| 1297 | - ['localhost', 11211], |
|
| 1298 | - //array('other.host.local', 11211), |
|
| 1294 | + // hostname, port and optional weight. Also see: |
|
| 1295 | + // https://www.php.net/manual/en/memcached.addservers.php |
|
| 1296 | + // https://www.php.net/manual/en/memcached.addserver.php |
|
| 1297 | + ['localhost', 11211], |
|
| 1298 | + //array('other.host.local', 11211), |
|
| 1299 | 1299 | ], |
| 1300 | 1300 | |
| 1301 | 1301 | /** |
| 1302 | 1302 | * Connection options for memcached |
| 1303 | 1303 | */ |
| 1304 | 1304 | 'memcached_options' => [ |
| 1305 | - // Set timeouts to 50ms |
|
| 1306 | - \Memcached::OPT_CONNECT_TIMEOUT => 50, |
|
| 1307 | - \Memcached::OPT_RETRY_TIMEOUT => 50, |
|
| 1308 | - \Memcached::OPT_SEND_TIMEOUT => 50, |
|
| 1309 | - \Memcached::OPT_RECV_TIMEOUT => 50, |
|
| 1310 | - \Memcached::OPT_POLL_TIMEOUT => 50, |
|
| 1305 | + // Set timeouts to 50ms |
|
| 1306 | + \Memcached::OPT_CONNECT_TIMEOUT => 50, |
|
| 1307 | + \Memcached::OPT_RETRY_TIMEOUT => 50, |
|
| 1308 | + \Memcached::OPT_SEND_TIMEOUT => 50, |
|
| 1309 | + \Memcached::OPT_RECV_TIMEOUT => 50, |
|
| 1310 | + \Memcached::OPT_POLL_TIMEOUT => 50, |
|
| 1311 | 1311 | |
| 1312 | - // Enable compression |
|
| 1313 | - \Memcached::OPT_COMPRESSION => true, |
|
| 1312 | + // Enable compression |
|
| 1313 | + \Memcached::OPT_COMPRESSION => true, |
|
| 1314 | 1314 | |
| 1315 | - // Turn on consistent hashing |
|
| 1316 | - \Memcached::OPT_LIBKETAMA_COMPATIBLE => true, |
|
| 1315 | + // Turn on consistent hashing |
|
| 1316 | + \Memcached::OPT_LIBKETAMA_COMPATIBLE => true, |
|
| 1317 | 1317 | |
| 1318 | - // Enable Binary Protocol |
|
| 1319 | - \Memcached::OPT_BINARY_PROTOCOL => true, |
|
| 1318 | + // Enable Binary Protocol |
|
| 1319 | + \Memcached::OPT_BINARY_PROTOCOL => true, |
|
| 1320 | 1320 | |
| 1321 | - // Binary serializer vill be enabled if the igbinary PECL module is available |
|
| 1322 | - //\Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_IGBINARY, |
|
| 1321 | + // Binary serializer vill be enabled if the igbinary PECL module is available |
|
| 1322 | + //\Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_IGBINARY, |
|
| 1323 | 1323 | ], |
| 1324 | 1324 | |
| 1325 | 1325 | |
@@ -1365,61 +1365,61 @@ discard block |
||
| 1365 | 1365 | * One way to test is applying for a trystack account at http://trystack.org/ |
| 1366 | 1366 | */ |
| 1367 | 1367 | 'objectstore' => [ |
| 1368 | - 'class' => 'OC\\Files\\ObjectStore\\Swift', |
|
| 1369 | - 'arguments' => [ |
|
| 1370 | - // trystack will use your facebook id as the user name |
|
| 1371 | - 'username' => 'facebook100000123456789', |
|
| 1372 | - // in the trystack dashboard go to user -> settings -> API Password to |
|
| 1373 | - // generate a password |
|
| 1374 | - 'password' => 'Secr3tPaSSWoRdt7', |
|
| 1375 | - // must already exist in the objectstore, name can be different |
|
| 1376 | - 'container' => 'nextcloud', |
|
| 1377 | - // prefix to prepend to the fileid, default is 'oid:urn:' |
|
| 1378 | - 'objectPrefix' => 'oid:urn:', |
|
| 1379 | - // create the container if it does not exist. default is false |
|
| 1380 | - 'autocreate' => true, |
|
| 1381 | - // required, dev-/trystack defaults to 'RegionOne' |
|
| 1382 | - 'region' => 'RegionOne', |
|
| 1383 | - // The Identity / Keystone endpoint |
|
| 1384 | - 'url' => 'http://8.21.28.222:5000/v2.0', |
|
| 1385 | - // required on dev-/trystack |
|
| 1386 | - 'tenantName' => 'facebook100000123456789', |
|
| 1387 | - // dev-/trystack uses swift by default, the lib defaults to 'cloudFiles' |
|
| 1388 | - // if omitted |
|
| 1389 | - 'serviceName' => 'swift', |
|
| 1390 | - // The Interface / url Type, optional |
|
| 1391 | - 'urlType' => 'internal' |
|
| 1392 | - ], |
|
| 1368 | + 'class' => 'OC\\Files\\ObjectStore\\Swift', |
|
| 1369 | + 'arguments' => [ |
|
| 1370 | + // trystack will use your facebook id as the user name |
|
| 1371 | + 'username' => 'facebook100000123456789', |
|
| 1372 | + // in the trystack dashboard go to user -> settings -> API Password to |
|
| 1373 | + // generate a password |
|
| 1374 | + 'password' => 'Secr3tPaSSWoRdt7', |
|
| 1375 | + // must already exist in the objectstore, name can be different |
|
| 1376 | + 'container' => 'nextcloud', |
|
| 1377 | + // prefix to prepend to the fileid, default is 'oid:urn:' |
|
| 1378 | + 'objectPrefix' => 'oid:urn:', |
|
| 1379 | + // create the container if it does not exist. default is false |
|
| 1380 | + 'autocreate' => true, |
|
| 1381 | + // required, dev-/trystack defaults to 'RegionOne' |
|
| 1382 | + 'region' => 'RegionOne', |
|
| 1383 | + // The Identity / Keystone endpoint |
|
| 1384 | + 'url' => 'http://8.21.28.222:5000/v2.0', |
|
| 1385 | + // required on dev-/trystack |
|
| 1386 | + 'tenantName' => 'facebook100000123456789', |
|
| 1387 | + // dev-/trystack uses swift by default, the lib defaults to 'cloudFiles' |
|
| 1388 | + // if omitted |
|
| 1389 | + 'serviceName' => 'swift', |
|
| 1390 | + // The Interface / url Type, optional |
|
| 1391 | + 'urlType' => 'internal' |
|
| 1392 | + ], |
|
| 1393 | 1393 | ], |
| 1394 | 1394 | |
| 1395 | 1395 | /** |
| 1396 | 1396 | * To use swift V3 |
| 1397 | 1397 | */ |
| 1398 | 1398 | 'objectstore' => [ |
| 1399 | - 'class' => 'OC\\Files\\ObjectStore\\Swift', |
|
| 1400 | - 'arguments' => [ |
|
| 1401 | - 'autocreate' => true, |
|
| 1402 | - 'user' => [ |
|
| 1403 | - 'name' => 'swift', |
|
| 1404 | - 'password' => 'swift', |
|
| 1405 | - 'domain' => [ |
|
| 1406 | - 'name' => 'default', |
|
| 1407 | - ], |
|
| 1408 | - ], |
|
| 1409 | - 'scope' => [ |
|
| 1410 | - 'project' => [ |
|
| 1411 | - 'name' => 'service', |
|
| 1412 | - 'domain' => [ |
|
| 1413 | - 'name' => 'default', |
|
| 1414 | - ], |
|
| 1415 | - ], |
|
| 1416 | - ], |
|
| 1417 | - 'tenantName' => 'service', |
|
| 1418 | - 'serviceName' => 'swift', |
|
| 1419 | - 'region' => 'regionOne', |
|
| 1420 | - 'url' => 'http://yourswifthost:5000/v3', |
|
| 1421 | - 'bucket' => 'nextcloud', |
|
| 1422 | - ], |
|
| 1399 | + 'class' => 'OC\\Files\\ObjectStore\\Swift', |
|
| 1400 | + 'arguments' => [ |
|
| 1401 | + 'autocreate' => true, |
|
| 1402 | + 'user' => [ |
|
| 1403 | + 'name' => 'swift', |
|
| 1404 | + 'password' => 'swift', |
|
| 1405 | + 'domain' => [ |
|
| 1406 | + 'name' => 'default', |
|
| 1407 | + ], |
|
| 1408 | + ], |
|
| 1409 | + 'scope' => [ |
|
| 1410 | + 'project' => [ |
|
| 1411 | + 'name' => 'service', |
|
| 1412 | + 'domain' => [ |
|
| 1413 | + 'name' => 'default', |
|
| 1414 | + ], |
|
| 1415 | + ], |
|
| 1416 | + ], |
|
| 1417 | + 'tenantName' => 'service', |
|
| 1418 | + 'serviceName' => 'swift', |
|
| 1419 | + 'region' => 'regionOne', |
|
| 1420 | + 'url' => 'http://yourswifthost:5000/v3', |
|
| 1421 | + 'bucket' => 'nextcloud', |
|
| 1422 | + ], |
|
| 1423 | 1423 | ], |
| 1424 | 1424 | |
| 1425 | 1425 | /** |
@@ -1500,8 +1500,8 @@ discard block |
||
| 1500 | 1500 | * encryption in MySQL or specify a custom wait timeout on a cheap hoster. |
| 1501 | 1501 | */ |
| 1502 | 1502 | 'dbdriveroptions' => [ |
| 1503 | - PDO::MYSQL_ATTR_SSL_CA => '/file/path/to/ca_cert.pem', |
|
| 1504 | - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET wait_timeout = 28800' |
|
| 1503 | + PDO::MYSQL_ATTR_SSL_CA => '/file/path/to/ca_cert.pem', |
|
| 1504 | + PDO::MYSQL_ATTR_INIT_COMMAND => 'SET wait_timeout = 28800' |
|
| 1505 | 1505 | ], |
| 1506 | 1506 | |
| 1507 | 1507 | /** |
@@ -1558,10 +1558,10 @@ discard block |
||
| 1558 | 1558 | * - pgsql (PostgreSQL) |
| 1559 | 1559 | */ |
| 1560 | 1560 | 'supportedDatabases' => [ |
| 1561 | - 'sqlite', |
|
| 1562 | - 'mysql', |
|
| 1563 | - 'pgsql', |
|
| 1564 | - 'oci', |
|
| 1561 | + 'sqlite', |
|
| 1562 | + 'mysql', |
|
| 1563 | + 'pgsql', |
|
| 1564 | + 'oci', |
|
| 1565 | 1565 | ], |
| 1566 | 1566 | |
| 1567 | 1567 | /** |
@@ -1902,8 +1902,8 @@ discard block |
||
| 1902 | 1902 | * WARNING: only use this if you know what you are doing |
| 1903 | 1903 | */ |
| 1904 | 1904 | 'csrf.optout' => [ |
| 1905 | - '/^WebDAVFS/', // OS X Finder |
|
| 1906 | - '/^Microsoft-WebDAV-MiniRedir/', // Windows webdav drive |
|
| 1905 | + '/^WebDAVFS/', // OS X Finder |
|
| 1906 | + '/^Microsoft-WebDAV-MiniRedir/', // Windows webdav drive |
|
| 1907 | 1907 | ], |
| 1908 | 1908 | |
| 1909 | 1909 | /** |