Log mislukte logins als LOGIN_FAILED (fail2ban/rapportage), logger-threshold naar 5

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 10:21:08 +02:00
co-authored by Claude Sonnet 5.5
parent 506c88a5bd
commit 643f5fd9a7
7 changed files with 188 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
/**
* Minimal bootstrap for the unit tests: loads the composer autoloader and the
* CodeIgniter 4 core functions (log_message, config, ...) without booting the
* application (no database, session or routing). WRITEPATH points to a temp
* dir so tests never touch writable/logs.
*/
error_reporting(E_ALL);
define('ENVIRONMENT', 'testing');
define('CI_DEBUG', true);
$root = dirname(__DIR__);
$tmp = sys_get_temp_dir() . '/dbois-phpunit-' . getmypid() . '/';
mkdir($tmp . 'logs', 0777, true);
register_shutdown_function(static function () use ($tmp) {
array_map('unlink', glob($tmp . 'logs/*') ?: []);
@rmdir($tmp . 'logs');
@rmdir($tmp);
});
define('ROOTPATH', $root . '/');
define('APPPATH', $root . '/app/');
define('WRITEPATH', $tmp);
define('SYSTEMPATH', $root . '/vendor/codeigniter4/framework/system/');
define('FCPATH', $root . '/public/');
require $root . '/vendor/autoload.php';
require SYSTEMPATH . 'Common.php';