Skip to content

Commit 5936b6a

Browse files
authored
Merge pull request #2 from 1024pix/update-oauth2-proxy
add static start config and upgrade oauth2-proxy version
2 parents 89b76d2 + 6d0a8c1 commit 5936b6a

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

bin/compile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
set -eo pipefail
44

5-
OAUTH2_PROXY_VERSION="${OAUTH2_PROXY_VERSION:=v7.3.0}"
6-
OAUTH2_PROXY_CHECKSUM="5ebeaa616e22d941e2e4917879b81c25469546f339adafc2411f58c41ea5d151"
5+
OAUTH2_PROXY_VERSION="${OAUTH2_PROXY_VERSION:=v7.6.0}"
6+
OAUTH2_PROXY_CHECKSUM="5e2f84ded61074b5f33eeef2c9f6d2d94294bcc9f9802e78921f02189ece0988"
77

88
BP_DIR="$(cd $(dirname "$0"); pwd)"
99
BUILD_DIR="$1"
@@ -16,9 +16,11 @@ mkdir -p "$BUILD_DIR/bin"
1616

1717
echo "downloading oauth2-proxy..."
1818
wget --no-verbose "https://github.com/oauth2-proxy/oauth2-proxy/releases/download/${OAUTH2_PROXY_VERSION}/oauth2-proxy-${OAUTH2_PROXY_VERSION}.linux-amd64.tar.gz" -O $tmp_dir/oauth2-proxy.tar.gz
19+
20+
echo "$OAUTH2_PROXY_CHECKSUM $tmp_dir/oauth2-proxy.tar.gz" | sha256sum -c -
21+
1922
tar -xzf $tmp_dir/oauth2-proxy.tar.gz -C "$BUILD_DIR/bin" --strip-components=1
2023

21-
echo "$OAUTH2_PROXY_CHECKSUM $BUILD_DIR/bin/oauth2-proxy" | sha256sum -c -
2224

2325

2426

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
cd "$(dirname "$0")"
6+
7+
if [ -z ${PORT+x} ]; then echo "please set PORT"; exit 1; fi
8+
if [ -z ${OAUTH2_PROXY_PROVIDER+x} ]; then echo "please set OAUTH2_PROXY_PROVIDER"; exit 1; fi
9+
if [ -z ${OAUTH2_PROXY_CLIENT_ID+x} ]; then echo "please set OAUTH2_PROXY_CLIENT_ID"; exit 1; fi
10+
if [ -z ${OAUTH2_PROXY_CLIENT_SECRET+x} ]; then echo "please set OAUTH2_PROXY_CLIENT_SECRET"; exit 1; fi
11+
if [ -z ${OAUTH2_PROXY_COOKIE_SECRET+x} ]; then echo "please set OAUTH2_PROXY_COOKIE_SECRET"; exit 1; fi
12+
13+
OAUTH2_PROXY_SET_XAUTHREQUEST="${OAUTH2_PROXY_SET_XAUTHREQUEST:-true}"
14+
export OAUTH2_PROXY_SET_XAUTHREQUEST
15+
16+
OAUTH2_PROXY_PASS_ACCESS_TOKEN="${OAUTH2_PROXY_PASS_ACCESS_TOKEN:-true}"
17+
export OAUTH2_PROXY_PASS_ACCESS_TOKEN
18+
19+
OAUTH2_PROXY_HTTP_ADDRESS="${OAUTH2_PROXY_HTTP_ADDRESS:-http://:$PORT}"
20+
export OAUTH2_PROXY_HTTP_ADDRESS
21+
22+
if [ -n "${OAUTH2_EMAIL_DOMAIN}" ]; then
23+
OAUTH2_PROXY_EMAIL_DOMAINS="${OAUTH2_EMAIL_DOMAIN}"
24+
else
25+
OAUTH2_PROXY_EMAIL_DOMAINS="*"
26+
fi
27+
export OAUTH2_PROXY_EMAIL_DOMAINS
28+
29+
if [ -n "${OAUTH2_GITHUB_ORG}" ]; then
30+
OAUTH2_PROXY_GITHUB_ORG="${OAUTH2_GITHUB_ORG}"
31+
export OAUTH2_PROXY_GITHUB_ORG
32+
fi
33+
34+
echo "starting oauth2-proxy..."
35+
exec ./oauth2-proxy --upstream file:///app/dist/#/

0 commit comments

Comments
 (0)