mirror of
https://github.com/fabriziosalmi/caddy-waf.git
synced 2025-12-23 14:17:45 -05:00
Bump WAF version to v0.0.5 and ensure proper module registration
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user