mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Closes #2053: Introduced the LOGIN_TIMEOUT configuration setting
This commit is contained in:
parent
63bd48003e
commit
641254b23a
@ -31,6 +31,7 @@ NetBox now supports modeling physical cables for console, power, and interface c
|
|||||||
* [#1444](https://github.com/digitalocean/netbox/issues/1444) - Added an `asset_tag` field for racks
|
* [#1444](https://github.com/digitalocean/netbox/issues/1444) - Added an `asset_tag` field for racks
|
||||||
* [#1931](https://github.com/digitalocean/netbox/issues/1931) - Added a count of assigned IP addresses to the interface API serializer
|
* [#1931](https://github.com/digitalocean/netbox/issues/1931) - Added a count of assigned IP addresses to the interface API serializer
|
||||||
* [#2000](https://github.com/digitalocean/netbox/issues/2000) - Dropped support for Python 2
|
* [#2000](https://github.com/digitalocean/netbox/issues/2000) - Dropped support for Python 2
|
||||||
|
* [#2053](https://github.com/digitalocean/netbox/issues/2053) - Introduced the `LOGIN_TIMEOUT` configuration setting
|
||||||
* [#2057](https://github.com/digitalocean/netbox/issues/2057) - Added description columns to interface connections list
|
* [#2057](https://github.com/digitalocean/netbox/issues/2057) - Added description columns to interface connections list
|
||||||
* [#2104](https://github.com/digitalocean/netbox/issues/2104) - Added a `status` field for racks
|
* [#2104](https://github.com/digitalocean/netbox/issues/2104) - Added a `status` field for racks
|
||||||
* [#2165](https://github.com/digitalocean/netbox/issues/2165) - Improved natural ordering of Interfaces
|
* [#2165](https://github.com/digitalocean/netbox/issues/2165) - Improved natural ordering of Interfaces
|
||||||
|
@ -133,6 +133,14 @@ Setting this to True will permit only authenticated users to access any part of
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## LOGIN_TIMEOUT
|
||||||
|
|
||||||
|
Default: 1209600 seconds (14 days)
|
||||||
|
|
||||||
|
The liftetime (in seconds) of the authentication cookie issued to a NetBox user upon login.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## MAINTENANCE_MODE
|
## MAINTENANCE_MODE
|
||||||
|
|
||||||
Default: False
|
Default: False
|
||||||
|
@ -91,6 +91,10 @@ LOGGING = {}
|
|||||||
# are permitted to access most data in NetBox (excluding secrets) but not make any changes.
|
# are permitted to access most data in NetBox (excluding secrets) but not make any changes.
|
||||||
LOGIN_REQUIRED = False
|
LOGIN_REQUIRED = False
|
||||||
|
|
||||||
|
# The length of time (in seconds) for which a user will remain logged into the web UI before being prompted to
|
||||||
|
# re-authenticate. (Default: 1209600 [14 days])
|
||||||
|
LOGIN_TIMEOUT = None
|
||||||
|
|
||||||
# Setting this to True will display a "maintenance mode" banner at the top of every page.
|
# Setting this to True will display a "maintenance mode" banner at the top of every page.
|
||||||
MAINTENANCE_MODE = False
|
MAINTENANCE_MODE = False
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ ENFORCE_GLOBAL_UNIQUE = getattr(configuration, 'ENFORCE_GLOBAL_UNIQUE', False)
|
|||||||
EMAIL = getattr(configuration, 'EMAIL', {})
|
EMAIL = getattr(configuration, 'EMAIL', {})
|
||||||
LOGGING = getattr(configuration, 'LOGGING', {})
|
LOGGING = getattr(configuration, 'LOGGING', {})
|
||||||
LOGIN_REQUIRED = getattr(configuration, 'LOGIN_REQUIRED', False)
|
LOGIN_REQUIRED = getattr(configuration, 'LOGIN_REQUIRED', False)
|
||||||
|
LOGIN_TIMEOUT = getattr(configuration, 'LOGIN_TIMEOUT', None)
|
||||||
MAINTENANCE_MODE = getattr(configuration, 'MAINTENANCE_MODE', False)
|
MAINTENANCE_MODE = getattr(configuration, 'MAINTENANCE_MODE', False)
|
||||||
MAX_PAGE_SIZE = getattr(configuration, 'MAX_PAGE_SIZE', 1000)
|
MAX_PAGE_SIZE = getattr(configuration, 'MAX_PAGE_SIZE', 1000)
|
||||||
MEDIA_ROOT = getattr(configuration, 'MEDIA_ROOT', os.path.join(BASE_DIR, 'media')).rstrip('/')
|
MEDIA_ROOT = getattr(configuration, 'MEDIA_ROOT', os.path.join(BASE_DIR, 'media')).rstrip('/')
|
||||||
@ -113,6 +114,13 @@ DATABASES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Sessions
|
# Sessions
|
||||||
|
if LOGIN_TIMEOUT is not None:
|
||||||
|
if type(LOGIN_TIMEOUT) is not int or LOGIN_TIMEOUT < 0:
|
||||||
|
raise ImproperlyConfigured(
|
||||||
|
"LOGIN_TIMEOUT must be a positive integer (value: {})".format(LOGIN_TIMEOUT)
|
||||||
|
)
|
||||||
|
# Django default is 1209600 seconds (14 days)
|
||||||
|
SESSION_COOKIE_AGE = LOGIN_TIMEOUT
|
||||||
if SESSION_FILE_PATH is not None:
|
if SESSION_FILE_PATH is not None:
|
||||||
SESSION_ENGINE = 'django.contrib.sessions.backends.file'
|
SESSION_ENGINE = 'django.contrib.sessions.backends.file'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user