S3 Uploader doesn't support namespaced buckets
Namespaced buckets are a feature provided by CEPH storage. I don't know if anyone else does this. It's a nice feature that allows you to generate API keys for the S3 storage but contain them in a namespace. The issue is that this breaks the public_endpoint
URL generation because there's no way to indicate the namespace.
e.g.,
config :pleroma, Pleroma.Uploaders.S3,
bucket: "foobar",
public_endpoint: "http://internal-server.com:6780/"
config :ex_aws, :s3,
access_key_id: "MYSECUREK3Y",
secret_access_key: "SUPER_SECRET_ACCESS_KEY",
host: "internal-server.com",
port: "6780",
scheme: "http://"
if your bucket is foobar
but your namespace is pleroma
, the uploads will work fine because the backend knows the key goes to a namespace but the public_endpoint
URL is wrong
Instead of http://internal-server.com:6780/foobar/file.jpeg
the URL should be http://internal-server.com:6780/pleroma:foobar/file.jpeg
The only sane way to fix this that I can see is to remove the appending of the bucket name to the public_endpoint
URL and require people to give the full path to the bucket like so:
config :pleroma, Pleroma.Uploaders.S3,
bucket: "foobar",
public_endpoint: "http://internal-server.com:6780/pleroma:foobar/"
This change is simple and easy, but breaks all existing S3 bucket users' setups when they upgrade if they don't know to fix this one config line. Adding support for namespace logic into the config and the code seems to me like it would be needlessly complex.
What to do?