Skip to content

Commit

Permalink
feat: add use apollo config to silo, entity, authserver
Browse files Browse the repository at this point in the history
  • Loading branch information
mixhsnhd committed Dec 25, 2024
1 parent d20ee5f commit cfc21eb
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
<PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" Version="8.2.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="CoinGeckoAsyncApi" Version="1.7.0" />
<PackageReference Include="Com.Ctrip.Framework.Apollo.Configuration" Version="2.10.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/EoaServer.AuthServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static async Task<int> Main(string[] args)
var builder = WebApplication.CreateBuilder(args);
builder.Host.AddAppSettingsSecretsJson()
// .InitAppConfiguration(false)
// .UseApolloForConfigureHostBuilder()
.UseApolloForConfigureHostBuilder()
.UseAutofac()
.UseSerilog();

Expand Down
5 changes: 2 additions & 3 deletions src/EoaServer.DbMigrator/EoaServer.DbMigrator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
<PackageReference Include="Serilog.Sinks.RollingFile" Version="3.3.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="appsettings.apollo.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="appsettings.Development.json">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
1 change: 1 addition & 0 deletions src/EoaServer.EntityEventHandler/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static async Task<int> Main(string[] args)

internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.UseApolloForHostBuilder()
.ConfigureAppConfiguration(build =>
{
build.AddJsonFile("appsettings.secrets.json", optional: true);
Expand Down
3 changes: 3 additions & 0 deletions src/EoaServer.Silo/EoaServer.Silo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="appsettings.apollo.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="appsettings.Development.json">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
1 change: 1 addition & 0 deletions src/EoaServer.Silo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public async static Task<int> Main(string[] args)

internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.UseApolloForHostBuilder()
.ConfigureServices((hostcontext, services) =>
{
services.AddApplication<EoaServerOrleansSiloModule>(); })
Expand Down
14 changes: 14 additions & 0 deletions src/EoaServer.Silo/appsettings.apollo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"apollo": {
"AppId": "Portkey.EoaServer.Testnet",
"MetaServer": "http://10.10.32.82:8080,http://10.10.32.81:8080,http://10.10.32.80:8080",
"Namespaces": [
"eoa.silo.appsettings.json"
],
"Env": "DEV",
"RefreshInterval": 60000,
"Timeout": 5000,
"StartupTimeout": 30000
},
"IsApolloEnabled": false
}

0 comments on commit cfc21eb

Please sign in to comment.