From 385cb28bf23ead06c5bd3531d78221b650db4800 Mon Sep 17 00:00:00 2001 From: Dimitri Huisman Date: Mon, 20 Dec 2021 22:13:18 +0000 Subject: [PATCH] Correctly calculate and set SESSION_TIMEOUT in roundcube --- webmails/roundcube/config.inc.php | 2 +- webmails/roundcube/start.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/webmails/roundcube/config.inc.php b/webmails/roundcube/config.inc.php index 635f7207..b02c527e 100644 --- a/webmails/roundcube/config.inc.php +++ b/webmails/roundcube/config.inc.php @@ -13,7 +13,7 @@ $config['log_driver'] = 'stdout'; $config['zipdownload_selection'] = true; $config['enable_spellcheck'] = true; $config['spellcheck_engine'] = 'pspell'; -$config['session_lifetime'] = {{ SESSION_TIMEOUT }}; //60 +$config['session_lifetime'] = {{ SESSION_TIMEOUT_MINUTES | int }}; // Mail servers $config['default_host'] = '{{ FRONT_ADDRESS or "front" }}'; diff --git a/webmails/roundcube/start.py b/webmails/roundcube/start.py index 13cbdd42..db9e5ccd 100755 --- a/webmails/roundcube/start.py +++ b/webmails/roundcube/start.py @@ -62,6 +62,10 @@ context["PLUGINS"] = ",".join(f"'{p}'" for p in plugins) # add overrides context["INCLUDES"] = sorted(inc for inc in os.listdir("/overrides") if inc.endswith(".inc")) if os.path.isdir("/overrides") else [] +# calculate variables for config file +env["SESSION_TIMEOUT_MINUTES"] = str(int(env.get("SESSION_TIMEOUT", "3600")) // 60 ) if int(env.get("SESSION_TIMEOUT", "3600")) >= 60 else "1" +context.update(env) + # create config files conf.jinja("/php.ini", context, "/usr/local/etc/php/conf.d/roundcube.ini") conf.jinja("/config.inc.php", context, "/var/www/html/config/config.inc.php")