Skip to content

Commit

Permalink
initial proposal issue netbox-community#1105
Browse files Browse the repository at this point in the history
also included variables in netbox.env
  • Loading branch information
Ken Aerts committed Aug 31, 2024
1 parent 0c99ff8 commit 43e497d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ def _environ_get_and_map(variable_name: str, default: str | None = None, map_fn:
# PostgreSQL password
'HOST': environ.get('DB_HOST', 'localhost'), # Database server
'PORT': environ.get('DB_PORT', ''), # Database port (leave blank for default)
'OPTIONS': {'sslmode': environ.get('DB_SSLMODE', 'prefer')},
# Database connection SSLMODE
'OPTIONS': {
'sslmode': environ.get('DB_SSLMODE', 'prefer'), # Database connection SSLMODE
'sslcert': environ.get('DB_CLIENT_SSL_CERT', None),
'sslkey': environ.get('DB_CLIENT_SSL_KEY', None),
'sslrootcert': environ.get('DB_CLIENT_SSL_CA', None)
},
'CONN_MAX_AGE': _environ_get_and_map('DB_CONN_MAX_AGE', '300', _AS_INT),
# Max database connection age
'DISABLE_SERVER_SIDE_CURSORS': _environ_get_and_map('DB_DISABLE_SERVER_SIDE_CURSORS', 'False', _AS_BOOL),
Expand Down
3 changes: 3 additions & 0 deletions env/netbox.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ DB_HOST=postgres
DB_NAME=netbox
DB_PASSWORD=J5brHrAXFLQSif0K
DB_USER=netbox
DB_CLIENT_SSL_CERT=
DB_CLIENT_SSL_KEY=
DB_CLIENT_SSL_CA=
EMAIL_FROM=[email protected]
EMAIL_PASSWORD=
EMAIL_PORT=25
Expand Down

0 comments on commit 43e497d

Please sign in to comment.