Use Minio as a Media Source Type

Minio is an awesome, self hosted alternative to S3. The API they provide is supposed to be identical to S3, so I imagine that it would be pretty simple to create a new media source type based on the existing S3 class.

Any idea how to make this work? I’m more than happy to spearhead the development, especially since the existing aws classes are already working.

As far as I know, you should be able to just use the existing S3 media source, changing the URLs as appropriate.

I was thinking that would work too, but it looks like it’s still trying to reach out to S3. I am working on an intranet site that shouldn’t ever reach out to amazon, and when I change the URL to the local address and port i can see in the PHP error response that it’s still trying to reach out to AWS. See the attached screenshot…

If I recall correctly, there was hardcoded s3 url somewhere.

right. so, instead of hacking core, is there a tutorial on creating a different media source type?

I can see in the package management that people have created extensions for Dropbox, Webdav, etc. I think Minio could be an awesome addition to this.

Thanks!

Here is a basic doc on setting up a new media source

https://docs.modx.com/revolution/2.x/administering-your-site/media-sources/adding-a-media-source

AFAIK you just have to get the paths right, no credentials are passed…I guess

Right, I’ve already added a new media source. But, when the type is set to S3, all those AWS URLs are hard coded in the core aws classes. Instead of hacking those, I was thinking of creating a new media source type, not just a new media source.

There’s also a newer S3 integration available as an extra, perhaps that works better with Minio?

2 Likes

ooooooooooh i’ll check that out and give it a shot. if not, at least having that as a boilerplate to work off of should get me going in the right direction.

cheers!

You’ll still need to make a change like I did in this issue to get it working with Digital Ocean Spaces

1 Like