nelson-social / bots

Post Whitewater weather conditions and Avalance Info to https://nelson.social
0 stars 0 forks source link

Cloudflare 503 when running in Github Actions #2

Closed mattwynne closed 1 year ago

mattwynne commented 1 year ago

I can run this locally and it works, but when I run it from GitHub Actions, we get Cloudflare's bot detection page instead.

I'm not sure if we can do anything on our Cloudflare config to disable this, or whether we need to just bite the bullet and run it from somewhere else. Needs investigating.

mattwynne commented 1 year ago

@tillkruss do you know if it's possible (or desirable even?) to configure Cloudflare's Bot Manager to make an exception here and let these API calls through to the https://nelson.social server?

tillkruss commented 1 year ago

I can set up an exception. What’s the call exactly? User agent?

keeth commented 1 year ago

@mattwynne @tillkruss i think i am seeing this error too in the new TS version. i am getting 503 on all API calls.

The calls are things like:

POST https://nelson.soclal/api/v2/media GET https://nelson.soclal/api/v1/media/123 POST https://nelson.soclal/api/v1/statuses

The user agent is node-fetch but I can customize it if we want to make a more specific exception rule.

tillkruss commented 1 year ago

Are you able to set a custom UA? Its a bit generic for an allowlist 🥲

mattwynne commented 1 year ago

I'm sure we can. We could use whitewater-bot for example?

tillkruss commented 1 year ago

So it looks like "Bot Fight Mode" can't be configured, I disabled it for now.

mattwynne commented 1 year ago

Sweet, that works for me! Thanks Till!