[PR #7042] [misc] Move enterprise setup to Traefik and harden migration #30111

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/7042
Author: @bcmmbaga
Created: 8/3/2026
Status: 🔄 Open

Base: mainHead: enterprise-traefik-and-migration-fixes


📝 Commits (5)

  • c0dfef2 Use traefik instead of caddy in the enterprise bootstrap
  • 3c64a70 Merge branch 'main' into enterprise-traefik-and-migration-fixes
  • 926d331 Roll the enterprise migration back when it fails
  • 786ecef Back the store up through the container, not by volume name
  • b61785c Address migration review feedback

📊 Changes

2 files changed (+371 additions, -89 deletions)

View changed files

📝 infrastructure_files/getting-started-enterprise.sh (+136 -67)
📝 infrastructure_files/migrate-to-enterprise.sh (+235 -22)

📄 Description

Describe your changes

  • Replaces Caddy with Traefik in getting-started-enterprise.sh, aligning the enterprise setup with the community deployment
  • Converts the existing routes and security headers to Traefik labels and configures trusted proxy support
  • Adds automatic rollback to migrate-to-enterprise.sh so failed migrations restore the original stack, files, and .env
  • Replaces fragile volume-name-based backups with docker cp from the combined container
  • Validates the container, mount, and store data before stopping the deployment
  • Detects stale Postgres volumes from previous migration attempts

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)
  • I ran and tested this change locally — I did not rely on CI to find out whether it works
  • This PR has a single purpose (not a fix + refactor + feature in one)
  • This change is a trivial fix, OR it links an issue the NetBird team agreed on beforehand. Changes to the public API, gRPC protocols, functionality behavior, CLI / service flags, or new features always need that agreement first. See CONTRIBUTING.md.

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

    • Enterprise deployments now use automatic HTTPS certificates, HTTP-to-HTTPS redirects, security headers, and improved support for WebSocket, API, identity, gRPC, and traffic-flow connections.
    • Deployment networking is more consistent and reliable through defined network configuration.
  • Bug Fixes

    • Enterprise migrations now validate data storage before proceeding and provide safer backup and recovery handling.
    • Failed migrations automatically restore the previous deployment state where possible.
    • Migration backups and data transfers are now more reliable, including improved handling of existing storage.

🔄 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/7042 **Author:** [@bcmmbaga](https://github.com/bcmmbaga) **Created:** 8/3/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `enterprise-traefik-and-migration-fixes` --- ### 📝 Commits (5) - [`c0dfef2`](https://github.com/netbirdio/netbird/commit/c0dfef2e7e40d5c586dd07f1b4bf6f6e1556daa9) Use traefik instead of caddy in the enterprise bootstrap - [`3c64a70`](https://github.com/netbirdio/netbird/commit/3c64a70a2b6b21729d5ab8c6d6136f34f2c5f853) Merge branch 'main' into enterprise-traefik-and-migration-fixes - [`926d331`](https://github.com/netbirdio/netbird/commit/926d331f20f25a7a0cea84c586fe9a8f684315a2) Roll the enterprise migration back when it fails - [`786ecef`](https://github.com/netbirdio/netbird/commit/786ecef9a7be53404bb595b885267328477b9475) Back the store up through the container, not by volume name - [`b61785c`](https://github.com/netbirdio/netbird/commit/b61785cd636d9590e1e444d721fd7e185b5c2831) Address migration review feedback ### 📊 Changes **2 files changed** (+371 additions, -89 deletions) <details> <summary>View changed files</summary> 📝 `infrastructure_files/getting-started-enterprise.sh` (+136 -67) 📝 `infrastructure_files/migrate-to-enterprise.sh` (+235 -22) </details> ### 📄 Description ## Describe your changes - Replaces Caddy with Traefik in `getting-started-enterprise.sh`, aligning the enterprise setup with the community deployment - Converts the existing routes and security headers to Traefik labels and configures trusted proxy support - Adds automatic rollback to `migrate-to-enterprise.sh` so failed migrations restore the original stack, files, and .env - Replaces fragile volume-name-based backups with `docker cp` from the combined container - Validates the container, mount, and store data before stopping the deployment - Detects stale Postgres volumes from previous migration attempts ## Issue ticket number and link <!-- Required for anything that changes behavior. Link the issue (or the validated discussion it came from) that the NetBird team already agreed on. See https://github.com/netbirdio/netbird/blob/main/CONTRIBUTING.md#ticket-first-pr-second --> ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] I ran and tested this change locally — I did not rely on CI to find out whether it works - [ ] This PR has a single purpose (not a fix + refactor + feature in one) - [ ] This change is a trivial fix, **OR** it links an issue the NetBird team agreed on beforehand. Changes to the public API, gRPC protocols, functionality behavior, CLI / service flags, or new features always need that agreement first. See [CONTRIBUTING.md](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTING.md#ticket-first-pr-second). > 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** * Enterprise deployments now use automatic HTTPS certificates, HTTP-to-HTTPS redirects, security headers, and improved support for WebSocket, API, identity, gRPC, and traffic-flow connections. * Deployment networking is more consistent and reliable through defined network configuration. * **Bug Fixes** * Enterprise migrations now validate data storage before proceeding and provide safer backup and recovery handling. * Failed migrations automatically restore the previous deployment state where possible. * Migration backups and data transfers are now more reliable, including improved handling of existing storage. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <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 08:10:10 -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#30111