Skip to content

feat(s3): allow custom region and addressing style - #1511

Open
Jasowills wants to merge 1 commit into
jitsucom:newjitsufrom
Jasowills:fix/s3-custom-region-addressing
Open

Jasowills wants to merge 1 commit into
jitsucom:newjitsufrom
Jasowills:fix/s3-custom-region-addressing

Conversation

@Jasowills

Copy link
Copy Markdown

Summary / 概述

Fixes #1479. S3 destination was limited to 23 hardcoded regions and always used path-style for custom endpoints, blocking S3-compatible stores (MinIO, Wasabi, etc.) and newer AWS regions. This PR makes region free-text and adds explicit addressing-style control.

What / 变更内容

  • webapps/console/lib/schema/destinations.tsx: region: z.enum(s3Regions)z.string().min(1).default("us-west-1") (keeps s3Regions[0] as default); added s3AddressingStyles = ["auto","virtual-hosted","path"] and addressingStyle: z.enum(...).optional().default("auto")
  • bulker/bulkerlib/implementations/s3.go: added AddressingStyle to S3Config; NewS3 now respects path / virtual-hosted / auto (auto preserves historical endpoint != "" => UsePathStyle=true)

Why / 动机

Issue reports custom regions are impossible via dropdown and S3-compatible clouds need path vs virtual-hosted choice. Current enum blocks legitimate configs.

Test Plan / 测试计划

  • pnpm codegen && pnpm typecheck — pass
  • go vet ./implementations — pass
  • Validated zod schema manually: accepts eu-west-10, custom-region-1, my-minio-region; rejects empty; defaults region=us-west-1, addressingStyle=auto; rejects invalid addressingStyle
  • Pre-existing vitest --project unit 129/130 pass (1 timeout in models-editor.test.ts pre-existing)

Backward Compatibility / 向后兼容

Defaults match previous behavior: existing configs without addressingStyle get auto (path-style when endpoint set, virtual-hosted otherwise); existing 23 regions remain valid as free text.

Related Issue

Fixes #1479

Checklist

  • pnpm codegen && pnpm typecheck pass
  • go vet pass
  • Minimal diff (2 files, 30 lines)

AI-Assisted Disclosure

Per CONTRIBUTING guidelines: I have read every line; tested locally with pnpm codegen/typecheck and go vet; single-topic PR; AI tools used: Muse Spark for drafting. Final review and decisions are mine.

Fixes jitsucom#1479.

- Region was z.enum(s3Regions) (23 hardcoded values) — blocked
  S3-compatible stores and newer AWS regions. Changed to
  z.string().min(1) with default, preserving s3Regions[0] as
  default and keeping existing configs valid.
- Added addressingStyle enum [auto, virtual-hosted, path] (default
  auto) to expose S3 URL addressing control for S3-compatible
  endpoints. Backend respects it in bulker S3 client:
  path/virtual-hosted explicit, auto preserves historical
  behavior (path-style when endpoint set).

Backward compatible: defaults match previous behavior.
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.

Add ability to specify custom region and addressing style for s3

1 participant