Skip to content

Commit

Permalink
simplified config in 1 docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykKul committed Oct 2, 2024
1 parent 78c3bac commit 6e394c8
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 152 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VITE_DATAVERSE_AUTHN_URL=http://localhost:4180
STORYBOOK_CHROMATIC_BUILD=false
3 changes: 0 additions & 3 deletions dev-authn-env/.env.example

This file was deleted.

4 changes: 0 additions & 4 deletions dev-authn-env/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions dev-authn-env/Makefile

This file was deleted.

81 changes: 0 additions & 81 deletions dev-authn-env/docker-compose-keycloak.yml

This file was deleted.

20 changes: 0 additions & 20 deletions dev-authn-env/frontend/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions dev-authn-env/frontend/public/.env

This file was deleted.

19 changes: 0 additions & 19 deletions dev-authn-env/frontend/public/nginx.conf

This file was deleted.

3 changes: 3 additions & 0 deletions dev-env/add-oidc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

curl -X POST -H 'Content-type: application/json' --upload-file oidc.json http://localhost:8080/api/admin/authenticationProviders
36 changes: 36 additions & 0 deletions dev-env/docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
services:
oauth2-proxy:
container_name: oauth2-proxy
image: quay.io/oauth2-proxy/oauth2-proxy:v7.6.0
command: --config /oauth2-proxy.cfg
hostname: oauth2-proxy
volumes:
- "./oauth2-proxy-keycloak.cfg:/oauth2-proxy.cfg"
restart: unless-stopped
ports:
- 4180:4180
networks:
- dataverse
depends_on:
- dev_nginx
- keycloak

keycloak:
container_name: keycloak
image: keycloak/keycloak:25.0
hostname: keycloak
command:
- 'start-dev'
- '--http-port=8000'
- '--import-realm'
volumes:
- ./keycloak:/opt/keycloak/data/import
environment:
KC_HTTP_PORT: 8000
KEYCLOAK_ADMIN: [email protected]
KEYCLOAK_ADMIN_PASSWORD: password
ports:
- 9080:8000
networks:
- dataverse

dev_nginx:
container_name: 'dev_nginx_proxy'
image: nginx:stable
hostname: dev_nginx
ports:
- '8000:80'
networks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@
"clientAuthenticatorType": "client-secret",
"secret": "72341b6d-7065-4518-a0e4-50ee15025608",
"redirectUris": [
"http://oauth2-proxy.localhost:4180/oauth2/callback"
"http://localhost:4180/oauth2/callback"
],
"webOrigins": [],
"notBefore": 0,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ http_address="0.0.0.0:4180"
cookie_secret="OQINaROshtE9TcZkNAm-5Zs2Pv3xaWytBmc5W7sPX7w="
email_domains="mailinator.com"
cookie_secure="false"
upstreams="http://dataverse-public"
cookie_domains=["oauth2-proxy.localhost:4080", "dataverse-public.localhost:8000", "keycloak.localhost:9080"] # Required so cookie can be read on all subdomains.
upstreams="http://dev_nginx"
cookie_domains=["localhost:4180", "localhost:8000", "localhost:9080"] # Required so cookie can be read on all subdomains.
whitelist_domains=[".localhost"] # Required to allow redirection back to original requested target.
skip_jwt_bearer_tokens="true" # will skip requests that have verified JWT bearer tokens (the token must have aud that matches this client id or one of the extras from extra-jwt-issuers)
pass_access_token="true"
Expand All @@ -13,7 +13,7 @@ pass_authorization_header="true"
# keycloak provider
client_secret="72341b6d-7065-4518-a0e4-50ee15025608"
client_id="oauth2-proxy"
redirect_url="http://oauth2-proxy.localhost:4180/oauth2/callback"
redirect_url="http://localhost:4180/oauth2/callback"

# in this case oauth2-proxy is going to visit
# http://keycloak.localhost:9080/realms/oauth2-proxy/.well-known/openid-configuration for configuration
Expand Down
File renamed without changes.

0 comments on commit 6e394c8

Please sign in to comment.