Compare commits

...

2 Commits

Author SHA1 Message Date
janderedev 2b488ca15a
fixed issue where it stopped working after 24 hours lol 2021-11-03 19:34:30 +01:00
janderedev 744f043373
move readme images into repository
domain was about to expire lol
2021-11-03 19:25:49 +01:00
4 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,7 @@
# Cloudflare Firewall Discord Webhook
yes.
![https://shitass.studio/sc/1617749859-nicememe.8LjIKiH1ECHwQX7h3Ix.png](https://shitass.studio/sc/1617749859-nicememe.8LjIKiH1ECHwQX7h3Ix.png)
![assets/1617749859-nicememe.8LjIKiH1ECHwQX7h3Ix.png](assets/1617749859-nicememe.8LjIKiH1ECHwQX7h3Ix.png)
## Setup
**Step 1:** Read source code because I'm too lazy to write proper instructions
@ -10,7 +10,7 @@ yes.
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:
![https://shitass.studio/sc/1617750671-nicememe.L0cFCxLqyEDYNNZRw2f.png](https://shitass.studio/sc/1617750671-nicememe.L0cFCxLqyEDYNNZRw2f.png)
![assets/1617750671-nicememe.L0cFCxLqyEDYNNZRw2f.png](assets/1617750671-nicememe.L0cFCxLqyEDYNNZRw2f.png)
**Step 3:** Set environment variables

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -23,6 +23,7 @@ async function refresh(zone) {
let lowerDate = new Date();
let upperDate = new Date();
lowerDate.setTime(await fs.promises.readFile('./last_request'));
if (upperDate.getTime() - lowerDate.getTime() > 1000 * 60 * 60 * 24) lowerDate.setTime((Date.now() - (1000 * 60 * 60 * 24) + 10000));
let payload = `{ "query":
"query ListFirewallEvents($zoneTag: string, $filter: FirewallEventsAdaptiveFilter_InputObject) {
viewer {