Skip to content

[reverse proxy] Feature/cluster one click deploy#707

Merged
braginini merged 22 commits into
mainfrom
feature/cluster-one-click-deploy
Jul 12, 2026
Merged

[reverse proxy] Feature/cluster one click deploy#707
braginini merged 22 commits into
mainfrom
feature/cluster-one-click-deploy

Conversation

@mlsmaycon

@mlsmaycon mlsmaycon commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Issue ticket number and link

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/__

E2E tests

Optional: override the image tags used by the Playwright e2e workflow.
Defaults to main when omitted.

management-cloud-tag: main
reverse-proxy-tag: main

Summary by CodeRabbit

  • New Features
    • Added one-click reverse-proxy cluster deployment UI with a deployment method selector (Docker/Docker Compose/Kubernetes and Hetzner Cloud/DigitalOcean/AWS).
    • Added cloud deployment flows with provider-specific provisioning and live registration/progress checks, plus DNS guidance for cloud setups.
    • Added AWS CloudFormation and canonical cloud-init templates for reverse-proxy provisioning.
  • Bug Fixes
    • Expanded the outbound connection allowlist for the security policy to include additional cloud/API endpoints.
  • Documentation
    • Added reverse-proxy one-click deployment template documentation.
  • Chores
    • Added automation to sync, validate, and test reverse-proxy deployment template changes via CI workflows.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0b9b5a0e-5c0f-41a9-83ce-a36dfd6fa235

📥 Commits

Reviewing files that changed from the base of the PR and between 40bf729 and b5c8684.

📒 Files selected for processing (2)
  • .github/workflows/sync-deploy-templates.yml
  • .github/workflows/test-cloud-deploy.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/test-cloud-deploy.yml

📝 Walkthrough

Walkthrough

The change adds one-click reverse-proxy deployment through Hetzner, DigitalOcean, and AWS, shared Cloud-init and CloudFormation templates, registration polling, modal integration, CSP updates, CI validation, and updated cluster setup text.

Changes

Reverse-proxy cloud deployment

Layer / File(s) Summary
Provisioning templates and AWS publishing
templates/reverse-proxy/*, .github/workflows/sync-deploy-templates.yml
Adds CloudFormation and Cloud-init definitions, deployment documentation, template validation, and S3 publication.
Shared cloud deployment runtime
src/modules/reverse-proxy/clusters/ClusterCloudDeploy.tsx
Adds provider dispatch, shared provisioning, Hetzner and DigitalOcean deployment, AWS quick-create launch, DNS instructions, and registration polling.
Deployment method and modal flow
src/modules/reverse-proxy/clusters/ClustersModal.tsx
Adds cloud deployment methods, provider rendering, cloud-aware navigation, management URL handling, and registration-gated completion.
Deployment validation and CSP wiring
.github/workflows/test-cloud-deploy.yml, docker/init_react_envs.sh
Adds CI checks for CSP origins and the CloudFormation URL, and expands the CSP connect-src allowlist.
Cluster setup copy
src/app/(dashboard)/reverse-proxy/clusters/page.tsx, src/modules/reverse-proxy/clusters/ClustersTable.tsx
Updates introductory and empty-state text for proxy cluster setup.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ClustersModal
  participant ClusterCloudDeploy
  participant CloudProviderAPI
  participant NetBirdManagementAPI
  User->>ClustersModal: select cloud deployment method
  ClustersModal->>ClusterCloudDeploy: render provider deployment
  ClusterCloudDeploy->>CloudProviderAPI: provision instance or open AWS launch
  CloudProviderAPI-->>ClusterCloudDeploy: return deployment result
  ClusterCloudDeploy->>NetBirdManagementAPI: poll cluster registration
  NetBirdManagementAPI-->>ClusterCloudDeploy: return registered proxy status
  ClusterCloudDeploy-->>ClustersModal: report registration complete
  ClustersModal-->>User: enable Finish Setup
Loading

Poem

I’m a rabbit with a template to share,
Cloud-init carrots floating through air.
Hetzner hops, DigitalOcean gleams,
AWS sails on CloudFormation dreams.
CSP gates open, proxies align—
Registration says, “All paws are fine!”

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is mostly the template and leaves required fields like the issue link, docs choice, and docs PR URL unfilled. Fill in the issue ticket/link, choose a documentation option, and provide the docs PR URL if documentation was added.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change by calling out the reverse-proxy cluster one-click deploy feature, though it is a bit broad.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/cluster-one-click-deploy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@braginini braginini self-requested a review July 12, 2026 11:36
braginini
braginini previously approved these changes Jul 12, 2026
@braginini braginini marked this pull request as ready for review July 12, 2026 11:36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (2)
.github/workflows/test-cloud-deploy.yml (1)

27-27: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Set persist-credentials: false on checkout steps.

By default actions/checkout@v4 persists the GITHUB_TOKEN in .git/config. Although this workflow only requests contents: read, disabling credential persistence is a security best practice that prevents accidental token leakage through artifacts or debug output.

🔒️ Proposed fix
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v4
+        with:
+          persist-credentials: false

Apply the same change to both checkout steps (lines 27 and 72).

Also applies to: 72-72

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-cloud-deploy.yml at line 27, Update both
actions/checkout@v4 steps in the workflow to set persist-credentials to false,
ensuring checkout does not store the GITHUB_TOKEN in the repository
configuration.

Source: Linters/SAST tools

.github/workflows/sync-deploy-templates.yml (1)

5-6: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the dev-only feature branch before merging.

The feature/cluster-one-click-deploy trigger is marked as dev-only. Leaving it would make the workflow push templates to the production S3 bucket from that branch.

Want me to open a tracking issue so this isn't forgotten?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/sync-deploy-templates.yml around lines 5 - 6, Remove
feature/cluster-one-click-deploy from the branches trigger in the
sync-deploy-templates workflow, and delete the associated dev-only TODO comment.
Retain only the main branch trigger so production template deployment cannot run
from the feature branch.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/sync-deploy-templates.yml:
- Line 18: Update the actions/checkout@v4 step in the sync-deploy-templates
workflow to disable credential persistence by configuring persist-credentials as
false, while leaving the existing checkout behavior unchanged.

In @.github/workflows/test-cloud-deploy.yml:
- Line 79: Adjust the cfn-template-url job’s external URL liveness check around
curl so it cannot block pull requests when sync-deploy-templates has not yet
published the template. Make the check non-blocking with a warning, or gate the
job to the default branch while preserving validation where the URL is expected
to exist.
- Around line 11-12: Remove the dev-only feature/cluster-one-click-deploy branch
from the push trigger in the workflow, along with its associated TODO comment,
while preserving any remaining intended workflow triggers and configuration.

In `@src/modules/reverse-proxy/clusters/ClusterCloudDeploy.tsx`:
- Around line 462-495: Normalize hetznerToken once before the Hetzner API
requests by defining a trimmed apiToken, then use apiToken consistently for the
create-server request and the primary-IP update within the surrounding
deployment flow. Replace the raw token usage in the fetch headers and the
existing hetznerToken.trim() usage in the primary-IP call, preserving the
current request behavior.

In `@src/modules/reverse-proxy/clusters/ClustersTable.tsx`:
- Line 204: Update the empty-state message in ClustersTable to use neutral
wording or explicitly mention both self-hosted and cloud deployment options,
while preserving its purpose of guiding users to set up a cluster.

In `@templates/reverse-proxy/netbird-proxy-cfn.yaml`:
- Around line 180-191: Update ProxySecurityGroup and ProxyInstance to support
non-default VPC deployments: define the security group in the selected VPC using
the existing VPC configuration, replace ProxyInstance.SecurityGroups with
SecurityGroupIds, and provide the required SubnetId/VPC parameter wiring.
Preserve the current default behavior where applicable while ensuring accounts
without a default VPC can create the stack.

---

Nitpick comments:
In @.github/workflows/sync-deploy-templates.yml:
- Around line 5-6: Remove feature/cluster-one-click-deploy from the branches
trigger in the sync-deploy-templates workflow, and delete the associated
dev-only TODO comment. Retain only the main branch trigger so production
template deployment cannot run from the feature branch.

In @.github/workflows/test-cloud-deploy.yml:
- Line 27: Update both actions/checkout@v4 steps in the workflow to set
persist-credentials to false, ensuring checkout does not store the GITHUB_TOKEN
in the repository configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dc5725ba-6f0b-4a4b-a911-19b4ee381ab8

📥 Commits

Reviewing files that changed from the base of the PR and between 58d1035 and 118c9f0.

📒 Files selected for processing (10)
  • .github/workflows/sync-deploy-templates.yml
  • .github/workflows/test-cloud-deploy.yml
  • docker/init_react_envs.sh
  • src/app/(dashboard)/reverse-proxy/clusters/page.tsx
  • src/modules/reverse-proxy/clusters/ClusterCloudDeploy.tsx
  • src/modules/reverse-proxy/clusters/ClustersModal.tsx
  • src/modules/reverse-proxy/clusters/ClustersTable.tsx
  • templates/reverse-proxy/README.md
  • templates/reverse-proxy/netbird-proxy-cfn.yaml
  • templates/reverse-proxy/netbird-proxy-cloud-init.yaml

Comment thread .github/workflows/sync-deploy-templates.yml
Comment thread .github/workflows/test-cloud-deploy.yml Outdated
Comment thread .github/workflows/test-cloud-deploy.yml Outdated
Comment thread src/modules/reverse-proxy/clusters/ClusterCloudDeploy.tsx
Comment thread src/modules/reverse-proxy/clusters/ClustersTable.tsx Outdated
Comment thread templates/reverse-proxy/netbird-proxy-cfn.yaml
@braginini braginini self-requested a review July 12, 2026 13:04
@braginini braginini merged commit 8ed69f2 into main Jul 12, 2026
8 of 10 checks passed
@braginini braginini deleted the feature/cluster-one-click-deploy branch July 12, 2026 13:05
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