You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO P1 big bug: fatal error when changing techno without dsn already set at previous state. Quick fix: Add error if no dsn and ask to set dsn then save then select techno.
62
-
63
61
$bouncer = getBouncerInstance();
64
62
$bouncer->clearCache();
65
63
$message = __('Cache system changed. Previous cache data has been cleared.');
@@ -86,13 +84,11 @@ function adminAdvancedSettings()
86
84
87
85
// Field "crowdsec_redis_dsn"
88
86
addFieldString('crowdsec_redis_dsn', 'Redis DSN<br>(if applicable)', 'crowdsec_plugin_advanced_settings', 'crowdsec_advanced_settings', 'crowdsec_admin_advanced_cache', function ($input) {
89
-
// TODO P2 check if it's a valid DSN
90
87
return$input;
91
88
}, '<p>Fill in this field only if you have chosen the Redis cache.<br>Example of DSN: redis://localhost:6379.', 'redis://...', '');
92
89
93
90
// Field "crowdsec_memcached_dsn"
94
91
addFieldString('crowdsec_memcached_dsn', 'Memcached DSN<br>(if applicable)', 'crowdsec_plugin_advanced_settings', 'crowdsec_advanced_settings', 'crowdsec_admin_advanced_cache', function ($input) {
95
-
// TODO P2 check if it's a valid DSN
96
92
return$input;
97
93
}, '<p>Fill in this field only if you have chosen the Memcached cache.<br>Example of DSN: memcached://localhost:11211.', 'memcached://...', '');
98
94
@@ -127,11 +123,21 @@ function adminAdvancedSettings()
Copy file name to clipboardExpand all lines: inc/admin/settings.php
+3-5Lines changed: 3 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -15,14 +15,12 @@ function adminSettings()
15
15
16
16
// Field "crowdsec_api_url"
17
17
addFieldString('crowdsec_api_url', 'LAPI URL', 'crowdsec_plugin_settings', 'crowdsec_settings', 'crowdsec_admin_connection', function ($input) {
18
-
// P2 TODO ping API to see if it's available if not: add_settings_error("LAPI URL", "crowdsec_error", "LAPI URL " . $input . " is not reachable.");
19
18
return$input;
20
19
}, '<p>If the CrowdSec Agent is installed on this server, you will set this field to http://localhost:8080.</p>', 'Your LAPI URL', '');
21
20
22
21
23
22
// Field "crowdsec_api_key"
24
23
addFieldString('crowdsec_api_key', 'Bouncer API key', 'crowdsec_plugin_settings', 'crowdsec_settings', 'crowdsec_admin_connection', function ($input) {
25
-
// TODO check api key format / ping api if not: add_settings_error("LAPI URL", "crowdsec_error", "LAPI URL " . $input . " is not reachable.");
26
24
return$input;
27
25
}, '<p>Generated with the cscli command, ex: <em>cscli bouncers add wordpress-bouncer</em></p>', 'Your bouncer key', 'width: 280px;', 'text');
0 commit comments