Skip to content

FaeyUmbrea/S3-Path-URL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this module

This module allows for use of S3 Storage where the API Url and the Public URL don't match.

Why?

A lot of people, myself included, have bought budget object storage with an alternative provider, only to realize that their provider of choice does not support the format that foundry wants from us.

How?

Foundry only ever actually touches the S3 API when you upload stuff or when you request a directory's item list. As such, the backend actually never handles your S3 Object Storage after you leave the FilePicker. This allows a frontend module to take whatever URL the backend gives us and transform it into the correct format.

S3 Custom URL patches the two FilePicker methods that interact with the Backend generated URLs using libWrapper and modifies the URL to fit the configured scheme automagically. It also provides the method S3CustomURL.createS3URL which takes the bucket and the filepath and spits out the URL for you. This is mainly so modules can make use of it.

Ok now how do I use this?

Simple, there really is only 2 1 use cases this module covers (3 2 if you count all features disabled)

1) I want Path Style URLs (most of you, probably)

This is built into foundry now! Set "forcePathStyle" in S3.json and you're good. You can uninstall the module.

If your urls look like this: "http(s)://[url of endpoint]/[bucket]/[path to file]

Then all you have to do is tick the "Path Style" checkbox in the Settings and leave the other one unchecked.

This is actually the default, so you can just install the module and are good to go!

2) My Provider does something wierd

If your urls don't look like anything like the stuff Amazon would give you, you can check the "Custom Style" checkbox in settings and enter whatever unique prefix for the bucket your provider expects. Please be advised that ALL URLs generated by this module will be modified for whatever you enter here, so you won't be able to change the bucket anymore. URLs from other buckets still work by just pasting them into the file pickers text-box.

Compatibility

Tested Modules:

  • D&D Beyond Importer: Fully works! Including munching to S3
  • Moulinette: Fully supported for file upload and link generation

Feel free to let me know if there are any issues!

About

A Foundry Module that will magically make Path Style URLs work!

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published