@@ -10,9 +10,21 @@ if [[ -z $DOCKER_BUILD ]]; then
1010 exit 1
1111fi
1212
13+ function get_src {
14+ hash=$1
15+ url=$2
16+ f=$( basename $url )
17+
18+ curl -sSL $url -o $f
19+ echo " $hash $f " | sha256sum -c - || exit 10
20+ tar xzf $f
21+ rm $f
22+ }
23+
1324export VERSION_NGINX=nginx-1.9.2
14- export SHA256_NGINX=80b6425be14a005c8cb15115f3c775f4bc06bf798aa1affaee84ed9cf641ed78
1525export VERSION_NAXSI=0d53a64ed856e694fcb4038748c8cf6d5551a603
26+ export VERSION_NDK=0.2.19
27+ export VERSION_SETMISC=0.29
1628
1729export BUILD_PATH=/tmp/build
1830
@@ -38,14 +50,18 @@ apk add --update-cache \
3850 zlib \
3951 zlib-dev
4052
41- # grab the source files
42- curl -sSL http://nginx.org/download/$VERSION_NGINX .tar.gz -o $BUILD_PATH /$VERSION_NGINX .tar.gz
43- echo " $SHA256_NGINX *$VERSION_NGINX .tar.gz" | sha256sum -c - || exit 10
44- curl -sSL https://github.com/nbs-system/naxsi/archive/$VERSION_NAXSI .tar.gz -o $BUILD_PATH /$VERSION_NAXSI .tar.gz
53+ # download, verify and extract the source files
54+ get_src 80b6425be14a005c8cb15115f3c775f4bc06bf798aa1affaee84ed9cf641ed78 \
55+ http://nginx.org/download/$VERSION_NGINX .tar.gz
56+
57+ get_src 128b56873eedbd3f240dc0f88a8b260d791321db92f14ba2fc5c49fc5307e04d \
58+ https://github.com/nbs-system/naxsi/archive/$VERSION_NAXSI .tar.gz
59+
60+ get_src 501f299abdb81b992a980bda182e5de5a4b2b3e275fbf72ee34dd7ae84c4b679 \
61+ https://github.com/simpl/ngx_devel_kit/archive/v$VERSION_NDK .tar.gz
4562
46- # expand the source files
47- tar xzf $VERSION_NGINX .tar.gz
48- tar xzf $VERSION_NAXSI .tar.gz
63+ get_src 8d280fc083420afb41dbe10df9a8ceec98f1d391bd2caa42ebae67d5bc9295d8 \
64+ https://github.com/openresty/set-misc-nginx-module/archive/v$VERSION_SETMISC .tar.gz
4965
5066# build nginx
5167cd $BUILD_PATH /$VERSION_NGINX
@@ -70,6 +86,8 @@ cd $BUILD_PATH/$VERSION_NGINX
7086 --with-mail_ssl_module \
7187 --with-stream \
7288 --add-module=$BUILD_PATH /naxsi-$VERSION_NAXSI /naxsi_src \
89+ --add-module=$BUILD_PATH /ngx_devel_kit-$VERSION_NDK \
90+ --add-module=$BUILD_PATH /set-misc-nginx-module-$VERSION_SETMISC \
7391 && make && make install
7492
7593mv /tmp/firewall /opt/nginx/firewall
0 commit comments