Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Redis password in config.py #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
1 change: 1 addition & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def competition_has_started():

_redis = {
'host': 'localhost',
'password' : None, # change this to 'stringOfYourRedisPassword'
'port': 6379,
'db': 0
}
Expand Down
2 changes: 1 addition & 1 deletion ctftool
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
2 changes: 1 addition & 1 deletion daemons/cache_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down