Browse Source

feat: 更新 PostgreSQL 配置

pull/1048/head
feijie 1 year ago
parent
commit
cd136b1ab6
  1. 12
      aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.PostgreSql.json
  2. 13
      aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/FodyWeavers.xsd
  3. 10
      aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs
  4. 4
      aspnet-core/services/LY.MicroService.Applications.Single/Program.cs
  5. 11
      aspnet-core/services/LY.MicroService.Applications.Single/Properties/launchSettings.json
  6. 19
      aspnet-core/services/LY.MicroService.Applications.Single/appsettings.PostgreSql.json

12
aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.PostgreSql.json

@ -48,9 +48,9 @@
"Features": { "Features": {
"DefaultPersistence": { "DefaultPersistence": {
"Enabled": true, "Enabled": true,
"ConnectionStringIdentifier": "Workflow", "ConnectionStringIdentifier": "Default",
"EntityFrameworkCore": { "EntityFrameworkCore": {
"MySql": { "PostgreSql": {
"Enabled": true "Enabled": true
} }
} }
@ -71,18 +71,18 @@
"PublishWebhook": true, "PublishWebhook": true,
"Webhooks": { "Webhooks": {
"Enabled": true, "Enabled": true,
"ConnectionStringIdentifier": "Workflow", "ConnectionStringIdentifier": "Default",
"EntityFrameworkCore": { "EntityFrameworkCore": {
"MySql": { "PostgreSql": {
"Enabled": true "Enabled": true
} }
} }
}, },
"WorkflowSettings": { "WorkflowSettings": {
"Enabled": true, "Enabled": true,
"ConnectionStringIdentifier": "Workflow", "ConnectionStringIdentifier": "Default",
"EntityFrameworkCore": { "EntityFrameworkCore": {
"MySql": { "PostgreSql": {
"Enabled": true "Enabled": true
} }
} }

13
aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/FodyWeavers.xsd

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This is a partial XSD schema. For brevity, only essential elements are included --> <!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers"> <xs:element name="Weavers">
<xs:complexType> <xs:complexType>
<xs:all> <xs:all>
@ -12,12 +12,17 @@
</xs:all> </xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean"> <xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation> <xs:annotation>
<xs:documentation>Use to enforce assembly verification.</xs:documentation> <xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> <xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation> <xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored.</xs:documentation> <xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:attribute> </xs:attribute>
</xs:complexType> </xs:complexType>

10
aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs

@ -317,13 +317,17 @@ namespace LY.MicroService.Applications.Single;
typeof(AbpAspNetCoreAuthenticationJwtBearerModule), typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpCachingStackExchangeRedisModule), typeof(AbpCachingStackExchangeRedisModule),
#if POSTGRESQL
// typeof(AbpElsaModule),
// typeof(AbpElsaServerModule),
// typeof(AbpElsaActivitiesModule),
// typeof(AbpElsaEntityFrameworkCoreModule),
// typeof(AbpElsaEntityFrameworkCorePostgreSqlModule),
#else
typeof(AbpElsaModule), typeof(AbpElsaModule),
typeof(AbpElsaServerModule), typeof(AbpElsaServerModule),
typeof(AbpElsaActivitiesModule), typeof(AbpElsaActivitiesModule),
typeof(AbpElsaEntityFrameworkCoreModule), typeof(AbpElsaEntityFrameworkCoreModule),
#if POSTGRESQL
typeof(AbpElsaEntityFrameworkCorePostgreSqlModule),
#else
typeof(AbpElsaEntityFrameworkCoreMySqlModule), typeof(AbpElsaEntityFrameworkCoreMySqlModule),
#endif #endif

4
aspnet-core/services/LY.MicroService.Applications.Single/Program.cs

@ -37,12 +37,8 @@ await builder.AddApplicationAsync<MicroServiceApplicationsSingleModule>(options
MicroServiceApplicationsSingleModule.ApplicationName = Environment.GetEnvironmentVariable("APPLICATION_NAME") MicroServiceApplicationsSingleModule.ApplicationName = Environment.GetEnvironmentVariable("APPLICATION_NAME")
?? MicroServiceApplicationsSingleModule.ApplicationName; ?? MicroServiceApplicationsSingleModule.ApplicationName;
options.ApplicationName = MicroServiceApplicationsSingleModule.ApplicationName; options.ApplicationName = MicroServiceApplicationsSingleModule.ApplicationName;
// 从环境变量取用户机密配置, 适用于容器测试
options.Configuration.UserSecretsId = Environment.GetEnvironmentVariable("APPLICATION_USER_SECRETS_ID"); options.Configuration.UserSecretsId = Environment.GetEnvironmentVariable("APPLICATION_USER_SECRETS_ID");
// 如果容器没有指定用户机密, 从项目读取
options.Configuration.UserSecretsAssembly = typeof(MicroServiceApplicationsSingleModule).Assembly; options.Configuration.UserSecretsAssembly = typeof(MicroServiceApplicationsSingleModule).Assembly;
// 搜索 Modules 目录下所有文件作为插件
// 取消显示引用所有其他项目的模块,改为通过插件的形式引用
var pluginFolder = Path.Combine( var pluginFolder = Path.Combine(
Directory.GetCurrentDirectory(), "Modules"); Directory.GetCurrentDirectory(), "Modules");
DirectoryHelper.CreateIfNotExists(pluginFolder); DirectoryHelper.CreateIfNotExists(pluginFolder);

11
aspnet-core/services/LY.MicroService.Applications.Single/Properties/launchSettings.json

@ -17,11 +17,20 @@
"ASPNETCORE_ENVIRONMENT": "Production" "ASPNETCORE_ENVIRONMENT": "Production"
} }
}, },
"LY.MicroService.Applications.Single.Development": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "http://0.0.0.0:30000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"LY.MicroService.Applications.Single.PostgreSQL": { "LY.MicroService.Applications.Single.PostgreSQL": {
"commandName": "Project", "commandName": "Project",
"dotnetRunMessages": true, "dotnetRunMessages": true,
"launchBrowser": false, "launchBrowser": false,
"applicationUrl": "http://0.0.0.0:30001", "applicationUrl": "http://0.0.0.0:30000",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "PostgreSQL" "ASPNETCORE_ENVIRONMENT": "PostgreSQL"
} }

19
aspnet-core/services/LY.MicroService.Applications.Single/appsettings.PostgreSql.json

@ -47,8 +47,8 @@
"Elsa": { "Elsa": {
"Features": { "Features": {
"DefaultPersistence": { "DefaultPersistence": {
"Enabled": true, "Enabled": false,
"ConnectionStringIdentifier": "Workflow", "ConnectionStringIdentifier": "Default",
"EntityFrameworkCore": { "EntityFrameworkCore": {
"PostgreSql": { "PostgreSql": {
"Enabled": true "Enabled": true
@ -70,8 +70,8 @@
"IM": true, "IM": true,
"PublishWebhook": true, "PublishWebhook": true,
"Webhooks": { "Webhooks": {
"Enabled": true, "Enabled": false,
"ConnectionStringIdentifier": "Workflow", "ConnectionStringIdentifier": "Default",
"EntityFrameworkCore": { "EntityFrameworkCore": {
"PostgreSql": { "PostgreSql": {
"Enabled": true "Enabled": true
@ -79,8 +79,8 @@
} }
}, },
"WorkflowSettings": { "WorkflowSettings": {
"Enabled": true, "Enabled": false,
"ConnectionStringIdentifier": "Workflow", "ConnectionStringIdentifier": "Default",
"EntityFrameworkCore": { "EntityFrameworkCore": {
"PostgreSql": { "PostgreSql": {
"Enabled": true "Enabled": true
@ -93,16 +93,17 @@
} }
}, },
"Quartz": { "Quartz": {
"UsePersistentStore": true, "UsePersistentStore": false,
"Properties": { "Properties": {
"quartz.jobStore.dataSource": "tkm", "quartz.jobStore.dataSource": "tkm",
"quartz.jobStore.useProperties": "true",
"quartz.jobStore.type": "Quartz.Impl.AdoJobStore.JobStoreTX,Quartz", "quartz.jobStore.type": "Quartz.Impl.AdoJobStore.JobStoreTX,Quartz",
"quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.PostgreSQLDelegate,Quartz", "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.PostgreSQLDelegate,Quartz",
"quartz.dataSource.tkm.connectionString": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;SslMode=Prefer", "quartz.dataSource.tkm.connectionString": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;SslMode=Prefer",
"quartz.dataSource.tkm.provider": "Npgsql", "quartz.dataSource.tkm.provider": "Npgsql",
"quartz.dataSource.tkm.connectionStringName": "Default",
"quartz.jobStore.clustered": "true", "quartz.jobStore.clustered": "true",
"quartz.serializer.type": "json", "quartz.serializer.type": "json"
"quartz.dataSource.tkm.connectionStringName": "TaskManagement"
} }
}, },
"Redis": { "Redis": {

Loading…
Cancel
Save