From 8cbd103532806a0a989a817378734d08b3dc3ade Mon Sep 17 00:00:00 2001 From: Mark Ettema Date: Mon, 17 May 2021 08:34:14 +0700 Subject: [PATCH] Trying to setup with debugging in visual studio --- develop/proxy/Dockerfile | 8 +++++++- .../{proxy_ssl.conf => proxy_ssl.conf.template} | 8 ++++---- docker-compose.debug.yml | 7 +++++++ docker-compose.secrets.yml.template | 14 ++++++++++++++ src/appsettings.Development.json | 2 +- src/appsettings.json | 7 ++++--- 6 files changed, 37 insertions(+), 9 deletions(-) rename develop/proxy/{proxy_ssl.conf => proxy_ssl.conf.template} (65%) create mode 100644 docker-compose.debug.yml create mode 100644 docker-compose.secrets.yml.template diff --git a/develop/proxy/Dockerfile b/develop/proxy/Dockerfile index 0947519..38c3a8e 100644 --- a/develop/proxy/Dockerfile +++ b/develop/proxy/Dockerfile @@ -1,3 +1,9 @@ FROM nginx -ADD ./proxy_ssl.conf /etc/nginx/conf.d/proxy_ssl.conf \ No newline at end of file +ENV SSL_CERT=/tmp/dev.local.crt +ENV SSL_KEY=/tmp/dev.local.key + +ENV KEYCLOAK_URI=http://keycloak:8080 +ENV STEAMIDP_URI=http://steamidp:80 + +ADD ./proxy_ssl.conf.template /etc/nginx/templates/ \ No newline at end of file diff --git a/develop/proxy/proxy_ssl.conf b/develop/proxy/proxy_ssl.conf.template similarity index 65% rename from develop/proxy/proxy_ssl.conf rename to develop/proxy/proxy_ssl.conf.template index 2f9d45d..00ff768 100644 --- a/develop/proxy/proxy_ssl.conf +++ b/develop/proxy/proxy_ssl.conf.template @@ -1,7 +1,7 @@ server { listen 443 ssl; - ssl_certificate /tmp/dev.local.crt; - ssl_certificate_key /tmp/dev.local.key; + ssl_certificate ${SSL_CERT}; + ssl_certificate_key ${SSL_KEY}; proxy_set_header X-Forwarded-For $proxy_protocol_addr; proxy_set_header X-Forwarded-Proto $scheme; @@ -12,10 +12,10 @@ server { } location /auth { - proxy_pass http://keycloak:8080; + proxy_pass ${KEYCLOAK_URI}; } location /steam { - proxy_pass http://steamidp:80; + proxy_pass ${STEAMIDP_URI}; } } \ No newline at end of file diff --git a/docker-compose.debug.yml b/docker-compose.debug.yml new file mode 100644 index 0000000..85b2a37 --- /dev/null +++ b/docker-compose.debug.yml @@ -0,0 +1,7 @@ +version: '2' +services: + proxy: + environment: + STEAMIDP_URI: https://steamidp-debugger:5001 + extra_hosts: + - "steamidp-debugger:host-gateway" \ No newline at end of file diff --git a/docker-compose.secrets.yml.template b/docker-compose.secrets.yml.template new file mode 100644 index 0000000..c32387a --- /dev/null +++ b/docker-compose.secrets.yml.template @@ -0,0 +1,14 @@ +version: '2' +services: + proxy: + volumes: + - "/dev.local.crt:/tmp/dev.local.crt" + - "/dev.local.key:/tmp/dev.local.key" + + keycloak: + volumes: + - "/dev.local.crt:/tmp/dev.local.crt" + + steamidp: + environment: + Steam__ApplicationKey: \ No newline at end of file diff --git a/src/appsettings.Development.json b/src/appsettings.Development.json index 9988482..35c654c 100644 --- a/src/appsettings.Development.json +++ b/src/appsettings.Development.json @@ -7,6 +7,6 @@ } }, "Hosting": { - "PathBase": "/test" + "PathBase": "/steam" } } diff --git a/src/appsettings.json b/src/appsettings.json index 9c45c2d..bba5e09 100644 --- a/src/appsettings.json +++ b/src/appsettings.json @@ -6,9 +6,10 @@ }, "AllowedHosts": "*", "OpenID": { - "ClientID": "proxy", - "ClientSecret": "secret", - "RedirectUri": "http://localhost:8080/auth/realms/dev/broker/steam-dev/endpoint", + "ClientID": "keycloak", + "ClientSecret": "keycloak", + "ClientName": "keycloak", + "RedirectUri": "https://dev.local/auth/realms/dev/broker/steam/endpoint", "PostLogoutRedirectUri": "" }, "Hosting": {