Skip to content

fix(domain): allow single-label hostnames without a TLD - #4972

Open
narcisonunez wants to merge 1 commit into
canaryfrom
fix/domain-single-label-hostname
Open

fix(domain): allow single-label hostnames without a TLD#4972
narcisonunez wants to merge 1 commit into
canaryfrom
fix/domain-single-label-hostname

Conversation

@narcisonunez

@narcisonunez narcisonunez commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

What is this PR about?

Regression from #4729: VALID_HOSTNAME_REGEX required at least one dot, rejecting single-label hosts like "dokploy-server", the TLD is optional.

Checklist

Before submitting this PR, please make sure that:

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
  • You have tested this PR in your local instance. If you have not tested it yet, please do so before submitting. This helps avoid wasting maintainers' time reviewing code that has not been verified by you.

Issues related (if applicable)

closes #4881

Screenshots (if applicable)

Screenshot 2026-08-04 at 5 40 51 PM

Greptile Summary

This PR restores support for valid single-label hostnames by making the dotted-label portion of the hostname regex optional.

  • Accepts names such as dokploy-server, localhost, and example.
  • Adds regression tests while preserving rejection of malformed labels, underscores, spaces, and empty hostnames.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The quantifier change narrowly permits a hostname without a dot while retaining the existing per-label character, length, and boundary restrictions, and the tests directly cover the intended regression.

Reviews (1): Last reviewed commit: "fix(domain): allow single-label hostname..." | Re-trigger Greptile

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Domain feature not accepting valid host name

1 participant