소스 검색

Closes #18528: Introduce HOSTNAME config parameter (#19894)

Jeremy Stretch 7 달 전
부모
커밋
7f2b744a53
2개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 10 0
      docs/configuration/system.md
  2. 1 1
      netbox/netbox/settings.py

+ 10 - 0
docs/configuration/system.md

@@ -72,6 +72,16 @@ Email is sent from NetBox only for critical events or if configured for [logging
 
 ---
 
+## HOSTNAME
+
+!!! info "This parameter was introduced in NetBox v4.4."
+
+Default: System hostname
+
+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()`.
+
+---
+
 ## HTTP_PROXIES
 
 Default: `None`

+ 1 - 1
netbox/netbox/settings.py

@@ -27,7 +27,6 @@ from utilities.string import trailing_slash
 
 RELEASE = load_release_data()
 VERSION = RELEASE.full_version  # Retained for backward compatibility
-HOSTNAME = platform.node()
 # Set the base directory two levels up
 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 
@@ -125,6 +124,7 @@ EXEMPT_VIEW_PERMISSIONS = getattr(configuration, 'EXEMPT_VIEW_PERMISSIONS', [])
 FIELD_CHOICES = getattr(configuration, 'FIELD_CHOICES', {})
 FILE_UPLOAD_MAX_MEMORY_SIZE = getattr(configuration, 'FILE_UPLOAD_MAX_MEMORY_SIZE', 2621440)
 GRAPHQL_MAX_ALIASES = getattr(configuration, 'GRAPHQL_MAX_ALIASES', 10)
+HOSTNAME = getattr(configuration, 'HOSTNAME', platform.node())
 HTTP_PROXIES = getattr(configuration, 'HTTP_PROXIES', {})
 INTERNAL_IPS = getattr(configuration, 'INTERNAL_IPS', ('127.0.0.1', '::1'))
 ISOLATED_DEPLOYMENT = getattr(configuration, 'ISOLATED_DEPLOYMENT', False)