pineapplelife
New member
Does this plugin support pre-signed urls for media? Would like to potentially shift from Amazon S3 but I need URL/Image security.
Internally it does have the necessary functions to generate the pre-signed URLs so it wouldn’t be terribly hard to implement. Currently it attaches a public domain for WordPress media mainly because then you are able to serve that from Cloudflare’s edge (caching in data centers without needing to even do a read from the bucket).
Since the functions already exist, it wouldn’t be terribly hard to give the option to make the bucket private and media served via presigned URLs. It would end up being slower (and more class-B operations since you wouldn’t be able to leverage the CDN edge cache though).
Just out of curiosity, what’s your particular use-case, are you selling media (don’t want unregistered users able to see them)?
Yes everything is only accessed by way of Wordpress and logged in user accounts.Ya, you’d ideally want to route through something that can’t be cached that in turns generates the pre-signed URLs.
In your particular case, is everything within WordPress (for example are the users trying to access the content logged into WordPress user accounts)?
Are there various permission levels, or is it just a situation where if someone is logged in, they should be able to access via a presigned URL?
Okay. I’ll see what I can whip up…
Honestly there probably isn’t going to be an easy/great way to do it with third-party things that are storing media in different locations. WordPress doesn’t have a generalized abstracted filesystem like some other platforms have. So because of that, to get something to support R2 (even default WordPress media) is coding for that specific thing (and a pain in the ass).
I keep hoping WordPress will add an abstracted filesystem so you would then just need to hook into the filesystem to make everything work, but I’m not holding my breath.
There certainly wouldn’t prevent Buddyboss (or anything else) from leveraging R2 via the plugin, but I’ve not heard of them working on that (they also wouldn’t need to tell us, so it’s possible they do). Do you have a link you could share about it? I could try to look around and see what they have/haven’t done.I thought that I had read that appforcf had some support for Buddyboss...assuming that code for BB related directories had been complete. I'm currently using Media Cloud for Wordpress which supports BB directories but they don't support R2 pre-signed, in addition while the plugin works pretty well it seems like there is very little support for new features as I can't even get someone from Media Cloud to respond to any requests.
So, I have been looking to replace Media Cloud with something having more Cloudflare support.
There certainly wouldn’t prevent Buddyboss (or anything else) from leveraging R2 via the plugin, but I’ve not heard of them working on that (they also wouldn’t need to tell us, so it’s possible they do). Do you have a link you could share about it? I could try to look around and see what they have/haven’t done.
uploads/avatars/ |
uploads/group-avatars/ |
uploads/media |
uploads/bb_medias/ |
uploads/bb_videos/ |
uploads/bb_documents/ |
The way WordPress works internally, there's really not going to be a way to force third-party things to use R2 without explicitly getting into the third-party code to add support.
That would change *if* WordPress designed a better filesystem system, but right now WordPress really only supports the local filesystem internally. For example, if they had an abstracted filesystem that simply defaulted to "local", then you could do drop-in replacements for the filesystem itself. While other platforms do exactly that, it's a bit of a pipe dream for WordPress at this point to be honest (it's internals are so old/antiquated, I doubt we'll see that sort of change anytime soon).
That being said, I'm happy to help third-party devs add R2 support if they want (it would be fairly easy for them since the framework is done, all they need to do is add a couple lines of code to actually use the R2 library).
For at least supporting normal WordPress media with presigned URLs, it's fairly simple... I'm just trying to figure out how to do it and add settings for it in a way that's simple and not confusing for everyone else *not* trying to do presigned URLs. That's the tricky part.
If they are doing it in a way that they are hooking into WordPress actions/filters, it should be able to be done... but if they are doing it on their own, that's a different story. Like if they are trying to replace the WordPress Media system with something different, that's where it becomes more problematic, because now you are trying to keep up with third-party code (and future changes that could make what once work, break).
Have you picked up that I hate the fact that WordPress doesn't use an abstracted filesystem? 😂
Is there something those addons do that the WordPress Media section doesn't? Basically just wondering if there's actually a need to use those custom directories...
Is it an option to move the existing Media Cloud media back into WordPress Media? If they aren’t being responsive to general support, they probably aren’t going to be helpful with trying to add R2 support in their plugin.