Documentation
¶
Index ¶
- Constants
- func ApplyBotMitigation(projectDir, state string, opts BotMitigationOptions) error
- func ApplyBotMitigationContext(ctx context.Context, projectDir, state string, opts BotMitigationOptions) error
- func BotMitigation(opts BotMitigationOptions) corecomponent.Definition
- type BotMitigationOptions
- type CaptchaProtectMiddlewareOptions
Constants ¶
const ( // BotMitigationName is the component name for Traefik captcha-protect bot mitigation. BotMitigationName = "bot-mitigation" // BotMitigationStateOn enables captcha-protect bot mitigation. BotMitigationStateOn = "on" // BotMitigationStateOff disables captcha-protect bot mitigation. BotMitigationStateOff = "off" )
Variables ¶
This section is empty.
Functions ¶
func ApplyBotMitigation ¶
func ApplyBotMitigation(projectDir, state string, opts BotMitigationOptions) error
ApplyBotMitigation applies or removes Traefik captcha-protect configuration.
func ApplyBotMitigationContext ¶
func ApplyBotMitigationContext(ctx context.Context, projectDir, state string, opts BotMitigationOptions) error
ApplyBotMitigationContext applies or removes Traefik captcha-protect configuration, using ctx for network work performed while enabling.
func BotMitigation ¶
func BotMitigation(opts BotMitigationOptions) corecomponent.Definition
BotMitigation returns reusable Traefik captcha-protect component metadata.
ApplyBotMitigation is the sole mutating entrypoint. The returned definition is intentionally metadata-only so component review/create prompts cannot drift from the command, volume, router, and plugin-source mutations.
Types ¶
type BotMitigationOptions ¶
type BotMitigationOptions struct {
Name string
RouterName string
RouterConfigPath string
MiddlewareName string
Middleware CaptchaProtectMiddlewareOptions
}
BotMitigationOptions configures a reusable Traefik bot-mitigation component for an application router.
func NormalizeBotMitigationOptions ¶
func NormalizeBotMitigationOptions(opts BotMitigationOptions) BotMitigationOptions
NormalizeBotMitigationOptions applies defaults for reusable bot mitigation.
type CaptchaProtectMiddlewareOptions ¶
type CaptchaProtectMiddlewareOptions struct {
Window int
Mode string
ProtectRoutes string
ExcludeRoutes []string
ProtectParameters string
ChallengeTemplate string
ChallengeURL string
ChallengeStatusCode int
CaptchaProvider string
SiteKey string
SecretKey string
IPForwardedHeader string
GoodBots []string
PersistentStateFile string
ProtectFileExtensions string
PeriodSeconds int
FailureThreshold int
EnableGooglebotIPCheck string
EnableUptimeRobotBypass string
}
CaptchaProtectMiddlewareOptions configures the generated captcha-protect middleware block.