mirror of
https://github.com/lord-alfred/ipranges.git
synced 2025-12-19 03:37:47 +00:00
Add DigitalOcean
This commit is contained in:
4
.github/workflows/update.yml
vendored
4
.github/workflows/update.yml
vendored
@@ -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:
|
||||
|
||||
@@ -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
22
digitalocean/downloader.sh
Executable 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user