[DigitalPoint] App for Cloudflare®

[DigitalPoint] App for Cloudflare® 1.9.6

No permission to download
Presigned URLs expire after 60 seconds, so users can't share them with other users to bypass permission checks.

Is it possible to have the expiration time configurable?
Most of my attachments are images, and I prefer caching the request for a month.

Thanks, DP.
 
Is it possible to have the expiration time configurable?
Most of my attachments are images, and I prefer caching the request for a month.

Thanks, DP.
Presigned URLs aren't cacheable like things on your public domain are. They are going through the S3 API (using a domain you don't control [*.r2.cloudflarestorage.com], so you can't set any cache rules).

What you can do if you want attachments to be cached:
  • Disable presigned URLs
  • Go to XF Admin -> Cloudflare -> Edge caching, and enable Cache media attachments
 
I hope you can incorporate the @xfrocks "[bd] Attachment Store" feature into this add-on.
Which store attachments in data:// directory or location.

That way, requests for attachments won't need PHP/MySQL usage and will always hit Cloudflare caching, not directly from the server.
Thank you. :)

1758158809276.webp
 
I hope you can incorporate the @xfrocks "[bd] Attachment Store" feature into this add-on.
Which store attachments in data:// directory or location.

That way, requests for attachments won't need PHP/MySQL usage and will always hit Cloudflare caching, not directly from the server.
Thank you. :)

View attachment 327255
Should work fine as long as they are using XenForo’s abstracted filesystem.
 
digitalpoint updated [DigitalPoint] App for Cloudflare® with a new update entry:

Web analytics & permission checking

IMPORTANT for existing users: New functionality requires 3 additional API permissions in order to use the new functions.
  • Account.Account Settings: Read
  • Account.Account Settings: Edit
  • User.API Token: Read
For whatever reason, Account.Account Settings: Read isn't granted implicitly with Account.Account Settings: Edit.

Not sure why (maybe a current...

Read the rest of this update entry...
 

DigitalPoint said:
Not sure why (maybe a current Cloudflare bug?), but the User.API Token: Read permission can't currently be added manually to tokens (initially or after the fact). The only workaround I could figure out is to create a new token via this link: Create new token with pre-filled permissions
 
I updated and was able to select a "specific zone" (domain) in the Cloudflare API Tokens page.

In Xenforo, when I went to enable the Cloudflare web analytics, I got this error:
Code:
Oops! We ran into some problems.
10021: web_analytics.configuration.api.zoneInvalid

I went back to the Cloudflare API tokens page to edit it, and once I select "all zones from an account" it doesn't let me switch back to "specific zone". So I tried allowing all zones and then adding excludes for the zones/domains that Xenforo isn't running on, and that seemed to work.
 
I updated and was able to select a "specific zone" (domain) in the Cloudflare API Tokens page.

In Xenforo, when I went to enable the Cloudflare web analytics, I got this error:
Code:
Oops! We ran into some problems.
10021: web_analytics.configuration.api.zoneInvalid

I went back to the Cloudflare API tokens page to edit it, and once I select "all zones from an account" it doesn't let me switch back to "specific zone". So I tried allowing all zones and then adding excludes for the zones/domains that Xenforo isn't running on, and that seemed to work.
Ya… I reported that to Cloudflare. Appears to be a bug somewhere on their side. The API calls work about 75% of the time, but sometimes they don’t (without changing anything). Not much I can do about that other than wait for them to fix it. Retrying usually will make it go through though. 🤷🏻‍♂️

1758654299851.webp
 
Maybe we can get a "View analytics" button on the admin home screen, maybe below the CF statistics area?
 
Maybe we can get a "View analytics" button on the admin home screen, maybe below the CF statistics area?
There is a link on the new Web analytics page. Not sure it makes a ton of sense to put it on the admin index because there's a (slow) Cloudflare API call that needs to be made in order to get part of the URL it presents you with. It would make the admin index page noticeably slower. Go to the Web analytics page and you can see it's not instant (it's that API call that's needed to generate the URL).
 
Awesome stuff with this add-on!

Bit of a feature request from our organisation: We'd like to use a specific R2 bucket token rather than giving access to all of our R2 buckets (some of which are private) from the data security perspective of giving least-privilege.

We've achieved this internally by patching the add-on, but it would be preferable to have this feature built-in?
 
Awesome stuff with this add-on!

Bit of a feature request from our organisation: We'd like to use a specific R2 bucket token rather than giving access to all of our R2 buckets (some of which are private) from the data security perspective of giving least-privilege.

We've achieved this internally by patching the add-on, but it would be preferable to have this feature built-in?
Ya, I don’t disagree… but it’s also a balance between keeping it simple and making things a little more complicated with multiple tokens and how to create R2-specific tokens. …and basically it’s going to end up with a lot of support I need to do (tough to justify that when it’s all free).

That being said said, it will probably happen at some point. Cloudflare has been updating how tokens work as they roll out account-level tokens (they aren’t fully supported yet, it’s a work in progress). I’m hoping they make “normal” tokens have optional R2 bucket restrictions. …but if they don’t as part of the revamp, will probably do something on this end at some point (but I still don’t love if I need to… hah)
 
Do you guys remember back in the "old days" when this addon really only let you toggle settings in Cloudflare? 😂

Was trying to find something unrelated in this forum and came across that post:


Crazy thinking about what it does now (and also a WordPress version that has feature parity and shared codebase).

I need a life...
 
@digitalpoint

Code:
    ErrorException: Cloudflare: 6003: Invalid request headers src/XF/Error.php:77

    Generated by: Unknown account Sep 28, 2025 at 3:30 AM

Stack trace

#0 src/XF.php(219): XF\Error->logError('Cloudflare: 600...', false)
#1 src/addons/DigitalPoint/Cloudflare/Traits/XF.php(162): XF::logError('Cloudflare: 600...')
#2 src/addons/DigitalPoint/Cloudflare/Api/Cloudflare.php(781): DigitalPoint\Cloudflare\Api\Cloudflare->logError('Cloudflare: 600...')
#3 src/addons/DigitalPoint/Cloudflare/Api/Cloudflare.php(388): DigitalPoint\Cloudflare\Api\CloudflareAbstract->makeRequest('GET', 'https://api.clo...', Array)
#4 src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php(979): DigitalPoint\Cloudflare\Api\CloudflareAbstract->listZones('***.net')
#5 src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php(842): DigitalPoint\Cloudflare\Repository\CloudflareAbstract->getZoneId('www.***.n...')
#6 src/addons/DigitalPoint/Cloudflare/Repository/Advanced/Cloudflare.php(848): DigitalPoint\Cloudflare\Repository\CloudflareAbstract->getGraphQLZoneAnalytics(1, '@***')
#7 src/addons/DigitalPoint/Cloudflare/Stats/Cloudflare.php(39): DigitalPoint\Cloudflare\Repository\Advanced\Cloudflare->getStats(***)
#8 src/XF/Repository/Stats.php(63): DigitalPoint\Cloudflare\Stats\Cloudflare->getData(1758931200, ***)
#9 src/XF/Cron/Counters.php(30): XF\Repository\Stats->build(1758931200, 1759017600)
#10 src/XF/Job/Cron.php(37): XF\Cron\Counters::recordDailyStats(Object(XF\Entity\CronEntry))
#11 src/XF/Job/Manager.php(260): XF\Job\Cron->run(10)
#12 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 10)
#13 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 10)
#14 job.php(43): XF\Job\Manager->runQueue(false, 10)
#15 {main}

Request state

array(4) {
  ["url"] => string(15) "/sosyal/job.php"
  ["referrer"] => string(72) "https://www.***.net/***/konu/badminton-raketi-tavsiyesi.493697/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
@digitalpoint

Code:
    ErrorException: Cloudflare: 6003: Invalid request headers src/XF/Error.php:77

    Generated by: Unknown account Sep 28, 2025 at 3:30 AM

Stack trace

#0 src/XF.php(219): XF\Error->logError('Cloudflare: 600...', false)
#1 src/addons/DigitalPoint/Cloudflare/Traits/XF.php(162): XF::logError('Cloudflare: 600...')
#2 src/addons/DigitalPoint/Cloudflare/Api/Cloudflare.php(781): DigitalPoint\Cloudflare\Api\Cloudflare->logError('Cloudflare: 600...')
#3 src/addons/DigitalPoint/Cloudflare/Api/Cloudflare.php(388): DigitalPoint\Cloudflare\Api\CloudflareAbstract->makeRequest('GET', 'https://api.clo...', Array)
#4 src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php(979): DigitalPoint\Cloudflare\Api\CloudflareAbstract->listZones('***.net')
#5 src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php(842): DigitalPoint\Cloudflare\Repository\CloudflareAbstract->getZoneId('www.***.n...')
#6 src/addons/DigitalPoint/Cloudflare/Repository/Advanced/Cloudflare.php(848): DigitalPoint\Cloudflare\Repository\CloudflareAbstract->getGraphQLZoneAnalytics(1, '@***')
#7 src/addons/DigitalPoint/Cloudflare/Stats/Cloudflare.php(39): DigitalPoint\Cloudflare\Repository\Advanced\Cloudflare->getStats(***)
#8 src/XF/Repository/Stats.php(63): DigitalPoint\Cloudflare\Stats\Cloudflare->getData(1758931200, ***)
#9 src/XF/Cron/Counters.php(30): XF\Repository\Stats->build(1758931200, 1759017600)
#10 src/XF/Job/Cron.php(37): XF\Cron\Counters::recordDailyStats(Object(XF\Entity\CronEntry))
#11 src/XF/Job/Manager.php(260): XF\Job\Cron->run(10)
#12 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 10)
#13 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 10)
#14 job.php(43): XF\Job\Manager->runQueue(false, 10)
#15 {main}

Request state

array(4) {
  ["url"] => string(15) "/sosyal/job.php"
  ["referrer"] => string(72) "https://www.***.net/***/konu/badminton-raketi-tavsiyesi.493697/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
Double check your API token. Make sure it has all the right permissions and that you haven’t blocked it from being used by certain IPs or for certain domains.
 
Back
Top Bottom