Update nginx to fix geoip database deprecation
This commit is contained in:
parent
3526163aac
commit
811075a0c8
5 changed files with 11 additions and 9 deletions
|
@ -13,7 +13,7 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
# 0.0.0 shouldn't clobber any released builds
|
# 0.0.0 shouldn't clobber any released builds
|
||||||
TAG ?= 0.73
|
TAG ?= 0.74
|
||||||
REGISTRY ?= quay.io/kubernetes-ingress-controller
|
REGISTRY ?= quay.io/kubernetes-ingress-controller
|
||||||
ARCH ?= $(shell go env GOARCH)
|
ARCH ?= $(shell go env GOARCH)
|
||||||
DOCKER ?= docker
|
DOCKER ?= docker
|
||||||
|
|
|
@ -109,18 +109,16 @@ mkdir -p /etc/nginx
|
||||||
# Get the GeoIP data
|
# Get the GeoIP data
|
||||||
GEOIP_FOLDER=/etc/nginx/geoip
|
GEOIP_FOLDER=/etc/nginx/geoip
|
||||||
mkdir -p $GEOIP_FOLDER
|
mkdir -p $GEOIP_FOLDER
|
||||||
function geoip_get {
|
|
||||||
wget -O $GEOIP_FOLDER/$1 $2 || { echo "Could not download $1, exiting." ; exit 1; }
|
|
||||||
gunzip $GEOIP_FOLDER/$1
|
|
||||||
}
|
|
||||||
function geoip2_get {
|
function geoip2_get {
|
||||||
wget -O $GEOIP_FOLDER/$1.tar.gz $2 || { echo "Could not download $1, exiting." ; exit 1; }
|
wget -O $GEOIP_FOLDER/$1.tar.gz $2 || { echo "Could not download $1, exiting." ; exit 1; }
|
||||||
mkdir $GEOIP_FOLDER/$1 && tar xf $GEOIP_FOLDER/$1.tar.gz -C $GEOIP_FOLDER/$1 --strip-components 1 && mv $GEOIP_FOLDER/$1/$1.mmdb $GEOIP_FOLDER/$1.mmdb && rm -rf $GEOIP_FOLDER/$1
|
mkdir $GEOIP_FOLDER/$1 \
|
||||||
|
&& tar xf $GEOIP_FOLDER/$1.tar.gz -C $GEOIP_FOLDER/$1 --strip-components 1 \
|
||||||
|
&& mv $GEOIP_FOLDER/$1/$1.mmdb $GEOIP_FOLDER/$1.mmdb \
|
||||||
|
&& rm -rf $GEOIP_FOLDER/$1 \
|
||||||
|
&& rm -rf $GEOIP_FOLDER/$1.tar.gz
|
||||||
}
|
}
|
||||||
|
|
||||||
geoip_get "GeoIPASNum.dat.gz" "http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz"
|
|
||||||
geoip_get "GeoIP.dat.gz" "https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz"
|
|
||||||
geoip_get "GeoLiteCity.dat.gz" "https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz"
|
|
||||||
geoip2_get "GeoLite2-City" "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"
|
geoip2_get "GeoLite2-City" "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"
|
||||||
geoip2_get "GeoLite2-ASN" "http://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz"
|
geoip2_get "GeoLite2-ASN" "http://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz"
|
||||||
|
|
||||||
|
@ -567,6 +565,10 @@ rm -rf /etc/nginx/owasp-modsecurity-crs/util/regression-tests
|
||||||
|
|
||||||
rm -rf $HOME/.hunter
|
rm -rf $HOME/.hunter
|
||||||
|
|
||||||
|
# move geoip directory
|
||||||
|
mv /geoip/* /etc/nginx/geoip
|
||||||
|
rm -rf /geoip
|
||||||
|
|
||||||
# update image permissions
|
# update image permissions
|
||||||
writeDirs=( \
|
writeDirs=( \
|
||||||
/etc/nginx \
|
/etc/nginx \
|
||||||
|
|
BIN
images/nginx/rootfs/geoip/GeoIP.dat
Normal file
BIN
images/nginx/rootfs/geoip/GeoIP.dat
Normal file
Binary file not shown.
BIN
images/nginx/rootfs/geoip/GeoIPASNum.dat
Normal file
BIN
images/nginx/rootfs/geoip/GeoIPASNum.dat
Normal file
Binary file not shown.
BIN
images/nginx/rootfs/geoip/GeoLiteCity.dat
Normal file
BIN
images/nginx/rootfs/geoip/GeoLiteCity.dat
Normal file
Binary file not shown.
Loading…
Reference in a new issue