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 }}