Skip to content

Conversation

@kradalby
Copy link
Collaborator

@kradalby kradalby commented Jan 27, 2025

fixes #2762

  Client Registration (New Nodes)

  'my-laptop'       → 'my-laptop'        ✓ Valid, accepted as-is
  'My-Laptop'       → 'my-laptop'        ✓ Uppercase → lowercase
  'my_laptop'       → 'invalid-a1b2c3'   ✗ Contains underscore
  'test@host'       → 'invalid-d4e5f6'   ✗ Contains @
  'server-北京-01'  → 'invalid-g7h8i9'   ✗ Contains Chinese chars
  'laptop-🚀'       → 'invalid-j1k2l3'   ✗ Contains emoji
  'very-long-hostname-that-exceeds-sixty-three-characters-and-more'   → 'invalid-m4n5o6'   ✗ Too long (>63 chars)

  Hostinfo Updates (From Tailscale Client) or CLI

  'my-laptop'       → Accepted           ✓ Valid
  'My-Laptop'       → 'my-laptop'        ✓ Lowercased and accepted
  'my_laptop'       → Rejected            ✗ "invalid characters"
  'test@host'       → Rejected            ✗ "invalid characters"
  'server-北京-01'  → Rejected            ✗ "invalid characters"
  '-test'           → Rejected            ✗ "cannot start or end with a hyphen"
  'a'               → Rejected            ✗ "must be at least 2 characters"

Signed-off-by: Kristoffer Dalby <[email protected]>
@kradalby kradalby force-pushed the kradalby/validate-hostname branch 2 times, most recently from 4306c48 to 0cd8abd Compare October 17, 2025 12:37
@kradalby kradalby force-pushed the kradalby/validate-hostname branch from 0cd8abd to 708cbac Compare October 17, 2025 12:55
@kradalby kradalby marked this pull request as ready for review October 19, 2025 16:35
Copy link
Collaborator

@nblock nblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A entry in the "breaking" section of the changelog would be good as some hostnames that worked before will now be rejected/renamed.

Signed-off-by: Kristoffer Dalby <[email protected]>
@nblock nblock added this to the v0.27.0 milestone Oct 21, 2025
@kradalby kradalby merged commit 1cdea7e into juanfont:main Oct 22, 2025
85 of 89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] If a computer set an invalid hostname, the entire network will be unavailable (re-emerging)

2 participants