配置参考
FreeKitModules 使用 appsettings.json 进行配置,支持环境变量覆盖。
配置文件位置
| 宿主 | 配置文件 |
|---|---|
| FreeKit.Host | src/Services/Host/FreeKit.Host/appsettings.json |
| FreeKit.Job.Host | src/Services/Host/FreeKit.Job.Host/appsettings.json |
| FreeKit.MessageHandler.Host | src/Services/Host/FreeKit.MessageHandler.Host/appsettings.json |
| FreeKit.Auth.Host | src/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 |
MySql | MySQL 连接字符串 |
Redis | Redis 连接字符串 |
搜索引擎
{
"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_api | https://localhost:7002/kit_api/swagger |
| FreeKit.Job.Host | /job_api | https://localhost:7000/job_api/swagger |
| FreeKit.MessageHandler.Host | /message_api | https://localhost:7003/message_api/swagger |