[PR #728] [MERGED] Report offline peers to agents #12930

Closed
opened 2026-08-05 02:07:02 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/728
Author: @braginini
Created: 3/6/2023
Status: Merged
Merged: 3/7/2023
Merged by: @braginini

Base: mainHead: feature/offline_peers


📝 Commits (6)

  • 9067cf6 Report offline peer to agents
  • 198732e Remove unnecessary len check in offline peers
  • 22f1e24 Make allowedIPs code safer
  • 8b04ec2 Fix lint issues
  • ce32ba4 Fix lint issues
  • 9f5464b Add offline peers proto test

📊 Changes

10 files changed (+353 additions, -162 deletions)

View changed files

📝 client/internal/engine.go (+18 -1)
📝 client/internal/peer/status.go (+13 -1)
📝 management/proto/management.pb.go (+159 -145)
📝 management/proto/management.proto (+6 -3)
📝 management/server/account.go (+7 -4)
📝 management/server/grpcserver.go (+3 -0)
📝 management/server/management_proto_test.go (+15 -4)
📝 management/server/management_test.go (+1 -0)
📝 management/server/network.go (+5 -4)
management/server/testdata/store_with_expired_peers.json (+126 -0)

📄 Description

Describe your changes

The peer login expiration ACL check introduced in https://github.com/netbirdio/netbird/pull/714
filters out peers that are expired and agents receive a network map without that expired peers.
However, the agents should see those peers in status "Disconnected".

This PR extends the Agent <-> Management protocol by introducing a new field OfflinePeers
that contain expired peers. Agents keep track of those and display then just in the Status response.

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 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/netbirdio/netbird/pull/728 **Author:** [@braginini](https://github.com/braginini) **Created:** 3/6/2023 **Status:** ✅ Merged **Merged:** 3/7/2023 **Merged by:** [@braginini](https://github.com/braginini) **Base:** `main` ← **Head:** `feature/offline_peers` --- ### 📝 Commits (6) - [`9067cf6`](https://github.com/netbirdio/netbird/commit/9067cf6990a6ff79ab6b737d5cd66cc1c064fa1b) Report offline peer to agents - [`198732e`](https://github.com/netbirdio/netbird/commit/198732e844615532aaff3dc6b044b8bb8a015464) Remove unnecessary len check in offline peers - [`22f1e24`](https://github.com/netbirdio/netbird/commit/22f1e24ab92b39147afef8d334f20498ad89fa17) Make allowedIPs code safer - [`8b04ec2`](https://github.com/netbirdio/netbird/commit/8b04ec2ca72c85b4091cc0c2c2ed95d65160b5cc) Fix lint issues - [`ce32ba4`](https://github.com/netbirdio/netbird/commit/ce32ba4b3589173f7a4d0951b93162a76f250862) Fix lint issues - [`9f5464b`](https://github.com/netbirdio/netbird/commit/9f5464b98f48daea56c638c4fb6df41aaca9e62c) Add offline peers proto test ### 📊 Changes **10 files changed** (+353 additions, -162 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/engine.go` (+18 -1) 📝 `client/internal/peer/status.go` (+13 -1) 📝 `management/proto/management.pb.go` (+159 -145) 📝 `management/proto/management.proto` (+6 -3) 📝 `management/server/account.go` (+7 -4) 📝 `management/server/grpcserver.go` (+3 -0) 📝 `management/server/management_proto_test.go` (+15 -4) 📝 `management/server/management_test.go` (+1 -0) 📝 `management/server/network.go` (+5 -4) ➕ `management/server/testdata/store_with_expired_peers.json` (+126 -0) </details> ### 📄 Description ## Describe your changes The peer login expiration ACL check introduced in https://github.com/netbirdio/netbird/pull/714 filters out peers that are expired and agents receive a network map without that expired peers. However, the agents should see those peers in status "Disconnected". This PR extends the Agent <-> Management protocol by introducing a new field OfflinePeers that contain expired peers. Agents keep track of those and display then just in the Status response. ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 02:07:02 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#12930