Skip to content

Allow customizable hostname setting to be configured #18528

@markh0338

Description

@markh0338

NetBox version

4.1.11

Feature type

Change to existing functionality

Proposed functionality

Currently, the HOSTNAME variable is set to use only platform.node() as its value. While this is sufficient in most cases, providing an option for customization would be beneficial. To avoid conflicts with #18518, it may be best to introduce a DISPLAY_NAME variable that can accept a custom value or default to HOSTNAME. This ensures that the meta tags from #18518 reflect the actual server name while allowing the DISPLAY_NAME to be customized.

Addition to settings.py:
DISPLAY_NAME = getattr(configuration, 'DISPLAY_NAME', HOSTNAME)
or
DISPLAY_NAME = getattr(configuration, 'DISPLAY_NAME', platform.node())

Modification in the footer section of base/layout.html:
<li class="list-inline-item">{{ settings.HOSTNAME }}</li>
would be come:
<li class="list-inline-item">{{ settings.DISPLAY_NAME }}</li>

Use case

In certain use cases, the server's hostname is not customizable and is displayed in the footer section of all NetBox pages, which may be unclear or confusing to end users. Making this setting customizable would allow administrators to define a value that better suits their environment or leave it unset to use the default value.

Database changes

N/A

External dependencies

N/A

Metadata

Metadata

Assignees

Labels

complexity: lowRequires minimal effort to implementstatus: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions