From 185f39348199158ef4ff6bb8b552afa121954916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 16 Jul 2018 23:34:15 +0200 Subject: [PATCH] drop the entrypoint for oauth2-proxy --- oauth2-proxy/Dockerfile | 24 +----------------------- oauth2-proxy/entrypoint.sh | 16 ---------------- oauth2-proxy/oauth2.cfg.tpl | 18 ------------------ 3 files changed, 1 insertion(+), 57 deletions(-) delete mode 100755 oauth2-proxy/entrypoint.sh delete mode 100644 oauth2-proxy/oauth2.cfg.tpl diff --git a/oauth2-proxy/Dockerfile b/oauth2-proxy/Dockerfile index 507373c..f95ba79 100644 --- a/oauth2-proxy/Dockerfile +++ b/oauth2-proxy/Dockerfile @@ -9,8 +9,7 @@ ENV OAUTH2_ARCHIVE_SHA256=1c16698ed0c85aa47aeb80e608f723835d9d1a8b98bd9ae36a5148 ENV OAUTH2_URL=https://github.com/bitly/oauth2_proxy/releases/download/v$OAUTH2_PROXY_SHORT_VERSION/$OAUTH2_ARCHIVE.tar.gz # Deps -RUN apk add --no-cache ca-certificates && \ - apk add --no-cache --virtual curl gettext +RUN apk add --no-cache ca-certificates gettext curl WORKDIR /tmp @@ -23,25 +22,4 @@ RUN curl -sL -o oauth2_proxy.tar.gz "$OAUTH2_URL" && \ # Cleanup RUN rm -fr /tmp/oauth2* -# Default settings -ENV OAUTH2_COOKIE_EXPIRE=24h \ - OAUTH2_COOKIE_HTTPONLY=false \ - OAUTH2_COOKIE_REFRESH=1h \ - OAUTH2_COOKIE_SECURE=false \ - OAUTH2_EMAIL_DOMAINS=["*"] \ - OAUTH2_HTTP_ADDRESS=127.0.0.1:8090 \ - OAUTH2_PROVIDER=github \ - OAUTH2_REQUEST_LOGGING=false - -# Mandatory settings -ENV OAUTH2_CLIENT_ID= \ - OAUTH2_CLIENT_SECRET= \ - OAUTH2_COOKIE_DOMAIN= \ - OAUTH2_COOKIE_SECRET= \ - OAUTH2_REDIRECT_URL= \ - OAUTH2_UPSTREAMS= - -ADD oauth2.cfg.tpl /var/lib/oauth.cfg.tpl -ADD entrypoint.sh /entrypoint.sh - ENTRYPOINT ["/bin/oauth2_proxy"] diff --git a/oauth2-proxy/entrypoint.sh b/oauth2-proxy/entrypoint.sh deleted file mode 100755 index cc5f568..0000000 --- a/oauth2-proxy/entrypoint.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env/bash - -# Verify mandatory veriables are set -[[ -z "$OAUTH2_CLIENT_ID" ]] && echo "Not set: OAUTH2_CLIENT_ID" && exit 1 -[[ -z "$OAUTH2_CLIENT_SECRET" ]] && echo "Not set: OAUTH2_CLIENT_SECRET" && exit 1 -[[ -z "$OAUTH2_COOKIE_DOMAIN" ]] && echo "Not set: OAUTH2_COOKIE_DOMAIN" && exit 1 -[[ -z "$OAUTH2_COOKIE_SECRET" ]] && echo "Not set: OAUTH2_COOKIE_SECRET" && exit 1 -[[ -z "$OAUTH2_REDIRECT_URL" ]] && echo "Not set: OAUTH2_REDIRECT_URL" && exit 1 -[[ -z "$OAUTH2_UPSTREAMS" ]] && echo "Not set: OAUTH2_UPSTREAMS" && exit 1 - -# This will apply the environment variables defined for docker container -# to the template to generate the oauth2 config file. -envsubst < /var/lib/oauth.cfg.tpl > /etc/oauth2.cfg - -# Run the actual proxy -/bin/oauth2_proxy -config /etc/oauth2.cfg $@ diff --git a/oauth2-proxy/oauth2.cfg.tpl b/oauth2-proxy/oauth2.cfg.tpl deleted file mode 100644 index 3d0dc1f..0000000 --- a/oauth2-proxy/oauth2.cfg.tpl +++ /dev/null @@ -1,18 +0,0 @@ -## OAuth2 Proxy Config File -## https://github.com/bitly/oauth2_proxy -## https://github.com/bitly/oauth2_proxy/blob/master/contrib/oauth2_proxy.cfg.example - -client_id = "$OAUTH2_CLIENT_ID" -client_secret = "$OAUTH2_CLIENT_SECRET" -cookie_domain = "$OAUTH2_COOKIE_DOMAIN" -cookie_expire = "$OAUTH2_COOKIE_EXPIRE" -cookie_httponly = $OAUTH2_COOKIE_HTTPONLY -cookie_refresh = "$OAUTH2_COOKIE_REFRESH" -cookie_secret = "$OAUTH2_COOKIE_SECRET" -cookie_secure = $OAUTH2_COOKIE_SECURE -email_domains = $OAUTH2_EMAIL_DOMAINS -http_address = "$OAUTH2_HTTP_ADDRESS" -provider = "$OAUTH2_PROVIDER" -redirect_url = "$OAUTH2_REDIRECT_URL" -request_logging = $OAUTH2_REQUEST_LOGGING -upstreams = $OAUTH2_UPSTREAMS