Skip to content

[client] Feature/upload bundle #3734

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 26 commits into from
Apr 28, 2025
Merged

[client] Feature/upload bundle #3734

merged 26 commits into from
Apr 28, 2025

Conversation

mlsmaycon
Copy link
Collaborator

@mlsmaycon mlsmaycon commented Apr 23, 2025

Describe your changes

Add an upload bundle option with the flag --upload-bundle; by default, the upload will use a NetBird address, which can be replaced using the flag --upload-bundle-url.

The upload server is available under the /upload-server path. The release change will push a docker image to netbirdio/upload image repository.

The server supports using s3 with pre-signed URL for direct upload and local file for storing bundles. You can configure them with the following environment variables:

# S3
# bucket to generate pre-signed url
BUCKET
# region needed to generate presigned url
AWS_REGION
# if not using rules or similar:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY

# Local file store

# server URL to build upload URL for client to send data
SERVER_URL
# store directory (defaults to /var/lib/netbird
STORE_DIR

Issue ticket number and link

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)
  • Extended the README / documentation, if necessary

@mlsmaycon mlsmaycon marked this pull request as ready for review April 26, 2025 21:57
@Copilot Copilot AI review requested due to automatic review settings April 26, 2025 21:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the upload functionality by introducing a new bundle upload option along with configurable flags. It adds new endpoints and tests for both S3 and local upload mechanisms and updates the client to support uploading debug bundles.

Reviewed Changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
upload-server/types/upload.go Defines upload-related constants and response struct
upload-server/server/server.go Sets up server, routing, and common upload handling
upload-server/server/s3.go Implements S3 upload URL presigning
upload-server/server/local.go Implements local storage upload handlers and returns appropriate responses
upload-server/server/s3_test.go Adds tests for the S3 upload URL handler
upload-server/server/local_test.go Adds tests for the local upload URL and PUT request handling
client/server/debug_test.go Tests the debug bundle upload functionality
client/server/debug.go Updates debug bundle functionality to include optional upload handling
client/cmd/root.go & debug.go Introduces new CLI flags for upload bundle support and prints additional info
.goreleaser.yaml, CI workflows Adds build and docker configuration for the upload server component
Files not reviewed (2)
  • go.mod: Language not supported
  • upload-server/Dockerfile: Language not supported

Copy link

@mlsmaycon mlsmaycon merged commit 2f44fe2 into main Apr 28, 2025
32 checks passed
@mlsmaycon mlsmaycon deleted the feature/upload-bundle branch April 28, 2025 22:43
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