Remove requirement for fully-qualified domains in custom URL fields #1202

Closed
opened 2025-12-29 16:30:01 +01:00 by adam · 1 comment
Owner

Originally created by @kopacko on GitHub (Aug 30, 2017).

Issue type

[ ] Feature request
[x] Bug report
[ ] Documentation

Environment

  • Python version:
  • NetBox version: 2.1.2

Description

I created a custom field URL to point do a devices repository for configuration backups as well as to a direct REST API link from my Cisco Prime Infrastructure servers. One thing I noticed is that you have to supply a FQDN for the custom field. We have our internal domains as our search domain and I believe this field should be able to accept that form of short-hand.

For example: https://ciscoprime.domain.com (currently required)

Internally domain.com is the given search domain so https://ciscoprime (should be acceptable by this field)

I could not find any previous issues directly referencing this issue. If they exist, I apologize now.

Originally created by @kopacko on GitHub (Aug 30, 2017). <!-- Before opening a new issue, please search through the existing issues to see if your topic has already been addressed. Note that you may need to remove the "is:open" filter from the search bar to include closed issues. Check the appropriate type for your issue below by placing an x between the brackets. If none of the below apply, please raise your issue for discussion on our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please note that issues which do not fall under any of the below categories will be closed. ---> ### Issue type [ ] Feature request <!-- Requesting the implementation of a new feature --> [x] Bug report <!-- Reporting unexpected or erroneous behavior --> [ ] Documentation <!-- Proposing a modification to the documentation --> <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) --> ### Environment * Python version: <!-- Example: 3.5.4 --> * NetBox version: <!-- Example: 2.1.3 --> 2.1.2 <!-- BUG REPORTS must include: * A list of the steps needed to reproduce the bug * A description of the expected behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description I created a custom field URL to point do a devices repository for configuration backups as well as to a direct REST API link from my Cisco Prime Infrastructure servers. One thing I noticed is that you have to supply a FQDN for the custom field. We have our internal domains as our search domain and I believe this field should be able to accept that form of short-hand. For example: https://ciscoprime.domain.com (currently required) Internally domain.com is the given search domain so https://ciscoprime (should be acceptable by this field) I could not find any previous issues directly referencing this issue. If they exist, I apologize now.
adam added the type: feature label 2025-12-29 16:30:01 +01:00
adam closed this issue 2025-12-29 16:30:01 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 30, 2017):

Validation of the URL is performed using Django's built-in URLValidator, which seems to enforce a domain name and TLD. We've already implemented our own URLField too allow for arbitrary schemes. It probably makes sense to ditch the built-in validator in favor of something more flexible.

@jeremystretch commented on GitHub (Aug 30, 2017): Validation of the URL is performed using Django's built-in [URLValidator](https://docs.djangoproject.com/en/1.11/_modules/django/core/validators/#URLValidator), which seems to enforce a domain name and TLD. We've already implemented [our own URLField](https://github.com/digitalocean/netbox/blob/develop/netbox/utilities/forms.py#L432) too allow for arbitrary schemes. It probably makes sense to ditch the built-in validator in favor of something more flexible.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1202