plane icon indicating copy to clipboard operation
plane copied to clipboard

S3 private buckets feature does not seem to be usable - confusion between s3 endpoints to publish and read

Open squalou opened this issue 10 months ago • 2 comments

Hi,

I hope I'm wrong but I tried to follow documentation for "private s3 storage" found here

https://developers.plane.so/self-hosting/govern/private-bucket

and I tried to implement it. I'm using s3 buckets that block public access at account level. (No choice here, best practice and security and etc..).

observations

Here is what happens when I try to create a project for instance :

  • fill informations
  • click create
  • get an error message "Could not upload image"

plane-api can upload files (and delete) just fine, Ican find the project's image file in the bucket.

Yet, the page cannot read that back, I get a "CORS missing blabla" Error. (even when CORS are filled in s3 configuration)

Thing is, using "s3 web hosting" AND private buckets ( = will all public access blocked) seems not possible, which makes sense.

On the other hand, I tried to change "AWS_S3_ENDPOINT_URL" to other value for a check, and I noticed errors in plane-api logs :

packages/botocore/args.py\", line 138, in get_client_args\n
    endpoint = endpoint_creator.create_endpoint(\n
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
  File \"/usr/local/lib/python3.12/site-packages/botocore/endpoint.py\", line 400, in create_endpoint\n
    raise ValueError(f\"Invalid endpoint: {endpoint_url}\")\nValueError: Invalid endpoint:

which I understand as : plane-api is using boto3 lib for AWS s3 sdk use pointing to the given "AWS_S3_ENDPOINT_URL", that has nothing to do with re resource url served over http.

conclusion

Once again I may be wrong but my understanding is that AWS_S3_ENDPOINT_URL is both used for Files uploads using SDK AND for frontend serving files.

It would be really a solution to separate the two, imagine a AWS_S3_WEBHOST_URL (facultative) that would be used to serve files.

With that, it's then easy to set up a CDN (Cloudfront for instance) in front of the private s3 bucket, and everything should work.

(for the records, I may try to tweak file server config following these ideas https://github.com/makeplane/plane/pull/3278 but I fear I wont go far)

squalou avatar Jan 25 '26 08:01 squalou

Hi! I’d like to work on this issue.

I’ve reviewed the current storage implementation on the preview branch and confirmed that S3 upload/presigned-read URL generation is still coupled to the same AWS_S3_ENDPOINT_URL configuration. I’ll first trace the current private-bucket serving path end-to-end, including how object URLs are returned to the web client, and verify the documented private-bucket configuration against the current implementation.

I’ll keep the change focused on separating the S3 API endpoint used by the backend from the public/web-serving endpoint only where the existing architecture requires it, with regression coverage for private S3-compatible storage. I’ll avoid unrelated storage changes.

faizansaiyed123 avatar Oct 08 '26 09:10 faizansaiyed123

Hi! I’d like to work on this issue.

Thanks for looking into this! I'm not sure why it isn't mentioned here, but PR #9114 fixes this issue, and its solution is good enough that I don't think another fix is needed.

ch4og avatar Oct 08 '26 10:10 ch4og