From 848580604673f93fc54c9ea76b1aedd305b113af Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 28 Jan 2021 17:55:37 +0200 Subject: [PATCH] Easy config: add support for setting redis URI. --- etebase-server.ini.example | 1 + etebase_server/settings.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/etebase-server.ini.example b/etebase-server.ini.example index 2b4682a..13903b2 100644 --- a/etebase-server.ini.example +++ b/etebase-server.ini.example @@ -8,6 +8,7 @@ debug = false ;media_url = /user-media/ ;language_code = en-us ;time_zone = UTC +;redis_uri = redis://localhost:6379 [allowed_hosts] allowed_host1 = example.com diff --git a/etebase_server/settings.py b/etebase_server/settings.py index 5d57ec0..80a6ee9 100644 --- a/etebase_server/settings.py +++ b/etebase_server/settings.py @@ -154,6 +154,9 @@ if any(os.path.isfile(x) for x in config_locations): TIME_ZONE = section.get("time_zone", TIME_ZONE) DEBUG = section.getboolean("debug", DEBUG) + if "redis_uri" in section: + ETEBASE_REDIS_URI = section.get("redis_uri") + if "allowed_hosts" in config: ALLOWED_HOSTS = [y for x, y in config.items("allowed_hosts")]