[DigitalPoint] App for Cloudflare®

[DigitalPoint] App for Cloudflare® 1.7.2.1

No permission to download
We'll keep an eye on it, I think it pops up from time to time. Thanks for your replies.
I can confirm now we are getting this error once a day.

Error: Call to a member function getBody() on array src/addons/DigitalPoint/Cloudflare/Traits/XF.php:146
Generated by: Unknown account May 16, 2023 at 23:10
 
Last edited:
Is it consistently always once? At the same time? I could be some sort of automated process doing something with the server's network connection... maybe a DHCP lease renewing, switch being reboot on a schedule, etc... if it's always about the same time of day, I'd say it's probably something scheduled happening.
 
Is it consistently always once? At the same time? I could be some sort of automated process doing something with the server's network connection... maybe a DHCP lease renewing, switch being reboot on a schedule, etc... if it's always about the same time of day, I'd say it's probably something scheduled happening.
The time is different, but it seems like there is a pattern. They always happen at 10 past X hour.

Error: Call to a member function getBody() on array src/addons/DigitalPoint/Cloudflare/Traits/XF.php:146
Generated by: Unknown account May 14, 2023 at 18:10
Error: Call to a member function getBody() on array src/addons/DigitalPoint/Cloudflare/Traits/XF.php:146
Generated by: Unknown account May 18, 2023 at 06:10
Error: Call to a member function getBody() on array src/addons/DigitalPoint/Cloudflare/Traits/XF.php:146
Generated by: Unknown account May 19, 2023 at 14:10
Error: Call to a member function getBody() on array src/addons/DigitalPoint/Cloudflare/Traits/XF.php:146
Generated by: Unknown account May 19, 2023 at 16:10
 
Maybe check if your server is getting its IP address(es) via DHCP… maybe it’s on a short 2 hour lease or something. DHCP sucks for servers because you effectively disable the network for a brief time while it renews.

But being on some sort of hourly schedule does point to something scheduled going on with your server or data center/network. Not just random fails once in awhile.
 
Feature Suggestion: At /admin.php?cloudflare/r2 have an option to make all (or per bucket) R2 storage read only.

This would be good to utilise in test/UAT installations so that you can still have attachments etc. shown, but no ability - by accident or naivety - to inadvertently remove/replace production items, or add orphaned (unused in production) items to R2.
 
Wouldn’t that be something that isn’t necessarily related to R2 and more be a feature request for XenForo as a whole? Seems like the better place to do that would be in the abstracted file system rather than try to do it for one possible/specific file system that XenForo can use.

I mean it wouldn’t be hard to do, but the place to do it isn’t in one file system, but the abstracted system. Maybe there’s already an addon that does it?
 
Well, you could just make a new Cloudflare token and instead of Account: Workers R2 Storage: Edit, set it to Account: Workers R2 Storage: Read.

Then it's handled upstream... no changes needed and no need to make sure you figured out every place to manually do checks.
 
@digitalpoint what could be better? CF guest caching or Litespeed cache addon? I think CF given the case guest traffic won't reach the server
I don’t use Litespeed cache, so maybe it has some benefit I’m not aware of. But seems to me if your server isn’t being touched for the cached requests (not even a server-side cache) and the caches are being stored physically close to users in ~300 data centers, that’s good. 🤷🏻‍♂️

Other question: what's the risk associated to enabling guest caching using your addon? I'm not sure what risks you could be referring to..
Ya, not it sure either. Do you have a link to whatever risks you are talking about?
 
@digitalpoint guest caching in the addon is affecting a Wordpress site at the root. Why don't I see the rules set by the addon when I enable guest caching in your addon? Are the changes applied 'to the fly' and not being set up at CloudFlare as static settings?
 
There is a Cache Rule it adds, however a big part of it is the code on the server-side. If you are running WordPress on the same domain, your best option would be to disable guest page caching. It’s designed for XenForo, not WordPress.
 
or create a rule to specifically caching only on /forum rather than the whole domain hence why my question
Yep... like I said, it does create a Cache Rule, so you could edit it (would just need to make sure you manually delete it if you ever disable guest page caching).
 
Guest caching is triggering an error when any user profile is loaded:
Code:
domain.com/forum/members/admin.1/recent-content?_xfRequestUri=%2Fforum%2F%admin%2F&_xfWithData=1&_xfResponseType=json 400
Any ideas?
 
Last edited:
Guest caching is triggering an error when any user profile is loaded:
Code:
domain.com/forum/members/admin.1/recent-content?_xfRequestUri=%2Fforum%2F%admin%2F&_xfWithData=1&_xfResponseType=json 400
Any ideas?
If you go to XF Admin -> Appearance -> Template Modifications and find the public helper_js_global modification that this addon adds and change the Replace to this:

Code:
$1
<xf:if is="callable($xf.app.templater, 'canEdgeCache') && $xf.app.templater.canEdgeCache()"><script>$(document).on("xf:page-load-start",function(a,b){XF.config.time.now=Math.floor((new Date).getTime()/1E3);$.ajaxSetup({async:!1});XF.KeepAlive.initialize();XF.KeepAlive.refresh();$.ajaxSetup({async:!0})});</script></xf:if>
$2
<xf:if is="callable($xf.app.templater, 'canEdgeCache') && $xf.app.templater.canEdgeCache()">XF.config=new Proxy(XF.config,{set:function(c,d,a){c[d]=a;$(".has-csrf").each(function(){let b=new URL($(this).attr("href"),XF.config.url.fullBase);b.searchParams.set("t",a);$(this).attr("href",b.toString())});return!0}});</xf:if>
$3

...does that fix it? You will want to flush your Cloudflare cache to properly check it.

Long story short is XenForo's tab system can sometimes trigger an AJAX request before it's ready (cached guest pages need to fetch a CSRF token). Specifically the tab triggers the AJAX request before the guest user's CSRF token was returned.

This should only happen if the user landed on that page from search or something (first page view of the site for them). The above change makes the CSRF token fetch request synchronous and seems to work in the testing I did... but good to make sure it works for others.
 
@digitalpoint Is there a way to use Cloudflare Stream for videos? Or make it run on the R2 bucket? This is something that would be great.
No, this addon doesn't do anything as far as using Cloudflare Stream for videos (honestly, I don't even have a site that I allow users to upload video). You should be able to use an R2 bucket for videos without any issues/changes though since the place video is stored is inside the standard public data bucket.
 
No, this addon doesn't do anything as far as using Cloudflare Stream for videos (honestly, I don't even have a site that I allow users to upload video). You should be able to use an R2 bucket for videos without any issues/changes though since the place video is stored is inside the standard public data bucket.

Ok.

I just moved everything over... but I can't get me full images to show. They are broken... however... the thumbnails are all working. How do I fix that?
 
Back
Top Bottom