Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Resume running on tye #264

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.Tye.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"RemoteServices": {
"Default": {
"BaseUrl": "https://localhost:44373"
}
},
"ReverseProxy": {
"Routes": {
"route1": {
"ClusterId": "cluster1",
"Match": {
"Path": "/api/{**anypath}"
}
}
},
"Clusters": {
"cluster1": {
"Destinations": {
"destination1": {
"Address": "https://localhost:44373"
}
}
}
}
}
}
186 changes: 186 additions & 0 deletions gateways/web-public/src/EShopOnAbp.WebPublicGateway/yarp.Tye.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
{
"ReverseProxy": {
"Routes": {
"AbpApi": {
"ClusterId": "Administration",
"Match": {
"Path": "/api/abp/{**catch-all}"
}
},
"Identity Service": {
"ClusterId": "Identity",
"Match": {
"Path": "/api/identity/{**everything}"
}
},
"Identity Service Swagger": {
"ClusterId": "Identity",
"Match": {
"Path": "/swagger-json/Identity/swagger/v1/swagger.json"
},
"Transforms": [
{ "PathRemovePrefix": "/swagger-json/Identity" }
]
},
"FeatureManagement": {
"ClusterId": "Administration",
"Match": {
"Path": "/api/feature-management/{**everything}"
}
},
"PermissionManagement": {
"ClusterId": "Administration",
"Match": {
"Path": "/api/permission-management/{**everything}"
}
},
"SettingManagement": {
"ClusterId": "Administration",
"Match": {
"Path": "/api/setting-management/{**everything}"
}
},
"Administration Service Swagger": {
"ClusterId": "Administration",
"Match": {
"Path": "/swagger-json/Administration/swagger/v1/swagger.json"
},
"Transforms": [
{ "PathRemovePrefix": "/swagger-json/Administration" }
]
},
"Catalog Service": {
"ClusterId": "catalogCluster",
"Match": {
"Path": "/api/catalog/{**everything}"
}
},
"Catalog Service Swagger": {
"ClusterId": "catalogCluster",
"Match": {
"Path": "/swagger-json/Catalog/swagger/v1/swagger.json"
},
"Transforms": [
{ "PathRemovePrefix": "/swagger-json/Catalog" }
]
},
"Basket Service": {
"ClusterId": "Basket",
"Match": {
"Path": "/api/basket/{**everything}"
}
},
"Basket Service Swagger": {
"ClusterId": "Basket",
"Match": {
"Path": "/swagger-json/Basket/swagger/v1/swagger.json"
},
"Transforms": [
{ "PathRemovePrefix": "/swagger-json/Basket" }
]
},
"Ordering Service": {
"ClusterId": "Ordering",
"Match": {
"Path": "/api/ordering/{**everything}"
}
},
"Ordering Service Swagger": {
"ClusterId": "Ordering",
"Match": {
"Path": "/swagger-json/Ordering/swagger/v1/swagger.json"
},
"Transforms": [
{ "PathRemovePrefix": "/swagger-json/Ordering" }
]
},
"Cmskit Public Service": {
"ClusterId": "CmsKit",
"Match": {
"Path": "/api/cms-kit-public/{**everything}"
}
},
"Cmskit Admin Service": {
"ClusterId": "CmsKit",
"Match": {
"Path": "/api/cms-kit-admin/{**everything}"
}
},
"Cmskit Service Swagger": {
"ClusterId": "CmsKit",
"Match": {
"Path": "/swagger-json/Cmskit/swagger/v1/swagger.json"
},
"Transforms": [
{ "PathRemovePrefix": "/swagger-json/Cmskit" }
]
},
"Payment Service": {
"ClusterId": "Payment",
"Match": {
"Path": "/api/payment/{**everything}"
}
},
"Payment Service Swagger": {
"ClusterId": "Payment",
"Match": {
"Path": "/swagger-json/Payment/swagger/v1/swagger.json"
},
"Transforms": [
{ "PathRemovePrefix": "/swagger-json/Payment" }
]
}
},
"Clusters": {
"Identity": {
"Destinations": {
"destination1": {
"Address": "https://localhost:44351"
}
}
},
"Administration": {
"Destinations": {
"destination1": {
"Address": "https://localhost:44353"
}
}
},
"catalogCluster": {
"Destinations": {
"destination1": {
"Address": "https://localhost:44354"
}
}
},
"Basket": {
"Destinations": {
"destination1": {
"Address": "https://localhost:44355"
}
}
},
"Ordering": {
"Destinations": {
"destination1": {
"Address": "https://localhost:44356"
}
}
},
"CmsKit": {
"Destinations": {
"destination1": {
"Address": "https://localhost:44358"
}
}
},
"Payment": {
"Destinations": {
"destination1": {
"Address": "https://localhost:44357"
}
}
}
}
}
}
1 change: 1 addition & 0 deletions gateways/web/src/EShopOnAbp.WebGateway/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static async Task<int> Main(string[] args)
{
Log.Information($"Starting {assemblyName}.");
var builder = WebApplication.CreateBuilder(args);

builder.Host
.AddAppSettingsSecretsJson()
.AddYarpJson()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
using EShopOnAbp.CatalogService.Grpc;
using EShopOnAbp.Shared.Hosting.AspNetCore;
using EShopOnAbp.Shared.Hosting.Microservices;
using Grpc.Net.ClientFactory;
using Microsoft.AspNetCore.Cors;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Polly;
using Volo.Abp;
Expand Down Expand Up @@ -56,7 +58,7 @@ public override void ConfigureServices(ServiceConfigurationContext context)

ConfigureAutoMapper();
ConfigureAspNetCoreRouting();
ConfigureGrpc(context);
ConfigureGrpc(context,configuration);
ConfigureDistributedCache();
ConfigureVirtualFileSystem();
ConfigureAuthentication(context, configuration);
Expand Down Expand Up @@ -152,12 +154,12 @@ private void ConfigureAutoApiControllers()
});
}

private void ConfigureGrpc(ServiceConfigurationContext context)
private void ConfigureGrpc(ServiceConfigurationContext context, IConfiguration configuration)
{
// context.Services.AddHttpForwarderWithServiceDiscovery();

context.Services.AddGrpcClient<ProductPublic.ProductPublicClient>((services, options) =>
{
options.Address = new Uri("http://_grpc.catalogService");
options.Address = new Uri(configuration.GetRequiredSection("GrpcService:Address").Value);
});
}

Expand Down
12 changes: 12 additions & 0 deletions services/basket/src/EShopOnAbp.BasketService/appsettings.Tye.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"GrpcService": {
"Address": "https://localhost:44354"
}
}
3 changes: 3 additions & 0 deletions services/basket/src/EShopOnAbp.BasketService/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@
},
"ElasticSearch": {
"Url": "http://localhost:9200"
},
"GrpcService": {
"Address": "http://grpc.catalogService"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,8 @@ public static async Task<int> Main(string[] args)
try
{
Log.Information($"Starting {assemblyName}.");
var builder = WebApplication.CreateBuilder(args);
builder.Host
.UseAutofac()
.UseSerilog();

builder.AddServiceDefaults();
builder.WebHost.ConfigureKestrel(options =>
{
options.ListenAnyIP(5054, listenOptions =>
{
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
options.ListenAnyIP(8181, listenOptions =>
{
listenOptions.Protocols = HttpProtocols.Http2;
});
});

await builder.AddApplicationAsync<CatalogServiceHttpApiHostModule>();
var app = builder.Build();
var app = await ApplicationBuilderHelper
.BuildApplicationAsync<CatalogServiceHttpApiHostModule>(args);
await app.InitializeApplicationAsync();
await app.RunAsync();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ public static IHostBuilder AddYarpJson(
bool reloadOnChange = true,
string path = AppYarpJsonPath)
{
return hostBuilder.ConfigureAppConfiguration((_, builder) =>
return hostBuilder.ConfigureAppConfiguration((context, builder) =>
{
string environmentName = context.HostingEnvironment.EnvironmentName;
string yarpJsonPath = environmentName == "Tye" ? "yarp.Tye.json" : AppYarpJsonPath;
builder.AddJsonFile(
path: AppYarpJsonPath,
path: yarpJsonPath,
optional: optional,
reloadOnChange: reloadOnChange
)
Expand Down
6 changes: 6 additions & 0 deletions tye.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ services:
env:
- Kestrel__Certificates__Default__Path=../../../../etc/dev-cert/localhost.pfx
- Kestrel__Certificates__Default__Password=8b6039b6-c67a-448b-977b-0ce6d3fcfd49
- ASPNETCORE_ENVIRONMENT=Tye
- DOTNET_ENVIRONMENT=Tye

- name: ordering-service
project: services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj
Expand Down Expand Up @@ -84,6 +86,8 @@ services:
env:
- Kestrel__Certificates__Default__Path=../../../../etc/dev-cert/localhost.pfx
- Kestrel__Certificates__Default__Password=8b6039b6-c67a-448b-977b-0ce6d3fcfd49
- ASPNETCORE_ENVIRONMENT=Tye
- DOTNET_ENVIRONMENT=Tye

- name: public-web
project: apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj
Expand All @@ -93,6 +97,8 @@ services:
env:
- Kestrel__Certificates__Default__Path=../../../../etc/dev-cert/localhost.pfx
- Kestrel__Certificates__Default__Password=8b6039b6-c67a-448b-977b-0ce6d3fcfd49
- ASPNETCORE_ENVIRONMENT=Tye
- DOTNET_ENVIRONMENT=Tye

- name: keycloak-seeder
project: shared/EShopOnAbp.Keycloak.DbMigrator/EShopOnAbp.Keycloak.DbMigrator.csproj