diff --git a/app.py b/app.py index 6d46414..e437268 100644 --- a/app.py +++ b/app.py @@ -88,7 +88,7 @@ def debug_app(): @app.before_request def before_request(): db.connect() - g.redis = redis.StrictRedis(host=config.redis.host, port=config.redis.port, db=config.redis.db) + g.redis = redis.StrictRedis(host=config.redis.host, port=config.redis.port, db=config.redis.db, password=config.redis.password) g.connected = True diff --git a/config.py b/config.py index 750c0ee..f03c563 100644 --- a/config.py +++ b/config.py @@ -76,6 +76,7 @@ def competition_has_started(): _redis = { 'host': 'localhost', + 'password' : None, # change this to 'stringOfYourRedisPassword' 'port': 6379, 'db': 0 } diff --git a/ctftool b/ctftool index a9f61d3..6131baa 100755 --- a/ctftool +++ b/ctftool @@ -168,7 +168,7 @@ def clear_challenges(args): def recache_solves(args): - r = redis.StrictRedis(host=config.redis.host, port=config.redis.port, db=config.redis.db) + r = redis.StrictRedis(host=config.redis.host, port=config.redis.port, db=config.redis.db, password=config.redis.password) for chal in Challenge.select(): r.hset("solves", chal.id, chal.solves.count()) print(r.hvals("solves")) diff --git a/daemons/cache_score.py b/daemons/cache_score.py index 7c6fed9..b614a1b 100644 --- a/daemons/cache_score.py +++ b/daemons/cache_score.py @@ -6,7 +6,7 @@ def run(): - r = redis.StrictRedis(host=config.redis.host, port=config.redis.port, db=config.redis.db) + r = redis.StrictRedis(host=config.redis.host, port=config.redis.port, db=config.redis.db, password=config.redis.password) db.connect() def set_complex(key, val):