2021-04-06 23:22:23 +00:00
# Cloudflare Firewall Discord Webhook
yes.
2021-11-03 18:25:49 +00:00
![assets/1617749859-nicememe.8LjIKiH1ECHwQX7h3Ix.png ](assets/1617749859-nicememe.8LjIKiH1ECHwQX7h3Ix.png )
2021-04-06 23:22:23 +00:00
## Setup
**Step 1:** Read source code because I'm too lazy to write proper instructions
**Step 2:** Get an API key
Go to [https://dash.cloudflare.com/profile/api-tokens ](https://dash.cloudflare.com/profile/api-tokens ) and create a new token, with the following permissions:
2021-11-03 18:25:49 +00:00
![assets/1617750671-nicememe.L0cFCxLqyEDYNNZRw2f.png ](assets/1617750671-nicememe.L0cFCxLqyEDYNNZRw2f.png )
2021-04-06 23:22:23 +00:00
**Step 3:** Set environment variables
Create a file called `.env` in the project root:
CF_TOKEN=The previously created token
WEBHOOK_ID=The ID of the Discord Webhook
WEBHOOK_SECRET=The Webhook's token
CF_ZONES_BLACKLIST=(Optional) Comma-seperated list of domains (Zone IDs!) that should not be monitored.
Note that I have no idea if `CF_ZONES_BLACKLIST` even works simply because I'm too lazy to test it.
**Step 4:** Run it
`npm install` and `node .` yada yada ya