Skip to content

Conversation

@ProjectInitiative
Copy link

feat(client): Pass setup key to service run command

No idea if this correctly solves or addresses #4352 but it did work when I tested it.

The netbird service run command did not correctly handle the --setup-key or
--setup-key-file flags. This was because the setup key was not being passed to the service
when it was started.

This commit fixes the issue by:

  • Passing the setup key from the service run command to the server instance.
  • Ensuring the getSetupKey function is called to read the key from a file if provided.
  • Passing the setup key through the connection client to the login function.
  • Updating all calls to NewConnectClient to include the setup key.

With this change, the netbird service run command now correctly uses the setup key to register
the peer.

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)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Fixes expected behavior

 feat(client): Pass setup key to service run command

 The `netbird service run` command did not correctly handle the `--setup-key` or
 `--setup-key-file` flags. This was because the setup key was not being passed to the service
 when it was started.

 This commit fixes the issue by:
 - Passing the setup key from the `service run` command to the server instance.
 - Ensuring the `getSetupKey` function is called to read the key from a file if provided.
 - Passing the setup key through the connection client to the login function.
 - Updating all calls to `NewConnectClient` to include the setup key.

With this change, the `netbird service run` command now correctly uses the setup key to register
  the peer.
@CLAassistant
Copy link

CLAassistant commented Aug 15, 2025

CLA assistant check
All committers have signed the CLA.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants