Repository navigation
Three small management changes we carry as patches and would like to upstream: setup-key fields in the API, and a first API token without the dashboard #8623
dlf-dds
started this conversation in
Ideas & Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
goat is an open-source data fabric from the U.S. Army (USAREUR-AF) whose mesh is self-hosted NetBird: code, docs.
In #8607 we said we would ask before opening pull requests. These are the three management-side changes that touch the HTTP API or the management command line. Each is a patch against v0.71.4 in
ops/netbird/patches/, each is off unless used, and each leaves existing behavior unchanged when its field or flag is absent. We deploy by automation and never through the dashboard, and all three exist because of that.1.
auto_peer_nameon a setup keyChange.
POST /api/setup-keysaccepts an optionalauto_peer_name. A peer that enrolls with the key is named<auto_peer_name>-<hostname>. Without the field the name is the hostname, as today.Why. We mint one key per device and want the peer list to show which request each device came from. The label is chosen when the key is minted; the hostname is reported by the device. Keeping both lets an operator match a peer to the request that created its key.
Patch.
auto-peer-name.patch: a field onSetupKey, the create-key handler,openapi.ymland the generated types.2.
user_idon a setup keyChange.
POST /api/setup-keysaccepts an optionaluser_id. A peer that enrolls with the key gets that user as its owner (peer.UserID). It does not mark the peer as added by a user, so login expiration and inactivity expiration behave as they do for any setup-key peer.Why. A peer enrolled with a setup key has no owner. Only interactive sign-in sets one.
Limit we found. The value must be the ID of an existing NetBird user. NetBird checks
peer.UserIDagainst itsuserstable, and an ID from an external identity provider makes the peer's sync fail with "user not found". Our people are not NetBird users, so we do not set this field today; we attribute peers by name and our own registry. We are offering it because the gap it fills is general, and we would like your view on whether the validation or the field should change.Patch.
setupkey-user-id-stamp.patch.3.
service-user bootstrap-tokenChange. A management subcommand that runs against the store with no dashboard and no sign-in:
It creates a service user with an ID derived from the name, or reuses it if it exists, mints a personal access token for it, and prints only the token.
Why. Every scripted API call needs an admin token, and the documented way to get the first one is for a person to create it in the dashboard. That is the one manual step in an otherwise automated installation.
Limit. It needs an account to exist, so the owner's first sign-in still has to happen once.
Patch.
service-user-token-bootstrap.patch.What we have not done
None of the three has been rebased onto current upstream main. Patches 1 and 2 leave out test files; we would write tests as part of a pull request. We have no measurements to report for these; they are changes to what the API accepts.
Questions
A fourth management change, an environment switch to skip schema migrations on replicated PostgreSQL, is already open as #5925 and is covered in a separate post.
All reactions