Browse Source

修改网关配置,将文件分离以便修改,文件允许注释,并监视文件修改,自动生成ocelot.json,自动加载新配置

网关增加settingmanagement的{everything}配置
pull/862/head
李宏 3 years ago
parent
commit
54a431e6a1
  1. 2
      aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.Configure.cs
  2. 2
      aspnet-core/start-http-api-host.bat
  3. 5
      aspnet-core/start-internal-gateway.bat
  4. 83
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/Ocelot/Configuration/AutoConfigOcelot.cs
  5. 129
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.aggregate.json
  6. 1268
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.backendadmin.json
  7. 48
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.global.json
  8. 435
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.idsadmin.json
  9. 247
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.localization.json
  10. 714
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.messages.json
  11. 617
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.platform.json
  12. 183
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.task.json
  13. 121
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.webhook.json
  14. 13
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/Program.cs
  15. 1895
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.Development.json
  16. 4349
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.json
  17. 2
      starter/70.start-internal-gateway.bat

2
aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/TaskManagementHttpApiHostModule.Configure.cs

@ -251,7 +251,7 @@ public partial class TaskManagementHttpApiHostModule
services.AddSwaggerGen( services.AddSwaggerGen(
options => options =>
{ {
options.SwaggerDoc("v1", new OpenApiInfo { Title = "WorkflowManagement API", Version = "v1" }); options.SwaggerDoc("v1", new OpenApiInfo { Title = "TaskManagement API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true); options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName); options.CustomSchemaIds(type => type.FullName);
options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme

2
aspnet-core/start-http-api-host.bat

@ -25,7 +25,7 @@ dotnet run
exit exit
:watchrun :watchrun
dotnet watch run dotnet watch run --no-restore
exit exit
:restore :restore

5
aspnet-core/start-internal-gateway.bat

@ -10,6 +10,7 @@ cd ..\gateways\internal\LINGYUN.MicroService.Internal.ApiGateway\src\LINGYUN.Mic
if '%1' equ '--publish' goto publish if '%1' equ '--publish' goto publish
if '%1' equ '--run' goto run if '%1' equ '--run' goto run
if '%1' equ '--watchrun' goto watchrun
if '%1' equ '--restore' goto restore if '%1' equ '--restore' goto restore
if '%1' equ '' goto run if '%1' equ '' goto run
exit exit
@ -23,6 +24,10 @@ exit
dotnet run dotnet run
exit exit
:watchrun
dotnet watch run --no-restore
exit
:restore :restore
dotnet restore dotnet restore
exit exit

83
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/Ocelot/Configuration/AutoConfigOcelot.cs

@ -0,0 +1,83 @@

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using Castle.Core.Logging;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Memory;
using Newtonsoft.Json;
using Ocelot.Configuration.File;
using Serilog;
using Serilog.Core;
namespace Ocelot.DependencyInjection
{
public static class ConfigurationBuilderExtensions
{
public static IConfigurationBuilder AddAutoOcelotConfig(this IConfigurationBuilder builder, IWebHostEnvironment env)
{
return builder.AddAutoOcelotConfig(".", env);
}
static object locker = new object();
public static IConfigurationBuilder AddAutoOcelotConfig(this IConfigurationBuilder builder, string folder, IWebHostEnvironment env)
{
WriteFile(folder, env);
Action<object, FileSystemEventArgs> fileChanged = (sender, e) =>
{
lock (locker)
{
Log.Debug("Ocelot config regenerate...");
Thread.Sleep(100); //解决vs文件保存时多次触发change事件时引起异常
WriteFile(folder, env);
}
};
FileSystemWatcher watcher = new FileSystemWatcher("OcelotConfig", "*.json");
watcher.Changed += new FileSystemEventHandler(fileChanged);
watcher.Deleted += new FileSystemEventHandler(fileChanged);
watcher.Created += new FileSystemEventHandler(fileChanged);
watcher.Renamed += new RenamedEventHandler(fileChanged);
watcher.EnableRaisingEvents = true;
builder.AddJsonFile("ocelot.json", optional: true, reloadOnChange: true);
return builder;
}
private static void WriteFile(string folder, IWebHostEnvironment env)
{
string excludeConfigName = ((env != null && env.EnvironmentName != null) ? ("ocelot." + env.EnvironmentName + ".json") : string.Empty);
Regex reg = new Regex("^ocelot\\.(.*?)\\.json$", RegexOptions.IgnoreCase | RegexOptions.Singleline);
List<FileInfo> list = (from fi in new DirectoryInfo(folder).EnumerateFiles()
where reg.IsMatch(fi.Name) && fi.Name != excludeConfigName
select fi).ToList();
FileConfiguration fileConfiguration = new FileConfiguration();
foreach (FileInfo item in list)
{
if (list.Count <= 1 || !item.Name.Equals("ocelot.json", StringComparison.OrdinalIgnoreCase))
{
FileConfiguration fileConfiguration2 = JsonConvert.DeserializeObject<FileConfiguration>(File.ReadAllText(item.FullName));
if (fileConfiguration2 == null)
{
Log.Fatal($"Ocelot config file \"{item.FullName}\" is empty");
}
if (item.Name.Equals("ocelot.global.json", StringComparison.OrdinalIgnoreCase))
{
fileConfiguration.GlobalConfiguration = fileConfiguration2.GlobalConfiguration;
}
fileConfiguration.Aggregates.AddRange(fileConfiguration2.Aggregates);
fileConfiguration.Routes.AddRange(fileConfiguration2.Routes);
}
}
string contents = JsonConvert.SerializeObject(fileConfiguration, Formatting.Indented);
File.WriteAllText("ocelot.json", contents);
}
}
}

129
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.aggregate.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.aggregate.json

@ -1,67 +1,62 @@
{ {
"Aggregates": [ "Aggregates": [
// ̬ۺ {
{ "RouteKeys": [
"RouteKeys": [ "platform-api-definition",
"platform-api-definition", "backend-admin-api-definition",
"backend-admin-api-definition", "messages-api-definition",
"messages-api-definition", "ids-admin-api-definition",
"ids-admin-api-definition", "localization-api-definition",
"localization-api-definition", "task-api-definition",
"task-api-definition", "webhook-api-definition"
"webhook-api-definition" ],
], "UpstreamPathTemplate": "/api/abp/api-definition",
"UpstreamPathTemplate": "/api/abp/api-definition", "Aggregator": "AbpResponseMergeAggregator"
"Aggregator": "AbpResponseMergeAggregator", },
"Priority": 99 {
}, "RouteKeys": [
// þۺ "platform-configuration",
{ "backend-admin-configuration",
"RouteKeys": [ "messages-configuration",
"platform-configuration", "ids-admin-configuration",
"backend-admin-configuration", "localization-configuration",
"messages-configuration", "task-configuration"
"ids-admin-configuration", ],
"localization-configuration", "UpstreamPathTemplate": "/api/abp/application-configuration",
"task-configuration" "Aggregator": "AbpResponseMergeAggregator",
], "Priority": 99
"UpstreamPathTemplate": "/api/abp/application-configuration", },
"Aggregator": "AbpResponseMergeAggregator", {
"Priority": 99 "RouteKeys": [
}, "setting-global",
// ȫ "wechat-setting-global",
{ "tencent-cloud-setting-global",
"RouteKeys": [ "aliyun-setting-global",
"setting-global", "oss-management-setting-global"
"wechat-setting-global", ],
"aliyun-setting-global", "UpstreamPathTemplate": "/api/setting-management/settings/by-global",
"oss-management-setting-global" "Aggregator": "AbpResponseMergeAggregator",
], "Priority": 99
"UpstreamPathTemplate": "/api/setting-management/settings/by-global", },
"Aggregator": "AbpResponseMergeAggregator", {
"Priority": 99 "RouteKeys": [
}, "setting-current-tenant",
// "wechat-setting-current-tenant",
{ "tencent-cloud-setting-current-tenant",
"RouteKeys": [ "aliyun-setting-current-tenant",
"setting-current-tenant", "oss-management-setting-current-tenant"
"wechat-setting-current-tenant", ],
"aliyun-setting-current-tenant", "UpstreamPathTemplate": "/api/setting-management/settings/by-current-tenant",
"oss-management-setting-current-tenant" "Aggregator": "AbpResponseMergeAggregator",
], "Priority": 99
"UpstreamPathTemplate": "/api/setting-management/settings/by-current-tenant", },
"Aggregator": "AbpResponseMergeAggregator", {
"Priority": 99 "RouteKeys": [
}, "setting-current-user"
// û ],
{ "UpstreamPathTemplate": "/api/setting-management/settings/by-current-user",
"RouteKeys": [ "Aggregator": "AbpResponseMergeAggregator",
"assignables-notifilers", "Priority": 99
"my-subscribes" }
], ]
"UpstreamPathTemplate": "/api/my-subscribes/assignables-notifilers", }
"Aggregator": "AbpResponseMergeAggregator",
"Priority": 99
}
]
}

1268
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.backendadmin.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.backendadmin.json

File diff suppressed because it is too large

48
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.global.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.global.json

@ -1,24 +1,24 @@
{ {
"GlobalConfiguration": { "GlobalConfiguration": {
"BaseUrl": "http://localhost:30000", "BaseUrl": "http://localhost:30000",
"DownstreamScheme": "HTTP", "DownstreamScheme": "HTTP",
"HttpHandlerOptions": { "HttpHandlerOptions": {
"UseTracing": true "UseTracing": true
}, },
"RateLimitOptions": { "RateLimitOptions": {
"DisableRateLimitHeaders": false, "DisableRateLimitHeaders": false,
"ClientIdHeader": "ClientId", "ClientIdHeader": "ClientId",
"RateLimitCounterPrefix": "ocelot", "RateLimitCounterPrefix": "ocelot",
"QuotaExceededMessage": "您的操作过快,请稍后再试!", "QuotaExceededMessage": "您的操作过快,请稍后再试!",
"HttpStatusCode": 429 "HttpStatusCode": 429
}, },
"QoSOptions": { "QoSOptions": {
"TimeoutValue": 30000, "TimeoutValue": 30000,
"DurationOfBreak": 60000, "DurationOfBreak": 60000,
"ExceptionsAllowedBeforeBreaking": 30 "ExceptionsAllowedBeforeBreaking": 30
}, },
"LoadBalancerOptions": { "LoadBalancerOptions": {
"Type": "RoundRobin" "Type": "RoundRobin"
} }
} }
} }

435
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.idsadmin.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.idsadmin.json

@ -1,180 +1,255 @@
{ {
"Routes": [ "Routes": [
// //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 30015 "Port": 30015
} }
], ],
"UpstreamPathTemplate": "/api/abp/ids-admin/application-configuration", "UpstreamPathTemplate": "/api/abp/ids-admin/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"LoadBalancerOptions": { "GET"
"Type": "RoundRobin" ],
}, "LoadBalancerOptions": {
"RateLimitOptions": {}, "Type": "RoundRobin"
"QoSOptions": { },
"ExceptionsAllowedBeforeBreaking": 10, "RateLimitOptions": {},
"DurationOfBreak": 1000, "QoSOptions": {
"TimeoutValue": 10000 "ExceptionsAllowedBeforeBreaking": 10,
}, "DurationOfBreak": 1000,
"HttpHandlerOptions": { "TimeoutValue": 10000
"UseTracing": true },
}, "HttpHandlerOptions": {
"Key": "ids-admin-configuration" "UseTracing": true
}, },
// API "Key": "ids-admin-configuration"
{ },
"DownstreamPathTemplate": "/api/abp/api-definition", // API
"DownstreamScheme": "http", {
"DownstreamHostAndPorts": [ "DownstreamPathTemplate": "/api/abp/api-definition",
{ "DownstreamScheme": "http",
"Host": "127.0.0.1", "DownstreamHostAndPorts": [
"Port": 30015 {
} "Host": "127.0.0.1",
], "Port": 30015
"UpstreamPathTemplate": "/api/abp/ids-admin/api-definition", }
"UpstreamHttpMethod": [ "GET" ], ],
"LoadBalancerOptions": { "UpstreamPathTemplate": "/api/abp/ids-admin/api-definition",
"Type": "RoundRobin" "UpstreamHttpMethod": [
}, "GET"
"RateLimitOptions": {}, ],
"QoSOptions": { "LoadBalancerOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "Type": "RoundRobin"
"DurationOfBreak": 1000, },
"TimeoutValue": 10000 "RateLimitOptions": {},
}, "QoSOptions": {
"HttpHandlerOptions": { "ExceptionsAllowedBeforeBreaking": 10,
"UseTracing": true "DurationOfBreak": 1000,
}, "TimeoutValue": 10000
"Key": "ids-admin-api-definition" },
}, "HttpHandlerOptions": {
// "UseTracing": true
{ },
"DownstreamPathTemplate": "/api/identity/{everything}", "Key": "ids-admin-api-definition"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ //
{ {
"Host": "127.0.0.1", "DownstreamPathTemplate": "/api/identity/{everything}",
"Port": 30015 "DownstreamScheme": "http",
} "DownstreamHostAndPorts": [
], {
"UpstreamPathTemplate": "/api/identity/{everything}", "Host": "127.0.0.1",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "Port": 30015
"LoadBalancerOptions": { }
"Type": "RoundRobin" ],
}, "UpstreamPathTemplate": "/api/identity/{everything}",
"RateLimitOptions": { "UpstreamHttpMethod": [
"ClientWhitelist": [], "GET",
"EnableRateLimiting": true, "POST",
"Period": "1s", "PUT",
"PeriodTimespan": 1, "DELETE"
"Limit": 5 ],
}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {
"TimeoutValue": 10000 "ClientWhitelist": [],
}, "EnableRateLimiting": true,
"HttpHandlerOptions": { "Period": "1s",
"UseTracing": true "PeriodTimespan": 1,
} "Limit": 100
}, },
// "QoSOptions": {
{ "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamPathTemplate": "/api/identity-server/{everything}", "DurationOfBreak": 1000,
"DownstreamScheme": "http", "TimeoutValue": 10000
"DownstreamHostAndPorts": [ },
{ "HttpHandlerOptions": {
"Host": "127.0.0.1", "UseTracing": true
"Port": 30015 }
} },
], //
"UpstreamPathTemplate": "/api/identity-server/{everything}", {
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "DownstreamPathTemplate": "/api/identity-server/{everything}",
"LoadBalancerOptions": { "DownstreamScheme": "http",
"Type": "RoundRobin" "DownstreamHostAndPorts": [
}, {
"RateLimitOptions": { "Host": "127.0.0.1",
"ClientWhitelist": [], "Port": 30015
"EnableRateLimiting": true, }
"Period": "1s", ],
"PeriodTimespan": 1, "UpstreamPathTemplate": "/api/identity-server/{everything}",
"Limit": 5 "UpstreamHttpMethod": [
}, "GET",
"QoSOptions": { "POST",
"ExceptionsAllowedBeforeBreaking": 10, "PUT",
"DurationOfBreak": 1000, "DELETE"
"TimeoutValue": 10000 ],
}, "LoadBalancerOptions": {
"HttpHandlerOptions": { "Type": "RoundRobin"
"UseTracing": true },
} "RateLimitOptions": {
}, "ClientWhitelist": [],
// "EnableRateLimiting": true,
{ "Period": "1s",
"DownstreamPathTemplate": "/api/account/{everything}", "PeriodTimespan": 1,
"DownstreamScheme": "http", "Limit": 100
"DownstreamHostAndPorts": [ },
{ "QoSOptions": {
"Host": "127.0.0.1", "ExceptionsAllowedBeforeBreaking": 10,
"Port": 30015 "DurationOfBreak": 1000,
} "TimeoutValue": 10000
], },
"UpstreamPathTemplate": "/api/account/{everything}", "HttpHandlerOptions": {
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UseTracing": true
"LoadBalancerOptions": { }
"Type": "RoundRobin" },
}, //
"RateLimitOptions": { {
"ClientWhitelist": [], "DownstreamPathTemplate": "/api/account/{everything}",
"EnableRateLimiting": true, "DownstreamScheme": "http",
"Period": "1s", "DownstreamHostAndPorts": [
"PeriodTimespan": 1, {
"Limit": 5 "Host": "127.0.0.1",
}, "Port": 30015
"QoSOptions": { }
"ExceptionsAllowedBeforeBreaking": 10, ],
"DurationOfBreak": 1000, "UpstreamPathTemplate": "/api/account/{everything}",
"TimeoutValue": 10000 "UpstreamHttpMethod": [
}, "GET",
"HttpHandlerOptions": { "POST",
"UseTracing": true "PUT",
} "DELETE"
}, ],
// API "LoadBalancerOptions": {
{ "Type": "RoundRobin"
"DownstreamPathTemplate": "/swagger/v1/swagger.json", },
"DownstreamScheme": "http", "RateLimitOptions": {
"DownstreamHostAndPorts": [ "ClientWhitelist": [],
{ "EnableRateLimiting": true,
"Host": "127.0.0.1", "Period": "1s",
"Port": 30015 "PeriodTimespan": 1,
} "Limit": 100
], },
"UpstreamPathTemplate": "/ids-admin/v1/swagger.json", "QoSOptions": {
"UpstreamHttpMethod": [ "GET" ], "ExceptionsAllowedBeforeBreaking": 10,
"LoadBalancerOptions": { "DurationOfBreak": 1000,
"Type": "RoundRobin" "TimeoutValue": 10000
}, },
"RateLimitOptions": { "HttpHandlerOptions": {
"ClientWhitelist": [], "UseTracing": true
"EnableRateLimiting": true, }
"Period": "1s", },
"PeriodTimespan": 1, //
"Limit": 5 {
}, "DownstreamPathTemplate": "/.well-known/openid-configuration",
"QoSOptions": { "DownstreamScheme": "http",
"ExceptionsAllowedBeforeBreaking": 10, "DownstreamHostAndPorts": [
"DurationOfBreak": 1000, {
"TimeoutValue": 10000 "Host": "127.0.0.1",
}, "Port": 44385
"HttpHandlerOptions": { }
"UseTracing": true ],
} "UpstreamPathTemplate": "/.well-known/openid-configuration",
} "UpstreamHttpMethod": [
] "GET"
} ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
{
"DownstreamPathTemplate": "/connect/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 44385
}
],
"UpstreamPathTemplate": "/connect/{everything}",
"UpstreamHttpMethod": [
"GET",
"POST"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
// API
{
"DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30015
}
],
"UpstreamPathTemplate": "/ids-admin/v1/swagger.json",
"UpstreamHttpMethod": [
"GET"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 100
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
}
]
}

247
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.localization.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.localization.json

@ -1,118 +1,129 @@
{ {
"Routes": [ "Routes": [
// //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 30030 "Port": 30030
} }
], ],
"UpstreamPathTemplate": "/api/abp/localization/application-configuration", "UpstreamPathTemplate": "/api/abp/localization/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"LoadBalancerOptions": { "GET"
"Type": "RoundRobin" ],
}, "LoadBalancerOptions": {
"RateLimitOptions": {}, "Type": "RoundRobin"
"QoSOptions": { },
"ExceptionsAllowedBeforeBreaking": 10, "RateLimitOptions": {},
"DurationOfBreak": 1000, "QoSOptions": {
"TimeoutValue": 10000 "ExceptionsAllowedBeforeBreaking": 10,
}, "DurationOfBreak": 1000,
"HttpHandlerOptions": { "TimeoutValue": 10000
"UseTracing": true },
}, "HttpHandlerOptions": {
"Key": "localization-configuration" "UseTracing": true
}, },
// API "Key": "localization-configuration"
{ },
"DownstreamPathTemplate": "/api/abp/api-definition", // API
"DownstreamScheme": "http", {
"DownstreamHostAndPorts": [ "DownstreamPathTemplate": "/api/abp/api-definition",
{ "DownstreamScheme": "http",
"Host": "127.0.0.1", "DownstreamHostAndPorts": [
"Port": 30030 {
} "Host": "127.0.0.1",
], "Port": 30030
"UpstreamPathTemplate": "/api/abp/localization/api-definition", }
"UpstreamHttpMethod": [ "GET" ], ],
"LoadBalancerOptions": { "UpstreamPathTemplate": "/api/abp/localization/api-definition",
"Type": "RoundRobin" "UpstreamHttpMethod": [
}, "GET"
"RateLimitOptions": {}, ],
"QoSOptions": { "LoadBalancerOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "Type": "RoundRobin"
"DurationOfBreak": 1000, },
"TimeoutValue": 10000 "RateLimitOptions": {},
}, "QoSOptions": {
"HttpHandlerOptions": { "ExceptionsAllowedBeforeBreaking": 10,
"UseTracing": true "DurationOfBreak": 1000,
}, "TimeoutValue": 10000
"Key": "localization-api-definition" },
}, "HttpHandlerOptions": {
// "UseTracing": true
{ },
"DownstreamPathTemplate": "/api/localization/{everything}", "Key": "localization-api-definition"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ //
{ {
"Host": "127.0.0.1", "DownstreamPathTemplate": "/api/localization/{everything}",
"Port": 30030 "DownstreamScheme": "http",
} "DownstreamHostAndPorts": [
], {
"UpstreamPathTemplate": "/api/localization/{everything}", "Host": "127.0.0.1",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "Port": 30030
"LoadBalancerOptions": { }
"Type": "RoundRobin" ],
}, "UpstreamPathTemplate": "/api/localization/{everything}",
"RateLimitOptions": { "UpstreamHttpMethod": [
"ClientWhitelist": [], "GET",
"EnableRateLimiting": true, "POST",
"Period": "1s", "PUT",
"PeriodTimespan": 1, "DELETE"
"Limit": 5 ],
}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {
"TimeoutValue": 10000 "ClientWhitelist": [],
}, "EnableRateLimiting": true,
"HttpHandlerOptions": { "Period": "1s",
"UseTracing": true "PeriodTimespan": 1,
} "Limit": 100
}, },
// API "QoSOptions": {
{ "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamPathTemplate": "/swagger/v1/swagger.json", "DurationOfBreak": 1000,
"DownstreamScheme": "http", "TimeoutValue": 10000
"DownstreamHostAndPorts": [ },
{ "HttpHandlerOptions": {
"Host": "127.0.0.1", "UseTracing": true
"Port": 30030 }
} },
], // API
"UpstreamPathTemplate": "/localization/v1/swagger.json", {
"UpstreamHttpMethod": [ "GET" ], "DownstreamPathTemplate": "/swagger/v1/swagger.json",
"LoadBalancerOptions": { "DownstreamScheme": "http",
"Type": "RoundRobin" "DownstreamHostAndPorts": [
}, {
"RateLimitOptions": { "Host": "127.0.0.1",
"ClientWhitelist": [], "Port": 30030
"EnableRateLimiting": true, }
"Period": "1s", ],
"PeriodTimespan": 1, "UpstreamPathTemplate": "/localization/v1/swagger.json",
"Limit": 5 "UpstreamHttpMethod": [
}, "GET"
"QoSOptions": { ],
"ExceptionsAllowedBeforeBreaking": 10, "LoadBalancerOptions": {
"DurationOfBreak": 1000, "Type": "RoundRobin"
"TimeoutValue": 10000 },
}, "RateLimitOptions": {
"HttpHandlerOptions": { "ClientWhitelist": [],
"UseTracing": true "EnableRateLimiting": true,
} "Period": "1s",
} "PeriodTimespan": 1,
] "Limit": 100
} },
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
}
]
}

714
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.messages.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.messages.json

@ -1,423 +1,291 @@
{ {
"Routes": [ "Routes": [
// ܶ˵ //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 30020 "Port": 30020
} }
], ],
"UpstreamPathTemplate": "/api/abp/messages/application-configuration", "UpstreamPathTemplate": "/api/abp/messages/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"LoadBalancerOptions": { "GET"
"Type": "RoundRobin" ],
}, "LoadBalancerOptions": {
"RateLimitOptions": {}, "Type": "RoundRobin"
"QoSOptions": { },
"ExceptionsAllowedBeforeBreaking": 10, "RateLimitOptions": {},
"DurationOfBreak": 1000, "QoSOptions": {
"TimeoutValue": 10000 "ExceptionsAllowedBeforeBreaking": 10,
}, "DurationOfBreak": 1000,
"HttpHandlerOptions": { "TimeoutValue": 10000
"UseTracing": true },
}, "HttpHandlerOptions": {
"Key": "messages-configuration" "UseTracing": true
}, },
// ̬ܶAPI˵ "Key": "messages-configuration"
{ },
"DownstreamPathTemplate": "/api/abp/api-definition", // API
"DownstreamScheme": "http", {
"DownstreamHostAndPorts": [ "DownstreamPathTemplate": "/api/abp/api-definition",
{ "DownstreamScheme": "http",
"Host": "127.0.0.1", "DownstreamHostAndPorts": [
"Port": 30020 {
} "Host": "127.0.0.1",
], "Port": 30020
"UpstreamPathTemplate": "/api/abp/messages/api-definition", }
"UpstreamHttpMethod": [ "GET" ], ],
"LoadBalancerOptions": { "UpstreamPathTemplate": "/api/abp/messages/api-definition",
"Type": "RoundRobin" "UpstreamHttpMethod": [
}, "GET"
"RateLimitOptions": {}, ],
"QoSOptions": { "LoadBalancerOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "Type": "RoundRobin"
"DurationOfBreak": 1000, },
"TimeoutValue": 10000 "RateLimitOptions": {},
}, "QoSOptions": {
"HttpHandlerOptions": { "ExceptionsAllowedBeforeBreaking": 10,
"UseTracing": true "DurationOfBreak": 1000,
}, "TimeoutValue": 10000
"Key": "messages-api-definition" },
}, "HttpHandlerOptions": {
// ʱͨѶ "UseTracing": true
{ },
"DownstreamPathTemplate": "/api/im/{everything}", "Key": "messages-api-definition"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ //
{ {
"Host": "127.0.0.1", "DownstreamPathTemplate": "/api/im/{everything}",
"Port": 30020 "DownstreamScheme": "http",
} "DownstreamHostAndPorts": [
], {
"UpstreamPathTemplate": "/api/im/{everything}", "Host": "127.0.0.1",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "Port": 30020
"LoadBalancerOptions": { }
"Type": "RoundRobin" ],
}, "UpstreamPathTemplate": "/api/im/{everything}",
"RateLimitOptions": { "UpstreamHttpMethod": [
"ClientWhitelist": [], "GET",
"EnableRateLimiting": true, "POST",
"Period": "1s", "PUT",
"PeriodTimespan": 1, "DELETE"
"Limit": 5 ],
}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {
"TimeoutValue": 10000 "ClientWhitelist": [],
}, "EnableRateLimiting": true,
"HttpHandlerOptions": { "Period": "1s",
"UseTracing": true "PeriodTimespan": 1,
} "Limit": 100
}, },
// Hangfire DZ "QoSOptions": {
{ "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamPathTemplate": "/hangfire/{everything}", "DurationOfBreak": 1000,
"DownstreamScheme": "http", "TimeoutValue": 10000
"DownstreamHostAndPorts": [ },
{ "HttpHandlerOptions": {
"Host": "127.0.0.1", "UseTracing": true
"Port": 30020 }
} },
], // Hangfire
"UpstreamPathTemplate": "/hangfire/{everything}", {
"UpstreamHttpMethod": [ "GET" ], "DownstreamPathTemplate": "/hangfire/{everything}",
"LoadBalancerOptions": { "DownstreamScheme": "http",
"Type": "RoundRobin" "DownstreamHostAndPorts": [
}, {
"RateLimitOptions": { "Host": "127.0.0.1",
"ClientWhitelist": [], "Port": 30020
"EnableRateLimiting": true, }
"Period": "1s", ],
"PeriodTimespan": 1, "UpstreamPathTemplate": "/hangfire/{everything}",
"Limit": 5 "UpstreamHttpMethod": [
}, "GET"
"QoSOptions": { ],
"ExceptionsAllowedBeforeBreaking": 10, "LoadBalancerOptions": {
"DurationOfBreak": 1000, "Type": "RoundRobin"
"TimeoutValue": 10000 },
}, "RateLimitOptions": {
"HttpHandlerOptions": { "ClientWhitelist": [],
"UseTracing": true "EnableRateLimiting": true,
} "Period": "1s",
}, "PeriodTimespan": 1,
{ "Limit": 100
"DownstreamPathTemplate": "/api/my-subscribes", },
"DownstreamScheme": "http", "QoSOptions": {
"DownstreamHostAndPorts": [ "ExceptionsAllowedBeforeBreaking": 10,
{ "DurationOfBreak": 1000,
"Host": "127.0.0.1", "TimeoutValue": 10000
"Port": 30020 },
} "HttpHandlerOptions": {
], "UseTracing": true
"UpstreamPathTemplate": "/api/my-subscribes", }
"UpstreamHttpMethod": [ },
"GET", //
"POST", {
"PUT", "DownstreamPathTemplate": "/api/notifications/{everything}",
"DELETE" "DownstreamScheme": "http",
], "DownstreamHostAndPorts": [
"LoadBalancerOptions": { {
"Type": "RoundRobin" "Host": "127.0.0.1",
}, "Port": 30020
"RateLimitOptions": { }
"ClientWhitelist": [], ],
"EnableRateLimiting": true, "UpstreamPathTemplate": "/api/notifications/{everything}",
"Period": "1s", "UpstreamHttpMethod": [
"PeriodTimespan": 1, "GET",
"Limit": 5 "POST",
}, "PUT",
"QoSOptions": { "DELETE"
"ExceptionsAllowedBeforeBreaking": 10, ],
"DurationOfBreak": 1000, "LoadBalancerOptions": {
"TimeoutValue": 10000 "Type": "RoundRobin"
}, },
"HttpHandlerOptions": { "RateLimitOptions": {
"UseTracing": true "ClientWhitelist": [],
}, "EnableRateLimiting": true,
"Priority": 99 "Period": "1s",
}, "PeriodTimespan": 1,
// û "Limit": 100
{ },
"DownstreamPathTemplate": "/api/my-subscribes/{everything}", "QoSOptions": {
"DownstreamScheme": "http", "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamHostAndPorts": [ "DurationOfBreak": 1000,
{ "TimeoutValue": 10000
"Host": "127.0.0.1", },
"Port": 30020 "HttpHandlerOptions": {
} "UseTracing": true
], }
"UpstreamPathTemplate": "/api/my-subscribes/{everything}", },
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], // Api
"LoadBalancerOptions": { {
"Type": "RoundRobin" "DownstreamPathTemplate": "/swagger/v1/swagger.json",
}, "DownstreamScheme": "http",
"RateLimitOptions": { "DownstreamHostAndPorts": [
"ClientWhitelist": [], {
"EnableRateLimiting": true, "Host": "127.0.0.1",
"Period": "1s", "Port": 30020
"PeriodTimespan": 1, }
"Limit": 5 ],
}, "UpstreamPathTemplate": "/messages/v1/swagger.json",
"QoSOptions": { "UpstreamHttpMethod": [
"ExceptionsAllowedBeforeBreaking": 10, "GET"
"DurationOfBreak": 1000, ],
"TimeoutValue": 10000 "LoadBalancerOptions": {
}, "Type": "RoundRobin"
"HttpHandlerOptions": { },
"UseTracing": true "RateLimitOptions": {
} "ClientWhitelist": [],
}, "EnableRateLimiting": true,
// ûб "Period": "1s",
{ "PeriodTimespan": 1,
"DownstreamPathTemplate": "/api/my-subscribes/all", "Limit": 100
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ "QoSOptions": {
{ "ExceptionsAllowedBeforeBreaking": 10,
"Host": "127.0.0.1", "DurationOfBreak": 1000,
"Port": 30020 "TimeoutValue": 10000
} },
], "HttpHandlerOptions": {
"UpstreamPathTemplate": "/api/my-subscribes/all", "UseTracing": true
"UpstreamHttpMethod": [ "GET" ], }
"LoadBalancerOptions": { },
"Type": "RoundRobin" // signalr
}, {
"RateLimitOptions": { "DownstreamPathTemplate": "/signalr-hubs/messages",
"ClientWhitelist": [], "DownstreamScheme": "ws",
"EnableRateLimiting": true, "DownstreamHostAndPorts": [
"Period": "1s", {
"PeriodTimespan": 1, "Host": "127.0.0.1",
"Limit": 5 "Port": 30020
}, }
"QoSOptions": { ],
"ExceptionsAllowedBeforeBreaking": 10, "UpstreamPathTemplate": "/signalr-hubs/messages",
"DurationOfBreak": 1000, "UpstreamHttpMethod": [
"TimeoutValue": 10000 "GET",
}, "POST",
"HttpHandlerOptions": { "PUT",
"UseTracing": true "DELETE",
}, "OPTIONS"
"Priority": 99, ],
"Key": "my-subscribes" "LoadBalancerOptions": {
}, "Type": "RoundRobin"
// û֪ͨ },
{ "RateLimitOptions": {},
"DownstreamPathTemplate": "/api/notifications/my-notifilers/assignables", "QoSOptions": {
"DownstreamScheme": "http", "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamHostAndPorts": [ "DurationOfBreak": 1000,
{ "TimeoutValue": 10000
"Host": "127.0.0.1", },
"Port": 30020 "HttpHandlerOptions": {},
} "DangerousAcceptAnyServerCertificateValidator": true,
], "RouteIsCaseSensitive": false,
"UpstreamPathTemplate": "/api/notifications/my-notifilers/assignables", "Priority": 99
"UpstreamHttpMethod": [ "GET" ], },
"LoadBalancerOptions": { {
"Type": "RoundRobin" "DownstreamPathTemplate": "/signalr-hubs/notifications",
}, "DownstreamScheme": "ws",
"RateLimitOptions": { "DownstreamHostAndPorts": [
"ClientWhitelist": [], {
"EnableRateLimiting": true, "Host": "127.0.0.1",
"Period": "1s", "Port": 30020
"PeriodTimespan": 1, }
"Limit": 5 ],
}, "UpstreamPathTemplate": "/signalr-hubs/notifications",
"QoSOptions": { "UpstreamHttpMethod": [
"ExceptionsAllowedBeforeBreaking": 10, "GET",
"DurationOfBreak": 1000, "POST",
"TimeoutValue": 10000 "PUT",
}, "DELETE",
"HttpHandlerOptions": { "OPTIONS"
"UseTracing": true ],
}, "LoadBalancerOptions": {
"Priority": 99, "Type": "RoundRobin"
"Key": "assignables-notifilers" },
}, "RateLimitOptions": {},
// û֪ͨ "QoSOptions": {
{ "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamPathTemplate": "/api/notifications/my-notifilers", "DurationOfBreak": 1000,
"DownstreamScheme": "http", "TimeoutValue": 10000
"DownstreamHostAndPorts": [ },
{ "HttpHandlerOptions": {},
"Host": "127.0.0.1", "DangerousAcceptAnyServerCertificateValidator": true,
"Port": 30020 "RouteIsCaseSensitive": false,
} "Priority": 99
], },
"UpstreamPathTemplate": "/api/notifications/my-notifilers", {
"UpstreamHttpMethod": [ "GET" ], "DownstreamPathTemplate": "/signalr-hubs/{everything}",
"LoadBalancerOptions": { "DownstreamScheme": "ws",
"Type": "RoundRobin" "DownstreamHostAndPorts": [
}, {
"RateLimitOptions": { "Host": "127.0.0.1",
"ClientWhitelist": [], "Port": 30020
"EnableRateLimiting": true, }
"Period": "1s", ],
"PeriodTimespan": 1, "UpstreamPathTemplate": "/signalr-hubs/{everything}",
"Limit": 5 "UpstreamHttpMethod": [
}, "GET",
"QoSOptions": { "POST",
"ExceptionsAllowedBeforeBreaking": 10, "PUT",
"DurationOfBreak": 1000, "DELETE",
"TimeoutValue": 10000 "OPTIONS"
}, ],
"HttpHandlerOptions": { "LoadBalancerOptions": {
"UseTracing": true "Type": "RoundRobin"
} },
}, "RateLimitOptions": {},
{ "QoSOptions": {
"DownstreamPathTemplate": "/api/notifications/my-notifilers/{id}", "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamScheme": "http", "DurationOfBreak": 1000,
"DownstreamHostAndPorts": [ "TimeoutValue": 10000
{ },
"Host": "127.0.0.1", "HttpHandlerOptions": {},
"Port": 30020 "DangerousAcceptAnyServerCertificateValidator": true,
} "RouteIsCaseSensitive": false
], }
"UpstreamPathTemplate": "/api/notifications/my-notifilers/{id}", ]
"UpstreamHttpMethod": [ }
"GET",
"POST",
"PUT",
"DELETE"
],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 5
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
// API ĵ
{
"DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
],
"UpstreamPathTemplate": "/messages/v1/swagger.json",
"UpstreamHttpMethod": [ "GET" ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 1,
"Limit": 5
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
},
//
{
"DownstreamPathTemplate": "/signalr-hubs/messages",
"DownstreamScheme": "ws",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
],
"UpstreamPathTemplate": "/signalr-hubs/messages",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {},
"DangerousAcceptAnyServerCertificateValidator": true,
"RouteIsCaseSensitive": false,
"Priority": 99
},
{
"DownstreamPathTemplate": "/signalr-hubs/notifications",
"DownstreamScheme": "ws",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
],
"UpstreamPathTemplate": "/signalr-hubs/notifications",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {},
"DangerousAcceptAnyServerCertificateValidator": true,
"RouteIsCaseSensitive": false,
"Priority": 99
},
{
"DownstreamPathTemplate": "/signalr-hubs/{everything}",
"DownstreamScheme": "ws",
"DownstreamHostAndPorts": [
{
"Host": "127.0.0.1",
"Port": 30020
}
],
"UpstreamPathTemplate": "/signalr-hubs/{everything}",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ],
"LoadBalancerOptions": {
"Type": "RoundRobin"
},
"RateLimitOptions": {},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {},
"DangerousAcceptAnyServerCertificateValidator": true,
"RouteIsCaseSensitive": false
}
]
}

617
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.platform.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.platform.json

@ -1,314 +1,303 @@
{ {
"Routes": [ "Routes": [
// ܶ˵ //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 30025 "Port": 30025
} }
], ],
"UpstreamPathTemplate": "/api/abp/platform/application-configuration", "UpstreamPathTemplate": "/api/abp/platform/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"LoadBalancerOptions": { "GET"
"Type": "RoundRobin" ],
}, "LoadBalancerOptions": {
"RateLimitOptions": {}, "Type": "RoundRobin"
"QoSOptions": { },
"ExceptionsAllowedBeforeBreaking": 10, "RateLimitOptions": {},
"DurationOfBreak": 1000, "QoSOptions": {
"TimeoutValue": 10000 "ExceptionsAllowedBeforeBreaking": 10,
}, "DurationOfBreak": 1000,
"HttpHandlerOptions": { "TimeoutValue": 10000
"UseTracing": true },
}, "HttpHandlerOptions": {
"Key": "platform-configuration" "UseTracing": true
}, },
// ̬ܶAPI˵ "Key": "platform-configuration"
{ },
"DownstreamPathTemplate": "/api/abp/api-definition", // API
"DownstreamScheme": "http", {
"DownstreamHostAndPorts": [ "DownstreamPathTemplate": "/api/abp/api-definition",
{ "DownstreamScheme": "http",
"Host": "127.0.0.1", "DownstreamHostAndPorts": [
"Port": 30025 {
} "Host": "127.0.0.1",
], "Port": 30025
"UpstreamPathTemplate": "/api/abp/platform/api-definition", }
"UpstreamHttpMethod": [ "GET" ], ],
"LoadBalancerOptions": { "UpstreamPathTemplate": "/api/abp/platform/api-definition",
"Type": "RoundRobin" "UpstreamHttpMethod": [
}, "GET"
"RateLimitOptions": {}, ],
"QoSOptions": { "LoadBalancerOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "Type": "RoundRobin"
"DurationOfBreak": 1000, },
"TimeoutValue": 10000 "RateLimitOptions": {},
}, "QoSOptions": {
"HttpHandlerOptions": { "ExceptionsAllowedBeforeBreaking": 10,
"UseTracing": true "DurationOfBreak": 1000,
}, "TimeoutValue": 10000
"Key": "platform-api-definition" },
}, "HttpHandlerOptions": {
// "UseTracing": true
{ },
"DownstreamPathTemplate": "/api/oss-management/{everything}", "Key": "platform-api-definition"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ // oss
{ {
"Host": "127.0.0.1", "DownstreamPathTemplate": "/api/oss-management/{everything}",
"Port": 30025 "DownstreamScheme": "http",
} "DownstreamHostAndPorts": [
], {
"UpstreamPathTemplate": "/api/oss-management/{everything}", "Host": "127.0.0.1",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "Port": 30025
"LoadBalancerOptions": { }
"Type": "RoundRobin" ],
}, "UpstreamPathTemplate": "/api/oss-management/{everything}",
"RateLimitOptions": { "UpstreamHttpMethod": [
"ClientWhitelist": [], "GET",
"EnableRateLimiting": true, "POST",
"Period": "1s", "PUT",
"PeriodTimespan": 1, "DELETE"
"Limit": 5 ],
}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {
"TimeoutValue": 10000 "ClientWhitelist": [],
}, "EnableRateLimiting": true,
"HttpHandlerOptions": { "Period": "1s",
"UseTracing": true "PeriodTimespan": 1,
} "Limit": 100
}, },
// ƽ̨ "QoSOptions": {
{ "ExceptionsAllowedBeforeBreaking": 10,
"DownstreamPathTemplate": "/api/platform/{everything}", "DurationOfBreak": 1000,
"DownstreamScheme": "http", "TimeoutValue": 10000
"DownstreamHostAndPorts": [ },
{ "HttpHandlerOptions": {
"Host": "127.0.0.1", "UseTracing": true
"Port": 30025 }
} },
], //
"UpstreamPathTemplate": "/api/platform/{everything}", {
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "DownstreamPathTemplate": "/api/platform/{everything}",
"LoadBalancerOptions": { "DownstreamScheme": "http",
"Type": "RoundRobin" "DownstreamHostAndPorts": [
}, {
"RateLimitOptions": { "Host": "127.0.0.1",
"ClientWhitelist": [], "Port": 30025
"EnableRateLimiting": true, }
"Period": "1s", ],
"PeriodTimespan": 1, "UpstreamPathTemplate": "/api/platform/{everything}",
"Limit": 5 "UpstreamHttpMethod": [
}, "GET",
"QoSOptions": { "POST",
"ExceptionsAllowedBeforeBreaking": 10, "PUT",
"DurationOfBreak": 1000, "DELETE"
"TimeoutValue": 10000 ],
}, "LoadBalancerOptions": {
"HttpHandlerOptions": { "Type": "RoundRobin"
"UseTracing": true },
} "RateLimitOptions": {
}, "ClientWhitelist": [],
// ļ "EnableRateLimiting": true,
{ "Period": "1s",
"DownstreamPathTemplate": "/api/files/{everything}", "PeriodTimespan": 1,
"DownstreamScheme": "http", "Limit": 100
"DownstreamHostAndPorts": [ },
{ "QoSOptions": {
"Host": "127.0.0.1", "ExceptionsAllowedBeforeBreaking": 10,
"Port": 30025 "DurationOfBreak": 1000,
} "TimeoutValue": 10000
], },
"UpstreamPathTemplate": "/api/files/{everything}", "HttpHandlerOptions": {
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "UseTracing": true
"LoadBalancerOptions": { }
"Type": "RoundRobin" },
}, //
"RateLimitOptions": { {
"ClientWhitelist": [], "DownstreamPathTemplate": "/api/files/{everything}",
"EnableRateLimiting": true, "DownstreamScheme": "http",
"Period": "1s", "DownstreamHostAndPorts": [
"PeriodTimespan": 1, {
"Limit": 5 "Host": "127.0.0.1",
}, "Port": 30025
"QoSOptions": { }
"ExceptionsAllowedBeforeBreaking": 10, ],
"DurationOfBreak": 1000, "UpstreamPathTemplate": "/api/files/{everything}",
"TimeoutValue": 10000 "UpstreamHttpMethod": [
}, "GET",
"HttpHandlerOptions": { "POST",
"UseTracing": true "PUT",
} "DELETE"
}, ],
{ "LoadBalancerOptions": {
"DownstreamPathTemplate": "/api/files/{everything}", "Type": "RoundRobin"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ "RateLimitOptions": {
{ "ClientWhitelist": [],
"Host": "127.0.0.1", "EnableRateLimiting": true,
"Port": 30025 "Period": "1s",
} "PeriodTimespan": 1,
], "Limit": 100
"UpstreamPathTemplate": "/api/api/files/{everything}", },
"UpstreamHttpMethod": [ "QoSOptions": {
"GET", "ExceptionsAllowedBeforeBreaking": 10,
"POST", "DurationOfBreak": 1000,
"PUT", "TimeoutValue": 10000
"DELETE" },
], "HttpHandlerOptions": {
"LoadBalancerOptions": { "UseTracing": true
"Type": "RoundRobin" }
}, },
"RateLimitOptions": { {
"ClientWhitelist": [], "DownstreamPathTemplate": "/api/files/{everything}",
"EnableRateLimiting": true, "DownstreamScheme": "http",
"Period": "1s", "DownstreamHostAndPorts": [
"PeriodTimespan": 1, {
"Limit": 5 "Host": "127.0.0.1",
}, "Port": 30025
"QoSOptions": { }
"ExceptionsAllowedBeforeBreaking": 10, ],
"DurationOfBreak": 1000, "UpstreamPathTemplate": "/api/api/files/{everything}",
"TimeoutValue": 10000 "UpstreamHttpMethod": [
}, "GET",
"HttpHandlerOptions": { "POST",
"UseTracing": true "PUT",
} "DELETE"
}, ],
{ "LoadBalancerOptions": {
"DownstreamPathTemplate": "/api/task-management/{everything}", "Type": "RoundRobin"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ "RateLimitOptions": {
{ "ClientWhitelist": [],
"Host": "127.0.0.1", "EnableRateLimiting": true,
"Port": 30040 "Period": "1s",
} "PeriodTimespan": 1,
], "Limit": 100
"UpstreamPathTemplate": "/api/task-management/{everything}", },
"UpstreamHttpMethod": [ "QoSOptions": {
"GET", "ExceptionsAllowedBeforeBreaking": 10,
"POST", "DurationOfBreak": 1000,
"PUT", "TimeoutValue": 10000
"DELETE" },
], "HttpHandlerOptions": {
"LoadBalancerOptions": { "UseTracing": true
"Type": "RoundRobin" }
}, },
"RateLimitOptions": { // oss
"ClientWhitelist": [], {
"EnableRateLimiting": true, "DownstreamPathTemplate": "/api/setting-management/oss-management/by-current-tenant",
"Period": "1s", "DownstreamScheme": "http",
"PeriodTimespan": 1, "DownstreamHostAndPorts": [
"Limit": 5 {
}, "Host": "127.0.0.1",
"QoSOptions": { "Port": 30025
"ExceptionsAllowedBeforeBreaking": 10, }
"DurationOfBreak": 1000, ],
"TimeoutValue": 10000 "UpstreamPathTemplate": "/api/setting-management/oss-management/by-current-tenant",
}, "UpstreamHttpMethod": [
"HttpHandlerOptions": { "GET"
"UseTracing": true ],
} "LoadBalancerOptions": {
}, "Type": "RoundRobin"
// },
{ "RateLimitOptions": {
"DownstreamPathTemplate": "/api/setting-management/oss-management/by-current-tenant", "ClientWhitelist": [],
"DownstreamScheme": "http", "EnableRateLimiting": true,
"DownstreamHostAndPorts": [ "Period": "1s",
{ "PeriodTimespan": 1,
"Host": "127.0.0.1", "Limit": 100
"Port": 30025 },
} "QoSOptions": {
], "ExceptionsAllowedBeforeBreaking": 10,
"UpstreamPathTemplate": "/api/setting-management/oss-management/by-current-tenant", "DurationOfBreak": 1000,
"UpstreamHttpMethod": [ "GET" ], "TimeoutValue": 10000
"LoadBalancerOptions": { },
"Type": "RoundRobin" "HttpHandlerOptions": {
}, "UseTracing": true
"RateLimitOptions": { },
"ClientWhitelist": [], "Key": "oss-management-setting-current-tenant"
"EnableRateLimiting": true, },
"Period": "1s", {
"PeriodTimespan": 1, "DownstreamPathTemplate": "/api/setting-management/oss-management/by-global",
"Limit": 5 "DownstreamScheme": "http",
}, "DownstreamHostAndPorts": [
"QoSOptions": { {
"ExceptionsAllowedBeforeBreaking": 10, "Host": "127.0.0.1",
"DurationOfBreak": 1000, "Port": 30025
"TimeoutValue": 10000 }
}, ],
"HttpHandlerOptions": { "UpstreamPathTemplate": "/api/setting-management/oss-management/by-global",
"UseTracing": true "UpstreamHttpMethod": [
}, "GET"
"Key": "oss-management-setting-current-tenant" ],
}, "LoadBalancerOptions": {
// ȫ "Type": "RoundRobin"
{ },
"DownstreamPathTemplate": "/api/setting-management/oss-management/by-global", "RateLimitOptions": {
"DownstreamScheme": "http", "ClientWhitelist": [],
"DownstreamHostAndPorts": [ "EnableRateLimiting": true,
{ "Period": "1s",
"Host": "127.0.0.1", "PeriodTimespan": 1,
"Port": 30025 "Limit": 100
} },
], "QoSOptions": {
"UpstreamPathTemplate": "/api/setting-management/oss-management/by-global", "ExceptionsAllowedBeforeBreaking": 10,
"UpstreamHttpMethod": [ "GET" ], "DurationOfBreak": 1000,
"LoadBalancerOptions": { "TimeoutValue": 10000
"Type": "RoundRobin" },
}, "HttpHandlerOptions": {
"RateLimitOptions": { "UseTracing": true
"ClientWhitelist": [], },
"EnableRateLimiting": true, "Key": "oss-management-setting-global"
"Period": "1s", },
"PeriodTimespan": 1, // Api
"Limit": 5 {
}, "DownstreamPathTemplate": "/swagger/v1/swagger.json",
"QoSOptions": { "DownstreamScheme": "http",
"ExceptionsAllowedBeforeBreaking": 10, "DownstreamHostAndPorts": [
"DurationOfBreak": 1000, {
"TimeoutValue": 10000 "Host": "127.0.0.1",
}, "Port": 30025
"HttpHandlerOptions": { }
"UseTracing": true ],
}, "UpstreamPathTemplate": "/platform/v1/swagger.json",
"Key": "oss-management-setting-global" "UpstreamHttpMethod": [
}, "GET"
// API ĵ ],
{ "LoadBalancerOptions": {
"DownstreamPathTemplate": "/swagger/v1/swagger.json", "Type": "RoundRobin"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ "RateLimitOptions": {
{ "ClientWhitelist": [],
"Host": "127.0.0.1", "EnableRateLimiting": true,
"Port": 30025 "Period": "1s",
} "PeriodTimespan": 1,
], "Limit": 100
"UpstreamPathTemplate": "/platform/v1/swagger.json", },
"UpstreamHttpMethod": [ "GET" ], "QoSOptions": {
"LoadBalancerOptions": { "ExceptionsAllowedBeforeBreaking": 10,
"Type": "RoundRobin" "DurationOfBreak": 1000,
}, "TimeoutValue": 10000
"RateLimitOptions": { },
"ClientWhitelist": [], "HttpHandlerOptions": {
"EnableRateLimiting": true, "UseTracing": true
"Period": "1s", }
"PeriodTimespan": 1, }
"Limit": 5 ]
}, }
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
}
]
}

183
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.task.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.task.json

@ -1,87 +1,96 @@
{ {
"Routes": [ "Routes": [
// //
{ {
"DownstreamPathTemplate": "/api/abp/application-configuration", "DownstreamPathTemplate": "/api/abp/application-configuration",
"DownstreamScheme": "http", "DownstreamScheme": "http",
"DownstreamHostAndPorts": [ "DownstreamHostAndPorts": [
{ {
"Host": "127.0.0.1", "Host": "127.0.0.1",
"Port": 30040 "Port": 30040
} }
], ],
"UpstreamPathTemplate": "/api/abp/task/application-configuration", "UpstreamPathTemplate": "/api/abp/task/application-configuration",
"UpstreamHttpMethod": [ "GET" ], "UpstreamHttpMethod": [
"LoadBalancerOptions": { "GET"
"Type": "RoundRobin" ],
}, "LoadBalancerOptions": {
"RateLimitOptions": {}, "Type": "RoundRobin"
"QoSOptions": { },
"ExceptionsAllowedBeforeBreaking": 10, "RateLimitOptions": {},
"DurationOfBreak": 1000, "QoSOptions": {
"TimeoutValue": 10000 "ExceptionsAllowedBeforeBreaking": 10,
}, "DurationOfBreak": 1000,
"HttpHandlerOptions": { "TimeoutValue": 10000
"UseTracing": true },
}, "HttpHandlerOptions": {
"Key": "task-configuration" "UseTracing": true
}, },
// API "Key": "task-configuration"
{ },
"DownstreamPathTemplate": "/api/abp/api-definition", // API
"DownstreamScheme": "http", {
"DownstreamHostAndPorts": [ "DownstreamPathTemplate": "/api/abp/api-definition",
{ "DownstreamScheme": "http",
"Host": "127.0.0.1", "DownstreamHostAndPorts": [
"Port": 30040 {
} "Host": "127.0.0.1",
], "Port": 30040
"UpstreamPathTemplate": "/api/abp/task/api-definition", }
"UpstreamHttpMethod": [ "GET" ], ],
"LoadBalancerOptions": { "UpstreamPathTemplate": "/api/abp/task/api-definition",
"Type": "RoundRobin" "UpstreamHttpMethod": [
}, "GET"
"RateLimitOptions": {}, ],
"QoSOptions": { "LoadBalancerOptions": {
"ExceptionsAllowedBeforeBreaking": 10, "Type": "RoundRobin"
"DurationOfBreak": 1000, },
"TimeoutValue": 10000 "RateLimitOptions": {},
}, "QoSOptions": {
"HttpHandlerOptions": { "ExceptionsAllowedBeforeBreaking": 10,
"UseTracing": true "DurationOfBreak": 1000,
}, "TimeoutValue": 10000
"Key": "task-api-definition" },
}, "HttpHandlerOptions": {
// "UseTracing": true
{ },
"DownstreamPathTemplate": "/api/task-management/{everything}", "Key": "task-api-definition"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ //
{ {
"Host": "127.0.0.1", "DownstreamPathTemplate": "/api/task-management/{everything}",
"Port": 30040 "DownstreamScheme": "http",
} "DownstreamHostAndPorts": [
], {
"UpstreamPathTemplate": "/api/task-management/{everything}", "Host": "127.0.0.1",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "Port": 30040
"LoadBalancerOptions": { }
"Type": "RoundRobin" ],
}, "UpstreamPathTemplate": "/api/task-management/{everything}",
"RateLimitOptions": { "UpstreamHttpMethod": [
"ClientWhitelist": [], "GET",
"EnableRateLimiting": true, "POST",
"Period": "1s", "PUT",
"PeriodTimespan": 1, "DELETE"
"Limit": 5 ],
}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {
"TimeoutValue": 10000 "ClientWhitelist": [],
}, "EnableRateLimiting": true,
"HttpHandlerOptions": { "Period": "1s",
"UseTracing": true "PeriodTimespan": 1,
} "Limit": 100
} },
] "QoSOptions": {
} "ExceptionsAllowedBeforeBreaking": 10,
"DurationOfBreak": 1000,
"TimeoutValue": 10000
},
"HttpHandlerOptions": {
"UseTracing": true
}
}
]
}

121
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.webhook.json → gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/OcelotConfig/ocelot.webhook.json

@ -1,59 +1,62 @@
{ {
"Routes": [ "Routes": [
{ // API
"DownstreamPathTemplate": "/api/abp/api-definition", {
"DownstreamScheme": "http", "DownstreamPathTemplate": "/api/abp/api-definition",
"DownstreamHostAndPorts": [ "DownstreamScheme": "http",
{ "DownstreamHostAndPorts": [
"Host": "127.0.0.1", {
"Port": 30045 "Host": "127.0.0.1",
} "Port": 30045
], }
"UpstreamPathTemplate": "/api/abp/webhook/api-definition", ],
"UpstreamHttpMethod": [ "GET" ], "UpstreamPathTemplate": "/api/abp/webhook/api-definition",
"LoadBalancerOptions": { "UpstreamHttpMethod": [
"Type": "RoundRobin" "GET"
}, ],
"RateLimitOptions": {}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {},
"TimeoutValue": 10000 "QoSOptions": {
}, "ExceptionsAllowedBeforeBreaking": 10,
"HttpHandlerOptions": { "DurationOfBreak": 1000,
"UseTracing": true "TimeoutValue": 10000
}, },
"Key": "webhook-api-definition" "HttpHandlerOptions": {
}, "UseTracing": true
{ },
"DownstreamPathTemplate": "/api/webhooks/{everything}", "Key": "webhook-api-definition"
"DownstreamScheme": "http", },
"DownstreamHostAndPorts": [ // webhooks
{ {
"Host": "127.0.0.1", "DownstreamPathTemplate": "/api/webhooks/{everything}",
"Port": 30045 "DownstreamScheme": "http",
} "DownstreamHostAndPorts": [
], {
"UpstreamPathTemplate": "/api/webhooks/{everything}", "Host": "127.0.0.1",
"UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ], "Port": 30045
"LoadBalancerOptions": { }
"Type": "RoundRobin" ],
}, "UpstreamPathTemplate": "/api/webhooks/{everything}",
"RateLimitOptions": { "UpstreamHttpMethod": [
"ClientWhitelist": [], "GET",
"EnableRateLimiting": true, "POST",
"Period": "1s", "PUT",
"PeriodTimespan": 1, "DELETE"
"Limit": 5 ],
}, "LoadBalancerOptions": {
"QoSOptions": { "Type": "RoundRobin"
"ExceptionsAllowedBeforeBreaking": 10, },
"DurationOfBreak": 1000, "RateLimitOptions": {},
"TimeoutValue": 10000 "QoSOptions": {
}, "ExceptionsAllowedBeforeBreaking": 10,
"HttpHandlerOptions": { "DurationOfBreak": 1000,
"UseTracing": true "TimeoutValue": 30000
} },
} "HttpHandlerOptions": {
] "UseTracing": true
} }
}
]
}

13
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/Program.cs

@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Ocelot.DependencyInjection;
using Serilog; using Serilog;
using System; using System;
using System.IO; using System.IO;
@ -25,11 +26,13 @@ public class Program
.UseAutofac() .UseAutofac()
.ConfigureAppConfiguration((context, config) => .ConfigureAppConfiguration((context, config) =>
{ {
// 加入 ocelot配置文件 //// 加入 ocelot配置文件
config.AddJsonFile( //config.AddJsonFile(
$"ocelot.{context.HostingEnvironment.EnvironmentName ?? "Development"}.json", //$"ocelot.{context.HostingEnvironment.EnvironmentName ?? "Development"}.json",
optional: true, //optional: true,
reloadOnChange: true); //reloadOnChange: true);
config.AddAutoOcelotConfig("OcelotConfig", builder.Environment);
var configuration = config.Build(); var configuration = config.Build();
if (configuration.GetSection("AgileConfig").Exists()) if (configuration.GetSection("AgileConfig").Exists())

1895
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.Development.json

File diff suppressed because it is too large

4349
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/ocelot.json

File diff suppressed because it is too large

2
starter/70.start-internal-gateway.bat

@ -1,4 +1,4 @@
@echo off @echo off
cls cls
cd ..\aspnet-core\ cd ..\aspnet-core\
.\start-internal-gateway.bat .\start-internal-gateway.bat --watchrun
Loading…
Cancel
Save