-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Adaptor mapping for custom S3 endpoint is incorrect #328
Comments
Relavent code under
It might be a bad idea to use Now, my Minio is behind a reverse proxy. So the backend accesses through I also had problem when I omit regions (which might not be set up in Minio), but this may be a separate issue. |
Are you using both local and s3 at the same time? Regarding the wrong URL issues I'm sure we will need to overhaul the S3 adapter at some point, it's not the first issue reported to us and I'm not sure yet how we can fix it to accommodate all "compatible" S3 services. The workaround in the meantime would be to create a custom adapter, you could copy the S3 adapter code in it and hard-code the values. |
The driver is accurately named What is reported:
I think that we do need a s3 compatible adapter at some point. We also talked about allowing a CDN Url per adapter. As both of these aren't available right now the best solution would be to create your own Adapter in your Flarum install or as an extension by listening to the Collecting event or by extending the Adapter Manager. In this case we should also improve extensibility a bit in a future revision. |
No, but it is under local's setting, so I assumed it affects local adapter only until I saw the code. I am also unsure whether local and S3 can be used simultaneously, because I see that I can set adapter based on MIME type. Certainly there is a use case where different adapters use different CDN url, right...? I am new to S3, so I have to figure out a lot of things myself, so I cannot say for sure what to change, except maybe set URL to I am also new to Flarum and its ecosystem, so I have not looked into how to extending an extension yet. |
I'm a little confused; the config UI contains fields described as such "The following settings are only required when using S3 compatible storage. If you use AWS, you can leave them blank." This obviously implies S3-compatible storage does work, but the comments on this issue suggest otherwise. In my experience, it does indeed work, with the single exception of the bug relating to the URL generation. |
I've had another crack at getting my install to work, and thanks to the code snippet posted above by @rongcuid I tried putting my Backblaze "S3 Url" into FoF Upload's "Local storage settings: Content Delivery URL (prefixes files)" config, and downloading works now! (I don't use local storage, as I'm with FreeFlarum.) In Backblaze:
In the FoF Upload config:
|
In setting up Upload for a self-hosted Minio S3 endpoint, I find the URL mapping is incorrect.
Bug Report
Current Behavior
The adaptor mapping generates URL to amazon AWS, instead of my custom endpoint.
Steps to Reproduce
^image\/.*
,S3/Compatible
,Just URL
flarum
, and regionhome
(which is definitely not an AWS region)localhost:9000
. This is tested to work usingcurl
.Expected Behavior
Generate a URL like
localhost:9000/flarum/path/to/image
Actual Behavior
Generated a URL to AWS
Screenshots
Environment
Possible solution(s)
Use custom endpoint when generating the URL
Additional Context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: