Bump WAF version to v0.0.5 and ensure proper module registration

This commit is contained in:
fabriziosalmi
2025-04-30 11:38:01 +02:00
parent e4c88a3956
commit 13712e01d9
2 changed files with 4 additions and 5 deletions

View File

@@ -4,7 +4,6 @@
}
:8080 {
log {
output stdout
format console
@@ -32,7 +31,7 @@
requests 100
window 10s
cleanup_interval 5m
paths /ratelimited # List of individual regex patterns (example: paths ^/api/.*)
paths /ratelimited # List of individual regex patterns (example: paths ^/api/.*)
match_all_paths false
}
@@ -56,7 +55,7 @@
# Match the waf metrics endpoint specifically and stop processing
@wafmetrics path /waf_metrics
handle @wafmetrics {
header Access-Control-Allow-Origin * # Allow requests from any origin (for development - see note below)
header Access-Control-Allow-Origin * # Allow requests from any origin (for development - see note below)
header Access-Control-Allow-Methods "GET, OPTIONS" # Allow GET and OPTIONS methods
header Access-Control-Allow-Headers "User-Agent, Content-Type, *" # Allow User-Agent and Content-Type headers
# Do not respond here so it goes to the WAF plugin

View File

@@ -30,12 +30,12 @@ var (
)
// Add or update the version constant as needed
const wafVersion = "v0.0.1" // update this value to the new release version when tagging
const wafVersion = "v0.0.5" // update this value to the new release version when tagging
// ==================== Initialization and Setup ====================
func init() {
caddy.RegisterModule(&Middleware{}) // Changed from Middleware{} to &Middleware{}
caddy.RegisterModule(&Middleware{}) // Uncommented this line to properly register the module
httpcaddyfile.RegisterHandlerDirective("waf", parseCaddyfile)
}