mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Closes #2426: Introduced SESSION_FILE_PATH configuration setting for authentication without write access to database
This commit is contained in:
parent
fc41359df6
commit
f8e6cfbeba
@ -36,6 +36,7 @@ NetBox now supports modeling physical cables for console, power, and interface c
|
|||||||
* [#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
|
||||||
* [#2292](https://github.com/digitalocean/netbox/issues/2292) - Removed the deprecated UserAction model
|
* [#2292](https://github.com/digitalocean/netbox/issues/2292) - Removed the deprecated UserAction model
|
||||||
* [#2367](https://github.com/digitalocean/netbox/issues/2367) - Removed deprecated RPCClient functionality
|
* [#2367](https://github.com/digitalocean/netbox/issues/2367) - Removed deprecated RPCClient functionality
|
||||||
|
* [#2426](https://github.com/digitalocean/netbox/issues/2426) - Introduced `SESSION_FILE_PATH` configuration setting for authentication without write access to database
|
||||||
|
|
||||||
## Changes From v2.5-beta1
|
## Changes From v2.5-beta1
|
||||||
|
|
||||||
|
@ -223,6 +223,14 @@ The file path to the location where custom reports will be kept. By default, thi
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## SESSION_FILE_PATH
|
||||||
|
|
||||||
|
Default: None
|
||||||
|
|
||||||
|
Session data is used to track authenticated users when they access NetBox. By default, NetBox stores session data in the PostgreSQL database. However, this inhibits authentication to a standby instance of NetBox without write access to the database. Alternatively, a local file path may be specified here and NetBox will store session data as files instead of using the database. Note that the user as which NetBox runs must have read and write permissions to this path.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## TIME_ZONE
|
## TIME_ZONE
|
||||||
|
|
||||||
Default: UTC
|
Default: UTC
|
||||||
|
@ -121,10 +121,6 @@ PAGINATE_COUNT = 50
|
|||||||
# prefer IPv4 instead.
|
# prefer IPv4 instead.
|
||||||
PREFER_IPV4 = False
|
PREFER_IPV4 = False
|
||||||
|
|
||||||
# The Webhook event backend is disabled by default. Set this to True to enable it. Note that this requires a Redis
|
|
||||||
# database be configured and accessible by NetBox (see `REDIS` below).
|
|
||||||
WEBHOOKS_ENABLED = False
|
|
||||||
|
|
||||||
# Redis database settings (optional). A Redis database is required only if the webhooks backend is enabled.
|
# Redis database settings (optional). A Redis database is required only if the webhooks backend is enabled.
|
||||||
REDIS = {
|
REDIS = {
|
||||||
'HOST': 'localhost',
|
'HOST': 'localhost',
|
||||||
@ -138,9 +134,18 @@ REDIS = {
|
|||||||
# this setting is derived from the installed location.
|
# this setting is derived from the installed location.
|
||||||
# REPORTS_ROOT = '/opt/netbox/netbox/reports'
|
# REPORTS_ROOT = '/opt/netbox/netbox/reports'
|
||||||
|
|
||||||
|
# By default, NetBox will store session data in the database. Alternatively, a file path can be specified here to use
|
||||||
|
# local file storage instead. (This can be useful for enabling authentication on a standby instance with read-only
|
||||||
|
# database access.) Note that the user as which NetBox runs must have read and write permissions to this path.
|
||||||
|
SESSION_FILE_PATH = None
|
||||||
|
|
||||||
# Time zone (default: UTC)
|
# Time zone (default: UTC)
|
||||||
TIME_ZONE = 'UTC'
|
TIME_ZONE = 'UTC'
|
||||||
|
|
||||||
|
# The webhooks backend is disabled by default. Set this to True to enable it. Note that this requires a Redis
|
||||||
|
# database be configured and accessible by NetBox.
|
||||||
|
WEBHOOKS_ENABLED = False
|
||||||
|
|
||||||
# Date/time formatting. See the following link for supported formats:
|
# Date/time formatting. See the following link for supported formats:
|
||||||
# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
# https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
|
||||||
DATE_FORMAT = 'N j, Y'
|
DATE_FORMAT = 'N j, Y'
|
||||||
|
@ -65,6 +65,7 @@ PAGINATE_COUNT = getattr(configuration, 'PAGINATE_COUNT', 50)
|
|||||||
PREFER_IPV4 = getattr(configuration, 'PREFER_IPV4', False)
|
PREFER_IPV4 = getattr(configuration, 'PREFER_IPV4', False)
|
||||||
REPORTS_ROOT = getattr(configuration, 'REPORTS_ROOT', os.path.join(BASE_DIR, 'reports')).rstrip('/')
|
REPORTS_ROOT = getattr(configuration, 'REPORTS_ROOT', os.path.join(BASE_DIR, 'reports')).rstrip('/')
|
||||||
REDIS = getattr(configuration, 'REDIS', {})
|
REDIS = getattr(configuration, 'REDIS', {})
|
||||||
|
SESSION_FILE_PATH = getattr(configuration, 'SESSION_FILE_PATH', None)
|
||||||
SHORT_DATE_FORMAT = getattr(configuration, 'SHORT_DATE_FORMAT', 'Y-m-d')
|
SHORT_DATE_FORMAT = getattr(configuration, 'SHORT_DATE_FORMAT', 'Y-m-d')
|
||||||
SHORT_DATETIME_FORMAT = getattr(configuration, 'SHORT_DATETIME_FORMAT', 'Y-m-d H:i')
|
SHORT_DATETIME_FORMAT = getattr(configuration, 'SHORT_DATETIME_FORMAT', 'Y-m-d H:i')
|
||||||
SHORT_TIME_FORMAT = getattr(configuration, 'SHORT_TIME_FORMAT', 'H:i:s')
|
SHORT_TIME_FORMAT = getattr(configuration, 'SHORT_TIME_FORMAT', 'H:i:s')
|
||||||
@ -111,6 +112,10 @@ DATABASES = {
|
|||||||
'default': configuration.DATABASE,
|
'default': configuration.DATABASE,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Sessions
|
||||||
|
if SESSION_FILE_PATH is not None:
|
||||||
|
SESSION_ENGINE = 'django.contrib.sessions.backends.file'
|
||||||
|
|
||||||
# Redis
|
# Redis
|
||||||
REDIS_HOST = REDIS.get('HOST', 'localhost')
|
REDIS_HOST = REDIS.get('HOST', 'localhost')
|
||||||
REDIS_PORT = REDIS.get('PORT', 6379)
|
REDIS_PORT = REDIS.get('PORT', 6379)
|
||||||
|
Loading…
Reference in New Issue
Block a user