[PR #560] [MERGED] Rework hostname handling #1483

Closed
opened 2025-12-29 02:30:14 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/560
Author: @kradalby
Created: 4/24/2022
Status: Merged
Merged: 5/31/2022
Merged by: @kradalby

Base: mainHead: rename-fixess


📝 Commits (10+)

  • 663e838 Nickname support
  • 9901d6b Ability to clear nickname
  • 60ee046 Normalize nickname before saving to database
  • c8aa653 Merge branch 'main' into main
  • 8845938 Merge branch 'main' into main
  • 6e27680 Rename name -> hostname, nickname -> givenname
  • caf79f6 Change nickname to givenname in proto
  • 6b79679 Generate from proto
  • 14994cb Use new logic and fields for dns
  • 62808cb Bubble error up to user for rename

📊 Changes

34 files changed (+1480 additions, -541 deletions)

View changed files

📝 CHANGELOG.md (+4 -0)
📝 acls_test.go (+7 -7)
📝 api.go (+23 -11)
📝 app.go (+20 -8)
📝 cmd/headscale/cli/nodes.go (+55 -0)
📝 db.go (+41 -2)
📝 dns.go (+3 -9)
📝 dns_test.go (+14 -14)
📝 flake.lock (+7 -6)
📝 flake.nix (+37 -17)
📝 gen/go/headscale/v1/headscale.pb.go (+127 -114)
📝 gen/go/headscale/v1/headscale.pb.gw.go (+119 -0)
📝 gen/go/headscale/v1/headscale_grpc.pb.go (+36 -4)
📝 gen/go/headscale/v1/machine.pb.go (+273 -124)
📝 gen/openapiv2/headscale/v1/headscale.swagger.json (+48 -0)
📝 go.mod (+2 -16)
📝 go.sum (+4 -48)
📝 grpcv1.go (+34 -3)
📝 integration_cli_test.go (+172 -0)
📝 integration_common_test.go (+70 -0)

...and 14 more files

📄 Description

This PR builds on the work of @bravechamp, and implements the suggested changes from the comments.

It replaces #498

Changes:

  • Machines can have nicknames Machines now has a separate name used for DNS (settable by users)
  • Added "friendly name" on nodes list output
  • New command nodes rename to rename nodes
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md
  • GivenName needs to be unique (DB constraint)
  • GivenName sanitise should have a tiny hash when registering, to avoid collisions)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/560 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 4/24/2022 **Status:** ✅ Merged **Merged:** 5/31/2022 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `rename-fixess` --- ### 📝 Commits (10+) - [`663e838`](https://github.com/juanfont/headscale/commit/663e8384a3bed7db57ec83fe8e2360295d9b4591) Nickname support - [`9901d6b`](https://github.com/juanfont/headscale/commit/9901d6b2e74f563fb3edaf86249f756c148588fd) Ability to clear nickname - [`60ee046`](https://github.com/juanfont/headscale/commit/60ee04674d4252bf28015e5091458956b5253081) Normalize nickname before saving to database - [`c8aa653`](https://github.com/juanfont/headscale/commit/c8aa653275800fda72c41c2a09ccd02bbd548cfd) Merge branch 'main' into main - [`8845938`](https://github.com/juanfont/headscale/commit/88459388810f868003bf2b737e593efc32d8eb93) Merge branch 'main' into main - [`6e27680`](https://github.com/juanfont/headscale/commit/6e2768097a620fe7d43049e49f6d0fd6bc40fc8d) Rename name -> hostname, nickname -> givenname - [`caf79f6`](https://github.com/juanfont/headscale/commit/caf79f6910dc8caee29b3e608931eb7273e472a4) Change nickname to givenname in proto - [`6b79679`](https://github.com/juanfont/headscale/commit/6b79679cb419835854ee87e137c406ca6cf6350f) Generate from proto - [`14994cb`](https://github.com/juanfont/headscale/commit/14994cb6cca3d2b02e4b5ac24f66552f9b6fcce6) Use new logic and fields for dns - [`62808cb`](https://github.com/juanfont/headscale/commit/62808cbd86599008acbf66101a46c2c7c11febfa) Bubble error up to user for rename ### 📊 Changes **34 files changed** (+1480 additions, -541 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+4 -0) 📝 `acls_test.go` (+7 -7) 📝 `api.go` (+23 -11) 📝 `app.go` (+20 -8) 📝 `cmd/headscale/cli/nodes.go` (+55 -0) 📝 `db.go` (+41 -2) 📝 `dns.go` (+3 -9) 📝 `dns_test.go` (+14 -14) 📝 `flake.lock` (+7 -6) 📝 `flake.nix` (+37 -17) 📝 `gen/go/headscale/v1/headscale.pb.go` (+127 -114) 📝 `gen/go/headscale/v1/headscale.pb.gw.go` (+119 -0) 📝 `gen/go/headscale/v1/headscale_grpc.pb.go` (+36 -4) 📝 `gen/go/headscale/v1/machine.pb.go` (+273 -124) 📝 `gen/openapiv2/headscale/v1/headscale.swagger.json` (+48 -0) 📝 `go.mod` (+2 -16) 📝 `go.sum` (+4 -48) 📝 `grpcv1.go` (+34 -3) 📝 `integration_cli_test.go` (+172 -0) 📝 `integration_common_test.go` (+70 -0) _...and 14 more files_ </details> ### 📄 Description This PR builds on the work of @bravechamp, and implements the suggested changes from the comments. It replaces #498 Changes: - ~Machines can have nicknames~ Machines now has a separate name used for DNS (settable by users) - Added "friendly name" on `nodes list` output - New command `nodes rename` to rename nodes <!-- Please tick if the following things apply. You… --> - [x] added integration tests - [x] updated documentation if needed - [x] updated CHANGELOG.md - [x] GivenName needs to be unique (DB constraint) - [x] GivenName sanitise should have a tiny hash when registering, to avoid collisions) <!-- If applicable, please reference the issue using `Fixes #XXX` and add tests to cover your new code. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:30:14 +01:00
adam closed this issue 2025-12-29 02:30:14 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1483