- Go to https://dash.cloudflare.com
- Manage account -> Configurations -> Lists
- Create new list:
- Identifier: public_ips
- Go to the newly created list and grab the Account ID and List ID from the url:
https://dash.cloudflare.com/<Account ID>/configurations/lists/<List ID>
- Go to https://dash.cloudflare.com
- Websites -> Domain -> Security -> WAF
- Create new rule:
- Rule name: Block when the IP address is not ours
- Action: Block
- Expression:
(http.host eq "sub.domain.com" and not ip.src in $public_ips)
- Copy
docker-compose.example.ymltodocker-compose.yml - Edit
docker-compose.ymland fill in the Account ID and List ID from the step above. For the Auth Email and Auth Key, go to https://dash.cloudflare.com/profile/api-tokens and grab the Global API Key.
docker compose build
docker compose pushdocker compose up -ddocker compose exec job php job.php