-
Notifications
You must be signed in to change notification settings - Fork 166
[reverse proxy] Feature/cluster one click deploy #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e946aa8
Add Hetzner and AWS one-click deploy options to cluster setup modal
mlsmaycon 96d2d8d
Add DigitalOcean one-click deploy option to cluster setup modal
mlsmaycon c925654
Add reverse proxy deployment templates for cloud deploy options
mlsmaycon cbedffc
Point CloudFormation launch URL at S3 bucket and add template sync wo…
mlsmaycon 9ca44ff
Add optional IAM instance profile and compose-based bootstrap to CFN …
mlsmaycon d4b7041
Add optional IAM role creation and move to Ubuntu 26.04 in CFN template
mlsmaycon 4e0490e
Allow Hetzner and DigitalOcean APIs in CSP connect-src for cloud deploy
mlsmaycon b44535d
Add CI test for cloud deploy CSP and template URL
mlsmaycon 6b49636
Use configured gRPC endpoint for proxy management address in cluster …
mlsmaycon 520ac4d
Set and display a root password for DigitalOcean droplet console access
mlsmaycon 7b8509f
Load Hetzner catalog live with availability filtering and add static …
mlsmaycon b3d3a58
Use compose in cloud-init, show DNS records with instance IP, and ver…
mlsmaycon 6ab10f5
Set bootstrap timing expectations and add root password for Hetzner c…
mlsmaycon 3c74b15
Use Hetzner SSH keys instead of password and add registration check t…
mlsmaycon 978d2b3
Cap container log size in deploy compose configurations
mlsmaycon 8340ec2
Adjust and simplify 1-click proxy deployment lables
braginini 8bd9e12
Adjust and simplify 1-click proxy deployment lables
braginini d6fe03f
Improve clusters wording
braginini 29f3ee8
Add Hetzner docs link when adding proxy
braginini 118c9f0
Re-arrange 1-click deployment flow.
braginini 40bf729
Fix rabbit notes
braginini b5c8684
Remove dev ci/cd steps
braginini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Sync deploy templates to S3 | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "templates/reverse-proxy/**" | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| jobs: | ||
| sync: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: aws-actions/configure-aws-credentials@v4 | ||
| with: | ||
| role-to-assume: ${{ secrets.DEPLOY_TEMPLATES_ROLE_ARN }} | ||
| aws-region: eu-central-1 | ||
|
|
||
| - name: Validate CloudFormation template | ||
| run: | | ||
| aws cloudformation validate-template \ | ||
| --template-body file://templates/reverse-proxy/netbird-proxy-cfn.yaml | ||
|
|
||
| - name: Upload CloudFormation template | ||
| run: | | ||
| aws s3 cp templates/reverse-proxy/netbird-proxy-cfn.yaml \ | ||
| s3://netbird-deploy-templates/templates/netbird-proxy-cfn.yaml | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| name: Test cloud deploy config | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "docker/init_react_envs.sh" | ||
| - "templates/reverse-proxy/**" | ||
| - "src/modules/reverse-proxy/clusters/ClusterCloudDeploy.tsx" | ||
| - ".github/workflows/test-cloud-deploy.yml" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| csp-connect-src: | ||
| name: CSP allows cloud provider APIs | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install nginx | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y nginx gettext-base | ||
|
|
||
| - name: Prepare nginx layout expected by the init script | ||
| run: | | ||
| sudo mkdir -p /etc/nginx/http.d /usr/share/nginx/html | ||
| echo 'add_header Content-Security-Policy "placeholder" always;' | sudo tee /etc/nginx/http.d/default.conf | ||
| sudo touch /usr/share/nginx/html/OidcTrustedDomains.js.tmpl | ||
| sudo systemctl start nginx | ||
|
|
||
| - name: Run init script with production-like env | ||
| env: | ||
| AUTH_AUTHORITY: https://auth.example.com | ||
| AUTH_CLIENT_ID: test-client | ||
| AUTH_AUDIENCE: test-audience | ||
| AUTH_SUPPORTED_SCOPES: openid profile email | ||
| USE_AUTH0: "false" | ||
| NETBIRD_MGMT_API_ENDPOINT: https://api.example.com | ||
| run: sudo -E bash docker/init_react_envs.sh | ||
|
|
||
| - name: Assert provider APIs are in connect-src | ||
| run: | | ||
| CSP=$(grep -o 'Content-Security-Policy "[^"]*"' /etc/nginx/http.d/default.conf) | ||
| echo "Generated CSP: $CSP" | ||
| CONNECT_SRC=$(echo "$CSP" | sed 's/.*connect-src \([^;]*\);.*/\1/') | ||
| echo "connect-src: $CONNECT_SRC" | ||
| status=0 | ||
| for origin in https://api.hetzner.cloud https://api.digitalocean.com; do | ||
| if echo "$CONNECT_SRC" | grep -qF "$origin"; then | ||
| echo "OK: $origin" | ||
| else | ||
| echo "MISSING in connect-src: $origin" | ||
| status=1 | ||
| fi | ||
| done | ||
| exit $status | ||
|
|
||
| cfn-template-url: | ||
| name: CloudFormation template URL is live | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Extract template URL from component and check it | ||
| run: | | ||
| URL=$(grep -o 'https://[^"]*netbird-proxy-cfn\.yaml' src/modules/reverse-proxy/clusters/ClusterCloudDeploy.tsx) | ||
| echo "CFN_TEMPLATE_URL: $URL" | ||
| test -n "$URL" | ||
| # Non-blocking: the template is published by sync-deploy-templates on | ||
| # the default branch, so it may not exist yet for a PR that only edits | ||
| # the URL. Warn instead of failing the check. | ||
| if curl -sfI "$URL" >/dev/null; then | ||
| echo "OK: template URL is live" | ||
| else | ||
| echo "::warning::CloudFormation template URL is not reachable yet: $URL" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.