-
Notifications
You must be signed in to change notification settings - Fork 32
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
How to set s3ForcePathStyle in apostrophe-attachments/uploadfs for Minio #61
Comments
I don't think we currently support this. As I understand it AWS is deprecating path style, although it appears they have pushed that back at least another year or so for various backwards compatibility reasons. So it has never been a priority on our end. But it would make a great community contribution to uploadfs. |
I don't think passing this option on is actually what you need to do though. Where does Wasabi say this is required? |
Hi Tom, Thanks for the time.. Greatly Appreciated.. I think its already in uploadfs s3fs ( snippet below )... I did find this guidance from Minio ( https://docs.min.io/docs/how-to-use-aws-sdk-for-javascript-with-minio-server.html ) - where the s3ForcePathStyle: true is mentioned against the underlying toolkit ( aws-sdk ) node_modules/uploadfs/lib/s3.fs
Form what I can see the apostrophe-attachments sets the options, which are passed through... I just cant see why this underlying option isnt appearing.. I assume setting the options in the app.js is correct. I will keep looking, and happy to propose a change in the apostrophe-attachments if I can find the issue ( although , rfom what I see it SHOULD work ! ) |
I would suggest that you work with the uploadfs repo directly and see if
you can add unit tests for configuring it with this option, and see what
else is going on there. For instance it may be that the real issue is the
way uploadfs automatically constructs the URL and an option *to uploadfs*
is needed, something the s3.js storage module would honor.
…On Fri, Dec 4, 2020 at 9:00 AM viewdeckcloud ***@***.***> wrote:
Hi Tom, Thanks for the time.. Greatly Appreciated..
( The Wasabi Reference was just to show how to configure the s3 engine,
didnt specifically 'swap' to the Path mode... )
I think its already in uploadfs s3fs ( snippet below )... I did find this
guidance from Minio (
https://docs.min.io/docs/how-to-use-aws-sdk-for-javascript-with-minio-server.html
) - where the s3ForcePathStyle: true is mentioned against the underlying
toolkit ( aws-sdk )
node_modules/uploadfs/lib/s3.fs
// this is to support the knox style attribute OR AWS s3ForcePathStyle attribute
if (options.style && (options.style === 'path')) {
options.s3ForcePathStyle = true;
}
pathStyle = !!options.s3ForcePathStyle;
<more stuff>
getUrl: function (path) {
let url;
noProtoEndpoint = endpoint.replace(/^https?:\/\//i, '');
if (pathStyle) {
url = (https ? 'https://' : 'http://') + noProtoEndpoint + '/' + bucket;
} else {
url = (https ? 'https://' : 'http://') + bucket + '.' + noProtoEndpoint;
}
return utils.addPathToUrl(self.options, url, path);
},
Form what I can see the apostrophe-attachments sets the options, which are
passed through... I just cant see why this underlying option isnt
appearing..
I assume setting the options in the app.js is correct.
I will keep looking, and happy to propose a change in the
apostrophe-attachments if I can find the issue ( although , rfom what I see
it SHOULD work ! )
;-)
Best
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#61 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAH27KRMSUVCLZEWXJJF6LSTDTQVANCNFSM4UMRJG3A>
.
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
|
Hi, this is probably a newbie question, but Im struggling to see how to set the
s3ForcePathStyle option in s3.js / uploadfs to get apostrophe-attachments to use {endpoint}/{bucket} format rather than {bucket}.{endpoint} format. ( needed for Minio and Wasabi it seems )
( Following the handy guide in https://wasabi-support.zendesk.com/hc/en-us/articles/360004346871-How-do-I-use-Apostrophe-CMS-with-Wasabi- ) I tried :-
in app.js
Ive also tried the "style" = "path" option , but that doesnt seem to filter down either.
Ive tried the suggestions in https://javascriptio.com/view/2800082/serving-apostrophe-cms-s3-assets-attachments-as-https version, which has the setup in..../lib/modules/apostrophe-attachments/index.js
// in ./lib/modules/apostrophe-attachments/index.js
But alas, none of these have the desired outcome..
Possibly missing something very obvious, but any pointers greatly appreciated...
``
The text was updated successfully, but these errors were encountered: