mirror of
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin.git
synced 2026-07-21 11:38:59 +02:00
🍱 fix readme to add redis pass
This commit is contained in:
@@ -103,6 +103,10 @@ make run
|
||||
- string
|
||||
- default: "redis:6379"
|
||||
- hostname and port for the Redis service
|
||||
- RedisCachePassword
|
||||
- string
|
||||
- default: ""
|
||||
- Password for the Redis service
|
||||
- UpdateIntervalSeconds
|
||||
- int64
|
||||
- default: 60
|
||||
@@ -183,6 +187,7 @@ http:
|
||||
forwardedHeadersCustomName: X-Custom-Header
|
||||
redisCacheEnabled: false
|
||||
redisCacheHost: "redis:6379"
|
||||
redisCachePassword: password
|
||||
crowdsecLapiTLSCertificateAuthority: |-
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEBzCCAu+gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZQxCzAJBgNVBAYTAlVT
|
||||
|
||||
+2
-1
@@ -141,7 +141,8 @@ func New(ctx context.Context, next http.Handler, config *configuration.Config, n
|
||||
},
|
||||
cacheClient: &cache.Client{},
|
||||
}
|
||||
bouncer.cacheClient.New(config.RedisCacheEnabled, config.RedisCacheHost, config.RedisCachePass)
|
||||
config.RedisCachePassword, _ = configuration.GetVariable(config, "RedisCachePassword")
|
||||
bouncer.cacheClient.New(config.RedisCacheEnabled, config.RedisCacheHost, config.RedisCachePassword)
|
||||
|
||||
//nolint:nestif
|
||||
if (config.CrowdsecMode == configuration.StreamMode || config.CrowdsecMode == configuration.AloneMode) && ticker == nil {
|
||||
|
||||
@@ -55,7 +55,8 @@ type Config struct {
|
||||
ClientTrustedIPs []string `json:"clientTrustedIps,omitempty"`
|
||||
RedisCacheEnabled bool `json:"redisCacheEnabled,omitempty"`
|
||||
RedisCacheHost string `json:"redisCacheHost,omitempty"`
|
||||
RedisCachePass string `json:"redisCachePass,omitempty"`
|
||||
RedisCachePassword string `json:"redisCachePassword,omitempty"`
|
||||
RedisCachePasswordFile string `json:"redisCachePasswordFile,omitempty"`
|
||||
}
|
||||
|
||||
func contains(source []string, target string) bool {
|
||||
@@ -84,7 +85,7 @@ func New() *Config {
|
||||
ClientTrustedIPs: []string{},
|
||||
RedisCacheEnabled: false,
|
||||
RedisCacheHost: "redis:6379",
|
||||
RedisCachePass: "",
|
||||
RedisCachePassword: "",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,6 +131,10 @@ func ValidateParams(config *Config) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := GetVariable(config, "RedisCachePassword"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if config.CrowdsecMode == AloneMode {
|
||||
if _, err := GetVariable(config, "CrowdsecCapiMachineID"); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user