Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cf-ip-monitor #648

Merged
merged 3 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/cf-ip-monitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Cloudflare IP Monitor

on:
schedule:
- cron: 0 12 * * * # every day at 12:00

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check IPs
run: |
cd hack/cf-ip-monitor || exit
bash check.sh
shell: bash
- name: Create Issue
uses: JasonEtco/create-an-issue@v2
if: env.CHANGED == 1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: hack/cf-ip-monitor/ISSUE_TEMPLATE.md
4 changes: 4 additions & 0 deletions hack/cf-ip-monitor/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: :bomb: `Bug`: Cloudflare IPs-v4 Changed assignees: IronCore864, daniel-hutao labels: bug
---
Please see the [ips-v4](https://github.com/devstream-io/devstream/blob/main/hack/cf-ip-monitor/ips-v4) file
13 changes: 13 additions & 0 deletions hack/cf-ip-monitor/check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
curl -sL https://www.cloudflare.com/ips-v4 | grep -v '^$' >ips-v4
cat ips-v4
if git status --porcelain | grep -q "^ M";then
echo "ips-v4 changed"
echo "CHANGED=1" >> "$GITHUB_ENV"
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add ips-v4
git commit -m "chore: ips-v4 changed"
git push
else
echo "ips-v4 not changed"
fi
15 changes: 15 additions & 0 deletions hack/cf-ip-monitor/ips-v4
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
173.245.48.0/20
103.21.244.0/22
103.22.200.0/22
103.31.4.0/22
141.101.64.0/18
108.162.192.0/18
190.93.240.0/20
188.114.96.0/20
197.234.240.0/22
198.41.128.0/17
162.158.0.0/15
104.16.0.0/13
104.24.0.0/14
172.64.0.0/13
131.0.72.0/22