diff --git a/applications/KonSoft.AuthServer/Controller/HomeController.cs b/applications/KonSoft.AuthServer/Controller/HomeController.cs
new file mode 100644
index 0000000..c1a2e1c
--- /dev/null
+++ b/applications/KonSoft.AuthServer/Controller/HomeController.cs
@@ -0,0 +1,14 @@
+using Microsoft.AspNetCore.Mvc;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace KonSoft.Controller
+{
+ public class HomeController : AbpController
+ {
+ [HttpGet("health")]
+ public ActionResult Health()
+ {
+ return Ok("online");
+ }
+ }
+}
diff --git a/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj b/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj
index 0751a60..8e38898 100644
--- a/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj
+++ b/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj
@@ -59,6 +59,8 @@
+
+
diff --git a/applications/KonSoft.AuthServer/KonSoftAuthServerModule.cs b/applications/KonSoft.AuthServer/KonSoftAuthServerModule.cs
index 7529a65..5bd47c7 100644
--- a/applications/KonSoft.AuthServer/KonSoftAuthServerModule.cs
+++ b/applications/KonSoft.AuthServer/KonSoftAuthServerModule.cs
@@ -1,3 +1,5 @@
+using KonSoft.Admin;
+using KonSoft.Admin.EntityFrameworkCore;
using KonSoft.Shared.Hosting.AspNetCore;
using KonSoft.Shared.Hosting.Microservices;
using KonSoft.Shared.Localization.Localization;
@@ -10,6 +12,7 @@ using Volo.Abp.Account;
using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
+using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.Auditing;
@@ -24,7 +27,10 @@ namespace KonSoft;
[DependsOn(
typeof(AbpAccountWebOpenIddictModule),
typeof(AbpAccountApplicationModule),
- typeof(AbpAccountHttpApiModule),
+ typeof(AbpAccountHttpApiModule),
+ typeof(AdminApplicationModule),
+ typeof(AdminEntityFrameworkCoreModule),
+ typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(KonSoftSharedHostingMicroservicesModule)
)]
public class KonSoftAuthServerModule : AbpModule
@@ -54,7 +60,7 @@ public class KonSoftAuthServerModule : AbpModule
PreConfigure(serverBuilder =>
{
serverBuilder.AddProductionEncryptionAndSigningCertificate("openiddict.pfx",
- "59464dba-b66e-48cd-8b81-2e4a9c08c977");
+ configuration["Certificate:Password"]);
});
}
}
diff --git a/applications/KonSoft.AuthServer/Program.cs b/applications/KonSoft.AuthServer/Program.cs
index 0622452..0ae89c7 100644
--- a/applications/KonSoft.AuthServer/Program.cs
+++ b/applications/KonSoft.AuthServer/Program.cs
@@ -1,10 +1,8 @@
-using System;
-using System.Threading.Tasks;
+using KonSoft.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Builder;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
using Serilog;
-using Serilog.Events;
+using System;
+using System.Threading.Tasks;
namespace KonSoft;
@@ -12,45 +10,27 @@ public class Program
{
public static async Task Main(string[] args)
{
- Log.Logger = new LoggerConfiguration()
-#if DEBUG
- .MinimumLevel.Debug()
-#else
- .MinimumLevel.Information()
-#endif
- .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
- .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
- .Enrich.FromLogContext()
- .WriteTo.Async(c => c.File("Logs/logs.txt"))
- .WriteTo.Async(c => c.Console())
- .CreateLogger();
+ var assemblyName = typeof(Program).Assembly.GetName().Name!;
+ SerilogConfigurationHelper.Configure(assemblyName);
try
{
- Log.Information("Starting KonSoft.AuthServer.");
- var builder = WebApplication.CreateBuilder(args);
- builder.Host.AddAppSettingsSecretsJson()
- .UseAutofac()
- .UseSerilog();
- await builder.AddApplicationAsync();
- var app = builder.Build();
+ Log.Information($"Starting {assemblyName}.");
+ var app = await ApplicationBuilderHelper
+ .BuildApplicationAsync(args);
await app.InitializeApplicationAsync();
await app.RunAsync();
+
return 0;
}
catch (Exception ex)
{
- if (ex is HostAbortedException)
- {
- throw;
- }
-
- Log.Fatal(ex, "KonSoft.AuthServer terminated unexpectedly!");
+ Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
return 1;
}
finally
{
- Log.CloseAndFlush();
+ await Log.CloseAndFlushAsync();
}
}
}
\ No newline at end of file
diff --git a/applications/KonSoft.AuthServer/appsettings.json b/applications/KonSoft.AuthServer/appsettings.json
index 275efe5..a77de72 100644
--- a/applications/KonSoft.AuthServer/appsettings.json
+++ b/applications/KonSoft.AuthServer/appsettings.json
@@ -1,17 +1,8 @@
{
- "App": {
- "SelfUrl": "https://localhost:44322",
- "ClientUrl": "http://localhost:4200",
- "CorsOrigins": "https://*.KonSoft.com,http://localhost:4200,https://localhost:44316,https://localhost:44370",
- "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44319,https://localhost:44316,https://localhost:44347"
- },
- "ConnectionStrings": {
- "Default": "Host=localhost;Port=5432;Database=KonSoft;User ID=root;Password=myPassword;"
- },
- "Redis": {
- "Configuration": "127.0.0.1"
- },
- "StringEncryption": {
- "DefaultPassPhrase": "kxtywyrXW4i7vijT"
+ "AgileConfig": {
+ "appId": "KonSoft.Admin.HttpApi.Host",
+ "name": "KonSoft.Admin.HttpApi.Host",
+ "nodes": "https://config.konsoft.top/",
+ "secret": "DBE31703-14F9-4B01-893D-900B8380CE04"
}
}
diff --git a/docker-compose.yml b/docker-compose.yml
index eab4778..cd3a742 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,7 +1,7 @@
services:
internalgateways:
container_name: clean-internalgateways
- restart: always
+ restart: unless-stopped
build:
context: .
dockerfile: ./gateways/KonSoft.InternalGateway/Dockerfile
@@ -15,10 +15,21 @@ services:
- 8080:8080
networks:
- konsoft-shared-network
+ healthcheck:
+ test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 40s
+ logging:
+ driver: "json-file"
+ options:
+ max-size: "10m"
+ max-file: "3"
authserver:
container_name: clean-authserver
- restart: always
+ restart: unless-stopped
build:
context: .
dockerfile: ./applications/KonSoft.AuthServer/Dockerfile
@@ -30,12 +41,25 @@ services:
- AgileConfig__Secret=DBE31703-14F9-4B01-893D-900B8380CE04
ports:
- 8081:8081
+ volumes:
+ - /root/openiddict.pfx:/app/openiddict.pfx:ro
networks:
- konsoft-shared-network
+ healthcheck:
+ test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 40s
+ logging:
+ driver: "json-file"
+ options:
+ max-size: "10m"
+ max-file: "3"
adminservice:
container_name: clean-adminservice
- restart: always
+ restart: unless-stopped
build:
context: .
dockerfile: ./microservices/KonSoft.Admin.HttpApi.Host/Dockerfile
@@ -47,6 +71,17 @@ services:
- AgileConfig__Secret=DBE31703-14F9-4B01-893D-900B8380CE04
networks:
- konsoft-shared-network
+ healthcheck:
+ test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
+ interval: 30s
+ timeout: 10s
+ retries: 3
+ start_period: 40s
+ logging:
+ driver: "json-file"
+ options:
+ max-size: "10m"
+ max-file: "3"
networks:
konsoft-shared-network:
diff --git a/microservices/KonSoft.Admin.HttpApi.Host/Controllers/HomeController.cs b/microservices/KonSoft.Admin.HttpApi.Host/Controllers/HomeController.cs
index d815119..c8932d1 100644
--- a/microservices/KonSoft.Admin.HttpApi.Host/Controllers/HomeController.cs
+++ b/microservices/KonSoft.Admin.HttpApi.Host/Controllers/HomeController.cs
@@ -9,4 +9,10 @@ public class HomeController : AbpController
{
return Redirect("~/swagger");
}
+
+ [HttpGet("health")]
+ public ActionResult Health()
+ {
+ return Ok("online");
+ }
}
\ No newline at end of file
diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/Controllers/HomeController.cs b/microservices/KonSoft.Dispatch.HttpApi.Host/Controllers/HomeController.cs
index 5f97226..dcfc481 100644
--- a/microservices/KonSoft.Dispatch.HttpApi.Host/Controllers/HomeController.cs
+++ b/microservices/KonSoft.Dispatch.HttpApi.Host/Controllers/HomeController.cs
@@ -9,4 +9,11 @@ public class HomeController : AbpController
{
return Redirect("~/swagger");
}
+
+
+ [HttpGet("health")]
+ public ActionResult Health()
+ {
+ return Ok("online");
+ }
}
\ No newline at end of file
diff --git a/microservices/KonSoft.Payment.HttpApi.Host/Controllers/HomeController.cs b/microservices/KonSoft.Payment.HttpApi.Host/Controllers/HomeController.cs
index 1480f62..f6b393c 100644
--- a/microservices/KonSoft.Payment.HttpApi.Host/Controllers/HomeController.cs
+++ b/microservices/KonSoft.Payment.HttpApi.Host/Controllers/HomeController.cs
@@ -9,4 +9,11 @@ public class HomeController : AbpController
{
return Redirect("~/swagger");
}
+
+
+ [HttpGet("health")]
+ public ActionResult Health()
+ {
+ return Ok("online");
+ }
}
\ No newline at end of file
diff --git a/microservices/KonSoft.Report.HttpApi.Host/Controllers/HomeController.cs b/microservices/KonSoft.Report.HttpApi.Host/Controllers/HomeController.cs
index 3bbf891..6156bad 100644
--- a/microservices/KonSoft.Report.HttpApi.Host/Controllers/HomeController.cs
+++ b/microservices/KonSoft.Report.HttpApi.Host/Controllers/HomeController.cs
@@ -9,4 +9,11 @@ public class HomeController : AbpController
{
return Redirect("~/swagger");
}
+
+
+ [HttpGet("health")]
+ public ActionResult Health()
+ {
+ return Ok("online");
+ }
}
\ No newline at end of file
diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/Controllers/HomeController.cs b/microservices/KonSoft.TenantManagement.HttpApi.Host/Controllers/HomeController.cs
index d11861b..8db58ea 100644
--- a/microservices/KonSoft.TenantManagement.HttpApi.Host/Controllers/HomeController.cs
+++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/Controllers/HomeController.cs
@@ -9,4 +9,11 @@ public class HomeController : AbpController
{
return Redirect("~/swagger");
}
+
+
+ [HttpGet("health")]
+ public ActionResult Health()
+ {
+ return Ok("online");
+ }
}
\ No newline at end of file
diff --git a/shared/KonSoft.Shared.Hosting.Microservices/KonSoftSharedHostingMicroservivesModule.cs b/shared/KonSoft.Shared.Hosting.Microservices/KonSoftSharedHostingMicroservivesModule.cs
index 3d02834..af2901c 100644
--- a/shared/KonSoft.Shared.Hosting.Microservices/KonSoftSharedHostingMicroservivesModule.cs
+++ b/shared/KonSoft.Shared.Hosting.Microservices/KonSoftSharedHostingMicroservivesModule.cs
@@ -56,13 +56,14 @@ public class KonSoftSharedHostingMicroservicesModule : AbpModule
ServiceConfigurationContext context,
IConfiguration configuration)
{
+ var redisConnStr = configuration["Redis:Configuration"]!;
context.Services.AddDataProtection().SetApplicationName("KonSoft")
- .PersistKeysToStackExchangeRedis(ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!),
+ .PersistKeysToStackExchangeRedis(ConnectionMultiplexer.Connect(redisConnStr),
"KonSoft-Protection-Keys");
context.Services.AddSingleton(_ =>
new RedisDistributedSynchronizationProvider(ConnectionMultiplexer
- .Connect(configuration["Redis:Configuration"]!).GetDatabase()));
+ .Connect(redisConnStr).GetDatabase()));
}
private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)