Skip to content

feat: enhance S3 storage and improve Tailscale ACL sync#19

Merged
jaxxstorm merged 1 commit intomainfrom
s3_implementation
Jan 22, 2025
Merged

feat: enhance S3 storage and improve Tailscale ACL sync#19
jaxxstorm merged 1 commit intomainfrom
s3_implementation

Conversation

@jaxxstorm
Copy link
Copy Markdown
Member

@jaxxstorm jaxxstorm commented Jan 22, 2025

Important

Enhance S3 storage configuration, improve logging, and refine Tailscale ACL synchronization handling.

  • S3 Storage Enhancements:
    • Added S3Endpoint and S3Region flags in CLI struct in main.go for custom S3 configurations.
    • Updated InitializeS3Client in state.go to handle custom S3 endpoints and regions, and to log parsed S3 configurations.
    • Modified saveToStorage and loadFromS3 in state.go to use ObjectKey for S3 operations.
  • Logging Improvements:
    • Enhanced logging in state.go for S3 operations, including warnings for unrecognized storage configurations.
    • Improved debug logging in main.go for state changes and Tailscale operations.
  • Tailscale ACL Sync:
    • Refactored Start and Push functions in sync.go to ensure proper logging and error handling during ACL synchronization.
    • Removed id fields from ACL JSON in sync.go using removeIDFields function.

This description was created by Ellipsis for 98fea56. It will automatically update as commits are pushed.

@ellipsis-dev ellipsis-dev bot changed the title ... feat: enhance S3 storage and improve Tailscale ACL sync Jan 22, 2025
@jaxxstorm jaxxstorm merged commit 2dba4de into main Jan 22, 2025
@jaxxstorm jaxxstorm deleted the s3_implementation branch January 22, 2025 19:10
Copy link
Copy Markdown

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 98fea56 in 2 minutes and 0 seconds

More details
  • Looked at 428 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. pkg/common/state.go:255
  • Draft comment:
return nil, "", "", fmt.Errorf("storage URL must begin with s3://, got %q", storageURL)
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The error message in InitializeS3Client when the storage URL does not start with s3:// is clear and provides the expected format, which is good for debugging.
2. main.go:121
  • Draft comment:
logger.Fatal("Invalid storage scheme. Must be file:// or s3://")
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The code in main.go sets up the S3 client and checks for valid storage schemes. It correctly handles the initialization of the S3 client and logs errors if the initialization fails. The logic for checking the storage scheme is clear and ensures that only valid schemes are used.
3. pkg/sync/sync.go:99
  • Draft comment:
delete(val, "id")
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The function removeIDFields is designed to recursively remove "id" fields from a map. It correctly handles different types of data structures, such as arrays and maps, and returns the modified object. The logic is clear and concise.

Workflow ID: wflow_TbMn83mnzEBapbvU


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

return nil, "", "", fmt.Errorf("storage URL must begin with s3://, got %q", storageURL)
}

logger.With(zap.String("region", s3Region), zap.String("s3Endpoint", s3Region)).Sugar().Info("Parsed S3 config")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
logger.With(zap.String("region", s3Region), zap.String("s3Endpoint", s3Region)).Sugar().Info("Parsed S3 config")
logger.With(zap.String("region", s3Region), zap.String("s3Endpoint", s3Endpoint)).Sugar().Info("Parsed S3 config")

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.

1 participant