aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-10-24 22:04:41 +0200
committerJoas Schilling <coding@schilljs.com>2024-10-24 22:04:41 +0200
commit6854af0cc4eb210832eaf36b8bbd3df151832a85 (patch)
tree007b865c3b4c46f9a650840d81539af5844c1101 /lib
parentbc6a3e81596a1e0c9f7b3a1710376a04626de776 (diff)
downloadnextcloud-server-6854af0cc4eb210832eaf36b8bbd3df151832a85.tar.gz
nextcloud-server-6854af0cc4eb210832eaf36b8bbd3df151832a85.zip
feat(bruteforce): Allow forcing the database throttlerbugfix/noid/allow-to-force-db-throttler
Using the database is most likely worse for performance, but makes investigating issues a lot easier as it's possible to look directly at the table to see all logged remote addresses and actions. Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Server.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 2faae765960..0016e2bbb7a 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -846,7 +846,8 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerService(\OC\Security\Bruteforce\Backend\IBackend::class, function ($c) {
$config = $c->get(\OCP\IConfig::class);
- if (ltrim($config->getSystemValueString('memcache.distributed', ''), '\\') === \OC\Memcache\Redis::class) {
+ if (!$config->getSystemValueBool('auth.bruteforce.protection.force.database', false)
+ && ltrim($config->getSystemValueString('memcache.distributed', ''), '\\') === \OC\Memcache\Redis::class) {
$backend = $c->get(\OC\Security\Bruteforce\Backend\MemoryCacheBackend::class);
} else {
$backend = $c->get(\OC\Security\Bruteforce\Backend\DatabaseBackend::class);