[PR #2949] feat: Disable key expiry for nodes #2956

Open
opened 2025-12-29 04:19:48 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2949
Author: @marcotuna
Created: 12/8/2025
Status: 🔄 Open

Base: mainHead: feat/allow-expire-node


📝 Commits (7)

  • 81aab87 feat: add option to disable node expiry in CLI and API
  • 6b7f81c Merge branch 'main' of github.com:marcotuna/headscale into feat/allow-expire-node
  • 73a3ceb refactor(state): improve error handling in DisableNodeExpiry
  • 514e423 test: add TestDisableNodeExpiry to integration tests
  • 5de8bf5 refactor: update SetNodeExpiry
  • b544747 Merge branch 'main' of github.com:marcotuna/headscale into feat/allow-expire-node
  • bb67088 chore: Undo change regarding pointer copy

📊 Changes

12 files changed (+220 additions, -30 deletions)

View changed files

📝 .github/workflows/test-integration.yaml (+1 -0)
📝 cmd/headscale/cli/nodes.go (+46 -7)
📝 gen/go/headscale/v1/node.pb.go (+15 -5)
📝 gen/openapiv2/headscale/v1/headscale.swagger.json (+7 -0)
📝 hscontrol/auth.go (+1 -1)
📝 hscontrol/auth_test.go (+1 -1)
📝 hscontrol/db/node.go (+4 -5)
📝 hscontrol/db/node_test.go (+1 -1)
📝 hscontrol/grpcv1.go (+23 -6)
📝 hscontrol/state/state.go (+22 -4)
📝 integration/general_test.go (+97 -0)
📝 proto/headscale/v1/node.proto (+2 -0)

📄 Description

Fixes #2681

Adds the ability to disable key expiry for nodes via CLI, similar to Tailscale's implementation (https://tailscale.com/kb/1028/key-expiry#disabling-key-expiry).
This is a simpler implementation that focuses only on providing the CLI argument to expire nodes, and therefore does not fully cover the implementation proposed in #2681.

Usage

Disable key expiry (node will never expire)

headscale nodes expire --identifier 1 --disable

Implementation

  • Added disable_expiry field to ExpireNodeRequest proto
  • Added --disable flag to headscale nodes expire CLI command
  • When disabled, node expiry is set to NULL and IsExpired() returns false

Checklist

  • have read the CONTRIBUTING.md file
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

🔄 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/2949 **Author:** [@marcotuna](https://github.com/marcotuna) **Created:** 12/8/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/allow-expire-node` --- ### 📝 Commits (7) - [`81aab87`](https://github.com/juanfont/headscale/commit/81aab871dff82b661d887d38f0abbede67ddde1b) feat: add option to disable node expiry in CLI and API - [`6b7f81c`](https://github.com/juanfont/headscale/commit/6b7f81caa2b286d0061fa0baffd7766745d4bcc4) Merge branch 'main' of github.com:marcotuna/headscale into feat/allow-expire-node - [`73a3ceb`](https://github.com/juanfont/headscale/commit/73a3ceb84b6498a74c45f9548594937e974625cc) refactor(state): improve error handling in DisableNodeExpiry - [`514e423`](https://github.com/juanfont/headscale/commit/514e423a76890cade65dfb80163d68ded9f53dc5) test: add TestDisableNodeExpiry to integration tests - [`5de8bf5`](https://github.com/juanfont/headscale/commit/5de8bf5d0bc8402c2a356b7ad32b89767b99c747) refactor: update SetNodeExpiry - [`b544747`](https://github.com/juanfont/headscale/commit/b544747dd6e4d8f9a3838adcd094a3d96e64a31e) Merge branch 'main' of github.com:marcotuna/headscale into feat/allow-expire-node - [`bb67088`](https://github.com/juanfont/headscale/commit/bb67088721d45fabbb8e3fa154d7cf6b71970ff5) chore: Undo change regarding pointer copy ### 📊 Changes **12 files changed** (+220 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test-integration.yaml` (+1 -0) 📝 `cmd/headscale/cli/nodes.go` (+46 -7) 📝 `gen/go/headscale/v1/node.pb.go` (+15 -5) 📝 `gen/openapiv2/headscale/v1/headscale.swagger.json` (+7 -0) 📝 `hscontrol/auth.go` (+1 -1) 📝 `hscontrol/auth_test.go` (+1 -1) 📝 `hscontrol/db/node.go` (+4 -5) 📝 `hscontrol/db/node_test.go` (+1 -1) 📝 `hscontrol/grpcv1.go` (+23 -6) 📝 `hscontrol/state/state.go` (+22 -4) 📝 `integration/general_test.go` (+97 -0) 📝 `proto/headscale/v1/node.proto` (+2 -0) </details> ### 📄 Description Fixes #2681 Adds the ability to disable key expiry for nodes via CLI, similar to Tailscale's implementation (https://tailscale.com/kb/1028/key-expiry#disabling-key-expiry). This is a simpler implementation that focuses only on providing the CLI argument to expire nodes, and therefore does not fully cover the implementation proposed in #2681. ### Usage # Disable key expiry (node will never expire) headscale nodes expire --identifier 1 --disable ### Implementation - Added `disable_expiry` field to `ExpireNodeRequest` proto - Added `--disable` flag to `headscale nodes expire` CLI command - When disabled, node expiry is set to NULL and `IsExpired()` returns false ### Checklist - [x] have read the [CONTRIBUTING.md](./CONTRIBUTING.md) file - [x] raised a GitHub issue or discussed it on the projects chat beforehand - [x] added unit tests - [x] added integration tests - [ ] updated documentation if needed - [ ] updated CHANGELOG.md --- <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 04:19:48 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2956