feat: 优化代理准备并完善远端部署

- 增加严格代理、两分钟预取、白名单去重与分组状态展示\n- 增加远端注册令牌和安全地址校验\n- 增加 Docker Compose、Caddy 示例与控制中心部署文档
This commit is contained in:
yml
2026-11-21 20:59:35 +08:00
parent d176c421a8
commit 9c83be798d
43 changed files with 2755 additions and 119 deletions
+14
View File
@@ -28,6 +28,9 @@ func (a *App) StartSeckill(accountProducts map[string]string) types.MessageResul
if err := a.scheduler.PrepareProxyGroups(accountProducts); err != nil {
return types.MessageResult{Error: "代理准备失败: " + err.Error()}
}
if ok, reason := a.scheduler.ProxyRunGate(); !ok {
return types.MessageResult{Error: "严格代理模式未就绪: " + reason}
}
if !a.scheduler.TryStartRun() {
return types.MessageResult{Error: "抢购任务正在运行,请勿重复提交"}
}
@@ -81,6 +84,9 @@ func (a *App) startXiaodianSeckill(req types.FixedSeckillRequest, message string
if err := a.scheduler.PrepareProxyGroups(req.AccountProducts); err != nil {
return types.MessageResult{Error: "代理准备失败: " + err.Error()}
}
if ok, reason := a.scheduler.ProxyRunGate(); !ok {
return types.MessageResult{Error: "严格代理模式未就绪: " + reason}
}
if !a.scheduler.TryStartRun() {
return types.MessageResult{Error: "抢购任务正在运行,请勿重复提交"}
}
@@ -104,6 +110,14 @@ func (a *App) GetResults() map[string]string {
return a.scheduler.Results()
}
// GetProxyStatus returns the current instance proxy group and account mapping.
func (a *App) GetProxyStatus() types.ProxyStatusView {
if a.scheduler == nil {
return types.ProxyStatusView{State: "disabled"}
}
return a.scheduler.ProxyStatus()
}
// GetLogs 返回后端内存日志,支持增量获取。
func (a *App) GetLogs(since int64) types.LogsResult {
entries := a.logStore.Since(since)