From ba901234cfa85ecef7af588afe687437166ca2e7 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 2 May 2022 16:44:51 +0200 Subject: [PATCH] auth-backend: add example setup for oauth2-proxy Signed-off-by: Patrik Oldsberg --- .../examples/docker-compose.oauth2-proxy.yaml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 plugins/auth-backend/examples/docker-compose.oauth2-proxy.yaml diff --git a/plugins/auth-backend/examples/docker-compose.oauth2-proxy.yaml b/plugins/auth-backend/examples/docker-compose.oauth2-proxy.yaml new file mode 100755 index 0000000000..6915983ca6 --- /dev/null +++ b/plugins/auth-backend/examples/docker-compose.oauth2-proxy.yaml @@ -0,0 +1,43 @@ +#!/usr/bin/env docker-compose -f + +# This docker compose file can be used to try out the oauth2-proxy auth provider. +# You'll need to provide your own GitHub client ID and secret through +# GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET. +# +# The following env vars can be used to configure `yarn dev` to work with the proxy: +# +# APP_CONFIG_app_baseUrl=http://localhost APP_CONFIG_app_listen_port=3000 \ +# APP_CONFIG_backend_baseUrl=http://localhost APP_CONFIG_backend_listen_port=7007 yarn dev +# +# The only manual modification you need to make to the app is to switch the +# SignInPage to the following: +# +# +# +# Once done, you can run the following and then navigate to http://localhost: +# +# ./docker-compose.oauth2-proxy.yaml up + +version: '3' +services: + proxy: + container_name: oauth2-proxy + image: quay.io/oauth2-proxy/oauth2-proxy:v7.2.1 + + # The below config assumes that you are running the frontend and backend + # in development mode, and that `host.docker.internal` resolves to the host machine. + command: >- + --cookie-secret=super-super-secret-cookie-secret + --cookie-secure=false + --http-address=0.0.0.0:80 + --email-domain=* + + --provider=github + --client-id=${GITHUB_CLIENT_ID} + --client-secret=${GITHUB_CLIENT_SECRET} + + --redirect-url=http://localhost/oauth2/callback + --upstream=http://host.docker.internal:7007/api/,http://host.docker.internal:3000 + + ports: + - 80:80