mirror of
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin.git
synced 2026-07-21 11:38:59 +02:00
✨ handle redis password (#87)
* ✨ handle redis password * 🍱 fix version
This commit is contained in:
Vendored
+2
-2
@@ -82,9 +82,9 @@ type Client struct {
|
||||
}
|
||||
|
||||
// New Initialize cache client.
|
||||
func (client *Client) New(isRedis bool, host string) {
|
||||
func (client *Client) New(isRedis bool, host string, pass string) {
|
||||
if isRedis {
|
||||
redis.Init(host)
|
||||
redis.Init(host, pass)
|
||||
client.cache = &redisCache{}
|
||||
} else {
|
||||
client.cache = &localCache{}
|
||||
|
||||
@@ -55,6 +55,7 @@ type Config struct {
|
||||
ClientTrustedIPs []string `json:"clientTrustedIps,omitempty"`
|
||||
RedisCacheEnabled bool `json:"redisCacheEnabled,omitempty"`
|
||||
RedisCacheHost string `json:"redisCacheHost,omitempty"`
|
||||
RedisCachePass string `json:"redisCachePass,omitempty"`
|
||||
}
|
||||
|
||||
func contains(source []string, target string) bool {
|
||||
@@ -83,6 +84,7 @@ func New() *Config {
|
||||
ClientTrustedIPs: []string{},
|
||||
RedisCacheEnabled: false,
|
||||
RedisCacheHost: "redis:6379",
|
||||
RedisCachePass: "",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user