diff --git a/DevStore.sln b/DevStore.sln index 152cd34..8f21fab 100644 Binary files a/DevStore.sln and b/DevStore.sln differ diff --git a/docker/docker-compose-local-light.yml b/docker/docker-compose-local-light.yml index a691a1f..352dff9 100644 --- a/docker/docker-compose-local-light.yml +++ b/docker/docker-compose-local-light.yml @@ -10,13 +10,15 @@ services: dockerfile: ./web/DevStore.WebApp.MVC/Dockerfile restart: always environment: - - ASPNETCORE_ENVIRONMENT=Docker - - ASPNETCORE_URLS=http://*:5001 - - LC_ALL=en_US.UTF-8 - - LANG=en_US.UTF-8 + ASPNETCORE_ENVIRONMENT: Docker + ASPNETCORE_URLS: "https://+:443;http://+:80" + ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe + ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx + LC_ALL: "en_US.UTF-8" + LANG: "en_US.UTF-8" # Change the two lines above to your culture (ex pt_BR) volumes: - - dpkeys:/var/data_protection_keys/ + - ./certs:/https:ro depends_on: - api-catalog - api-identity @@ -28,7 +30,9 @@ services: image: rabbitmq:3-management container_name: devstore-rabbit expose: + ports: - 5672 + - 15672 environment: RABBITMQ_DEFAULT_USER: "devstore" RABBITMQ_DEFAULT_PASS: "devstore" @@ -45,14 +49,14 @@ services: api-identity: image: desenvolvedorio/devstore-api-identity:latest - container_name: devstore-api-identity + container_name: devstore-api-identity build: context: ../src dockerfile: ./services/DevStore.Identity.API/Dockerfile restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5101;http://+5102 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSUsers;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -73,7 +77,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5201;http://+5202 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSShoppingCart;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -95,7 +99,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5301;http://+5302 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSCatalog;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -116,7 +120,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5401;http://+5402 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSCustomers;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -138,7 +142,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5501;http://+5502 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx volumes: @@ -160,7 +164,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5601;http://+5602 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSBilling;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -183,7 +187,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5701;http://+5702 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSOrders;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -196,6 +200,27 @@ services: - api-identity - generate-pfx + web-status: + image: desenvolvedorio/devstore-web-status:latest + container_name: devstore-web-status + build: + context: ../src + dockerfile: ./web/DevStore.WebApp.Status/Dockerfile + restart: always + environment: + ASPNETCORE_ENVIRONMENT: Docker + ASPNETCORE_URLS: https://+:443;http://+:80 + CUSTOMCONNSTR_DefaultConnection: "Server=database-devstore;Database=DSStatus;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" + ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe + ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx + AppSettings__DatabaseType: SqlServer + USE_HTTPS_REDIRECTION: "false" + volumes: + - ./certs:/https:ro + depends_on: + - database-devstore + + generate-pfx: image: emberstack/openssl container_name: generate-pfx @@ -207,13 +232,10 @@ services: openssl genrsa -out devstore.rsa 2048 && openssl req -sha256 -new -key devstore.rsa -out devstore.csr -subj '/CN=localhost' && openssl x509 -req -sha256 -days 365 -in devstore.csr -signkey devstore.rsa -out devstore.crt && - openssl pkcs12 -export -out /https/devstore.academy-localhost.pfx -inkey devstore.rsa -in devstore.crt -password pass:9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe && - rm devstore.rsa devstore.csr devstore.crt)" + openssl pkcs12 -export -out /https/devstore.academy-localhost.pfx -inkey devstore.rsa -in devstore.crt -password pass:9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe)" seq: image: datalust/seq:latest - expose: - - 5341 ports: - 5341:80 environment: @@ -230,9 +252,9 @@ services: ports: - "7500:80" - "7501:443" + - "7510:8080" + - "7511:4443" depends_on: - web-mvc -volumes: - dpkeys: - + diff --git a/docker/docker-compose-local.yml b/docker/docker-compose-local.yml index 070674b..23fef49 100644 --- a/docker/docker-compose-local.yml +++ b/docker/docker-compose-local.yml @@ -10,13 +10,15 @@ services: dockerfile: ./web/DevStore.WebApp.MVC/Dockerfile restart: always environment: - - ASPNETCORE_ENVIRONMENT=Docker - - ASPNETCORE_URLS=http://*:5001 - - LC_ALL=en_US.UTF-8 - - LANG=en_US.UTF-8 + ASPNETCORE_ENVIRONMENT: Docker + ASPNETCORE_URLS: "https://+:443;http://+:80" + ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe + ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx + LC_ALL: "en_US.UTF-8" + LANG: "en_US.UTF-8" # Change the two lines above to your culture (ex pt_BR) volumes: - - dpkeys:/var/data_protection_keys/ + - ./certs:/https:ro depends_on: - api-catalog - api-identity @@ -53,7 +55,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5101;http://+5102 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-identity;Database=DSUsers;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -83,7 +85,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5201;http://+5202 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-cart;Database=DSShoppingCart;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -114,7 +116,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5301;http://+5302 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-catalog;Database=DSCatalog;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -144,7 +146,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5401;http://+5402 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-customers;Database=DSCustomers;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -166,7 +168,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5501;http://+5502 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx volumes: @@ -198,11 +200,11 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5601;http://+5602 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-billing;Port=5432;Database=DSBilling;User Id=sa;Password=MyDB@123" - AppSettings__DatabaseType: Postgre + AppSettings__DatabaseType: SqlServer volumes: - ./certs:/https:ro depends_on: @@ -230,7 +232,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5701;http://+5702 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-order;Database=DSOrders;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -252,6 +254,38 @@ services: environment: ACCEPT_EULA: "Y" + + database-status: + image: mcr.microsoft.com/mssql/server:2017-latest + container_name: devstore-database-status + expose: + - 1433 + environment: + SA_PASSWORD: "MyDB@123" + ACCEPT_EULA: "Y" + + + web-status: + image: desenvolvedorio/devstore-web-status:latest + container_name: devstore-web-status + build: + context: ../src + dockerfile: ./web/DevStore.WebApp.Status/Dockerfile + restart: always + environment: + ASPNETCORE_ENVIRONMENT: Docker + ASPNETCORE_URLS: https://+:443;http://+:80 + CUSTOMCONNSTR_DefaultConnection: "Server=database-status;Database=DSOrders;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" + ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe + ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx + AppSettings__DatabaseType: SqlServer + USE_HTTPS_REDIRECTION: "false" + volumes: + - ./certs:/https:ro + - ./certs/devstore.crt:/usr/local/share/ca-certificates/devstore.crt + depends_on: + - database-status + # This service is used to generate the PFX file for gRPC communication generate-pfx: image: emberstack/openssl @@ -280,6 +314,4 @@ services: depends_on: - web-mvc -volumes: - dpkeys: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 90b8aeb..d165cab 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -30,10 +30,12 @@ services: container_name: devstore-web-mvc-ecommerce restart: always environment: - - ASPNETCORE_ENVIRONMENT=Docker - - ASPNETCORE_URLS=http://*:5001 - - LC_ALL=en_US.UTF-8 - - LANG=en_US.UTF-8 + ASPNETCORE_ENVIRONMENT: Docker + ASPNETCORE_URLS: "https://+:443;http://+:80" + ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe + ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx + LC_ALL: "en_US.UTF-8" + LANG: "en_US.UTF-8" # Change the two lines above to your culture (ex pt_BR) volumes: - dpkeys:/var/data_protection_keys/ @@ -59,7 +61,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5101;http://+5102 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-identity;Database=DSUsers;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -86,7 +88,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5201;http://+5202 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-cart;Database=DSShoppingCart;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -114,7 +116,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5301;http://+5302 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-catalog;Database=DSCatalog;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -141,7 +143,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5401;http://+5402 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-customers;Database=DSCustomers;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -160,7 +162,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5501;http://+5502 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx volumes: @@ -188,7 +190,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5601;http://+5602 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-billing;Database=DSBilling;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -217,7 +219,7 @@ services: restart: always environment: ASPNETCORE_ENVIRONMENT: Docker - ASPNETCORE_URLS: https://+:5701;http://+5702 + ASPNETCORE_URLS: https://+:443;http://+:80 ASPNETCORE_Kestrel__Certificates__Default__Password: 9HoGMnb7Lu8NFdHBz4Vq2rtKivzMhmMXhtvuB4TZcLMmbWfFmDQCjJeLURAJ4GYe ASPNETCORE_Kestrel__Certificates__Default__Path: /https/devstore.academy-localhost.pfx CUSTOMCONNSTR_DefaultConnection: "Server=database-order;Database=DSOrders;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" @@ -232,8 +234,6 @@ services: seq: image: datalust/seq:latest - expose: - - 5341 ports: - 5341:80 environment: @@ -249,6 +249,8 @@ services: ports: - "7500:80" - "7501:443" + - "7510:8080" + - "7511:4443" depends_on: - web-mvc diff --git a/docker/nginx/devstore.conf b/docker/nginx/devstore.conf index 749de3e..dff369e 100644 --- a/docker/nginx/devstore.conf +++ b/docker/nginx/devstore.conf @@ -1,12 +1,18 @@ upstream web-mvc { - server web-mvc:5001; + server web-mvc; +} +upstream web-status { + server web-status; } server { listen 80; - server_name localhost; + server_name $hostname; + location /status { + rewrite ^/status(.*)$ http://localhost:7510/status$1 redirect; + } location / { proxy_pass http://web-mvc; } @@ -16,6 +22,15 @@ server { # } } +server { + listen 8080; + server_name $hostname; + + location / { + proxy_pass http://web-status; + } +} + server { listen 443 ssl; server_name $hostname; @@ -24,6 +39,9 @@ server { ssl_ciphers HIGH:!aNULL:!MD5; ssl_certificate /etc/nginx/nerdstore-certificate.pem; ssl_certificate_key /etc/nginx/nerdstore-certificate.key; + location /status { + rewrite ^/status(.*)$ https://localhost:7511/status$1 redirect; + } location / { proxy_pass http://web-mvc; proxy_redirect off; @@ -35,4 +53,25 @@ server { proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $server_name; } +} + +server { + listen 4443 ssl; + server_name $hostname; + + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_certificate /etc/nginx/nerdstore-certificate.pem; + ssl_certificate_key /etc/nginx/nerdstore-certificate.key; + location / { + proxy_pass http://web-status; + proxy_redirect off; + proxy_http_version 1.1; + proxy_set_header Connection keep-alive; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $server_name; + } } \ No newline at end of file diff --git a/src/api-gateways/DevStore.Bff.Checkout/Configuration/ApiConfig.cs b/src/api-gateways/DevStore.Bff.Checkout/Configuration/ApiConfig.cs index 3a9b518..49b30e3 100644 Binary files a/src/api-gateways/DevStore.Bff.Checkout/Configuration/ApiConfig.cs and b/src/api-gateways/DevStore.Bff.Checkout/Configuration/ApiConfig.cs differ diff --git a/src/api-gateways/DevStore.Bff.Checkout/DevStore.Bff.Checkout.csproj b/src/api-gateways/DevStore.Bff.Checkout/DevStore.Bff.Checkout.csproj index 74634dd..906e0c0 100644 Binary files a/src/api-gateways/DevStore.Bff.Checkout/DevStore.Bff.Checkout.csproj and b/src/api-gateways/DevStore.Bff.Checkout/DevStore.Bff.Checkout.csproj differ diff --git a/src/api-gateways/DevStore.Bff.Checkout/Services/OrderService.cs b/src/api-gateways/DevStore.Bff.Checkout/Services/OrderService.cs index 7e0c3ea..6a50438 100644 Binary files a/src/api-gateways/DevStore.Bff.Checkout/Services/OrderService.cs and b/src/api-gateways/DevStore.Bff.Checkout/Services/OrderService.cs differ diff --git a/src/api-gateways/DevStore.Bff.Checkout/appsettings.Docker.json b/src/api-gateways/DevStore.Bff.Checkout/appsettings.Docker.json index 93903b0..f75a253 100644 --- a/src/api-gateways/DevStore.Bff.Checkout/appsettings.Docker.json +++ b/src/api-gateways/DevStore.Bff.Checkout/appsettings.Docker.json @@ -22,17 +22,17 @@ "Application": "BffCheckout" } }, - "ShoppingCartUrl": "https://devstore-api-cart:5201", - "CatalogUrl": "https://devstore-api-catalog:5301", - "CustomerUrl": "https://devstore-api-customers:5401", - "PaymentUrl": "https://devstore-api-billing:5601", - "OrderUrl": "https://devstore-api-order:5701", + "ShoppingCartUrl": "https://devstore-api-cart", + "CatalogUrl": "https://devstore-api-catalog", + "CustomerUrl": "https://devstore-api-customers", + "PaymentUrl": "https://devstore-api-billing", + "OrderUrl": "https://devstore-api-order", "MessageQueueConnection": { "MessageBus": "host=devstore-rabbit:5672;publisherConfirms=true;timeout=30;username=devstore;password=devstore" }, "AppSettings": { - "JwksUri": "https://devstore-api-identity:5101/jwks", + "JwksUri": "https://devstore-api-identity/jwks", "Issuer": "https://devstore.academy", "Audience": "DevStore" } diff --git a/src/api-gateways/DevStore.Bff.Checkout/appsettings.Production.json b/src/api-gateways/DevStore.Bff.Checkout/appsettings.Production.json index 819d791..03fb20e 100644 --- a/src/api-gateways/DevStore.Bff.Checkout/appsettings.Production.json +++ b/src/api-gateways/DevStore.Bff.Checkout/appsettings.Production.json @@ -23,17 +23,17 @@ } }, - "ShoppingCartUrl": "https://devstore-api-cart:5201", - "CatalogUrl": "https://devstore-api-catalog:5301", - "CustomerUrl": "https://devstore-api-customers:5401", - "PaymentUrl": "https://devstore-api-billing:5601", - "OrderUrl": "https://devstore-api-order:5701", + "ShoppingCartUrl": "https://devstore-api-cart", + "CatalogUrl": "https://devstore-api-catalog", + "CustomerUrl": "https://devstore-api-customers", + "PaymentUrl": "https://devstore-api-billing", + "OrderUrl": "https://devstore-api-order", "MessageQueueConnection": { "MessageBus": "host=devstore-rabbit:5672;publisherConfirms=true;timeout=30;username=devstore;password=devstore" }, "AppSettings": { - "JwksUri": "https://devstore-api-identity:5101/jwks", + "JwksUri": "https://devstore-api-identity/jwks", "Issuer": "https://devstore.academy", "Audience": "DevStore" } diff --git a/src/building-blocks/DevStore.Core/Properties/launchSettings.json b/src/building-blocks/DevStore.Core/Properties/launchSettings.json new file mode 100644 index 0000000..86fe9e6 --- /dev/null +++ b/src/building-blocks/DevStore.Core/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "DevStore.Core": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:56389;http://localhost:56392" + } + } +} \ No newline at end of file diff --git a/src/building-blocks/DevStore.MessageBus/MessageBus.cs b/src/building-blocks/DevStore.MessageBus/MessageBus.cs index 7b490b0..6d65936 100644 Binary files a/src/building-blocks/DevStore.MessageBus/MessageBus.cs and b/src/building-blocks/DevStore.MessageBus/MessageBus.cs differ diff --git a/src/building-blocks/DevStore.WebAPI.Core/Configuration/DbHealthChecker.cs b/src/building-blocks/DevStore.WebAPI.Core/Configuration/DbHealthChecker.cs index 2bd8c44..738649f 100644 --- a/src/building-blocks/DevStore.WebAPI.Core/Configuration/DbHealthChecker.cs +++ b/src/building-blocks/DevStore.WebAPI.Core/Configuration/DbHealthChecker.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using DevStore.Core.Exceptions; using Microsoft.EntityFrameworkCore; diff --git a/src/building-blocks/DevStore.WebAPI.Core/Configuration/EasyNetQRabbitHealthCheck.cs b/src/building-blocks/DevStore.WebAPI.Core/Configuration/EasyNetQRabbitHealthCheck.cs new file mode 100644 index 0000000..9dffa95 --- /dev/null +++ b/src/building-blocks/DevStore.WebAPI.Core/Configuration/EasyNetQRabbitHealthCheck.cs @@ -0,0 +1,53 @@ +using EasyNetQ; +using EasyNetQ.ConnectionString; +using HealthChecks.RabbitMQ; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Diagnostics.HealthChecks; +using RabbitMQ.Client; + +namespace DevStore.WebAPI.Core.Configuration; + +public static class EasyNetQRabbitHealthCheck +{ + public static IHealthChecksBuilder AddEasyNetQRabbitHealthCheck(this IHealthChecksBuilder healthChecksBuilder, string connectionString) + { + var easyNetQConnstringParser = new ConnectionStringParser(); + var connectionConfiguration = easyNetQConnstringParser.Parse(connectionString); + var connRabbit = CreateConnectionFactory(connectionConfiguration); + var rabbitHealthCheck = new RabbitMQHealthCheck(connRabbit); + healthChecksBuilder.Services.AddSingleton(sp => rabbitHealthCheck); + + return healthChecksBuilder.Add(new HealthCheckRegistration( + "RabbitMQ", + sp => sp.GetRequiredService(), + default, + tags: new[] { "infra" }, + default)); + } + + private static IConnectionFactory CreateConnectionFactory(ConnectionConfiguration configuration) + { + var connectionFactory = new ConnectionFactory + { + AutomaticRecoveryEnabled = true, + TopologyRecoveryEnabled = false, + VirtualHost = configuration.VirtualHost, + UserName = configuration.UserName, + Password = configuration.Password, + Port = configuration.Port, + RequestedHeartbeat = configuration.RequestedHeartbeat, + ClientProperties = configuration.ClientProperties, + AuthMechanisms = configuration.AuthMechanisms, + ClientProvidedName = configuration.Name, + NetworkRecoveryInterval = configuration.ConnectIntervalAttempt, + ContinuationTimeout = configuration.Timeout, + DispatchConsumersAsync = true, + ConsumerDispatchConcurrency = configuration.PrefetchCount, + }; + + if (configuration.Hosts.Count > 0) + connectionFactory.HostName = configuration.Hosts[0].Host; + + return connectionFactory; + } +} \ No newline at end of file diff --git a/src/building-blocks/DevStore.WebAPI.Core/Configuration/GenericHealthCheck.cs b/src/building-blocks/DevStore.WebAPI.Core/Configuration/GenericHealthCheck.cs index f4ff9fe..f565b6d 100644 --- a/src/building-blocks/DevStore.WebAPI.Core/Configuration/GenericHealthCheck.cs +++ b/src/building-blocks/DevStore.WebAPI.Core/Configuration/GenericHealthCheck.cs @@ -1,18 +1,90 @@ -using Microsoft.AspNetCore.Builder; +using DevStore.Core.Utils; +using DevStore.WebAPI.Core.DatabaseFlavor; +using EasyNetQ; +using EasyNetQ.ConnectionString; +using HealthChecks.RabbitMQ; +using HealthChecks.UI.Client; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Diagnostics.HealthChecks; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Diagnostics.HealthChecks; +using NetDevPack.Utilities; +using RabbitMQ.Client; +using static DevStore.WebAPI.Core.DatabaseFlavor.ProviderConfiguration; namespace DevStore.WebAPI.Core.Configuration { public static class GenericHealthCheck { - public static void AddGenericHealthCheck(this IServiceCollection services) + + public static IHealthChecksBuilder AddDefaultHealthCheck( + this IServiceCollection services, + IConfiguration configuration) { - services.AddHealthChecks(); + var (database, connString) = DetectDatabase(configuration); + var checkBuilder = services + .AddHealthChecks() + .AddCheck("self", () => HealthCheckResult.Healthy(), tags: new[] { "api" }); + + var rabbitConnStr = configuration.GetMessageQueueConnection("MessageBus"); + + // We need to parse EasyNetQ Connection String to RabbitMQ native connectionstring + // before send it to Health check + if (rabbitConnStr.IsPresent()) + checkBuilder.AddEasyNetQRabbitHealthCheck(rabbitConnStr); + + + return database switch + { + DatabaseType.SqlServer => checkBuilder.AddSqlServer(connString, name: "SqlServer", tags: new[] { "infra" }), + DatabaseType.MySql => checkBuilder.AddMySql(connString, name: "MySql", tags: new[] { "infra" }), + DatabaseType.Postgre => checkBuilder.AddNpgSql(connString, name: "Postgre", tags: new[] { "infra" }), + DatabaseType.Sqlite => checkBuilder.AddSqlite(connString, name: "Sqlite", tags: new[] { "infra" }), + _ => checkBuilder + }; } - public static void UseGenericHealthCheck(this WebApplication app, string path) + private static IConnectionFactory CreateConnectionFactory(ConnectionConfiguration configuration) { - app.MapHealthChecks(path); + var connectionFactory = new ConnectionFactory + { + AutomaticRecoveryEnabled = true, + TopologyRecoveryEnabled = false, + VirtualHost = configuration.VirtualHost, + UserName = configuration.UserName, + Password = configuration.Password, + Port = configuration.Port, + RequestedHeartbeat = configuration.RequestedHeartbeat, + ClientProperties = configuration.ClientProperties, + AuthMechanisms = configuration.AuthMechanisms, + ClientProvidedName = configuration.Name, + NetworkRecoveryInterval = configuration.ConnectIntervalAttempt, + ContinuationTimeout = configuration.Timeout, + DispatchConsumersAsync = true, + ConsumerDispatchConcurrency = configuration.PrefetchCount, + }; + + if (configuration.Hosts.Count > 0) + connectionFactory.HostName = configuration.Hosts[0].Host; + + return connectionFactory; + } + + public static IApplicationBuilder UseDefaultHealthcheck(this IApplicationBuilder app) + { + app.UseHealthChecks("/healthz", new HealthCheckOptions + { + Predicate = r => r.Tags.Contains("api"), + ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse + }); + app.UseHealthChecks("/healthz-infra", new HealthCheckOptions + { + Predicate = r => r.Tags.Contains("infra"), + ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse + }); + + return app; } } } diff --git a/src/building-blocks/DevStore.WebAPI.Core/DatabaseFlavor/DatabaseType.cs b/src/building-blocks/DevStore.WebAPI.Core/DatabaseFlavor/DatabaseType.cs index 50b674e..fc1cabd 100644 --- a/src/building-blocks/DevStore.WebAPI.Core/DatabaseFlavor/DatabaseType.cs +++ b/src/building-blocks/DevStore.WebAPI.Core/DatabaseFlavor/DatabaseType.cs @@ -2,6 +2,7 @@ public enum DatabaseType { + None, SqlServer, MySql, Postgre, diff --git a/src/building-blocks/DevStore.WebAPI.Core/DatabaseFlavor/ProviderConfiguration.cs b/src/building-blocks/DevStore.WebAPI.Core/DatabaseFlavor/ProviderConfiguration.cs index eab8b2d..0ef1f22 100644 --- a/src/building-blocks/DevStore.WebAPI.Core/DatabaseFlavor/ProviderConfiguration.cs +++ b/src/building-blocks/DevStore.WebAPI.Core/DatabaseFlavor/ProviderConfiguration.cs @@ -9,16 +9,20 @@ namespace DevStore.WebAPI.Core.DatabaseFlavor; public class ProviderConfiguration { private readonly string _connectionString; - public static ProviderConfiguration With; + public ProviderConfiguration With() => this; private static readonly string MigrationAssembly = typeof(ProviderConfiguration).GetTypeInfo().Assembly.GetName().Name; - public static void Build(string connString) + public static ProviderConfiguration Build(string connString) { - if (With is null) - With = new ProviderConfiguration(connString); + return new ProviderConfiguration(connString); } - public ProviderConfiguration(string connString) => _connectionString = connString; + + + public ProviderConfiguration(string connString) + { + _connectionString = connString; + } public Action SqlServer => options => options.UseSqlServer(_connectionString, sql => sql.MigrationsAssembly(MigrationAssembly)); @@ -27,7 +31,8 @@ public static void Build(string connString) options => options.UseMySql(_connectionString, ServerVersion.AutoDetect(_connectionString), sql => sql.MigrationsAssembly(MigrationAssembly)); public Action Postgre => - options => { + options => + { options.UseNpgsql(_connectionString, sql => sql.MigrationsAssembly(MigrationAssembly)); AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); }; @@ -41,6 +46,6 @@ public static void Build(string connString) /// Trying to improve readability at ConfigureServices /// public static (DatabaseType, string) DetectDatabase(IConfiguration configuration) => ( - configuration.GetValue("AppSettings:DatabaseType"), + configuration.GetValue("AppSettings:DatabaseType", DatabaseType.None), configuration.GetConnectionString("DefaultConnection")); } \ No newline at end of file diff --git a/src/building-blocks/DevStore.WebAPI.Core/DatabaseFlavor/ProviderSelector.cs b/src/building-blocks/DevStore.WebAPI.Core/DatabaseFlavor/ProviderSelector.cs index bf3b13f..d8b619c 100644 --- a/src/building-blocks/DevStore.WebAPI.Core/DatabaseFlavor/ProviderSelector.cs +++ b/src/building-blocks/DevStore.WebAPI.Core/DatabaseFlavor/ProviderSelector.cs @@ -12,13 +12,12 @@ public static class ProviderSelector (DatabaseType, string) options) where TContext : DbContext { var (database, connString) = options; - Build(connString); return database switch { - DatabaseType.SqlServer => services.PersistStore(With.SqlServer), - DatabaseType.MySql => services.PersistStore(With.MySql), - DatabaseType.Postgre => services.PersistStore(With.Postgre), - DatabaseType.Sqlite => services.PersistStore(With.Sqlite), + DatabaseType.SqlServer => services.PersistStore(Build(connString).With().SqlServer), + DatabaseType.MySql => services.PersistStore(Build(connString).With().MySql), + DatabaseType.Postgre => services.PersistStore(Build(connString).With().Postgre), + DatabaseType.Sqlite => services.PersistStore(Build(connString).With().Sqlite), _ => throw new ArgumentOutOfRangeException(nameof(database), database, null) }; @@ -27,13 +26,12 @@ public static class ProviderSelector public static Action WithProviderAutoSelection((DatabaseType, string) options) { var (database, connString) = options; - Build(connString); return database switch { - DatabaseType.SqlServer => With.SqlServer, - DatabaseType.MySql => With.MySql, - DatabaseType.Postgre => With.Postgre, - DatabaseType.Sqlite => With.Sqlite, + DatabaseType.SqlServer => Build(connString).With().SqlServer, + DatabaseType.MySql => Build(connString).With().MySql, + DatabaseType.Postgre => Build(connString).With().Postgre, + DatabaseType.Sqlite => Build(connString).With().Sqlite, _ => throw new ArgumentOutOfRangeException(nameof(database), database, null) }; diff --git a/src/building-blocks/DevStore.WebAPI.Core/DevStore.WebAPI.Core.csproj b/src/building-blocks/DevStore.WebAPI.Core/DevStore.WebAPI.Core.csproj index c2e0770..67cc586 100644 Binary files a/src/building-blocks/DevStore.WebAPI.Core/DevStore.WebAPI.Core.csproj and b/src/building-blocks/DevStore.WebAPI.Core/DevStore.WebAPI.Core.csproj differ diff --git a/src/building-blocks/DevStore.WebAPI.Core/Extensions/HttpExtensions.cs b/src/building-blocks/DevStore.WebAPI.Core/Extensions/HttpExtensions.cs index 0867734..c1db2e9 100644 Binary files a/src/building-blocks/DevStore.WebAPI.Core/Extensions/HttpExtensions.cs and b/src/building-blocks/DevStore.WebAPI.Core/Extensions/HttpExtensions.cs differ diff --git a/src/building-blocks/DevStore.WebAPI.Core/Identity/JwtConfig.cs b/src/building-blocks/DevStore.WebAPI.Core/Identity/JwtConfig.cs index 67fe4af..d9d5bd0 100644 Binary files a/src/building-blocks/DevStore.WebAPI.Core/Identity/JwtConfig.cs and b/src/building-blocks/DevStore.WebAPI.Core/Identity/JwtConfig.cs differ diff --git a/src/services/DevStore.Billing.API/Configuration/ApiConfig.cs b/src/services/DevStore.Billing.API/Configuration/ApiConfig.cs index 04185a4..0e1941e 100644 Binary files a/src/services/DevStore.Billing.API/Configuration/ApiConfig.cs and b/src/services/DevStore.Billing.API/Configuration/ApiConfig.cs differ diff --git a/src/services/DevStore.Billing.API/DevStore.Billing.API.csproj b/src/services/DevStore.Billing.API/DevStore.Billing.API.csproj index 6d09d19..3e4eb58 100644 Binary files a/src/services/DevStore.Billing.API/DevStore.Billing.API.csproj and b/src/services/DevStore.Billing.API/DevStore.Billing.API.csproj differ diff --git a/src/services/DevStore.Billing.API/appsettings.Docker.json b/src/services/DevStore.Billing.API/appsettings.Docker.json index 1da4472..eee4280 100644 --- a/src/services/DevStore.Billing.API/appsettings.Docker.json +++ b/src/services/DevStore.Billing.API/appsettings.Docker.json @@ -29,7 +29,7 @@ "MessageBus": "host=devstore-rabbit:5672;publisherConfirms=true;timeout=30;username=devstore;password=devstore" }, "AppSettings": { - "JwksUri": "https://devstore-api-identity:5101/jwks", + "JwksUri": "https://devstore-api-identity/jwks", "Issuer": "https://devstore.academy", "Audience": "DevStore" }, diff --git a/src/services/DevStore.Billing.API/appsettings.Production.json b/src/services/DevStore.Billing.API/appsettings.Production.json index 3023dd0..001bde6 100644 --- a/src/services/DevStore.Billing.API/appsettings.Production.json +++ b/src/services/DevStore.Billing.API/appsettings.Production.json @@ -29,7 +29,7 @@ "MessageBus": "host=devstore-rabbit:5672;publisherConfirms=true;timeout=30;username=devstore;password=devstore" }, "AppSettings": { - "JwksUri": "https://devstore-api-identity:5101/jwks", + "JwksUri": "https://devstore-api-identity/jwks", "Issuer": "https://devstore.academy", "Audience": "DevStore" }, diff --git a/src/services/DevStore.Billing.DevsPay/Properties/launchSettings.json b/src/services/DevStore.Billing.DevsPay/Properties/launchSettings.json new file mode 100644 index 0000000..e147a5c --- /dev/null +++ b/src/services/DevStore.Billing.DevsPay/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "DevStore.Billing.DevsPay": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:56386;http://localhost:56395" + } + } +} \ No newline at end of file diff --git a/src/services/DevStore.Catalog.API/Configuration/ApiConfig.cs b/src/services/DevStore.Catalog.API/Configuration/ApiConfig.cs index 59d2ec6..4fb8d7a 100644 Binary files a/src/services/DevStore.Catalog.API/Configuration/ApiConfig.cs and b/src/services/DevStore.Catalog.API/Configuration/ApiConfig.cs differ diff --git a/src/services/DevStore.Catalog.API/DevStore.Catalog.API.csproj b/src/services/DevStore.Catalog.API/DevStore.Catalog.API.csproj index 67ce04a..251cf75 100644 Binary files a/src/services/DevStore.Catalog.API/DevStore.Catalog.API.csproj and b/src/services/DevStore.Catalog.API/DevStore.Catalog.API.csproj differ diff --git a/src/services/DevStore.Catalog.API/appsettings.Docker.json b/src/services/DevStore.Catalog.API/appsettings.Docker.json index 0916730..17b9143 100644 --- a/src/services/DevStore.Catalog.API/appsettings.Docker.json +++ b/src/services/DevStore.Catalog.API/appsettings.Docker.json @@ -29,7 +29,7 @@ "MessageBus": "host=devstore-rabbit:5672;publisherConfirms=true;timeout=30;username=devstore;password=devstore" }, "AppSettings": { - "JwksUri": "https://devstore-api-identity:5101/jwks", + "JwksUri": "https://devstore-api-identity/jwks", "Issuer": "https://devstore.academy", "Audience": "DevStore" } diff --git a/src/services/DevStore.Catalog.API/appsettings.Production.json b/src/services/DevStore.Catalog.API/appsettings.Production.json index 81bca98..f1ee6b3 100644 --- a/src/services/DevStore.Catalog.API/appsettings.Production.json +++ b/src/services/DevStore.Catalog.API/appsettings.Production.json @@ -29,7 +29,7 @@ "MessageBus": "host=devstore-rabbit:5672;publisherConfirms=true;timeout=30;username=devstore;password=devstore" }, "AppSettings": { - "JwksUri": "https://devstore-api-identity:5101/jwks", + "JwksUri": "https://devstore-api-identity/jwks", "Issuer": "https://devstore.academy", "Audience": "DevStore" } diff --git a/src/services/DevStore.Customers.API/Configuration/ApiConfig.cs b/src/services/DevStore.Customers.API/Configuration/ApiConfig.cs index 338e09c..9a04b05 100644 Binary files a/src/services/DevStore.Customers.API/Configuration/ApiConfig.cs and b/src/services/DevStore.Customers.API/Configuration/ApiConfig.cs differ diff --git a/src/services/DevStore.Customers.API/DevStore.Customers.API.csproj b/src/services/DevStore.Customers.API/DevStore.Customers.API.csproj index 9ec4a9e..d0e8d31 100644 Binary files a/src/services/DevStore.Customers.API/DevStore.Customers.API.csproj and b/src/services/DevStore.Customers.API/DevStore.Customers.API.csproj differ diff --git a/src/services/DevStore.Customers.API/appsettings.Development.json b/src/services/DevStore.Customers.API/appsettings.Development.json index 06147a6..a5a2227 100644 --- a/src/services/DevStore.Customers.API/appsettings.Development.json +++ b/src/services/DevStore.Customers.API/appsettings.Development.json @@ -35,7 +35,7 @@ //"DefaultConnection": "Data Source=DSCustomers.db" }, "MessageQueueConnection": { - "MessageBus": "host=localhost:5672;publisherConfirms=true;timeout=10;username=devstore;password=devstore" + "MessageBus": "host=localhost:5672;publisherConfirms=true;timeout=10;username=guest;password=guest" }, "AppSettings": { "JwksUri": "https://localhost:5421/jwks", diff --git a/src/services/DevStore.Customers.API/appsettings.Docker.json b/src/services/DevStore.Customers.API/appsettings.Docker.json index 9bc29d2..ae7710c 100644 --- a/src/services/DevStore.Customers.API/appsettings.Docker.json +++ b/src/services/DevStore.Customers.API/appsettings.Docker.json @@ -29,7 +29,7 @@ "MessageBus": "host=devstore-rabbit:5672;publisherConfirms=true;timeout=30;username=devstore;password=devstore" }, "AppSettings": { - "JwksUri": "https://devstore-api-identity:5101/jwks", + "JwksUri": "https://devstore-api-identity/jwks", "Issuer": "https://devstore.academy", "Audience": "DevStore" } diff --git a/src/services/DevStore.Customers.API/appsettings.Production.json b/src/services/DevStore.Customers.API/appsettings.Production.json index 7d233b2..358a262 100644 --- a/src/services/DevStore.Customers.API/appsettings.Production.json +++ b/src/services/DevStore.Customers.API/appsettings.Production.json @@ -29,7 +29,7 @@ "MessageBus": "host=devstore-rabbit:5672;publisherConfirms=true;timeout=30;username=devstore;password=devstore" }, "AppSettings": { - "JwksUri": "https://devstore-api-identity:5101/jwks", + "JwksUri": "https://devstore-api-identity/jwks", "Issuer": "https://devstore.academy", "Audience": "DevStore" } diff --git a/src/services/DevStore.Identity.API/Configuration/ApiConfig.cs b/src/services/DevStore.Identity.API/Configuration/ApiConfig.cs index d1d3d93..f6f4699 100644 Binary files a/src/services/DevStore.Identity.API/Configuration/ApiConfig.cs and b/src/services/DevStore.Identity.API/Configuration/ApiConfig.cs differ diff --git a/src/services/DevStore.Identity.API/DevStore.Identity.API.csproj b/src/services/DevStore.Identity.API/DevStore.Identity.API.csproj index 664403d..7e1dd3b 100644 Binary files a/src/services/DevStore.Identity.API/DevStore.Identity.API.csproj and b/src/services/DevStore.Identity.API/DevStore.Identity.API.csproj differ diff --git a/src/services/DevStore.Identity.API/Program.cs b/src/services/DevStore.Identity.API/Program.cs index ce963e8..af7ccd3 100644 Binary files a/src/services/DevStore.Identity.API/Program.cs and b/src/services/DevStore.Identity.API/Program.cs differ diff --git a/src/services/DevStore.Identity.API/appsettings.Development.json b/src/services/DevStore.Identity.API/appsettings.Development.json index f5b6caa..5e1a3db 100644 --- a/src/services/DevStore.Identity.API/appsettings.Development.json +++ b/src/services/DevStore.Identity.API/appsettings.Development.json @@ -37,6 +37,6 @@ }, "MessageQueueConnection": { - "MessageBus": "host=localhost:5672;publisherConfirms=true;timeout=10;username=devstore;password=devstore" + "MessageBus": "host=localhost:5672;publisherConfirms=true;timeout=10;username=guest;password=guest" } } diff --git a/src/services/DevStore.Orders.API/Configuration/ApiConfig.cs b/src/services/DevStore.Orders.API/Configuration/ApiConfig.cs index b1bbc39..c238713 100644 Binary files a/src/services/DevStore.Orders.API/Configuration/ApiConfig.cs and b/src/services/DevStore.Orders.API/Configuration/ApiConfig.cs differ diff --git a/src/services/DevStore.Orders.API/Controllers/OrderController.cs b/src/services/DevStore.Orders.API/Controllers/OrderController.cs index 105f150..ff87398 100644 Binary files a/src/services/DevStore.Orders.API/Controllers/OrderController.cs and b/src/services/DevStore.Orders.API/Controllers/OrderController.cs differ diff --git a/src/services/DevStore.Orders.API/Controllers/VoucherController.cs b/src/services/DevStore.Orders.API/Controllers/VoucherController.cs index a9fdb11..d07bf22 100644 Binary files a/src/services/DevStore.Orders.API/Controllers/VoucherController.cs and b/src/services/DevStore.Orders.API/Controllers/VoucherController.cs differ diff --git a/src/services/DevStore.Orders.API/appsettings.Docker.json b/src/services/DevStore.Orders.API/appsettings.Docker.json index 3982aa5..0d10e28 100644 --- a/src/services/DevStore.Orders.API/appsettings.Docker.json +++ b/src/services/DevStore.Orders.API/appsettings.Docker.json @@ -30,7 +30,7 @@ "MessageBus": "host=devstore-rabbit:5672;publisherConfirms=true;timeout=30;username=devstore;password=devstore" }, "AppSettings": { - "JwksUri": "https://devstore-api-identity:5101/jwks", + "JwksUri": "https://devstore-api-identity/jwks", "Issuer": "https://devstore.academy", "Audience": "DevStore" } diff --git a/src/services/DevStore.Orders.API/appsettings.Production.json b/src/services/DevStore.Orders.API/appsettings.Production.json index cc96e44..f94478b 100644 --- a/src/services/DevStore.Orders.API/appsettings.Production.json +++ b/src/services/DevStore.Orders.API/appsettings.Production.json @@ -30,7 +30,7 @@ "MessageBus": "host=devstore-rabbit:5672;publisherConfirms=true;timeout=30;username=devstore;password=devstore" }, "AppSettings": { - "JwksUri": "https://devstore-api-identity:5101/jwks", + "JwksUri": "https://devstore-api-identity/jwks", "Issuer": "https://devstore.academy", "Audience": "DevStore" } diff --git a/src/services/DevStore.Orders.Domain/Properties/launchSettings.json b/src/services/DevStore.Orders.Domain/Properties/launchSettings.json new file mode 100644 index 0000000..54e7ecd --- /dev/null +++ b/src/services/DevStore.Orders.Domain/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "DevStore.Orders.Domain": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:56390;http://localhost:56394" + } + } +} \ No newline at end of file diff --git a/src/services/DevStore.ShoppingCart.API/Configuration/ApiConfig.cs b/src/services/DevStore.ShoppingCart.API/Configuration/ApiConfig.cs index 15a1801..6134547 100644 --- a/src/services/DevStore.ShoppingCart.API/Configuration/ApiConfig.cs +++ b/src/services/DevStore.ShoppingCart.API/Configuration/ApiConfig.cs @@ -24,7 +24,7 @@ public static void AddApiConfiguration(this IServiceCollection services, IConfig .AllowAnyHeader()); }); - services.AddGenericHealthCheck(); + services.AddDefaultHealthCheck(configuration); } public static void UseApiConfiguration(this WebApplication app, IWebHostEnvironment env) @@ -47,7 +47,7 @@ public static void UseApiConfiguration(this WebApplication app, IWebHostEnvironm app.MapGrpcService().RequireCors("Total"); - app.UseGenericHealthCheck("/healthz"); + app.UseDefaultHealthcheck(); } } } \ No newline at end of file diff --git a/src/services/DevStore.ShoppingCart.API/DevStore.ShoppingCart.API.csproj b/src/services/DevStore.ShoppingCart.API/DevStore.ShoppingCart.API.csproj index c0396b3..0d77293 100644 --- a/src/services/DevStore.ShoppingCart.API/DevStore.ShoppingCart.API.csproj +++ b/src/services/DevStore.ShoppingCart.API/DevStore.ShoppingCart.API.csproj @@ -11,13 +11,6 @@ - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/src/services/DevStore.ShoppingCart.API/appsettings.Docker.json b/src/services/DevStore.ShoppingCart.API/appsettings.Docker.json index f5aa360..9bd3c24 100644 --- a/src/services/DevStore.ShoppingCart.API/appsettings.Docker.json +++ b/src/services/DevStore.ShoppingCart.API/appsettings.Docker.json @@ -29,7 +29,7 @@ "MessageBus": "host=devstore-rabbit:5672;publisherConfirms=true;timeout=30;username=devstore;password=devstore" }, "AppSettings": { - "JwksUri": "https://devstore-api-identity:5101/jwks", + "JwksUri": "https://devstore-api-identity/jwks", "Issuer": "https://devstore.academy", "Audience": "DevStore" } diff --git a/src/services/DevStore.ShoppingCart.API/appsettings.Production.json b/src/services/DevStore.ShoppingCart.API/appsettings.Production.json index 09828c8..72c2cb9 100644 --- a/src/services/DevStore.ShoppingCart.API/appsettings.Production.json +++ b/src/services/DevStore.ShoppingCart.API/appsettings.Production.json @@ -29,7 +29,7 @@ "MessageBus": "host=devstore-rabbit:5672;publisherConfirms=true;timeout=30;username=devstore;password=devstore" }, "AppSettings": { - "JwksUri": "https://devstore-api-identity:5101/jwks", + "JwksUri": "https://devstore-api-identity/jwks", "Issuer": "https://devstore.academy", "Audience": "DevStore" } diff --git a/src/services/DevStore.ShoppingCart.API/appsettings.json b/src/services/DevStore.ShoppingCart.API/appsettings.json index 1e32362..88d07e2 100644 --- a/src/services/DevStore.ShoppingCart.API/appsettings.json +++ b/src/services/DevStore.ShoppingCart.API/appsettings.json @@ -3,5 +3,6 @@ "Issuer": "https://devstore.academy", "Audience": "DevStore", "DatabaseType": "SqlServer" - } + }, + "USE_HTTPS_REDIRECTION": "true" } diff --git a/src/web/DevStore.WebApp.MVC/Configuration/WebAppConfig.cs b/src/web/DevStore.WebApp.MVC/Configuration/WebAppConfig.cs index 366cf3a..92d65da 100644 Binary files a/src/web/DevStore.WebApp.MVC/Configuration/WebAppConfig.cs and b/src/web/DevStore.WebApp.MVC/Configuration/WebAppConfig.cs differ diff --git a/src/web/DevStore.WebApp.MVC/Properties/launchSettings.json b/src/web/DevStore.WebApp.MVC/Properties/launchSettings.json index ae6c796..dcb3487 100644 --- a/src/web/DevStore.WebApp.MVC/Properties/launchSettings.json +++ b/src/web/DevStore.WebApp.MVC/Properties/launchSettings.json @@ -1,12 +1,4 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:52608", - "sslPort": 44303 - } - }, "profiles": { "SelfHosting - Dev": { "commandName": "Project", diff --git a/src/web/DevStore.WebApp.MVC/appsettings.Docker.json b/src/web/DevStore.WebApp.MVC/appsettings.Docker.json index 06f0f4f..10e8952 100644 --- a/src/web/DevStore.WebApp.MVC/appsettings.Docker.json +++ b/src/web/DevStore.WebApp.MVC/appsettings.Docker.json @@ -22,9 +22,9 @@ "Application": "DevStoreWeb" } }, - "AuthUrl": "https://devstore-api-identity:5101", - "CatalogUrl": "https://devstore-api-catalog:5301", - "CustomerUrl": "https://devstore-api-customers:5401", - "CheckoutBffUrl": "https://devstore-api-bff-checkout:5501" + "AuthUrl": "https://devstore-api-identity", + "CatalogUrl": "https://devstore-api-catalog", + "CustomerUrl": "https://devstore-api-customers", + "CheckoutBffUrl": "https://devstore-api-bff-checkout" } \ No newline at end of file diff --git a/src/web/DevStore.WebApp.MVC/appsettings.Production.json b/src/web/DevStore.WebApp.MVC/appsettings.Production.json index f6fd49a..7eebbef 100644 --- a/src/web/DevStore.WebApp.MVC/appsettings.Production.json +++ b/src/web/DevStore.WebApp.MVC/appsettings.Production.json @@ -22,9 +22,9 @@ "Application": "DevStoreWeb" } }, - "AuthUrl": "https://devstore-api-identity:5101", - "CatalogUrl": "https://devstore-api-catalog:5301", - "CustomerUrl": "https://devstore-api-customers:5401", - "CheckoutBffUrl": "https://devstore-api-bff-checkout:5501", + "AuthUrl": "https://devstore-api-identity", + "CatalogUrl": "https://devstore-api-catalog", + "CustomerUrl": "https://devstore-api-customers", + "CheckoutBffUrl": "https://devstore-api-bff-checkout", } \ No newline at end of file diff --git a/src/web/DevStore.WebApp.MVC/appsettings.json b/src/web/DevStore.WebApp.MVC/appsettings.json index 4faf77a..3d3da2e 100644 --- a/src/web/DevStore.WebApp.MVC/appsettings.json +++ b/src/web/DevStore.WebApp.MVC/appsettings.json @@ -1,3 +1,4 @@ { - "AllowedHosts": "*" + "AllowedHosts": "*", + "USE_HTTPS_REDIRECTION": "true" } diff --git a/src/web/DevStore.WebApp.Status/DevStore.WebApp.Status.csproj b/src/web/DevStore.WebApp.Status/DevStore.WebApp.Status.csproj new file mode 100644 index 0000000..39a811b --- /dev/null +++ b/src/web/DevStore.WebApp.Status/DevStore.WebApp.Status.csproj @@ -0,0 +1,51 @@ + + + + net6.0 + enable + enable + 0ab5617d-1cdf-455d-b9e2-e9f76e347af1 + Linux + ..\..\.. + + + + + + + + + + + + + + + + + + + + PreserveNewest + true + PreserveNewest + + + PreserveNewest + true + PreserveNewest + + + PreserveNewest + true + PreserveNewest + + + + + + Always + + + + diff --git a/src/web/DevStore.WebApp.Status/Dockerfile b/src/web/DevStore.WebApp.Status/Dockerfile new file mode 100644 index 0000000..4289ac9 --- /dev/null +++ b/src/web/DevStore.WebApp.Status/Dockerfile @@ -0,0 +1,24 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["web/DevStore.WebApp.Status/DevStore.WebApp.Status.csproj", "web/DevStore.WebApp.Status/"] +COPY ["building-blocks/DevStore.WebAPI.Core/DevStore.WebAPI.Core.csproj", "building-blocks/DevStore.WebAPI.Core/"] +COPY ["building-blocks/DevStore.Core/DevStore.Core.csproj", "building-blocks/DevStore.Core/"] +RUN dotnet restore "web/DevStore.WebApp.Status/DevStore.WebApp.Status.csproj" +COPY . . +WORKDIR "web/DevStore.WebApp.Status" +RUN dotnet build "DevStore.WebApp.Status.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "DevStore.WebApp.Status.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "DevStore.WebApp.Status.dll"] \ No newline at end of file diff --git a/src/web/DevStore.WebApp.Status/Dockerfile.original b/src/web/DevStore.WebApp.Status/Dockerfile.original new file mode 100644 index 0000000..66d4a89 --- /dev/null +++ b/src/web/DevStore.WebApp.Status/Dockerfile.original @@ -0,0 +1,22 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["src/web/DevStore.WebApp.Status/DevStore.WebApp.Status.csproj", "src/web/DevStore.WebApp.Status/"] +RUN dotnet restore "src/web/DevStore.WebApp.Status/DevStore.WebApp.Status.csproj" +COPY . . +WORKDIR "/src/src/web/DevStore.WebApp.Status" +RUN dotnet build "DevStore.WebApp.Status.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "DevStore.WebApp.Status.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "DevStore.WebApp.Status.dll"] \ No newline at end of file diff --git a/src/web/DevStore.WebApp.Status/Program.cs b/src/web/DevStore.WebApp.Status/Program.cs new file mode 100644 index 0000000..1c24e67 --- /dev/null +++ b/src/web/DevStore.WebApp.Status/Program.cs @@ -0,0 +1,67 @@ +using DevStore.WebAPI.Core.DatabaseFlavor; +using Serilog; +using DevStore.WebAPI.Core.Extensions; +using static DevStore.WebAPI.Core.DatabaseFlavor.ProviderConfiguration; + +var builder = WebApplication.CreateBuilder(args); + +builder.Logging.AddSerilog(new LoggerConfiguration() + .ReadFrom.Configuration(builder.Configuration) + .CreateLogger()); + +var healthCheckBuilder = builder.Services.AddHealthChecksUI(setupSettings: setup => +{ + setup.SetHeaderText("DevStore - Status Page"); + var endpoints = builder.Configuration.GetSection("ENDPOINTS").Get>(); + + foreach (var endpoint in endpoints) + { + var name = endpoint.Split(';')[0]; + var uri = endpoint.Split(';')[1]; + + setup.AddHealthCheckEndpoint(name, uri); + } + + setup.UseApiEndpointHttpMessageHandler(sp => HttpExtensions.ConfigureClientHandler()); +}); +var (database, connString) = DetectDatabase(builder.Configuration); + +switch (database) +{ + case DatabaseType.None: + healthCheckBuilder.AddInMemoryStorage(); + break; + case DatabaseType.SqlServer: + healthCheckBuilder.AddSqlServerStorage(connString); + break; + case DatabaseType.MySql: + healthCheckBuilder.AddMySqlStorage(connString); + break; + case DatabaseType.Postgre: + healthCheckBuilder.AddPostgreSqlStorage(connString); + break; + case DatabaseType.Sqlite: + healthCheckBuilder.AddSqliteStorage(connString); + break; + default: + healthCheckBuilder.AddInMemoryStorage(); + break; +} + +var app = builder.Build(); + +// Under certain scenarios, e.g minikube / linux environment / behind load balancer +// https redirection could lead dev's to over complicated configuration for testing purpouses +// In production is a good practice to keep it true +if (app.Configuration["USE_HTTPS_REDIRECTION"] == "true") +{ + app.UseHttpsRedirection(); + app.UseHsts(); +} + +app.MapHealthChecksUI(setup => +{ + setup.AddCustomStylesheet("devstore.css"); + setup.UIPath = "/status"; +}); +app.Run(); diff --git a/src/web/DevStore.WebApp.Status/Properties/launchSettings.json b/src/web/DevStore.WebApp.Status/Properties/launchSettings.json new file mode 100644 index 0000000..c8731b9 --- /dev/null +++ b/src/web/DevStore.WebApp.Status/Properties/launchSettings.json @@ -0,0 +1,14 @@ +{ + "profiles": { + "SelfHosting - Dev": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "status", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:4211;http://localhost:4210" + } + } +} \ No newline at end of file diff --git a/src/web/DevStore.WebApp.Status/appsettings.Development.json b/src/web/DevStore.WebApp.Status/appsettings.Development.json new file mode 100644 index 0000000..3f9bca5 --- /dev/null +++ b/src/web/DevStore.WebApp.Status/appsettings.Development.json @@ -0,0 +1,43 @@ +{ + "Serilog": { + "Using": [ "Serilog.Sinks.Console" ], + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft.AspNetCore": "Warning", + "Microsoft.EntityFrameworkCore": "Information" + } + }, + "WriteTo": [ + { "Name": "Console" } + ], + "Enrich": [ "FromLogContext" ], + "Properties": { + "Application": "DevStoreWeb" + } + }, + "ConnectionStrings": { + // Sql Server Connection + "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=DSStatus;Trusted_Connection=True;MultipleActiveResultSets=true" + + // Postgre Connection + //"DefaultConnection": "Server=localhost;Port=5432;Database=DSStatus;User Id=sa;Password=MyDB@123;" + + // MySql Connection + //"DefaultConnection": "server=localhost,port=3306;database=DSStatus;user=sa;password=MyDB@123" + + // SQLite Connection + //"DefaultConnection": "Data Source=DSStatus.db" + + }, + "ENDPOINTS": [ + "Frontend Web;https://localhost:5401/healthz-infra", + "Shopping Cart API;https://localhost:5411/healthz-infra", + "Identity API;https://localhost:5421/healthz-infra", + "Catalog API;https://localhost:5431/healthz-infra", + "Customer API;https://localhost:5441/healthz-infra", + "BFF Checkout;https://localhost:5451/healthz-infra", + "Billing API;https://localhost:5461/healthz-infra", + "Order API;https://localhost:5471/healthz-infra" + ] +} diff --git a/src/web/DevStore.WebApp.Status/appsettings.Docker.json b/src/web/DevStore.WebApp.Status/appsettings.Docker.json new file mode 100644 index 0000000..fbe44c1 --- /dev/null +++ b/src/web/DevStore.WebApp.Status/appsettings.Docker.json @@ -0,0 +1,32 @@ +{ + "Serilog": { + "Using": [ "Serilog.Sinks.Console" ], + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft.AspNetCore": "Warning", + "Microsoft.EntityFrameworkCore": "Information" + } + }, + "WriteTo": [ + { "Name": "Console" } + ], + "Enrich": [ "FromLogContext" ], + "Properties": { + "Application": "DevStoreWeb" + } + }, + "ConnectionStrings": { + "DefaultConnection": "Server=database-status;Database=DSStatus;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" + }, + "ENDPOINTS": [ + "Identity API;https://api-identity/healthz-infra", + "BFF Checkout;https://api-bff-checkout/healthz-infra", + "Frontend Web;https://web-mvc/healthz-infra", + "Shopping Cart API;https://api-cart/healthz-infra", + "Catalog API;https://api-catalog/healthz-infra", + "Customer API;https://api-customers/healthz-infra", + "Billing API;https://api-billing/healthz-infra", + "Order API;https://api-order/healthz-infra" + ] +} \ No newline at end of file diff --git a/src/web/DevStore.WebApp.Status/appsettings.Production.json b/src/web/DevStore.WebApp.Status/appsettings.Production.json new file mode 100644 index 0000000..32d4cf0 --- /dev/null +++ b/src/web/DevStore.WebApp.Status/appsettings.Production.json @@ -0,0 +1,32 @@ +{ + "Serilog": { + "Using": [ "Serilog.Sinks.Console" ], + "MinimumLevel": { + "Default": "Warning", + "Override": { + "Microsoft.AspNetCore": "Warning", + "Microsoft.EntityFrameworkCore": "Error" + } + }, + "WriteTo": [ + { "Name": "Console" } + ], + "Enrich": [ "FromLogContext" ], + "Properties": { + "Application": "DevStoreWeb" + } + }, + "ConnectionStrings": { + "DefaultConnection": "Server=database-status;Database=DSStatus;MultipleActiveResultSets=true;User Id=sa;Password=MyDB@123" + }, + "ENDPOINTS": [ + "Frontend Web;https://web-devstore-ecommerce/healthz-infra", + "Identity API;https://api-identity/healthz-infra", + "BFF Checkout;https://api-bff-checkout/healthz-infra", + "Shopping Cart API;https://api-cart/healthz-infra", + "Catalog API;https://api-catalog/healthz-infra", + "Customer API;https://api-customers/healthz-infra", + "Billing API;https://api-billing/healthz-infra", + "Order API;https://api-orders/healthz-infra" + ] +} \ No newline at end of file diff --git a/src/web/DevStore.WebApp.Status/appsettings.json b/src/web/DevStore.WebApp.Status/appsettings.json new file mode 100644 index 0000000..db4af7c --- /dev/null +++ b/src/web/DevStore.WebApp.Status/appsettings.json @@ -0,0 +1,6 @@ +{ + "AllowedHosts": "*", + "AppSettings": { + "DatabaseType": "SqlServer" + } +} diff --git a/src/web/DevStore.WebApp.Status/devstore.css b/src/web/DevStore.WebApp.Status/devstore.css new file mode 100644 index 0000000..dbc9a2a --- /dev/null +++ b/src/web/DevStore.WebApp.Status/devstore.css @@ -0,0 +1,8 @@ +:root { + --primaryColor: #525AF2; + --secondaryColor: #F2F2F2; + --bgMenuActive: #797FF2; + --bgButton: #A2A6F2; + --logoImageUrl: url('https://devstore.academy/images/favicon.png'); + --bgAside: var(--primaryColor); +}