traefik

package
v0.21.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL