Skip to content
This repository was archived by the owner on May 27, 2019. It is now read-only.

Commit 7003286

Browse files
feat(Dockerfile): verify nginx pgp key (#219)
1 parent 9f8b39a commit 7003286

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

rootfs/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ RUN apt-get update \
1717
libssl-dev \
1818
libpcre3-dev \
1919
make \
20-
&& export NGINX_VERSION=1.10.1 VTS_VERSION=0.1.8 BUILD_PATH=/tmp/build PREFIX=/opt/router \
20+
&& export NGINX_VERSION=1.10.1 SIGNING_KEY=A1C052F8 VTS_VERSION=0.1.8 BUILD_PATH=/tmp/build PREFIX=/opt/router \
2121
&& rm -rf "$PREFIX" \
2222
&& mkdir "$PREFIX" \
2323
&& mkdir "$BUILD_PATH" \
2424
&& cd "$BUILD_PATH" \
25-
&& get_src 1fd35846566485e03c0e318989561c135c598323ff349c503a6c14826487a801 \
25+
&& get_src_gpg $SIGNING_KEY \
2626
"http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz" \
2727
&& get_src 6bb9a36d8d70302d691c49557313fb7262cafd942a961d11a2730d9a5d9f70e0 \
2828
"https://github.com/vozlt/nginx-module-vts/archive/v$VTS_VERSION.tar.gz" \

rootfs/bin/get_src_gpg

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
key="$1"
4+
url="$2"
5+
f=$(basename "$url")
6+
7+
gpg --recv-keys --keyserver keyserver.ubuntu.com "$key"
8+
# Trust public key without a interactive prompt
9+
gpg --list-keys --fingerprint --with-colons |
10+
sed -E -n -e 's/^fpr:::::::::([0-9A-F]+):$/\1:6:/p' |
11+
gpg --import-ownertrust
12+
curl -sSL "$url" -o "$f"
13+
curl -sSL "$url.asc" -o "$f.asc"
14+
gpg --verify $f.asc
15+
tar xzf "$f"
16+
rm "$f"

0 commit comments

Comments
 (0)