jgraph / drawio

draw.io is a JavaScript, client-side editor for general diagramming.
https://www.drawio.com
Apache License 2.0
39.7k stars 7.43k forks source link

S3 storage support #3109

Open iFrozenPhoenix opened 1 year ago

iFrozenPhoenix commented 1 year ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] Currently it seems not be possible to load a file or save it to S3. So the current way to handle this files is to download them to local and handle them as local files.

Describe the solution you'd like A clear and concise description of what you want to happen. If I start the application I'd like to load a diagram from an S3 bucket. Also I want to save my changes back to the file in the bucket. The solution should not be limited to Amazon S3 but to S3 compatible services, so that also self hosted solutions can be used. The exposed config options should include endpoint, region and force path style.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Downloading the file from the s3 bucket, open it in draw.io as a local file, make changes, save it back to local and uploading it back to s3.

Additional context Add any other context or screenshots about the feature request here.

rickywu commented 1 year ago

Yes, need this function, its very important

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. See the FAQ for more information.

davidjgraph commented 6 months ago

I'm not against this idea, I just don't see the high level picture of how it'd be implemented.

Also, without AWS offering a file picker hosted on their domain, it seems that somewhat excess permissions would be required to navigate folders to find a save place.

I'm interested in any ideas for anyone that's thought about the details of how this would look for a user multi-user implementation. Does anyone use S3 as the default storage for a team or company?

What's the benefit over using locally mapped S3 storage and the desktop version?

rickywu commented 6 months ago

It make sense, some team or company has S3, they don't have gitlab or google drive, use S3 can share with team just with S3 file path as params, no need to share S3 files directly and S3 can be a local infra in a company which no internet access env

davidjgraph commented 6 months ago

Thanks, but that adds none of the information I needed.

href commented 6 months ago

A very simple version of this that would scratch my itch, would not need multi-user support. Just have the ability to set a secret/access key in the backend for a generic S3 provider (not just AWS), and then list the drawings found in the bucket.

I know that's maybe not what others are looking for, but for me, this would basically work like a shared drive. If more permissions are needed, maybe each user in the backend could have separate S3 credentials, and if those credentials work to list drawings, create, delete, and read them, good. If the permissions are lacking, just show an error.

This way a more complex set of permissions could be added by an S3 admin: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html

You can generally create policies for S3 objects and it works with wildcards, so if there's a policy that limits access to /secret-plans/*, then users without the right credentials won't be able to access them.