[DigitalPoint] App for Cloudflare®

[DigitalPoint] App for Cloudflare® 1.8.2

No permission to download
Sites have a lot more than 1,000 images (it’s total images per month, not just new images). Avatars (multiple different images since each size counts as 1), attachment thumbnails, etc. count the number of objects in your data bucket… that’s closer to the number of images it would be transforming every month.

Not sure XenForo is a good use case for it since it already does a good job at creating its own variations and serving them appropriately.
 
digitalpoint updated [DigitalPoint] App for Cloudflare® with a new update entry:

Very minor update

  • Changed wording of "API tokens & keys" to "API tokens" (no longer allowing global keys, only API tokens)
  • Updated charting library (Chart.js) to 4.4.1
  • Created workaround for addons being disabled during XenForo upgrades (we need to set the externalDataUrl so that the %ASSET:stylefolder% replacement var works as expected for R2 users when .less templates are compiled). Effectively we are firing our app_setup code event listener even when all addons are disabled...

Read the rest of this update entry...
 
I don't know if it's just me, but I have uploaded this twice now and I am not seeing the option to do an 'upgrade' like I normally get?
I just tried it on a site that I had not upgraded yet (even pulled the new version from xenforo.com) and it's working as expected when I do it.

1706897177172.webp

Double check that the new files are uploaded (and to the right place) on your server. XenForo just scans the appropriate directories in the src/addons/ folder in your XenForo install.
 
I just tried it on a site that I had not upgraded yet (even pulled the new version from xenforo.com) and it's working as expected when I do it.

View attachment 297598

Double check that the new files are uploaded (and to the right place) on your server. XenForo just scans the appropriate directories in the src/addons/ folder in your XenForo install.
Yup this was my bad, I'm an idiot.

im an idiot GIF
 
Tell me, can you add in your plugin Build a scalable image pipeline to store, resize, optimize, and deliver images in a fast and secure manner - Images?
 
Not planning to turn this into an image management addon if that's what you are asking?
2024-02-02_23-01-17.webp


Perhaps it was already made once, but deleted

 
Last edited:
Not sure if enough people have this ability in cloudflare, but I would love a feature in this addon whereby anyone with the exposed-credential-check header from cloudflare is forced to enable 2FA before continuing :)

  • Exposed-Credential-Check Header: Adds a new HTTP header to HTTP requests with exposed credentials. Your application at the origin can then force a password reset, start a two-factor authentication process, or perform any other action. The name of the added HTTP header is Exposed-Credential-Check and its value is 1.
 
View attachment 297608


Perhaps it was already made once, but deleted

For my XenForo-based sites it would seem like I'd just be paying for image resizing that I don't even need. XenForo is already generating various different sizes for things (avatars in multiple sizes, attachment thumbnails, etc.).

So I guess my real question is what exactly is the problem you are trying to solve on your site? If you have images that are sized wrong, can you show some examples?

Not sure if enough people have this ability in cloudflare, but I would love a feature in this addon whereby anyone with the exposed-credential-check header from cloudflare is forced to enable 2FA before continuing :)

  • Exposed-Credential-Check Header: Adds a new HTTP header to HTTP requests with exposed credentials. Your application at the origin can then force a password reset, start a two-factor authentication process, or perform any other action. The name of the added HTTP header is Exposed-Credential-Check and its value is 1.
While that's great and all, wouldn't it be better to just enforce all users have two-step authentication enable before their password shows up in a breach? Forcing them to use two-step after they have been breached is ultimately the same thing (and maybe too late anyway).

Either way, forcing password reset or two-step setup based on an HTTP header would probably be better suited in an addon that revolves around security than this one (the only thing that would align it with this addon is the company that set the header... technically it could be set by other entities as well):

 
Sites have a lot more than 1,000 images (it’s total images per month, not just new images). Avatars (multiple different images since each size counts as 1), attachment thumbnails, etc. count the number of objects in your data bucket… that’s closer to the number of images it would be transforming every month.

Not sure XenForo is a good use case for it since it already does a good job at creating its own variations and serving them appropriately.
I was thinking only full/large attachments, not thumbnails and avatars etc. A once off optimise for size, and thus cost saving in storage.
Thanks for considering though.
 
I was thinking only full/large attachments, not thumbnails and avatars etc. A once off optimise for size, and thus cost saving in storage.
Thanks for considering though.
I suppose... but the image transforms are redone each month as far as billing/cost. Let's say a medium sized site had 50,000 image attachments, you are potentially doing those 50,000 billable resizes over and over each month. All of a sudden you are paying $300/year to continuously resize the same images over and over.

It certainly could be done, but wouldn't it make more sense to do the resize once on the server side (for free) vs. redoing them all every month for a cost?

While it would potentially save money on storage costs, the $300/year you would be paying in that scenario would also buy you 1.7TB of R2 storage space for the images you resized once on your own.
 
The normal CLI command it comes with doesn’t give you the option?
No, But maybe I'm doing something wrong...

It's enabled in the adminCP but I don't see an adaptor.

Code:
php cmd.php dp:migrate-data

If you have a lot of data being moved, this is not going to be the best option for migrating data. Flysystem (the abstracted file system that XenForo uses) does not have a mechanism for paging through files (all file info is stored in a single array). If you have too many files, this could cause memory issues for PHP (and you will be better off using third-party tools that don't rely on Flysystem).

+---------------------------+-------------------+-----------------------------------------------------+
| Locatie                   | From adapter      | To adapter                                          |
+---------------------------+-------------------+-----------------------------------------------------+
| data                      | XF\LocalFsAdapter | DigitalPoint\Cloudflare\League\Flysystem\Adapter\R2 |
| internal_data/attachments | XF\LocalFsAdapter | DigitalPoint\Cloudflare\League\Flysystem\Adapter\R2 |
+---------------------------+-------------------+-----------------------------------------------------+

Which location would you like to migrate?
  [data                     ] The public data directory (/data/*) where XenForo stores public data (for example avatars).
  [internal_data/attachments] The private directory (/internal_data/attachments/*) where attachments are stored.
 
Is the stuff you are wanting to move not inside your data folder?
Yes, but I expected it to be in e seperate bucket bacouse that's how it's configured in AdminCP

R2 for /data/

R2 for /internal-data/attachments/

R2 for /internal-data/xfmg/

Not sure how I can point it to the correct location now.
 
Aha, ok.
Then everything should be good.
The only thing is I have a domain for the data bucket and if I check my xfmg it's not using that domain. (for the avatars it does use it) So it looks like it's loading the xfmg images from the old location.
 
Top Bottom