Add support for redis authentication (#420)
* Add support for redis authentication (Update redpool dependency) - Add configuration option `redisPassword` * Reference `redisPassword` in nitter.conf
This commit is contained in:
@@ -33,6 +33,7 @@ proc getConfig*(path: string): (Config, parseCfg.Config) =
|
||||
redisPort: cfg.get("Cache", "redisPort", 6379),
|
||||
redisConns: cfg.get("Cache", "redisConnections", 20),
|
||||
redisMaxConns: cfg.get("Cache", "redisMaxConnections", 30),
|
||||
redisPassword: cfg.get("Cache", "redisPassword", ""),
|
||||
|
||||
replaceYouTube: cfg.get("Preferences", "replaceYouTube", "piped.kavin.rocks")
|
||||
)
|
||||
|
||||
@@ -30,7 +30,7 @@ proc migrate*(key, match: string) {.async.} =
|
||||
proc initRedisPool*(cfg: Config) {.async.} =
|
||||
try:
|
||||
pool = await newRedisPool(cfg.redisConns, maxConns=cfg.redisMaxConns,
|
||||
host=cfg.redisHost, port=cfg.redisPort)
|
||||
host=cfg.redisHost, port=cfg.redisPort, password=cfg.redisPassword)
|
||||
|
||||
await migrate("snappyRss", "rss:*")
|
||||
await migrate("oldFrosty", "*")
|
||||
|
||||
@@ -220,6 +220,7 @@ type
|
||||
redisPort*: int
|
||||
redisConns*: int
|
||||
redisMaxConns*: int
|
||||
redisPassword*: string
|
||||
|
||||
replaceYouTube*: string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user