Skip to content

fix(storage): make openelements.storage.s3.region optional - #51

Merged
herbie-bot merged 1 commit into
mainfrom
fix/storage-s3-region-optional
Sep 25, 2026
Merged

herbie-bot merged 1 commit into
mainfrom
fix/storage-s3-region-optional

Conversation

@herbie-bot

Copy link
Copy Markdown
Collaborator

Why

The region belongs to the request signature, not to the address. SigV4 needs some string there, but only AWS derives meaning from it — on AWS it must match the bucket's region, while Hetzner Object Storage and other S3-compatible providers accept whatever is sent and ignore it.

Requiring it made a Hetzner deployment configure a value nobody reads, and failed start-up over its absence.

What changes

openelements.storage.s3.region is now optional, defaulting to us-east-1 — the value S3-compatible providers conventionally accept and ignore. Endpoint, bucket and credentials stay required, and their absence still fails start-up naming the property.

openelements.storage.s3.endpoint=https://fsn1.your-objectstorage.com   # required
openelements.storage.s3.bucket=my-objects                              # required
openelements.storage.s3.access-key=${S3_ACCESS_KEY}                    # required
openelements.storage.s3.secret-key=${S3_SECRET_KEY}                    # required
openelements.storage.s3.region=eu-central-1                            # optional

The default lives in StorageProperties.S3.DEFAULT_REGION and is applied by the binder via @DefaultValue, so the record component stays non-null and Region.of(...) has nothing to guard against.

Tests

Two added: type=s3 without a region starts and resolves to the default; a configured region survives. The incomplete-block test now expects bucket rather than region as the first missing property — which is the behaviour change, stated as an assertion.

93 tests in the module; ./mvnw -Pfull-build clean verify -Dmaven.javadoc.failOnWarnings=true green across all twelve.

README and docs/releases/upgrade-to-1.5.md updated, with the reason spelled out rather than just the flag flipped.

🤖 Generated with Claude Code

The region belongs to the request signature, not to the address. SigV4
needs some string there, but only AWS derives meaning from it: on AWS it
must match the bucket's region, while Hetzner Object Storage and other
S3-compatible providers accept whatever is sent. Requiring it made those
deployments configure a value nobody reads.

It now defaults to us-east-1, the value such providers conventionally
accept and ignore. Endpoint, bucket and credentials stay required.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@herbie-bot
herbie-bot merged commit f3dfcb9 into main Sep 25, 2026
1 check passed
@herbie-bot
herbie-bot deleted the fix/storage-s3-region-optional branch September 25, 2026 08:30
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