Browse Source

Add github

pull/3/head
Lord Alfred 3 years ago
parent
commit
46e9d14136
  1. 9
      .github/workflows/update.yml
  2. 7
      README.md
  3. 26
      github/downloader.sh

9
.github/workflows/update.yml

@ -18,11 +18,12 @@ jobs:
bash oracle/downloader.sh
bash digitalocean/downloader.sh
bash bing/downloader.sh
bash github/downloader.sh
- name: Create All-In-One ranges
run: |
cat google/ipv4.txt amazon/ipv4.txt microsoft/ipv4.txt oracle/ipv4.txt digitalocean/ipv4.txt bing/ipv4.txt | sort -h > all/ipv4.txt
cat google/ipv6.txt amazon/ipv6.txt microsoft/ipv6.txt digitalocean/ipv6.txt | sort -h > all/ipv6.txt
cat google/ipv4.txt amazon/ipv4.txt microsoft/ipv4.txt oracle/ipv4.txt digitalocean/ipv4.txt bing/ipv4.txt github/ipv4.txt | sort -h > all/ipv4.txt
cat google/ipv6.txt amazon/ipv6.txt microsoft/ipv6.txt digitalocean/ipv6.txt github/ipv6.txt | sort -h > all/ipv6.txt
- name: Set up Python 3.7
uses: actions/setup-python@v2
@ -52,6 +53,7 @@ jobs:
python utils/merge.py --source=oracle/ipv4.txt | sort -h > oracle/ipv4_merged.txt
python utils/merge.py --source=digitalocean/ipv4.txt | sort -h > digitalocean/ipv4_merged.txt
python utils/merge.py --source=bing/ipv4.txt | sort -h > bing/ipv4_merged.txt
python utils/merge.py --source=github/ipv4.txt | sort -h > github/ipv4_merged.txt
python utils/merge.py --source=all/ipv4.txt | sort -h > all/ipv4_merged.txt
# ipv6
python utils/merge.py --source=google/ipv6.txt | sort -h > google/ipv6_merged.txt
@ -60,6 +62,7 @@ jobs:
# oracle not provide ipv6
python utils/merge.py --source=digitalocean/ipv6.txt | sort -h > digitalocean/ipv6_merged.txt
# bing not provide ipv6
python utils/merge.py --source=github/ipv6.txt | sort -h > github/ipv6_merged.txt
python utils/merge.py --source=all/ipv6.txt | sort -h > all/ipv6_merged.txt
- name: Commit files

7
README.md

@ -52,6 +52,13 @@ All addresses are stored in `.txt` files with CIDRs, where each range is on a ne
- IPv6: https://raw.githubusercontent.com/lord-alfred/ipranges/main/digitalocean/ipv6.txt
- IPv6 (merged): https://raw.githubusercontent.com/lord-alfred/ipranges/main/digitalocean/ipv6_merged.txt
### GitHub
- IPv4: https://raw.githubusercontent.com/lord-alfred/ipranges/main/github/ipv4.txt
- IPv4 (merged): https://raw.githubusercontent.com/lord-alfred/ipranges/main/github/ipv4_merged.txt
- IPv6: https://raw.githubusercontent.com/lord-alfred/ipranges/main/github/ipv6.txt
- IPv6 (merged): https://raw.githubusercontent.com/lord-alfred/ipranges/main/github/ipv6_merged.txt
## All-In-One IPs
A list of IP addresses from all sources combined into one file.

26
github/downloader.sh

@ -0,0 +1,26 @@
#!/bin/bash
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-githubs-ip-addresses
set -euo pipefail
set -x
# get from public ranges
curl -s https://api.github.com/meta > /tmp/github.json
# get all prefixes without some keys
jq 'del(.["ssh_keys", "verifiable_password_authentication", "ssh_key_fingerprints"]) | .[] | .[]' -r /tmp/github.json > /tmp/github-all.txt
# save ipv4
grep -v ':' /tmp/github-all.txt > /tmp/github-ipv4.txt
# save ipv6
grep ':' /tmp/github-all.txt > /tmp/github-ipv6.txt
# sort & uniq
sort -h /tmp/github-ipv4.txt | uniq > github/ipv4.txt
sort -h /tmp/github-ipv6.txt | uniq > github/ipv6.txt
Loading…
Cancel
Save