[PR #1492] [MERGED] Codereorg: Part 5, state #2149

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/1492
Author: @kradalby
Created: 6/21/2023
Status: Merged
Merged: 9/19/2023
Merged by: @kradalby

Base: mainHead: codereorg-p5-state


📝 Commits (10+)

  • a885e1f format with prettier 3.0
  • 2f7cbc8 Replace the timestamp based state system
  • 47a75db Split up MapResponse
  • a52db30 Add missing return in shutdown
  • 8e973f4 add script to run integration tests
  • b6593dc rearrange channel closing defers
  • 3b8c4c9 add annoying linter to golangci
  • 809db0c add less/jq to hs debug container
  • 1013e5f add debug option to save all map responses
  • 3ee0179 disable online map by default for now

📊 Changes

50 files changed (+1634 additions, -1415 deletions)

View changed files

📝 .gitignore (+1 -0)
📝 .golangci.yaml (+2 -0)
📝 Dockerfile (+2 -2)
📝 Dockerfile.debug (+4 -0)
📝 cmd/headscale/cli/root.go (+1 -1)
📝 cmd/headscale/cli/utils.go (+3 -3)
📝 flake.lock (+3 -3)
📝 flake.nix (+1 -1)
📝 go.mod (+1 -1)
📝 go.sum (+2 -2)
📝 hscontrol/app.go (+35 -93)
📝 hscontrol/auth.go (+8 -5)
📝 hscontrol/auth_noise.go (+1 -0)
📝 hscontrol/db/addresses_test.go (+0 -6)
📝 hscontrol/db/api_key.go (+21 -0)
📝 hscontrol/db/api_key_test.go (+0 -8)
📝 hscontrol/db/db.go (+9 -10)
📝 hscontrol/db/machine.go (+232 -121)
📝 hscontrol/db/machine_test.go (+5 -60)
📝 hscontrol/db/preauth_keys.go (+35 -2)

...and 30 more files

📄 Description

This PR reworks the state management in headscale, instead of relying on timestamps and frequent checking, and sending the entire world every time, we now send incremental updates based on the change that has happened.

Closes #1390
Fixes #1461


🔄 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/1492 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 6/21/2023 **Status:** ✅ Merged **Merged:** 9/19/2023 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `codereorg-p5-state` --- ### 📝 Commits (10+) - [`a885e1f`](https://github.com/juanfont/headscale/commit/a885e1f23dd6f8a438a90a556896ae4559568ea8) format with prettier 3.0 - [`2f7cbc8`](https://github.com/juanfont/headscale/commit/2f7cbc813018c354f79eb02b2c2bddbc9af4bb34) Replace the timestamp based state system - [`47a75db`](https://github.com/juanfont/headscale/commit/47a75db1e0b9b81f3184b3f8dc5997c2412f13fc) Split up MapResponse - [`a52db30`](https://github.com/juanfont/headscale/commit/a52db30a9727cc461cbe7964ee632501516f4409) Add missing return in shutdown - [`8e973f4`](https://github.com/juanfont/headscale/commit/8e973f46af0a34887710eb3948423d5ea47aa8a0) add script to run integration tests - [`b6593dc`](https://github.com/juanfont/headscale/commit/b6593dc7a2828c35f2d683454a6d3510ce6ea248) rearrange channel closing defers - [`3b8c4c9`](https://github.com/juanfont/headscale/commit/3b8c4c9a7732264586430efcc8e202c540fb08f1) add annoying linter to golangci - [`809db0c`](https://github.com/juanfont/headscale/commit/809db0c916e01fe6055522813353071423123bbb) add less/jq to hs debug container - [`1013e5f`](https://github.com/juanfont/headscale/commit/1013e5ff70a45d4f09f053c57c7ab3a2e5170bf4) add debug option to save all map responses - [`3ee0179`](https://github.com/juanfont/headscale/commit/3ee017978f179c151eeb61be1ec0089a7eff5a07) disable online map by default for now ### 📊 Changes **50 files changed** (+1634 additions, -1415 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) 📝 `.golangci.yaml` (+2 -0) 📝 `Dockerfile` (+2 -2) 📝 `Dockerfile.debug` (+4 -0) 📝 `cmd/headscale/cli/root.go` (+1 -1) 📝 `cmd/headscale/cli/utils.go` (+3 -3) 📝 `flake.lock` (+3 -3) 📝 `flake.nix` (+1 -1) 📝 `go.mod` (+1 -1) 📝 `go.sum` (+2 -2) 📝 `hscontrol/app.go` (+35 -93) 📝 `hscontrol/auth.go` (+8 -5) 📝 `hscontrol/auth_noise.go` (+1 -0) 📝 `hscontrol/db/addresses_test.go` (+0 -6) 📝 `hscontrol/db/api_key.go` (+21 -0) 📝 `hscontrol/db/api_key_test.go` (+0 -8) 📝 `hscontrol/db/db.go` (+9 -10) 📝 `hscontrol/db/machine.go` (+232 -121) 📝 `hscontrol/db/machine_test.go` (+5 -60) 📝 `hscontrol/db/preauth_keys.go` (+35 -2) _...and 30 more files_ </details> ### 📄 Description This PR reworks the state management in headscale, instead of relying on timestamps and frequent checking, and sending the entire world every time, we now send incremental updates based on the change that has happened. Closes #1390 Fixes #1461 --- <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 03:19:58 +01:00
adam closed this issue 2025-12-29 03:19:59 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2149