git.iko.soy/typeable/oauth2-proxy
on master help sign in
distribution: create sha256sum.txt file when creating binaries to allow validation of checksums.

* update README.md to include instructions on how to verify prebuilt binaries for new releases.

commitdc65ff800f3766d13e93665066872cd7fc585b73 authorTanvir Alam <tanviralam2@gmail.com> dateMon 20 Nov 2017, 14:35 (9 years ago) parentb0c1c85
2 files changed+21−3
README.md+5 dist.sh+16−3
README.md+5
@@ -16,6 +16,11 @@ to validate accounts by email, domain or group.
1616## Installation
1717
18181. Download [Prebuilt Binary](https://github.com/bitly/oauth2_proxy/releases) (current release is `v2.2`) or build with `$ go get github.com/bitly/oauth2_proxy` which will put the binary in `$GOROOT/bin`
19+Prebuilt binaries can be validated by extracting the file and verifying it against the `sha256sum.txt` checksum file provided for each release starting with version `v2.3`.
20+```
21+sha256sum -c sha256sum.txt 2>&1 | grep OK
22+oauth2_proxy-2.3.linux-amd64: OK
23+```
19242. Select a Provider and Register an OAuth Application with a Provider
20253. Configure OAuth2 Proxy using config file, command line options, or environment variables
21264. Configure SSL or Deploy behind a SSL endpoint (example provided for Nginx)
dist.sh+16−3
@@ -13,6 +13,7 @@ os=$(go env GOOS)
1313arch=$(go env GOARCH)
1414version=$(cat $DIR/version.go | grep "const VERSION" | awk '{print $NF}' | sed 's/"//g')
1515goversion=$(go version | awk '{print $3}')
16+sha256sum=()
1617
1718echo "... running tests"
1819./test.sh
@@ -25,10 +26,22 @@ for os in windows linux darwin; do
2526 fi
2627 BUILD=$(mktemp -d ${TMPDIR:-/tmp}/oauth2_proxy.XXXXXX)
2728 TARGET="oauth2_proxy-$version.$os-$arch.$goversion"
29+ FILENAME="oauth2_proxy-$version.$os-$arch$EXT"
2830 GOOS=$os GOARCH=$arch CGO_ENABLED=0 \
29− go build -ldflags="-s -w" -o $BUILD/$TARGET/oauth2_proxy$EXT || exit 1
30− pushd $BUILD
31− tar czvf $TARGET.tar.gz $TARGET
31+ go build -ldflags="-s -w" -o $BUILD/$TARGET/$FILENAME || exit 1
32+ pushd $BUILD/$TARGET
33+ sha256sum+=("$(shasum -a 256 $FILENAME || exit 1)")
34+ cd .. && tar czvf $TARGET.tar.gz $TARGET
3235 mv $TARGET.tar.gz $DIR/dist
3336 popd
3437done
38+
39+checksum_file="sha256sum.txt"
40+cd $DIR/dist
41+if [ -f $checksum_file ]; then
42+ rm $checksum_file
43+fi
44+touch $checksum_file
45+for checksum in "${sha256sum[@]}"; do
46+ echo "$checksum" >> $checksum_file
47+done