Expand configuration (#368)
* Allow configuring httpMaxConns default: 100 * Allow setting NITTER_CONF_FILE path env var Co-authored-by: 3nprob <3nprob@3nprob>
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import asyncdispatch, strformat
|
||||
from net import Port
|
||||
from htmlgen import a
|
||||
from os import getEnv
|
||||
|
||||
import jester
|
||||
|
||||
@ -12,7 +13,7 @@ import routes/[
|
||||
|
||||
const instancesUrl = "https://github.com/zedeus/nitter/wiki/Instances"
|
||||
|
||||
const configPath {.strdefine.} = "./nitter.conf"
|
||||
let configPath = getEnv("NITTER_CONF_FILE", "./nitter.conf")
|
||||
let (cfg, fullCfg) = getConfig(configPath)
|
||||
|
||||
when defined(release):
|
||||
@ -28,7 +29,7 @@ updateDefaultPrefs(fullCfg)
|
||||
setCacheTimes(cfg)
|
||||
setHmacKey(cfg.hmacKey)
|
||||
setProxyEncoding(cfg.base64Media)
|
||||
setMaxHttpConns(100)
|
||||
setMaxHttpConns(cfg.httpMaxConns)
|
||||
|
||||
waitFor initRedisPool(cfg)
|
||||
stdout.write &"Connected to Redis at {cfg.redisHost}:{cfg.redisPort}\n"
|
||||
|
Reference in New Issue
Block a user