1
0
mirror of https://github.com/juanfont/headscale.git synced 2026-02-07 20:04:00 +01:00
juanfont.headscale/cmd/headscale/cli
Shourya Gautam 4e1834adaf
db: use PolicyManager for RequestTags migration
Refactor the RequestTags migration (202601121700-migrate-hostinfo-request-tags)
to use PolicyManager.NodeCanHaveTag() instead of reimplementing tag validation.

Changes:
- NewHeadscaleDatabase now accepts *types.Config to allow migrations
  access to policy configuration
- Add loadPolicyBytes helper to load policy from file or DB based on config
- Add standalone GetPolicy(tx *gorm.DB) for use during migrations
- Replace custom tag validation logic with PolicyManager

Benefits:
- Full HuJSON parsing support (not just JSON)
- Proper group expansion via PolicyManager
- Support for nested tags and autogroups
- Works with both file and database policy modes
- Single source of truth for tag validation


Co-Authored-By: Shourya Gautam <shouryamgautam@gmail.com>
2026-01-21 15:10:29 +01:00
..
api_key.go cli: add --id flag to API key expire/delete commands 2026-01-20 17:13:38 +01:00
configtest.go Only load needed part of configuration (#2109) 2024-09-07 09:23:58 +02:00
debug.go all: remove deadcode (#2952) 2025-12-10 15:55:15 +01:00
dump_config.go
generate.go
health.go add health command (#2659) 2025-10-16 12:00:11 +00:00
mockoidc.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
nodes.go gen: regenerate protobuf code 2026-01-14 09:32:46 +01:00
policy.go db: use PolicyManager for RequestTags migration 2026-01-21 15:10:29 +01:00
preauthkeys.go cli: show Owner column in preauthkeys list 2026-01-20 12:53:20 +01:00
pterm_style.go
root_test.go cli: do not show new pre-releases on stable (#2813) 2025-10-24 13:15:53 +02:00
root.go cli: do not show new pre-releases on stable (#2813) 2025-10-24 13:15:53 +02:00
serve.go db: add sqlite "source of truth" schema 2025-07-07 15:48:38 +01:00
users.go cmd: add option to get and set policy directly from database (#2765) 2025-09-12 16:55:15 +02:00
utils.go modernize: run gopls modernize to bring up to 1.25 (#2920) 2025-12-01 19:40:25 +01:00
version.go cli: use gobuild version handling (#2770) 2025-09-12 11:47:31 +02:00