instrumentl / rails-cloudflare-turnstile

ISC License
22 stars 10 forks source link

Works locally but can't get it to work on heroku hosted app #155

Closed christobh closed 4 months ago

christobh commented 4 months ago

I can't find any error messages.. so really flying blind.

Hoping someone can help?

Here is what I've tried:

1) Checked and rechecked enviroment variables, they seem fine. 2) Set CSP:

Rails.application.config.content_security_policy do |policy| policy.script_src :self, 'https://challenges.cloudflare.com' end

3) Checked connection to cloudflare from heroku bash:

mycomputer@1:~/code/app[qa]$ heroku run bash -r qa › Warning: heroku update available from 8.11.4 to 8.11.5. Running bash on ⬢ still-breek-XXXX... up, run.9052 (Basic) ~ $ curl -I https://challenges.cloudflare.com/ HTTP/2 200 date: Tue, 18 Jun 2024 07:47:08 GMT content-type: text/html; charset=utf-8 cf-ray: x-IAD access-control-allow-origin: * cache-control: public, max-age=0, must-revalidate etag: "x" vary: Accept-Encoding referrer-policy: strict-origin-when-cross-origin x-content-type-options: nosniff server: cloudflare alt-svc: h3=":443"; ma=86400

4) Checked that assest compile correctly

All of the above seem fine...

I can also run and test the turnstile succesfully through ngrok with no issues.

On the cloudflare dash I can see that the ngrok domain successfully talks to cloudflare, but get "insifficient data" for my own custom domain...