[PR #5412] [client] reuse logic in both up and login - login now respects env + persist config #22972

Open
opened 2026-08-05 06:06:38 -04:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/5412

State: closed
Merged: No


Describe your changes

Reopening because my previous PR was closed, because a new PR was merged, which doesn't resolve the issue I initially had. These changes still apply cleanly on top of the other PR :)

I've moved a bunch of logic from up, into login, and then reused it for both commands.

  • Moved logic from up.go into login.go (reason for using login.go, was that up.go seemed to rely heavily on it anyways)
  • Moved flags from root.go into up.go, unsure why they were placed there
  • login will now respect env
  • login will now save the configuration

Discussed it on Slack https://netbirdio.slack.com/archives/C02KHAE8VLZ/p1770216154715019

Previous PR https://github.com/netbirdio/netbird/pull/5263

Stack

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)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Summary by CodeRabbit

  • New Features

    • Daemon-aware login that auto-selects foreground vs. daemon mode.
    • New up command flags for interface blacklist, external IP mapping, DNS resolver, Rosenpass, auto-connect and lazy-connection behavior.
  • Changes

    • Unified config input for login and up flows; simplified daemon interactions.
    • CLI flags reorganized (some flags removed from root and surfaced/changed on up).
    • Deprecation warning when using --config with the service.
    • Updated success message: "Logged in successfully".

Review Change Stack

**Original Pull Request:** https://github.com/netbirdio/netbird/pull/5412 **State:** closed **Merged:** No --- ## Describe your changes Reopening because my previous PR was closed, because a new PR was merged, which doesn't resolve the issue I initially had. These changes still apply cleanly on top of the other PR :) I've moved a bunch of logic from up, into login, and then reused it for both commands. - Moved logic from up.go into login.go (reason for using login.go, was that up.go seemed to rely heavily on it anyways) - Moved flags from root.go into up.go, unsure why they were placed there - login will now respect env - login will now save the configuration ## Issue ticket number and link Discussed it on Slack https://netbirdio.slack.com/archives/C02KHAE8VLZ/p1770216154715019 Previous PR https://github.com/netbirdio/netbird/pull/5263 ## Stack <!-- branch-stack --> ### Checklist - [x] 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](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/__ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Daemon-aware login that auto-selects foreground vs. daemon mode. * New up command flags for interface blacklist, external IP mapping, DNS resolver, Rosenpass, auto-connect and lazy-connection behavior. * **Changes** * Unified config input for login and up flows; simplified daemon interactions. * CLI flags reorganized (some flags removed from root and surfaced/changed on up). * Deprecation warning when using --config with the service. * Updated success message: "Logged in successfully". <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/netbirdio/netbird/pull/5412) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
saavagebueno added the pull-request label 2026-08-05 06:06:38 -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#22972