Compare commits
2 Commits
39eb968989
...
2b488ca15a
Author | SHA1 | Date |
---|---|---|
janderedev | 2b488ca15a | |
janderedev | 744f043373 |
|
@ -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 |
1
index.js
1
index.js
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue