[DigitalPoint] App for Cloudflare®

[DigitalPoint] App for Cloudflare® 1.8.2

No permission to download
The error described above occurs even without the chunked upload addon and with any small files, like images or videos.

Also, uploaded video file attachments or XFMG videos are not subject to Xenforo permissions and are always saved in the "/data/" directory.

The only thing changed from stock XF is that the files are stored on R2 using this addon.
 
Last edited:
digitalpoint updated [DigitalPoint] App for Cloudflare® with a new update entry:

Fix for XenForo's class autoload variation

Not sure why this is the case, but it seems XenForo's class autoloading system works slightly differently when in the context of auto-run jobs (within job.php). Oddly, changing the order of PHP classes within 3 files seems to have solved it (and allows the autoloader to properly "see" the classes either way).

TL;DR

Fixes a problem where a class couldn't be found if it was running as a cron job (a scheduled task to delete a firewall)

Read the rest of this update entry...
 
The error described above occurs even without the chunked upload addon and with any small files, like images or videos.

Also, uploaded video file attachments or XFMG videos are not subject to Xenforo permissions and are always saved in the "/data/" directory.

The only thing changed from stock XF is that the files are stored on R2 using this addon.
Update for you should fix it.
 
  • Love
Reactions: rdn
While I was digging into the guts of XenForo to fix that issue, I realized that XenForo treats media differently than other files. Specifically video and audio files go straight into data fully rather than internal_data. Which solves the issue where XenForo is fully processing those file types when someone wants to download them. I think the problem for you is that it's only video and audio files that do that... so if you had massive attachments (like a disk image), those are still going to go through the normal attachment system where XenForo is processing the underlying file every time someone wants to download it.

If you end up building something custom to handle it (which probably is going to need to happen to get around all the issues you are going to run into), this is how I'd do it...
  • Leverage XenForo's ability to treat certain files different (do what XenForo is doing for media for other extensions like disk images)
  • Bypass XenForo's normal uploader and use R2 presigned URLs. Cloudflare is working on an example of how to do it exactly (see here) for those that don't know how to code it.
  • Probably schedule cron job a certain number of hours in the future in XenForo to clean up situations where you generate presigned URLs that a user can upload to, but they don't actually do it (then you don't end up with a bunch of "empty" attachments).
That allows you to not be limited to the constraints of XenForo's upload system and also allows you to get around the 100 second thing since the underlying http request isn't going to your server.

 
I've just swapped another site fully over to this, and the two buckets exist, and the attachments folder in present in the specific bucket.

Getting the following error when uploading attachments now:

Code:
League\Flysystem\FileNotFoundException: File not found at path: attachments/232/232281-d410e70db19b8a9699626ab0b7cc502e.data in src/addons/DigitalPoint/Cloudflare/League/Flysystem/Adapter/R2.php at line 166
DigitalPoint\Cloudflare\League\Flysystem\Adapter\R2->getMetadata() in src/addons/DigitalPoint/Cloudflare/League/Flysystem/Adapter/R2.php at line 83
DigitalPoint\Cloudflare\League\Flysystem\Adapter\R2->has() in src/vendor/league/flysystem/src/Filesystem.php at line 57
League\Flysystem\Filesystem->has()
call_user_func_array() in src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php at line 431
League\Flysystem\EventableFilesystem\EventableFilesystem->callFilesystemMethod() in src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php at line 395
League\Flysystem\EventableFilesystem\EventableFilesystem->delegateMethodCall() in src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php at line 128
League\Flysystem\EventableFilesystem\EventableFilesystem->has() in src/vendor/league/flysystem/src/Filesystem.php at line 118
League\Flysystem\Filesystem->putStream()
call_user_func_array() in src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php at line 431
League\Flysystem\EventableFilesystem\EventableFilesystem->callFilesystemMethod() in src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php at line 395
League\Flysystem\EventableFilesystem\EventableFilesystem->delegateMethodCall() in src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php at line 71
League\Flysystem\EventableFilesystem\EventableFilesystem->putStream() in src/vendor/league/flysystem/src/MountManager.php at line 615
League\Flysystem\MountManager->putStream() in src/XF/Util/File.php at line 185
XF\Util\File::copyFileToAbstractedPath() in src/XF/Service/Attachment/Preparer.php at line 78
XF\Service\Attachment\Preparer->insertDataFromFile() in src/addons/SV/AttachmentImprovements/XF/Service/Attachment/Preparer.php at line 74
SV\AttachmentImprovements\XF\Service\Attachment\Preparer->insertDataFromFile() in src/XF/Service/Attachment/Preparer.php at line 38
XF\Service\Attachment\Preparer->insertAttachment() in src/XF/Attachment/Manipulator.php at line 170
XF\Attachment\Manipulator->insertAttachmentFromUpload() in src/XF/Pub/Controller/Attachment.php at line 89
XF\Pub\Controller\Attachment->actionUpload() in src/XF/Mvc/Dispatcher.php at line 350
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2337
XF\App->run() in src/XF.php at line 488
XF::runApp() in index.php at line 20
Code:
array(4) {
  ["url"] => string(92) "/attachments/upload?type=post&context[thread_id]=48819&hash=87af26856cced168284c41d58746086b"
  ["referrer"] => string(56) "https://woodbarter.com/threads/attachment-changes.48819/"
  ["_GET"] => array(3) {
    ["type"] => string(4) "post"
    ["context"] => array(1) {
      ["thread_id"] => string(5) "48819"
    }
    ["hash"] => string(32) "87af26856cced168284c41d58746086b"
  }
  ["_POST"] => array(11) {
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
    ["_xfWithData"] => string(1) "1"
    ["flowChunkNumber"] => string(1) "1"
    ["flowChunkSize"] => string(10) "4294967296"
    ["flowCurrentChunkSize"] => string(6) "953548"
    ["flowTotalSize"] => string(6) "953548"
    ["flowIdentifier"] => string(38) "953548-Screenshot2023-01-25at182720png"
    ["flowFilename"] => string(37) "Screenshot 2023-01-25 at 18.27.20.png"
    ["flowRelativePath"] => string(37) "Screenshot 2023-01-25 at 18.27.20.png"
    ["flowTotalChunks"] => string(1) "1"
  }
}

1674684262645.webp
 
There's an issue with the feature "Use Cloudflare Workers for image and unfurl proxy."
It still logs the main server's IP.

Please test using: https://iplogger.org/

and try to embed an image with the iplogger link.
With the current implementation, what is being logged is:
Server IP > CF Worker


Edit: For image embed, maybe because I use this:

Sorry, there is no flaw with this addon.
 
Last edited:
About the feature "Use Cloudflare Workers as unfurl proxy."
Does it work for both "Convert URLs to page titles & Unfurl URL to a rich preview automatically"?
 
Are we allowed to modify the "Cache XenForo guest pages" cache rule added by this addon?
Will it still be compatible with your addon if modified?

Like adding custom Status code TTL.
 
Yep… the only issue would be if you disable guest page caching and you change the expression, you will need to delete the Cache Rule manually (it keys on the expression to know which to delete). Otherwise no issues.
 
  • Like
Reactions: rdn
Honestly the function to force a challenge to those pages to help mitigate spammers isn’t really the best option anymore. Cloudflare’s Turnstile captcha effectively does exactly that and it works in an AJAX request so can be used in an overlay.
 
  • Like
Reactions: rdn
Hi get this Error log

1674817795772.png

as tried to diable the Early Hints opion

1674817870039.png

also get the same issue with some other otptions if I try to disbale them. For example:

1674818371774.webp
 
Last edited:
If you reload the page and try changing Early Hints first is it an issue? I was able to replicate it on Crawler Hints but not Early Hints so far.
 
Top Bottom