Skip to content

Commit fabf902

Browse files
authored
Merge pull request #3624 from aledbf/update-nginx
Update nginx to fix geoip database deprecation
2 parents 1e2146c + 811075a commit fabf902

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

images/nginx/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
# 0.0.0 shouldn't clobber any released builds
16-
TAG ?= 0.73
16+
TAG ?= 0.74
1717
REGISTRY ?= quay.io/kubernetes-ingress-controller
1818
ARCH ?= $(shell go env GOARCH)
1919
DOCKER ?= docker

images/nginx/rootfs/build.sh

+10-8
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,16 @@ mkdir -p /etc/nginx
109109
# Get the GeoIP data
110110
GEOIP_FOLDER=/etc/nginx/geoip
111111
mkdir -p $GEOIP_FOLDER
112-
function geoip_get {
113-
wget -O $GEOIP_FOLDER/$1 $2 || { echo "Could not download $1, exiting." ; exit 1; }
114-
gunzip $GEOIP_FOLDER/$1
115-
}
112+
116113
function geoip2_get {
117114
wget -O $GEOIP_FOLDER/$1.tar.gz $2 || { echo "Could not download $1, exiting." ; exit 1; }
118-
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
115+
mkdir $GEOIP_FOLDER/$1 \
116+
&& tar xf $GEOIP_FOLDER/$1.tar.gz -C $GEOIP_FOLDER/$1 --strip-components 1 \
117+
&& mv $GEOIP_FOLDER/$1/$1.mmdb $GEOIP_FOLDER/$1.mmdb \
118+
&& rm -rf $GEOIP_FOLDER/$1 \
119+
&& rm -rf $GEOIP_FOLDER/$1.tar.gz
119120
}
120121

121-
geoip_get "GeoIPASNum.dat.gz" "http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz"
122-
geoip_get "GeoIP.dat.gz" "https://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz"
123-
geoip_get "GeoLiteCity.dat.gz" "https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz"
124122
geoip2_get "GeoLite2-City" "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"
125123
geoip2_get "GeoLite2-ASN" "http://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz"
126124

@@ -567,6 +565,10 @@ rm -rf /etc/nginx/owasp-modsecurity-crs/util/regression-tests
567565

568566
rm -rf $HOME/.hunter
569567

568+
# move geoip directory
569+
mv /geoip/* /etc/nginx/geoip
570+
rm -rf /geoip
571+
570572
# update image permissions
571573
writeDirs=( \
572574
/etc/nginx \

images/nginx/rootfs/geoip/GeoIP.dat

1.19 MB
Binary file not shown.
4.42 MB
Binary file not shown.
19.6 MB
Binary file not shown.

0 commit comments

Comments
 (0)