Add DigitalOcean

This commit is contained in:
Lord_Alfred
2021-08-01 14:57:56 +03:00
parent 4d101adebf
commit 08ac8593c6
4 changed files with 34 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ jobs:
bash amazon/downloader.sh
bash microsoft/downloader.sh
bash oracle/downloader.sh
bash digitalocean/downloader.sh
- name: Set up Python 3.7
uses: actions/setup-python@v2
@@ -43,10 +44,13 @@ jobs:
python utils/merge.py --source=amazon/ipv4.txt | sort -h > amazon/ipv4_merged.txt
python utils/merge.py --source=microsoft/ipv4.txt | sort -h > microsoft/ipv4_merged.txt
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
# ipv6
python utils/merge.py --source=google/ipv6.txt | sort -h > google/ipv6_merged.txt
python utils/merge.py --source=amazon/ipv6.txt | sort -h > amazon/ipv6_merged.txt
python utils/merge.py --source=microsoft/ipv6.txt | sort -h > microsoft/ipv6_merged.txt
# oracle not provide ipv6
python utils/merge.py --source=digitalocean/ipv6.txt | sort -h > digitalocean/ipv6_merged.txt
- name: Commit files
env:

View File

@@ -40,6 +40,13 @@ All addresses are stored in `.txt` files with CIDRs, where each range is on a ne
- IPv4: https://raw.githubusercontent.com/lord-alfred/ipranges/main/oracle/ipv4.txt
- IPv4 (merged): https://raw.githubusercontent.com/lord-alfred/ipranges/main/oracle/ipv4_merged.txt
### DigitalOcean
- IPv4: https://raw.githubusercontent.com/lord-alfred/ipranges/main/digitalocean/ipv4.txt
- IPv4 (merged): https://raw.githubusercontent.com/lord-alfred/ipranges/main/digitalocean/ipv4_merged.txt
- 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
## Author
Lord_Alfred

22
digitalocean/downloader.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
# https://docs.digitalocean.com/products/platform/
# From: https://github.com/nccgroup/cloud_ip_ranges
set -euo pipefail
set -x
# get from public ranges
curl -s https://www.digitalocean.com/geo/google.csv | cut -d, -f1 > /tmp/digitalocean.txt
# save ipv4
grep -v ':' /tmp/digitalocean.txt > /tmp/digitalocean-ipv4.txt
# save ipv6
grep ':' /tmp/digitalocean.txt > /tmp/digitalocean-ipv6.txt
# sort & uniq
sort -h /tmp/digitalocean-ipv4.txt | uniq > digitalocean/ipv4.txt
sort -h /tmp/digitalocean-ipv6.txt | uniq > digitalocean/ipv6.txt

View File

@@ -14,7 +14,7 @@ curl -s https://docs.oracle.com/en-us/iaas/tools/public_ip_ranges.json > /tmp/or
# save ipv4
jq '.regions[] | [.cidrs][] | .[].cidr | select(. != null)' -r /tmp/oracle.json > /tmp/oracle-ipv4.txt
# ipv6 not used
# ipv6 not provided
# sort & uniq