mirror of
https://github.com/optim-enterprises-bv/Mailu.git
synced 2025-11-02 02:57:56 +00:00
make sessions expire
(cherry picked from commit b9becd8649)
# Conflicts:
# core/admin/mailu/configuration.py
This commit is contained in:
committed by
Mergify
parent
eda5962798
commit
1ce562c58c
@@ -1,7 +1,11 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
<<<<<<< HEAD
|
||||||
import ipaddress
|
import ipaddress
|
||||||
|
=======
|
||||||
|
from socrate import system
|
||||||
|
>>>>>>> b9becd86 (make sessions expire)
|
||||||
|
|
||||||
DEFAULT_CONFIG = {
|
DEFAULT_CONFIG = {
|
||||||
# Specific to the admin UI
|
# Specific to the admin UI
|
||||||
@@ -72,6 +76,7 @@ DEFAULT_CONFIG = {
|
|||||||
'LOGO_URL': None,
|
'LOGO_URL': None,
|
||||||
'LOGO_BACKGROUND': None,
|
'LOGO_BACKGROUND': None,
|
||||||
# Advanced settings
|
# Advanced settings
|
||||||
|
<<<<<<< HEAD
|
||||||
'AUTH_REQUIRE_TOKENS': False,
|
'AUTH_REQUIRE_TOKENS': False,
|
||||||
'API': False,
|
'API': False,
|
||||||
'WEB_API': '/api',
|
'WEB_API': '/api',
|
||||||
@@ -83,6 +88,11 @@ DEFAULT_CONFIG = {
|
|||||||
'SESSION_TIMEOUT': 3600,
|
'SESSION_TIMEOUT': 3600,
|
||||||
'PERMANENT_SESSION_LIFETIME': 30*24*3600,
|
'PERMANENT_SESSION_LIFETIME': 30*24*3600,
|
||||||
'SESSION_COOKIE_SECURE': None,
|
'SESSION_COOKIE_SECURE': None,
|
||||||
|
=======
|
||||||
|
'LOG_LEVEL': 'WARNING',
|
||||||
|
'SESSION_LIFETIME': 24,
|
||||||
|
'SESSION_COOKIE_SECURE': True,
|
||||||
|
>>>>>>> b9becd86 (make sessions expire)
|
||||||
'CREDENTIAL_ROUNDS': 12,
|
'CREDENTIAL_ROUNDS': 12,
|
||||||
'TLS_PERMISSIVE': True,
|
'TLS_PERMISSIVE': True,
|
||||||
'TZ': 'Etc/UTC',
|
'TZ': 'Etc/UTC',
|
||||||
@@ -171,6 +181,7 @@ class ConfigManager:
|
|||||||
pass
|
pass
|
||||||
=======
|
=======
|
||||||
self.config['SESSION_KEY_BITS'] = 128
|
self.config['SESSION_KEY_BITS'] = 128
|
||||||
|
self.config['PERMANENT_SESSION_LIFETIME'] = timedelta(hours=int(self.config['SESSION_LIFETIME']))
|
||||||
# update the app config itself
|
# update the app config itself
|
||||||
app.config = self
|
app.config = self
|
||||||
>>>>>>> d459c374 (make session IDs 128bits)
|
>>>>>>> d459c374 (make session IDs 128bits)
|
||||||
|
|||||||
@@ -235,6 +235,8 @@ intend to access it over plain HTTP.
|
|||||||
requests before a session is invalidated. ``PERMANENT_SESSION_LIFETIME`` (default: 108000)
|
requests before a session is invalidated. ``PERMANENT_SESSION_LIFETIME`` (default: 108000)
|
||||||
is the maximum amount of time in seconds a session can be kept alive for if it hasn't timed-out.
|
is the maximum amount of time in seconds a session can be kept alive for if it hasn't timed-out.
|
||||||
|
|
||||||
|
``SESSION_LIFETIME`` (default: 24) is the length in hours a session is valid for on the administrative interface.
|
||||||
|
|
||||||
The ``LOG_LEVEL`` setting is used by the python start-up scripts as a logging threshold.
|
The ``LOG_LEVEL`` setting is used by the python start-up scripts as a logging threshold.
|
||||||
Log messages equal or higher than this priority will be printed.
|
Log messages equal or higher than this priority will be printed.
|
||||||
Can be one of: CRITICAL, ERROR, WARNING, INFO, DEBUG or NOTSET.
|
Can be one of: CRITICAL, ERROR, WARNING, INFO, DEBUG or NOTSET.
|
||||||
|
|||||||
Reference in New Issue
Block a user