[PR #608] [MERGED] Cleanup the configuration loading #1522

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/608
Author: @kradalby
Created: 6/3/2022
Status: Merged
Merged: 6/5/2022
Merged by: @kradalby

Base: mainHead: config-rework


📝 Commits (10+)

  • 533ecee Move config struct to its own file
  • 35722cd Move FilePerm function from cli to headscale
  • 1ea8bb7 Move all read config logic to config.go
  • 5514a86 Update headscale read config tests
  • aee8aa1 Move TLS config into its own struct
  • 24c9530 Add loglevel and disable update to config struct
  • c3db5ed Merge remote-tracking branch 'upstream/main' into config-rework
  • af89180 Make get config load the config, use config in main method
  • 78ed610 Switch config to pointer
  • 90f6be0 Rename one char var

📊 Changes

9 files changed (+562 additions, -512 deletions)

View changed files

📝 app.go (+11 -100)
📝 app_test.go (+1 -1)
📝 cmd/headscale/cli/server.go (+2 -2)
📝 cmd/headscale/cli/utils.go (+11 -386)
📝 cmd/headscale/headscale.go (+5 -10)
📝 cmd/headscale/headscale_test.go (+7 -7)
config.go (+504 -0)
📝 machine_test.go (+6 -6)
📝 utils.go (+15 -0)

📄 Description

This PR cleans up and factors the config handling into its own file. The ultimate goal is to help us achieve a state were we can load the config with SIGHUP.

This PR does not allow us to reload config on SIGHUP, but it streamlines the loading a bit.

  • read the CONTRIBUTING guidelines
  • 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/608 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 6/3/2022 **Status:** ✅ Merged **Merged:** 6/5/2022 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `config-rework` --- ### 📝 Commits (10+) - [`533ecee`](https://github.com/juanfont/headscale/commit/533ecee2522739f38ec0df5a627483ed45c73805) Move config struct to its own file - [`35722cd`](https://github.com/juanfont/headscale/commit/35722cd5aabbb270d2545e8ce16874cfab5b1388) Move FilePerm function from cli to headscale - [`1ea8bb7`](https://github.com/juanfont/headscale/commit/1ea8bb782c4854fae4aab44d46ce6f9e4fc0e348) Move all read config logic to config.go - [`5514a86`](https://github.com/juanfont/headscale/commit/5514a862dccbc8145216abed642ea34301259b16) Update headscale read config tests - [`aee8aa1`](https://github.com/juanfont/headscale/commit/aee8aa1c61b727865e682a07417466cf92e0629e) Move TLS config into its own struct - [`24c9530`](https://github.com/juanfont/headscale/commit/24c9530eee4e730856a5ed987f1bf2e448224247) Add loglevel and disable update to config struct - [`c3db5ed`](https://github.com/juanfont/headscale/commit/c3db5ed74907329911d923458c6e5f702cf6e2df) Merge remote-tracking branch 'upstream/main' into config-rework - [`af89180`](https://github.com/juanfont/headscale/commit/af891808f6451f3cdbd3ed3a88f7d4b76852f08e) Make get config load the config, use config in main method - [`78ed610`](https://github.com/juanfont/headscale/commit/78ed610b50fa85cb1201d78624c3c5e6b7620f84) Switch config to pointer - [`90f6be0`](https://github.com/juanfont/headscale/commit/90f6be0c98584eb7b9be7662d43d0d4413db5191) Rename one char var ### 📊 Changes **9 files changed** (+562 additions, -512 deletions) <details> <summary>View changed files</summary> 📝 `app.go` (+11 -100) 📝 `app_test.go` (+1 -1) 📝 `cmd/headscale/cli/server.go` (+2 -2) 📝 `cmd/headscale/cli/utils.go` (+11 -386) 📝 `cmd/headscale/headscale.go` (+5 -10) 📝 `cmd/headscale/headscale_test.go` (+7 -7) ➕ `config.go` (+504 -0) 📝 `machine_test.go` (+6 -6) 📝 `utils.go` (+15 -0) </details> ### 📄 Description This PR cleans up and factors the config handling into its own file. The ultimate goal is to help us achieve a state were we can load the config with SIGHUP. This PR does _not_ allow us to reload config on SIGHUP, but it streamlines the loading a bit. <!-- Please tick if the following things apply. You… --> - [x] read the [CONTRIBUTING guidelines](README.md#contributing) - [x] raised a GitHub issue or discussed it on the projects chat beforehand - [x] added unit tests - [x] added integration tests - [x] updated documentation if needed - [x] updated CHANGELOG.md <!-- 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:25 +01:00
adam closed this issue 2025-12-29 02:30:25 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1522