mirror of
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin.git
synced 2026-07-21 03:28:59 +02:00
✨️ Do not block middleware startup due to stream intialization (#281)
* 🍱 not block on stream startup * 🍱 fix * 🍱 fix lint * 🍱 fix lint * 🍱 fix lint * 🍱 update readme * 📚 clarify StreamStartupBlock warning in README Make the fail-open implication of StreamStartupBlock=false explicit: banned IPs are allowed through until the first stream sync completes. * 🐛 clear isCrowdsecStreamStartup on alreadyUpdated path When cacheTimeoutKey is already set (another instance/process has populated the stream cache within the update window), the early return in handleStreamCache used to leave isCrowdsecStreamStartup at true, causing this instance to keep sending startup=true on subsequent ticks. Flip the flag in the early-return path so startup is correctly tracked across multi-instance deployments sharing a cache. --------- Co-authored-by: mhx <mathieu@hanotaux.fr>
This commit is contained in:
@@ -84,6 +84,7 @@ type Config struct {
|
||||
UpdateIntervalSeconds int64 `json:"updateIntervalSeconds,omitempty"`
|
||||
MetricsUpdateIntervalSeconds int64 `json:"metricsUpdateIntervalSeconds,omitempty"`
|
||||
UpdateMaxFailure int64 `json:"updateMaxFailure,omitempty"`
|
||||
StreamStartupBlock bool `json:"streamStartupBlock,omitempty"`
|
||||
DefaultDecisionSeconds int64 `json:"defaultDecisionSeconds,omitempty"`
|
||||
RemediationStatusCode int `json:"remediationStatusCode,omitempty"`
|
||||
HTTPTimeoutSeconds int64 `json:"httpTimeoutSeconds,omitempty"`
|
||||
@@ -146,6 +147,7 @@ func New() *Config {
|
||||
UpdateIntervalSeconds: 60,
|
||||
MetricsUpdateIntervalSeconds: 600,
|
||||
UpdateMaxFailure: 0,
|
||||
StreamStartupBlock: true,
|
||||
DefaultDecisionSeconds: 60,
|
||||
RemediationStatusCode: http.StatusForbidden,
|
||||
HTTPTimeoutSeconds: 10,
|
||||
|
||||
Reference in New Issue
Block a user