Documentation ¶
Index ¶
- type AbuseIPDBReport
- type ListenCaddy
- func (ListenCaddy) CaddyModule() caddy.ModuleInfo
- func (l *ListenCaddy) Provision(ctx caddy.Context) error
- func (l ListenCaddy) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
- func (l *ListenCaddy) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (l *ListenCaddy) Validate() error
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbuseIPDBReport ¶
type ListenCaddy ¶
type ListenCaddy struct { // APIKey is the API key from AbuseIPDB. APIKey string `json:"apikey,omitempty"` // BannedURIs is a regex of banned URIs/paths. BannedURIs string `json:"banned_uris,omitempty"` // WhitelistedIPs is a regex of whitelisted IPs. (optional) WhitelistedIPs string `json:"whitelisted_ips,omitempty"` // AbuseIPDBMessage is the message that will be sent to AbuseIPDB. Uses Go templates (do {{.Path}} to get path accessed) (optional) AbuseIPDBMessage string `json:"abuseipdb_message,omitempty"` // ResponseMessage is the message that will be sent to the client accessing a resource they're not supposed to. Uses Go templates (do {{.Path}} to get path accessed) (optional) ResponseMessage string `json:"respond_message,omitempty"` Logger *zap.Logger }
ListenCaddy is a Caddy http.handlers module that listens for requests to specific URIs/paths and reports IPs that hit these URIs to AbuseIPDB.
func (ListenCaddy) CaddyModule ¶
func (ListenCaddy) CaddyModule() caddy.ModuleInfo
func (*ListenCaddy) Provision ¶
func (l *ListenCaddy) Provision(ctx caddy.Context) error
func (ListenCaddy) ServeHTTP ¶
func (l ListenCaddy) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
func (*ListenCaddy) UnmarshalCaddyfile ¶
func (l *ListenCaddy) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler.
func (*ListenCaddy) Validate ¶
func (l *ListenCaddy) Validate() error
Click to show internal directories.
Click to hide internal directories.