-
-
Notifications
You must be signed in to change notification settings - Fork 775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stream s3 stored background through planka #943
Comments
Hi! Did you mean project backgrounds? I thought it might not make much sense because backgrounds without S3 are also accessible via a link, even without a valid session. If we're talking about attachments and their previews, they're re-streamed through the Planka server, and direct access can be restricted using S3's ACL. |
Yes, talking about the project backgrounds. A solution could be to use S3-presigned URL, the bucket can be fully private while letting Planka grant time-limited access. Moreover, this could be also used for the attachments and their previews, removing the need to stream them and just generating the URL on the fly when permissions are met. (Sidenote: those pre-signed URL can be used to download content but also upload, removing the need to store the content with Planka temporarily) Reference: AWS S3 Documentation |
Using a fully private bucket and re-streaming background images or using presigned URLs both have their downsides: Re-streaming: The main disadvantage is that the Planka server remains involved throughout the download process, which can slow down performance and increase server load. For non-sensitive data such as project backgrounds, re-streaming is unnecessary because direct access is faster and more efficient, especially when session verification isn't needed. Presigned URLs: You can't store presigned URLs in the database, as they are time-limited. This means the server must request S3 to generate a new URL each time an image is accessed. While this approach might reduce server load compared to re-streaming (as you can simply redirect to the new URL), it still adds complexity and extra load, making it less practical than using direct links. When I reviewed the PR and considered secure attachment management, I looked at how other services handle this. Typically, re-streaming is used for attachments to ensure session validation and access control, whereas less sensitive files, such as avatars and backgrounds, are made available via direct links. |
Btw, I also tested S3 integration with MInIO and here is my ACL config (
|
In this way we can work with private s3 storage without using retransmission through the planka server. |
In my opinion, generating presigned URLs and storing them in the database is not a good approach. The first issue is that you always need to store the "token" in the database. For example, if you decide to migrate from storing files locally to S3, you would need to generate a token for each file and save it to the database. The second issue comes if the S3 With the current approach migration to/from S3 is pretty simple, and there is no dependency on the current Please feel free to correct me if I’m wrong. |
The Then, because the urls are signed during the request, you use the available credentials, with a valid time of 10 minutes for example. (no rotation required) |
Got it, so it wasn't about the signed part.
If the server signs a URL when requesting the required static file, does this mean the server would sign the URL and then respond with a redirect to the newly signed URL? I’m a bit unclear on the purpose of this approach. If all files are ultimately publicly accessible but only through the Planka server, wouldn’t it be simpler to set a policy in S3 to allow direct access to If the server signs URLs when responding with JSON data that includes signed URLs, this could create issues since Planka is a single-page application and doesn’t require a full page refresh (e.g., when you switch between already loaded boards, they are not reloaded). After the configured valid time (e.g., 10 minutes), all signed URLs would expire, requiring users to refresh the page to retrieve new URLs. This approach seems impractical for maintaining a seamless user experience. |
Is this a feature for the backend or frontend?
Backend
What would you like?
As for the attachments, could the background assets be re-streamed through the server?
Thanks
Why is this needed?
Remove the need to expose publicly assets.
Other information
No response
The text was updated successfully, but these errors were encountered: