Skip to content
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

Aws endpoint #13

Open
wants to merge 2 commits into
base: 5.x
Choose a base branch
from

Conversation

StrangeAnimals
Copy link

Minor change to support custom endpoints from the Fortrabbit Object Storage plugin.

We utilise Minio Object Storage for local development environments, with AWS S3 handling our production environments. We utilise the Fortrabbit Object Storage plugin to wrap the Craft AWS plugin, as this allows defining custom server endpoints for S3-alike Object Storage services.

This update simple checks to see if the FileSystem record is a Fortrabbit Fs class, and if so, passing through the defined endpoint value to the AWS S3Client, else passes NULL. The AWS S3Client class handles the endpoint as having a default value of null if not supplied.

@kennethormandy
Copy link
Owner

Thanks for this. To make sure I’m understanding this correctly:

So, the null fallback is what enables Minio support, because there is no endpoint in that scenario. Is that correct? Are you using Minio with DDEV?

We utilise the Fortrabbit Object Storage plugin to wrap the Craft AWS plugin, as this allows defining custom server endpoints for S3-alike Object Storage services.

I’ve wondered if it would be better to use the S3 client from the Craft AWS plugin / volume instead. I haven’t used the Fortrabbit plugin, but I wonder if that would be another way to resolve this for you? What do you think?

@StrangeAnimals
Copy link
Author

Apologies for the slow response, been under the pump a bit :)

So, the null fallback is what enables Minio support, because there is no endpoint in that scenario. Is that correct?

Passing null as the value is the default for the AWS S3 php lib, and will utilise the default endpoints for AWS via its internal logic. Passing a value instead of null for the endpoint instructs AWS S3 lib to connect to the specified endpoint instead of the default

Are you using Minio with DDEV?

Yep. In our setup, Minio is running within the DDEV environment as part of the web container, however this is not reliant on our particular setup of Minio existing in this specific configuration.

I’ve wondered if it would be better to use the S3 client from the Craft AWS plugin / volume instead. I haven’t used the Fortrabbit plugin, but I wonder if that would be another way to resolve this for you? What do you think?

The AWS plugin itself unfortunately does not provide any means to override the server addresses, which is where Fortrabbits plugin comes into play. I could make a corresponding request/PR to the AWS plugin to add the required fields, but I am not sure Amazon would care about non-AWS environments :)

Apologies if I have missed any detail - it is my first Github PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants