[DigitalPoint] Cloudflare

[DigitalPoint] Cloudflare 1.2.2.1

No permission to download

digitalpoint

Well-known member
I assume Authorisation is the translation for Permissions (in English)? That's where you set up the various permissions that it needs (in my screenshot and also shows on the External service providers options in XenForo).

For resources, I'd make it simple and set it to all accounts/all zones and leave the IP filtering and TTL blank.
 

Nicolas FR

Well-known member
Ok i'm done with the token, in the add-on options i set to API Token instead of Global API but i meet the same problem. 🤷‍♂️
in CF > Zero Trust > Logs > Access i have this error message

Capture web_15-8-2022_175648_dash.teams.cloudflare.com.jpeg

Nothing more in Logs > Admin than previous check
 

digitalpoint

Well-known member
I just mean the place you set the token in your XenForo settings is the place it also tells you what permissions it set...

1660586383152.png

As far as why Access stuff isn't working on your account with a Global API key or a Token, I'm not really sure to be honest. It seems like you are doing everything right and when I test it every way I can think of on my end, it works as expected. Is there anything unique about your Cloudflare account that you can think of? Like is your account not the primary account for those zones or something like that?

Difficult for me to debug on this end when I can't get it to replicate what you are seeing...
 

Nicolas FR

Well-known member
It's a unique account, one site is set, don't know why it should be different than yours.
I changed the token but same problem... Thank you very much for your help and patience.

Tomorrow the sun will rise.
 

digitalpoint

Well-known member
It's a unique account, one site is set, don't know why it should be different than yours.
I changed the token but same problem... Thank you very much for your help and patience.

Tomorrow the sun will rise.
I could take a peek at the underlying API calls/responses and see if it gives any insight, but it would require me having your Token for me to do that. Like I said, I can't get it to not work with my account/API token so maybe it could give some insight if I can see what it doing with your account. But that's up to you if you want me to have it (you can of course change it afterwards).
 

digitalpoint

Well-known member
It's a unique account, one site is set, don't know why it should be different than yours.
I changed the token but same problem... Thank you very much for your help and patience.

Tomorrow the sun will rise.
@nicodak already knows, but we were able to sort out the underlying issue. He had an admin that had no email address. The Cloudflare Access uses email addresses to identify who people are, so when the add-on tried to create a new Access policy for admins, it didn't work when one of the admins had no email. I think it would have been nice if Cloudflare API returned an error, but it just blindly didn't work.

Long story short is that the next version of this add-on takes it into account (checks if the admins have an email address before adding them to the Access policy). The workaround for now (in case someone happens to run into it before the next version) is to make sure your admins have email addresses.
 

dave3

Member
I have entered my own API key but cannot to see any settings of the extension because of this following error:

Code:
TypeError: Argument 1 passed to DigitalPoint\Cloudflare\Api::getSettings() must be of the type string, null given, called in /public_html/src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php on line 643 in src/addons/DigitalPoint/Cloudflare/Api.php at line 152
DigitalPoint\Cloudflare\Api->getSettings() in src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php at line 643
DigitalPoint\Cloudflare\Repository\Cloudflare->getZoneSettings() in src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php at line 502
DigitalPoint\Cloudflare\Repository\Cloudflare->organizeSettings() in src/addons/DigitalPoint/Cloudflare/Admin/Controller/Cloudflare.php at line 35
DigitalPoint\Cloudflare\Admin\Controller\Cloudflare->actionIndex() in src/XF/Mvc/Dispatcher.php at line 352
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2353
XF\App->run() in src/XF.php at line 524
XF::runApp() in admin.php at line 13

just read old posts but did not find any solution.
 

digitalpoint

Well-known member
I would triple check your token (make sure there are no stray characters in it like a space or carriage return). And double check the permissions you have set up for it.
 

dave3

Member
Hmmm, no idea. The API key looks fine, I generated it once again but still no luck. I am copying it so it does not contain any spelling mistakes. According to the permissions, this is how they look like:

1662129452662.png

I have compared them to the permissions that are recommended by the addon:


1662129228766.png
 

digitalpoint

Well-known member
Looked a little closer at the code to see what might be going on. It's definitely not an invalid token (you would get a different error saying you have an invalid token).

What it looks like to me is the possibility that the site you have XenForo setup on is not a zone on your Cloudflare account. Like if you are on localhost or some test domain that you haven't setup in Cloudflare, it's not going to know which zone's settings you are trying to alter because the zone it knows about (the domain your XenForo installation uses) isn't a zone in your Cloudflare account.

Is that a possibility for you?
 

dave3

Member
@digitalpoint

the problem was on my side. I have changed the domain name and for some reason tried to provide the old one... :unsure: We have fixed it already and after that we are able to see all of the settings. Thank you.
 

digitalpoint

Well-known member
@digitalpoint

the problem was on my side. I have changed the domain name and for some reason tried to provide the old one... :unsure: We have fixed it already and after that we are able to see all of the settings. Thank you.
Awesome... Not going to be a terribly common issue, but I'm going to make a change to give a little better error. One that will tell you that it couldn't find the zone in Cloudflare, rather than just assume the zone exists. :)
 

Smooth

Active member
Heya lovely. Thanks for the utterly AWESOME add on!

Wondering if you could help? I am using Xenporta2 for our homepage at mobitog.com, and I think Cloudflare is caching ALL images, so on our top 'Latest thread post' carousel, it's got some broken thumbnails where the images have been posted to a part of the site that guests don't have read permission for. Is there a way to stop Cloudflare caching attachments?

I've also had to turn off Friendly URLs - is there something I am missing?

Thanks again.
 

digitalpoint

Well-known member
That doesn't look like a Cloudflare issue, rather an issue with the domain you are using to serve static content. For example this is the URL you are using for your jQuery JavaScript:


Looks to me like your entire domain mobitog-mobitog.netdna-ssl.com isn't working.

...which means JavaScript isn't working on your site (so if you have an image carousel that works with JavaScript, it's going to be defunct because you don't have any JavaScript loading).
 

Smooth

Active member
Ugh. Thank you @digitalpoint - I am ditching MaxCDN and moving to cloudflare, but since installing MaxCDN, Xenforo have removed some of the setting areas such as Style -> General -> Settings, so I can't undo.
 
Top