Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Cloudflare API instead of Website #10

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jaapmarcus
Copy link

Cloudflare Website might show a random check if the visitor is a real user instead of a bot this causes the old system to fail

See: hestiacp/hestiacp#3370

Option would be to use the https://api.cloudflare.com/client/v4/ips how ever it will add a dependency on jq a 200kb tools of phrasing json files.

The API it self is free to use and it has been tested in the last 2 days since then no complains about the changes

Also @myrevery to contribute to the PR it self.

@myrevery
Copy link

@jaapmarcus Hey bro, are you missing something?:zany_face:

https://github.com/hestiacp/hestiacp/blob/6ac9b23b81b3f16fc513280347c06c58f3ee169b/func/upgrade.sh#L555

Comment on lines 3 to 4
CLOUDFLARE_FILE_PATH=${1:-/etc/nginx/cloudflare}
cf_ips="$(curl -fsLm2 --retry 1 https://api.cloudflare.com/client/v4/ips)"
CLOUDFLARE_FILE_PATH="/etc/nginx/cloudflare"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here should keep: define default path, also accept custom path option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants