Skip to content

Commit 7f2b744

Browse files
Closes #18528: Introduce HOSTNAME config parameter (#19894)
1 parent 733dd81 commit 7f2b744

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

docs/configuration/system.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ Email is sent from NetBox only for critical events or if configured for [logging
7272

7373
---
7474

75+
## HOSTNAME
76+
77+
!!! info "This parameter was introduced in NetBox v4.4."
78+
79+
Default: System hostname
80+
81+
The hostname displayed in the user interface identifying the system on which NetBox is running. If not defined, this defaults to the system hostname as reported by Python's `platform.node()`.
82+
83+
---
84+
7585
## HTTP_PROXIES
7686

7787
Default: `None`

netbox/netbox/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
RELEASE = load_release_data()
2929
VERSION = RELEASE.full_version # Retained for backward compatibility
30-
HOSTNAME = platform.node()
3130
# Set the base directory two levels up
3231
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
3332

@@ -125,6 +124,7 @@
125124
FIELD_CHOICES = getattr(configuration, 'FIELD_CHOICES', {})
126125
FILE_UPLOAD_MAX_MEMORY_SIZE = getattr(configuration, 'FILE_UPLOAD_MAX_MEMORY_SIZE', 2621440)
127126
GRAPHQL_MAX_ALIASES = getattr(configuration, 'GRAPHQL_MAX_ALIASES', 10)
127+
HOSTNAME = getattr(configuration, 'HOSTNAME', platform.node())
128128
HTTP_PROXIES = getattr(configuration, 'HTTP_PROXIES', {})
129129
INTERNAL_IPS = getattr(configuration, 'INTERNAL_IPS', ('127.0.0.1', '::1'))
130130
ISOLATED_DEPLOYMENT = getattr(configuration, 'ISOLATED_DEPLOYMENT', False)

0 commit comments

Comments
 (0)