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
- func ReverseProxy(opts ReverseProxyOptions) (corecomponent.ComposeServiceComponent, error)
- func UploadLimits(opts UploadLimitsOptions) (corecomponent.ComposeServiceComponent, error)
- type BotMitigationOptions
- type CaptchaProtectMiddlewareOptions
- type NginxRealIPConfig
- type ReverseProxyInspection
- type ReverseProxyOptions
- type UploadLimitsOptions
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" )
const ( UploadLimitsName = "upload-limits" DefaultMaxUploadSize = "128M" DefaultUploadTimeout = "300s" )
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 ReverseProxy(opts ReverseProxyOptions) (corecomponent.ComposeServiceComponent, error)
func UploadLimits ¶ added in v0.22.0
func UploadLimits(opts UploadLimitsOptions) (corecomponent.ComposeServiceComponent, error)
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 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)