[PR #2765] [MERGED] cmd: add option to get and set policy directly from database #2845

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2765
Author: @kradalby
Created: 9/10/2025
Status: Merged
Merged: 9/12/2025
Merged by: @kradalby

Base: mainHead: kradalby/acl-startup-invalid


📝 Commits (5)

  • 34b9cbf cmd: add option to get and set policy directly from database
  • e1dd414 changelog: add entry about bypass flag
  • 3001fc2 util: add YesNo prompt
  • 07d8da5 gomod: remove prompt import
  • 2372827 cmd: replace prompt with one that respect stdout redir

📊 Changes

10 files changed (+368 additions, -129 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 cmd/headscale/cli/nodes.go (+5 -57)
📝 cmd/headscale/cli/policy.go (+101 -17)
📝 cmd/headscale/cli/users.go (+5 -11)
📝 cmd/headscale/cli/utils.go (+8 -1)
📝 flake.nix (+1 -1)
📝 go.mod (+5 -10)
📝 go.sum (+8 -32)
hscontrol/util/prompt.go (+24 -0)
hscontrol/util/prompt_test.go (+209 -0)

📄 Description

this commit adds a new --bypass-grpc-access-and-database-directly flag to headscale policy get|set which allows the operator to directly get or set the policy from the database. This is useful if there is a broken policy in the database that prevents the server from starting.

Fixes #2630


🔄 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/2765 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 9/10/2025 **Status:** ✅ Merged **Merged:** 9/12/2025 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `kradalby/acl-startup-invalid` --- ### 📝 Commits (5) - [`34b9cbf`](https://github.com/juanfont/headscale/commit/34b9cbfdcc7b899a3c1b877be5c074ae58733b1b) cmd: add option to get and set policy directly from database - [`e1dd414`](https://github.com/juanfont/headscale/commit/e1dd414be49d564ac1ad1662f0985a74f63b9950) changelog: add entry about bypass flag - [`3001fc2`](https://github.com/juanfont/headscale/commit/3001fc2b49ce0e11e9e8d012345c80845957f60b) util: add YesNo prompt - [`07d8da5`](https://github.com/juanfont/headscale/commit/07d8da580f4d826978f25a31b6a5f1835029685e) gomod: remove prompt import - [`2372827`](https://github.com/juanfont/headscale/commit/2372827f40a09297aa8cca4a8b23dc14fbf687c7) cmd: replace prompt with one that respect stdout redir ### 📊 Changes **10 files changed** (+368 additions, -129 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `cmd/headscale/cli/nodes.go` (+5 -57) 📝 `cmd/headscale/cli/policy.go` (+101 -17) 📝 `cmd/headscale/cli/users.go` (+5 -11) 📝 `cmd/headscale/cli/utils.go` (+8 -1) 📝 `flake.nix` (+1 -1) 📝 `go.mod` (+5 -10) 📝 `go.sum` (+8 -32) ➕ `hscontrol/util/prompt.go` (+24 -0) ➕ `hscontrol/util/prompt_test.go` (+209 -0) </details> ### 📄 Description this commit adds a new `--bypass-grpc-access-and-database-directly` flag to `headscale policy get|set` which allows the operator to directly get or set the policy from the database. This is useful if there is a broken policy in the database that prevents the server from starting. Fixes #2630 --- <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:17 +01:00
adam closed this issue 2025-12-29 04:19:17 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2845