初始化 MiGu.Server 项目,包含基本的 ASP.NET Core 8 配置、JWT 鉴权、RBAC 权限管理、YARP 反向代理及相关配置文件。新增 build-and-run 脚本以简化构建与运行流程,添加 README 文档以指导用户快速上手。
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning",
|
||||
"Yarp": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Cors": {
|
||||
"Origins": [
|
||||
"http://localhost:5173",
|
||||
"http://127.0.0.1:5173"
|
||||
]
|
||||
},
|
||||
"Jwt": {
|
||||
"Secret": "REPLACE_ME",
|
||||
"Issuer": "migu.server",
|
||||
"Audience": "migu.client",
|
||||
"LifetimeMinutes": 1440
|
||||
},
|
||||
"Internal": {
|
||||
"Token": "REPLACE_ME"
|
||||
},
|
||||
"_comment_SimpleLite": "登录后拉起 SimpleLite;改路径请编辑下方 SimpleLite 节点。诊断: http://localhost:8080/api/health/simplelite",
|
||||
"SimpleLite": {
|
||||
"Enabled": true,
|
||||
"ExecutablePath": "..\\..\\Simple\\SimpleLite\\bin\\Debug\\SimpleLite.exe",
|
||||
"WorkingDirectory": "..\\..\\Simple\\SimpleLite\\bin\\Debug",
|
||||
"Arguments": "",
|
||||
"ReadinessTimeoutMs": 15000,
|
||||
"ReadinessPollIntervalMs": 250,
|
||||
"ProjectionPort": 8222,
|
||||
"FollowParent": false
|
||||
},
|
||||
"Auth": {
|
||||
"Users": {
|
||||
"admin": { "Password": "admin" },
|
||||
"ops": { "Password": "ops" }
|
||||
}
|
||||
},
|
||||
"_comment_Ops": "运维操作真实下发映射(M4)。opCode → 'kind:Method',Method 必须是 SimpleLite 反射 [MethodMember] 的真实方法名(车辆 kind=car,见 Car.cs:OnlineCar/OfflineCar/DisableCar/EnableCar/Repair/Blown/Reset 等;任务 kind=mission)。运营白名单的 pause/resume/gohome/manualCharge 内核暂无一一对应方法——留空则仅记审计并向前端如实返回『未下发』,按现场内核能力填写后即真实生效。示例: 'ops.car.gohome': 'car:Reset'",
|
||||
"Ops": {
|
||||
"Dispatch": {
|
||||
}
|
||||
},
|
||||
"ReverseProxy": {
|
||||
"Routes": {
|
||||
"sl-route": {
|
||||
"ClusterId": "sl-cluster",
|
||||
"AuthorizationPolicy": "AnyAuthed",
|
||||
"Match": { "Path": "/api/sl/{**catch-all}" },
|
||||
"Transforms": [
|
||||
{ "PathRemovePrefix": "/api/sl" }
|
||||
]
|
||||
},
|
||||
"vrender-route": {
|
||||
"ClusterId": "vrender-cluster",
|
||||
"Match": { "Path": "/vr/{**catch-all}" },
|
||||
"Transforms": [
|
||||
{ "PathRemovePrefix": "/vr" }
|
||||
]
|
||||
}
|
||||
},
|
||||
"Clusters": {
|
||||
"sl-cluster": {
|
||||
"Destinations": {
|
||||
"sl1": { "Address": "http://127.0.0.1:8222/" }
|
||||
}
|
||||
},
|
||||
"vrender-cluster": {
|
||||
"Destinations": {
|
||||
"vr1": { "Address": "http://127.0.0.1:8223/" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user