Skip to content

Commit

Permalink
fix: cloudflare ip updater
Browse files Browse the repository at this point in the history
  • Loading branch information
mfin committed Nov 11, 2023
1 parent ff3ba22 commit 563fcc2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/scripts/cloudflare-networks.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash

DATA=$(curl -s "https://api.cloudflare.com/client/v4/ips")
export CLOUDFLARE_IPS="$(echo $DATA | yq '.result.ipv4_cidrs + .result.ipv6_cidrs')"
export WHITELIST_IPS="$(echo $DATA | yq '.result.ipv4_cidrs + .result.ipv6_cidrs + ["10.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12"] | ..style="double"' -)"

yq -i '.ingress-nginx.controller.config.whitelist-source-range |= env(CLOUDFLARE_IPS) | ..style="double"' $1
yq -i '.ingress-nginx.controller.config.whitelist-source-range += ["10.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12"] | ..style="double"' $1
yq -i '.ingress-nginx.controller.config.whitelist-source-range = env(WHITELIST_IPS)' $1

0 comments on commit 563fcc2

Please sign in to comment.