[DigitalPoint] App for Cloudflare®

[DigitalPoint] App for Cloudflare® 1.9.1.1

No permission to download
I checked the permission which should be fine.

The result seems to be missing fight_mode:
Code:
{
    "result": {
        "enable_js": false,
        "optimize_wordpress": false,
        "suppress_session_score": false,
        "sbfm_definitely_automated": "allow",
        "sbfm_verified_bots": "allow",
        "sbfm_static_resource_protection": false,
        "using_latest_model": true
    },
    "success": true,
    "errors": [],
    "messages": []
}

In the Cloudflare UI, I only see settings for 'Super Bot Fight Mode'.
 
Seems they are changing the response of that API call depending on the account type you have. But it's definitely an undocumented/new thing because other paid tiers aren't doing it. So maybe they are just rolling it out slowly to new paid zones?

Either way, returning something different with an API call based on account type is really bad practice.

The API docs show that it should be what we are expecting (not what you are getting), so could also be a bug on their end.

Going to make some inquires with Cloudflare to figure out what's going on exactly. In the meantime, if you open up the DigitalPoint/Cloudflare/Repository/Cloudflare.php file and change this:

PHP:
$results['result']['value'] = $results['result'][$options['value_key']];

to this:

PHP:
$results['result']['value'] = empty($results['result'][$options['value_key']]) ? null : $results['result'][$options['value_key']];

Maybe that should at least get you by for now until I figure out what's happening on Cloudflare's side.
 
I just went to download a few items from my forum's Resources area and the files are all downloading as .data files instead of pictures or PDF's. Any idea why?

Normally content type and filenames are handled by XenForo, but if that’s not happening, are you using presigned URLs?

If so, are they old items (like something you already had in the system that got migrated to R2)?
 
Yes, these are old items, newly added ones are working fine, the old ones are all coming down as .data.

Yes, using presigned URL's since your support for it.
 
I just went to the admin area of my site then cloudflare settings and I get this error: (version 1.7.4 installed)

ErrorException: [E_WARNING] Undefined array key "fight_mode" in src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php at line 955
  1. XF::handlePhpError() in src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php at line 955
  2. DigitalPoint\Cloudflare\Repository\CloudflareAbstract->getZoneSettings() in src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php at line 672
  3. DigitalPoint\Cloudflare\Repository\CloudflareAbstract->organizeSettings() in src/addons/DigitalPoint/Cloudflare/Admin/Controller/Cloudflare.php at line 49
  4. DigitalPoint\Cloudflare\Admin\Controller\Cloudflare->actionIndex() in src/XF/Mvc/Dispatcher.php at line 352
  5. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259
  6. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
  7. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
  8. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2487
  9. XF\App->run() in src/XF.php at line 524
  10. XF::runApp() in admin.php at line 13
 
So the culprit is most likely whatever you used to migrate old data to R2. It may have tried to be smarter than it actually is and set a content type of something like application/data based on the file extension. If it doesn’t specifically tell Cloudflare what to set the content type to be, Cloudflare will work out what it is (for example an image) by analyzing the content (with a few exceptions it generally does a decent job at doing that). But if Cloudflare is told by something what to set the content type to, it will abide by that.
 
So the culprit is most likely whatever you used to migrate old data to R2. It may have tried to be smarter than it actually is and set a content type of something like application/data based on the file extension. If it doesn’t specifically tell Cloudflare what to set the content type to be, Cloudflare will work out what it is (for example an image) by analyzing the content (with a few exceptions it generally does a decent job at doing that). But if Cloudflare is told by something what to set the content type to, it will abide by that.
Okay, thanks, sounds like all the old resources are going to be kaput as I don't know what they are or even how to find and fix them among everything in R2. :(
 
Well you could just disable presigned URLs for now because then XenForo is handling the content type.

A longer term solution (depending on the effort you wanted to do) would be you could download them from R2 and just upload them right back, overwriting the R2 object and just be sure to not set a content type (or set it correctly) when doing that.
 
Scratch that... won't work (sorry).
Could you implement an option where in the settings for presigned URL's to have sub-checkboxes for different areas. For example, can you design a way to exclude presigned URL's for XFRM? If so then you could extend that to other areas such as gallery, etc. and give users more control of where presigned URL's are used?
 
Could you implement an option where in the settings for presigned URL's to have sub-checkboxes for different areas. For example, can you design a way to exclude presigned URL's for XFRM? If so then you could extend that to other areas such as gallery, etc. and give users more control of where presigned URL's are used?
Probably not to be honest, I don’t have XFRM, so would have no way to test something like that. But also doing it per content type really causes other issues and makes in unnecessarily complicated. Like now we have to try and write code for every addon that has its own content type in order for it to work with presigned URLs?
 
I wouldn't think by content type as it should not affect anything attached to a post. But if you could identify which area of the site is being used and then exclude this option for that area? Can XF get you a demo to dev against?
 
Back
Top Bottom