Skip to content

Commit

Permalink
trying different config
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykKul committed Oct 2, 2024
1 parent 25b338d commit ce6bbfc
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 93 deletions.
19 changes: 1 addition & 18 deletions dev-authn-env/docker-compose-keycloak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
dataverse: {}
oauth2-proxy: {}
depends_on:
- dataverse
- dataverse-public
- keycloak

keycloak:
Expand All @@ -57,23 +57,6 @@ services:
aliases:
- keycloak.localhost

dataverse:
container_name: 'dataverse'
hostname: dataverse
build:
context: ../
dockerfile: ./dev-authn-env/frontend/Dockerfile
network: host
args:
CONFIG: authn
DATAVERSE_SERVER: ${DATAVERSE_SERVER}
networks:
dataverse:
aliases:
- dataverse.localhost

# public access

dataverse-public:
container_name: 'dataverse-public'
hostname: dataverse-public
Expand Down
3 changes: 1 addition & 2 deletions dev-authn-env/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ FROM node:22-alpine AS builder

ADD ./dev-authn-env/frontend/git /app/
ARG CONFIG=public
COPY ./dev-authn-env/frontend/${CONFIG}/vite.config.ts /app/vite.config.ts
COPY ./dev-authn-env/frontend/${CONFIG}/.env /app/.env
COPY ./.npmrc /app/.npmrc

Expand All @@ -17,5 +16,5 @@ FROM nginx:1.27.1-alpine
COPY --from=builder /app/dist /usr/share/nginx/html
ARG CONFIG=public
COPY ./dev-authn-env/frontend/${CONFIG}/nginx.conf /etc/nginx/conf.d/default.conf
ARG DATAVERSE_SERVER=http://172.17.0.1:8080
ARG DATAVERSE_SERVER=http://172.17.0.1:8080/api
RUN sed -i -e 's@DATAVERSE_SERVER@'"$DATAVERSE_SERVER"'@' /etc/nginx/conf.d/default.conf
2 changes: 0 additions & 2 deletions dev-authn-env/frontend/authn/.env

This file was deleted.

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

This file was deleted.

24 changes: 0 additions & 24 deletions dev-authn-env/frontend/authn/vite.config.ts

This file was deleted.

24 changes: 0 additions & 24 deletions dev-authn-env/frontend/public/vite.config.ts

This file was deleted.

6 changes: 3 additions & 3 deletions dev-authn-env/oauth2-proxy-keycloak.cfg
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"
cookie_domains=["oauth2-proxy.localhost:4080", "dataverse.localhost:8000", "keycloak.localhost:9080"] # Required so cookie can be read on all subdomains.
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.
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 @@ -17,6 +17,6 @@ redirect_url="http://oauth2-proxy.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
oidc_issuer_url="http://keycloak.localhost:9080/realms/oauth2-proxy"
oidc_issuer_url="http://172.17.0.1:9080/realms/oauth2-proxy"
provider="oidc"
provider_display_name="Keycloak"
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const BASE_URL = (import.meta.env.VITE_DATAVERSE_BACKEND_URL as string) ?? ''
export const BASE_URL = `${window.location.protocol}//${window.location.hostname}`
export const AUTHN_URL = (import.meta.env.VITE_DATAVERSE_AUTHN_URL as string) ?? BASE_URL

0 comments on commit ce6bbfc

Please sign in to comment.