From 08bc91dec43880c01f014e1fc0e97188a1573222 Mon Sep 17 00:00:00 2001 From: nd Date: Mon, 8 Mar 2021 15:03:14 +0100 Subject: [PATCH] add session timeout --- defaults/main.yml | 1 + templates/mailman-web.py.j2 | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3af2dbc..9943d6f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,5 +13,6 @@ mailman: signup: True change_pw: True ldap: False + session_timeout: 3600 archiver: key: "{{ lookup('password', '/dev/null length=128') }}" diff --git a/templates/mailman-web.py.j2 b/templates/mailman-web.py.j2 index 8721d20..42273ae 100644 --- a/templates/mailman-web.py.j2 +++ b/templates/mailman-web.py.j2 @@ -39,8 +39,8 @@ MIDDLEWARE = ( 'postorius.middleware.PostoriusMiddleware', {% if mailman.web.remote_user %} 'django.contrib.auth.middleware.PersistentRemoteUserMiddleware', -# 'django.contrib.auth.middleware.RemoteUserMiddleware', {% endif %} + 'django_auth_ldap_remoteuser.middleware.SessionTimeoutMiddleware', ) # Application definition @@ -237,3 +237,5 @@ AUTH_LDAP_REQUIRE_GROUP = "{{ mailman.web.ldap.group_require|d('') }}" AUTH_LDAP_DENY_GROUP = "{{ mailman.web.ldap.group_require|d('') }}" AUTH_LDAP_USER_FLAGS_BY_GROUP = {{ mailman.web.ldap.mappings|d({})|to_json }} {% endif %} + +SESSION_EXPIRE_SECONDS = {{ mailman.web.session_timeout }}