From 453938dcb3dd069c051c8298a7cf546194c9d2f9 Mon Sep 17 00:00:00 2001 From: neothor Date: Thu, 26 Dec 2019 05:04:48 +0700 Subject: [PATCH 1/6] Add docker build github workflow --- .github/workflows/dockerimage.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/dockerimage.yml diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml new file mode 100644 index 0000000..5f2966b --- /dev/null +++ b/.github/workflows/dockerimage.yml @@ -0,0 +1,14 @@ +name: Docker Image CI + +on: [push] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag neothor/steam-open-id:$(date +%s) From 488d1d6e1962bf186ce986e57b3f138f4bad2e41 Mon Sep 17 00:00:00 2001 From: Mark Ettema Date: Fri, 27 Dec 2019 00:43:50 +0700 Subject: [PATCH 2/6] Added docker push --- .github/workflows/dockerimage.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 5f2966b..c2a361c 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -12,3 +12,11 @@ jobs: - uses: actions/checkout@v1 - name: Build the Docker image run: docker build . --file Dockerfile --tag neothor/steam-open-id:$(date +%s) + - name: Push the Docker image + uses: jerray/publish-docker-action@master + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + registry: docker.pkg.github.com + repository: neothor/steam-open-id + auto_tag: true \ No newline at end of file From b40945ee1d7772ce33d1610414c29b8b6664dee0 Mon Sep 17 00:00:00 2001 From: Mark Ettema Date: Fri, 27 Dec 2019 01:02:57 +0700 Subject: [PATCH 3/6] Use docker hub actions --- .github/workflows/dockerimage.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index c2a361c..909085f 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -10,13 +10,20 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag neothor/steam-open-id:$(date +%s) - - name: Push the Docker image - uses: jerray/publish-docker-action@master + + - name: Login to docker hub + if: success() + uses: actions-hub/docker/login@master + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build image + if: success() + run: docker build -t neothor/steam-open-id:${IMAGE_TAG} . + + - name: Push to docker registry + if: success() + uses: actions-hub/docker@master with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - registry: docker.pkg.github.com - repository: neothor/steam-open-id - auto_tag: true \ No newline at end of file + args: push neothor/steam-open-id:${IMAGE_TAG} \ No newline at end of file From d86435cce5e1a2e1ada1dca7e6302d92405cf0c3 Mon Sep 17 00:00:00 2001 From: neothor Date: Fri, 27 Dec 2019 01:19:32 +0700 Subject: [PATCH 4/6] Update README with github action badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 17dadb9..5b43f26 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Steam OpenId Connect Provider Steam OpenID 2.0 -> OpenID Connect Provider Proxy +![](https://github.com/neothor/steam-openid-connect-provider/workflows/Docker%20Image%20CI/badge.svg) + ## About Steam still uses the old OpenID 2.0 authentication protocol. Since ImperialPlugins.com has migrated to KeyCloak we were unable to migrate our old Steam logins as KeyCloak does not support OpenID 2.0. From ee132ce9fe8de1e6ff1b080705c16e2f03840f08 Mon Sep 17 00:00:00 2001 From: Mark Ettema Date: Fri, 27 Dec 2019 04:26:50 +0700 Subject: [PATCH 5/6] Added support for PathBase to be used behind a reverse proxy --- src/Startup.cs | 11 ++++++++++- src/appsettings.Development.json | 3 +++ src/appsettings.json | 5 ++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/Startup.cs b/src/Startup.cs index 146e59d..a562c62 100644 --- a/src/Startup.cs +++ b/src/Startup.cs @@ -41,7 +41,11 @@ namespace SteamOpenIdConnectProvider options.UserInteraction.LoginUrl = "/ExternalLogin"; }) .AddAspNetIdentity() - .AddInMemoryClients(IdentityServerConfig.GetClients(Configuration["OpenID:ClientID"], Configuration["OpenID:ClientSecret"], Configuration["OpenID:RedirectUri"], Configuration["OpenID:PostLogoutRedirectUri"])) + .AddInMemoryClients(IdentityServerConfig.GetClients( + Configuration["OpenID:ClientID"], + Configuration["OpenID:ClientSecret"], + Configuration["OpenID:RedirectUri"], + Configuration["OpenID:PostLogoutRedirectUri"])) .AddInMemoryPersistedGrants() .AddDeveloperSigningCredential(true) .AddInMemoryIdentityResources(IdentityServerConfig.GetIdentityResources()); @@ -63,6 +67,11 @@ namespace SteamOpenIdConnectProvider app.UseDeveloperExceptionPage(); } + if (!string.IsNullOrEmpty(Configuration["Hosting:PathBase"])) + { + app.UsePathBase(Configuration["Hosting:PathBase"]); + } + app.UseRouting(); app.UseIdentityServer(); app.UseEndpoints(endpoints => diff --git a/src/appsettings.Development.json b/src/appsettings.Development.json index e203e94..9988482 100644 --- a/src/appsettings.Development.json +++ b/src/appsettings.Development.json @@ -5,5 +5,8 @@ "System": "Information", "Microsoft": "Information" } + }, + "Hosting": { + "PathBase": "/test" } } diff --git a/src/appsettings.json b/src/appsettings.json index 5ea4b94..5582ca6 100644 --- a/src/appsettings.json +++ b/src/appsettings.json @@ -10,5 +10,8 @@ "RedirectUri": "http://localhost:8080/auth/realms/master/broker/steam/endpoint", "PostLogoutRedirectUri": "" }, - "AllowedHosts": "*" + "AllowedHosts": "*", + "Hosting": { + "PathBase": "" + } } \ No newline at end of file From 557fb8cc4836291684d5eee673802b192720dee4 Mon Sep 17 00:00:00 2001 From: neothor Date: Fri, 27 Dec 2019 15:54:22 +0700 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b43f26..e9938bd 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ After that set up your redirect URI, ClientID and ClientSecret in the appsetting This service contains a health check endpoint at `/health`. It checks if the Steam login server is up. ## Docker -[A docker image](https://hub.docker.com/r/imperialplugins/steam-openid-connect-provider) is also available. +[A docker image](https://hub.docker.com/r/neothor/steam-open-id) is also available. ``` docker run -it \