From b68488894a179c0be38a9a2017de892f758e8237 Mon Sep 17 00:00:00 2001 From: Pc Date: Wed, 22 Feb 2023 17:01:42 +0330 Subject: [PATCH 1/2] chore: Update identity server --- .../docker-compose/docker-compose.yaml | 335 +++++++++--------- deployments/k8s/flight.yml | 4 +- .../IdentityServerExtensions.cs | 2 +- 3 files changed, 177 insertions(+), 164 deletions(-) diff --git a/deployments/docker-compose/docker-compose.yaml b/deployments/docker-compose/docker-compose.yaml index d0fafcd..f065488 100644 --- a/deployments/docker-compose/docker-compose.yaml +++ b/deployments/docker-compose/docker-compose.yaml @@ -1,166 +1,7 @@ version: "3.3" services: - ####################################################### - # Gateway - ####################################################### - gateway: - image: gateway - build: - args: - Version: "1" - context: ../../ - dockerfile: src/ApiGateway/Dockerfile - container_name: booking-gateway - ports: - - "5001:80" - - "5000:443" - depends_on: - - postgres - - rabbitmq - - jaeger - - elasticsearch - - kibana - volumes: - - ~/.aspnet/https:/https:ro - environment: - - 'ASPNETCORE_URLS=https://+;http://+' - - ASPNETCORE_HTTPS_PORT=5001 - - ASPNETCORE_Kestrel__Certificates__Default__Password=password - - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx - networks: - - booking - - - ####################################################### - # Flight - ####################################################### - flight: - image: flight - build: - args: - Version: "1" - context: ../../ - dockerfile: src/Services/Flight/Dockerfile - container_name: flight - ports: - - 5004:80 - - 5003:443 - depends_on: - - postgres - - rabbitmq - - jaeger - - elasticsearch - - kibana - - mongo - volumes: - - ~/.aspnet/https:/https:ro - environment: - - 'ASPNETCORE_URLS=https://+;http://+' - - ASPNETCORE_HTTPS_PORT=5003 - - ASPNETCORE_Kestrel__Certificates__Default__Password=password - - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx - networks: - - booking - - - ####################################################### - # Identity - ####################################################### - identity: - image: identity - build: - args: - Version: "1" - context: ../../ - dockerfile: src/Services/Identity/Dockerfile - container_name: identity - ports: - - 6005:80 - - 5005:443 - depends_on: - - postgres - - rabbitmq - - jaeger - - elasticsearch - - kibana - volumes: - - ~/.aspnet/https:/https:ro - environment: - - 'ASPNETCORE_URLS=https://+;http://+' - - ASPNETCORE_HTTPS_PORT=5005 - - ASPNETCORE_Kestrel__Certificates__Default__Password=password - - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx - networks: - - booking - - - ####################################################### - # Passenger - ####################################################### - passenger: - image: passenger - build: - args: - Version: "1" - context: ../../ - dockerfile: src/Services/Passenger/Dockerfile - container_name: passenger - ports: - - 6012:80 - - 5012:443 - depends_on: - - postgres - - rabbitmq - - jaeger - - elasticsearch - - kibana - - mongo - volumes: - - ~/.aspnet/https:/https:ro - environment: - - 'ASPNETCORE_URLS=https://+;http://+' - - ASPNETCORE_HTTPS_PORT=5012 - - ASPNETCORE_Kestrel__Certificates__Default__Password=password - - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx - networks: - - booking - - - ####################################################### - # Booking - ####################################################### - booking: - image: booking - build: - args: - Version: "1" - context: ../../ - dockerfile: src/Services/Booking/Dockerfile - container_name: booking - ports: - - 6010:80 - - 5010:443 - depends_on: - - postgres - - rabbitmq - - jaeger - - eventstore - - elasticsearch - - kibana - - mongo - volumes: - - ~/.aspnet/https:/https:ro - environment: - - 'ASPNETCORE_URLS=https://+;http://+' - - ASPNETCORE_HTTPS_PORT=5010 - - ASPNETCORE_Kestrel__Certificates__Default__Password=password - - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx - networks: - - booking - - - ###################################################### + ###################################################### # Postgres ###################################################### postgres: @@ -266,9 +107,9 @@ services: networks: - booking - ####################################################### + ####################################################### # Kibana - ####################################################### + ####################################################### kibana: container_name: kibana image: kibana:7.17.9 @@ -283,6 +124,176 @@ services: - booking + ####################################################### + # Gateway + ####################################################### + # gateway: + # image: gateway + # build: + # args: + # Version: "1" + # context: ../../ + # dockerfile: src/ApiGateway/Dockerfile + # container_name: booking-gateway + # ports: + # - "5001:80" + # - "5000:443" + # depends_on: + # - postgres + # - rabbitmq + # - jaeger + # - elasticsearch + # - kibana + # volumes: + # - ~/.aspnet/https:/https:ro + # environment: + # - ASPNETCORE_ENVIRONMENT=docker + # - ASPNETCORE_URLS=https://+;http://+ + # - ASPNETCORE_HTTPS_PORT=5001 + # - ASPNETCORE_Kestrel__Certificates__Default__Password=password + # - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx + # networks: + # - booking + + + ####################################################### + # Flight + ####################################################### + flight: + image: flight + build: + args: + Version: "1" + context: ../../ + dockerfile: src/Services/Flight/Dockerfile + container_name: flight + ports: + - 5004:80 + - 5003:443 + depends_on: + - postgres + - rabbitmq + - jaeger + - elasticsearch + - kibana + - mongo + - identity + volumes: + - ~/.aspnet/https:/https:ro + environment: + - ASPNETCORE_ENVIRONMENT=docker + - ASPNETCORE_URLS=https://+;http://+ + - ASPNETCORE_HTTPS_PORT=5003 + - ASPNETCORE_HTTP_PORT=5004 + - Jwt__Authority=http://host.docker.internal:6005 + - Jwt__Audience=flight-api + - Jwt__RequireHttpsMetadata=false + - Jwt__MetadataAddress=http://host.docker.internal:6005/.well-known/openid-configuration + - ASPNETCORE_Kestrel__Certificates__Default__Password=password + - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx + networks: + - booking + + ####################################################### + # Identity + ####################################################### + identity: + image: identity + build: + args: + Version: "1" + context: ../../ + dockerfile: src/Services/Identity/Dockerfile + container_name: identity + ports: + - 6005:80 + - 5005:443 + depends_on: + - postgres + - rabbitmq + - jaeger + - elasticsearch + - kibana + volumes: + - ~/.aspnet/https:/https:ro + environment: + - ASPNETCORE_ENVIRONMENT=docker + - ASPNETCORE_URLS=https://+;http://+ + - ASPNETCORE_HTTPS_PORT=5005 + - ASPNETCORE_HTTP_PORT=6005 + - ASPNETCORE_Kestrel__Certificates__Default__Password=password + - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx + networks: + - booking + + + ####################################################### + # Passenger + ####################################################### + # passenger: + # image: passenger + # build: + # args: + # Version: "1" + # context: ../../ + # dockerfile: src/Services/Passenger/Dockerfile + # container_name: passenger + # ports: + # - 6012:80 + # - 5012:443 + # depends_on: + # - postgres + # - rabbitmq + # - jaeger + # - elasticsearch + # - kibana + # - mongo + # volumes: + # - ~/.aspnet/https:/https:ro + # environment: + # - ASPNETCORE_ENVIRONMENT=docker + # - ASPNETCORE_URLS=https://+;http://+ + # - ASPNETCORE_HTTPS_PORT=5012 + # - ASPNETCORE_Kestrel__Certificates__Default__Password=password + # - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx + # networks: + # - booking + + + ####################################################### + # Booking + ####################################################### + # booking: + # image: booking + # build: + # args: + # Version: "1" + # context: ../../ + # dockerfile: src/Services/Booking/Dockerfile + # container_name: booking + # ports: + # - 6010:80 + # - 5010:443 + # depends_on: + # - postgres + # - rabbitmq + # - jaeger + # - eventstore + # - elasticsearch + # - kibana + # - mongo + # volumes: + # - ~/.aspnet/https:/https:ro + # environment: + # - ASPNETCORE_ENVIRONMENT=docker + # - ASPNETCORE_URLS=https://+;http://+ + # - ASPNETCORE_HTTPS_PORT=5010 + # - ASPNETCORE_Kestrel__Certificates__Default__Password=password + # - ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx + # networks: + # - booking + + networks: booking: diff --git a/deployments/k8s/flight.yml b/deployments/k8s/flight.yml index 2722cf5..d8c978b 100644 --- a/deployments/k8s/flight.yml +++ b/deployments/k8s/flight.yml @@ -39,11 +39,13 @@ spec: - name: "MongoOptions__DatabaseName" value: "flight-db" - name: "Jwt__Authority" - value: "http://10.0.75.1:13926/" + value: "http://127.0.0.1:7914" - name: "Jwt__Audience" value: "flight-api" - name: "Jwt__RequireHttpsMetadata" value: "false" + - name: "Jwt__MetadataAddress" + value: "flight/.well-known/openid-configuration" # - name: "HealthOptions__Enabled" # value: "true" volumeMounts: diff --git a/src/Services/Identity/src/Identity/Extensions/Infrastructure/IdentityServerExtensions.cs b/src/Services/Identity/src/Identity/Extensions/Infrastructure/IdentityServerExtensions.cs index 495f955..492a3ed 100644 --- a/src/Services/Identity/src/Identity/Extensions/Infrastructure/IdentityServerExtensions.cs +++ b/src/Services/Identity/src/Identity/Extensions/Infrastructure/IdentityServerExtensions.cs @@ -38,7 +38,7 @@ public static class IdentityServerExtensions .AddResourceOwnerValidator(); //ref: https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html - identityServerBuilder.AddDeveloperSigningCredential(); + // identityServerBuilder.AddDeveloperSigningCredential(); return services; } From 13deb2869cdc024dfa28f310ab7895896f8b8b7d Mon Sep 17 00:00:00 2001 From: Pc Date: Wed, 22 Feb 2023 17:06:26 +0330 Subject: [PATCH 2/2] chore: Update identity server --- .github/actions/docker-build-publish/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/docker-build-publish/action.yml b/.github/actions/docker-build-publish/action.yml index 22a520c..13629b5 100644 --- a/.github/actions/docker-build-publish/action.yml +++ b/.github/actions/docker-build-publish/action.yml @@ -43,11 +43,11 @@ runs: if: ${{ github.ref == 'refs/heads/main' && success() }} shell: bash run: | - docker build -t ${{ inputs.registry-username }}/${{ inputs.image-name }}:v1.6.3 -f "${{ github.workspace }}/${{ inputs.dockerfile-path }}" . + docker build -t ${{ inputs.registry-username }}/${{ inputs.image-name }}:v1.6.4 -f "${{ github.workspace }}/${{ inputs.dockerfile-path }}" . - name: Publish Docker Image if: ${{ github.ref == 'refs/heads/main' && success() }} shell: bash run: | - docker push ${{ inputs.registry-username }}/${{ inputs.image-name }}:v1.6.3 + docker push ${{ inputs.registry-username }}/${{ inputs.image-name }}:v1.6.4