fix(objstore): keep the server-side endpoint on the provider's host

40b178d9a4 rebased all four public_* values onto the consumer's own origin, but only two of them face a browser. public_endpoint is the client endpoint an SDK inside the container dials: funkwhale's AWS_S3_ENDPOINT_URL and decidim's AWS_ENDPOINT. A container has no Tor resolver, so an onion-only consumer would have handed boto3 an address it cannot resolve, turning funkwhale's CERTIFICATE_VERIFY_FAILED into a connect failure.

public_bucket and public_url keep the rebase, since those are the base URLs the browser dials. public_domain keeps the provider host and has no direct consumer.

1e61debad2 established why funkwhale signs against the host it dials: query-string SigV4 binds the Host, so the signing host and the fetch host must be the same string. funkwhale is the only role that sets AWS_QUERYSTRING_AUTH, and it reads public_endpoint, so no rebased consumer signs and the same-origin route cannot produce SignatureDoesNotMatch. Attachment fetches on an onion pick stay failing, which that commit records as the accepted state.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5 committed 2026-10-22 18:28:18 +02:00
1 parent 3a3e9ed2c9
commit c6436924e9
2 files changed
+14 -9

No files matched your search

@@ -353,13 +353,18 @@ class ObjstoreSameOriginProxyTests(unittest.TestCase):
self.assertTrue(out["proxy_required"])
self.assertEqual(out["proxy_prefix"], "/objstore")
self.assertEqual(out["public_domain"], "foo.abcdefghij.onion/objstore")
self.assertEqual(
out["public_url"],
"http://foo.abcdefghij.onion/objstore/foo",
"the browser must dial the page's own origin, never the provider's "
"clearnet host it cannot resolve through Tor",
)
self.assertEqual(
out["public_endpoint"],
"https://api.seaweedfs.s3.example.com",
"a server-side S3 client runs in the container, which has no Tor "
"resolver, so its endpoint must stay on the provider's own host",
)
self.assertEqual(
(out["upstream_domain"], out["upstream_scheme"]),
("api.seaweedfs.s3.example.com", "https"),