What happened?
Summary
When AFFiNE storage is configured with provider: "cloudflare-r2", a custom config.endpoint is ignored.
The provider always uses https://<accountId>.r2.cloudflarestorage.com, which breaks uploads for jurisdictional buckets (for example EU) that require a jurisdiction endpoint like https://<accountId>.eu.r2.cloudflarestorage.com.
Current behavior
With config like:
{
"provider": "cloudflare-r2",
"bucket": "affine",
"config": {
"accountId": "<account-id>",
"endpoint": "https://<account-id>.eu.r2.cloudflarestorage.com",
"region": "auto",
"credentials": {
"accessKeyId": "...",
"secretAccessKey": "..."
}
}
}
AFFiNE still signs/sends requests to the global endpoint and uploads fail with 403 AccessDenied for EU jurisdiction buckets.
Expected behavior
If config.endpoint is provided for cloudflare-r2, AFFiNE should use it (while keeping path-style addressing).
Fallback to https://<accountId>.r2.cloudflarestorage.com only when endpoint is not set.
References
Distribution version
macOS x64 (Intel)
App Version
No response
What browsers are you seeing the problem on if you're using web version?
No response
Are you self-hosting?
Self-hosting Version
v0.26.6
Relevant log output
Anything else?
No response
Is your content generated by AI?
What happened?
Summary
When AFFiNE storage is configured with
provider: "cloudflare-r2", a customconfig.endpointis ignored.The provider always uses
https://<accountId>.r2.cloudflarestorage.com, which breaks uploads for jurisdictional buckets (for example EU) that require a jurisdiction endpoint likehttps://<accountId>.eu.r2.cloudflarestorage.com.Current behavior
With config like:
{ "provider": "cloudflare-r2", "bucket": "affine", "config": { "accountId": "<account-id>", "endpoint": "https://<account-id>.eu.r2.cloudflarestorage.com", "region": "auto", "credentials": { "accessKeyId": "...", "secretAccessKey": "..." } } }AFFiNE still signs/sends requests to the global endpoint and uploads fail with
403 AccessDeniedfor EU jurisdiction buckets.Expected behavior
If
config.endpointis provided forcloudflare-r2, AFFiNE should use it (while keeping path-style addressing).Fallback to
https://<accountId>.r2.cloudflarestorage.comonly whenendpointis not set.References
Distribution version
macOS x64 (Intel)
App Version
No response
What browsers are you seeing the problem on if you're using web version?
No response
Are you self-hosting?
Self-hosting Version
v0.26.6
Relevant log output
Anything else?
No response
Is your content generated by AI?