[PR #72] [MERGED] Make IP Prefix configurable and available ip deterministic #1238

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/72
Author: @kradalby
Created: 8/2/2021
Status: Merged
Merged: 8/3/2021
Merged by: @juanfont

Base: mainHead: ip-pool


📝 Commits (9)

  • 309f868 Make IP prefix configurable
  • b5841c8 Rework getAvailableIp
  • 9f85eff Update readme
  • 95de823 Add test to ensure we can read back ips
  • eda6e56 debug logging
  • 73207de Check that IP is set before parsing
  • d3349aa Add test to ensure we can deal with empty ips from database
  • ea615e3 Do not issue "network" or "broadcast" addresses (0 or 255)
  • 465669f Merge pull request #1 from kradalby/ip-pool-test

📊 Changes

8 files changed (+227 additions, -42 deletions)

View changed files

📝 README.md (+2 -1)
📝 api.go (+1 -0)
📝 app.go (+2 -0)
📝 app_test.go (+4 -1)
📝 cli_test.go (+1 -0)
📝 cmd/headscale/cli/utils.go (+4 -0)
📝 utils.go (+58 -40)
utils_test.go (+155 -0)

📄 Description

Hi

This PR contains two commits were the first (making ip prefix configurable) one can be cherry picked if the second (rework get available ip) is not desirable.

Please see the individual commit messages for details.

The code has some tests, but real world testing help would be appreciated.

If it is not desirable to change the IP allocation, then I can rework it into an alternative to the original, so users can opt in/out.


🔄 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/72 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 8/2/2021 **Status:** ✅ Merged **Merged:** 8/3/2021 **Merged by:** [@juanfont](https://github.com/juanfont) **Base:** `main` ← **Head:** `ip-pool` --- ### 📝 Commits (9) - [`309f868`](https://github.com/juanfont/headscale/commit/309f868a2113c9cf1ba193f744ff135808829eb0) Make IP prefix configurable - [`b5841c8`](https://github.com/juanfont/headscale/commit/b5841c8a8b088338db8cbda474a85243452c9433) Rework getAvailableIp - [`9f85eff`](https://github.com/juanfont/headscale/commit/9f85efffd5fc2b3d8c9cd7057c8dfab4a691d3c5) Update readme - [`95de823`](https://github.com/juanfont/headscale/commit/95de823b7241eec5ae8d763414d86cab7b1dfcf0) Add test to ensure we can read back ips - [`eda6e56`](https://github.com/juanfont/headscale/commit/eda6e560c369ea39e286cd1d916bc7e369fd7e03) debug logging - [`73207de`](https://github.com/juanfont/headscale/commit/73207decfd13b703370d3ea2b57460111363fa4e) Check that IP is set before parsing - [`d3349aa`](https://github.com/juanfont/headscale/commit/d3349aa4d13fca1ad6ef28424657d8e6219b1aab) Add test to ensure we can deal with empty ips from database - [`ea615e3`](https://github.com/juanfont/headscale/commit/ea615e3a268126ec291e72481f016d3dfd3d7040) Do not issue "network" or "broadcast" addresses (0 or 255) - [`465669f`](https://github.com/juanfont/headscale/commit/465669f650bab293e5062982e1f949965567e117) Merge pull request #1 from kradalby/ip-pool-test ### 📊 Changes **8 files changed** (+227 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+2 -1) 📝 `api.go` (+1 -0) 📝 `app.go` (+2 -0) 📝 `app_test.go` (+4 -1) 📝 `cli_test.go` (+1 -0) 📝 `cmd/headscale/cli/utils.go` (+4 -0) 📝 `utils.go` (+58 -40) ➕ `utils_test.go` (+155 -0) </details> ### 📄 Description Hi This PR contains two commits were the first (making ip prefix configurable) one can be cherry picked if the second (rework get available ip) is not desirable. Please see the individual commit messages for details. The code has some tests, but real world testing help would be appreciated. If it is not desirable to change the IP allocation, then I can rework it into an alternative to the original, so users can opt in/out. --- <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:29:25 +01:00
adam closed this issue 2025-12-29 02:29: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#1238