traefik

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 17 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"
)
View Source
const (
	UploadLimitsName = "upload-limits"

	DefaultMaxUploadSize = "128M"
	DefaultUploadTimeout = "300s"
)
View Source
const (
	ReverseProxyName = "reverse-proxy"
)

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.

func ReverseProxy added in v0.22.0

func UploadLimits added in v0.22.0

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.

type NginxRealIPConfig added in v0.22.0

type NginxRealIPConfig struct {
	Service   string
	TrustedIP []string
	Recursive string
}

type ReverseProxyInspection added in v0.22.0

type ReverseProxyInspection struct {
	ComposeFile   string
	Traefik       map[string][]string
	NginxServices map[string]NginxRealIPConfig
}

func InspectReverseProxy added in v0.22.0

func InspectReverseProxy(ctx *config.Context) (ReverseProxyInspection, error)

type ReverseProxyOptions added in v0.22.0

type ReverseProxyOptions struct {
	AppService     string
	NoAppService   bool
	TraefikService string
	Entrypoints    []string
	TrustedIPLimit int
}

type UploadLimitsOptions added in v0.22.0

type UploadLimitsOptions struct {
	AppService     string
	TraefikService string
	Entrypoints    []string
}

Jump to

Keyboard shortcuts

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