跳到主要内容

配置参考

FreeKitModules 使用 appsettings.json 进行配置,支持环境变量覆盖。

配置文件位置

宿主配置文件
FreeKit.Hostsrc/Services/Host/FreeKit.Host/appsettings.json
FreeKit.Job.Hostsrc/Services/Host/FreeKit.Job.Host/appsettings.json
FreeKit.MessageHandler.Hostsrc/Services/Host/FreeKit.MessageHandler.Host/appsettings.json
FreeKit.Auth.Hostsrc/Services/Auth/FreeKit.Auth.Host/appsettings.json

数据库连接

{
"ConnectionStrings": {
"DefaultDB": "0",
"MySql": "Data Source=localhost;Port=3306;User ID=root;Password=123456;Initial Catalog=freekit;Charset=utf8mb4",
"Redis": "localhost:6379,password=123456,defaultDatabase=1"
}
}
字段说明
DefaultDB数据库类型:0=MySQL, 1=SqlServer, 2=PostgreSQL, 4=Sqlite
MySqlMySQL 连接字符串
RedisRedis 连接字符串

搜索引擎

{
"MeiliSearch": {
"Enable": false,
"Host": "http://localhost:17700",
"ApiKey": "your-master-key"
}
}

文件存储

{
"FileStorage": {
"MaxFileSize": 83886080,
"NumLimit": 3,
"Exclude": ".exe,.dll,.jar",
"ServiceName": "LocalFileManager",
"LocalFile": {
"PrefixPath": "assets",
"Host": "https://localhost:7002/"
}
}
}

认证安全

{
"Security": {
"ValidToken": { "Enable": true },
"Cryptography": { "Key": "your-crypto-key" },
"Sso": {
"TokenExpiresIn": 86400,
"CodeExpiresInMinutes": 5
}
}
}

消息队列

{
"CAP": {
"Version": "Development",
"RabbitMQ": {
"HostName": "localhost",
"UserName": "guest",
"Password": "guest",
"Port": 5672
}
}
}

异常通知

{
"ExceptionNotify": {
"Enabled": true,
"Mail": { "Enabled": true, "MailTo": "ops@example.com" },
"Feishu": { "Enabled": true, "WebhookUrl": "https://open.feishu.cn/..." },
"WeCom": { "Enabled": false }
}
}

宿主路径前缀

宿主PathBase访问地址
FreeKit.Host/kit_apihttps://localhost:7002/kit_api/swagger
FreeKit.Job.Host/job_apihttps://localhost:7000/job_api/swagger
FreeKit.MessageHandler.Host/message_apihttps://localhost:7003/message_api/swagger

相关文档