From 1d90dc3ea382ec9f45f7d06a38ef905141f53ba4 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 4 Nov 2022 18:54:59 +0100 Subject: [PATCH] Allow running without redis --- core/admin/mailu/configuration.py | 5 +++-- core/admin/run_dev.sh | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/admin/mailu/configuration.py b/core/admin/mailu/configuration.py index a4c8c537..e18eb0b2 100644 --- a/core/admin/mailu/configuration.py +++ b/core/admin/mailu/configuration.py @@ -151,8 +151,9 @@ class ConfigManager: template = self.DB_TEMPLATES[self.config['DB_FLAVOR']] self.config['SQLALCHEMY_DATABASE_URI'] = template.format(**self.config) - self.config['RATELIMIT_STORAGE_URL'] = f'redis://{self.config["REDIS_ADDRESS"]}/2' - self.config['QUOTA_STORAGE_URL'] = f'redis://{self.config["REDIS_ADDRESS"]}/1' +# remove? self.config['QUOTA_STORAGE_URL'] = f'redis://{self.config["REDIS_ADDRESS"]}/1' + if not self.config.get('RATELIMIT_STORAGE_URL'): + self.config['RATELIMIT_STORAGE_URL'] = f'redis://{self.config["REDIS_ADDRESS"]}/2' self.config['SESSION_STORAGE_URL'] = f'redis://{self.config["REDIS_ADDRESS"]}/3' self.config['SESSION_COOKIE_SAMESITE'] = 'Strict' self.config['SESSION_COOKIE_HTTPONLY'] = True diff --git a/core/admin/run_dev.sh b/core/admin/run_dev.sh index fc553cc4..62919f6f 100755 --- a/core/admin/run_dev.sh +++ b/core/admin/run_dev.sh @@ -56,6 +56,7 @@ RUN set -euxo pipefail \ ENV FLASK_ENV=development ENV MEMORY_SESSIONS=true +ENV RATELIMIT_STORAGE_URL="memory://" ENV SESSION_COOKIE_SECURE=false ENV DEBUG=true