Autoenable Cloudflare UAM
Auto-enable Cloudflare "Under Attack" mode when CPU load is high.
Installation
- Clone script.
$ git clone https://github.com/cheenanet/autoenable-cloudflare-uam.git
- Install
bc
,jq
, andcurl
before run script.
Debian/Ubuntu:$ sudo apt install bc jq curl
Fedora/CentOS:$ sudo yum install bc jq curl
Configuration
- Create a new API token from Cloudflare dashboard.
- Set API token and Zone ID.
api_key=""
zone_id=""
- Set default security level and CPU load limit.
default_security_level="high"
max_loadavg=2
- Add to crontab.
*/20 * * * * /var/www/cloudflare-uam.sh