[优化] 移除 OpenRestyResolvers 配置,统一上游渲染为带 keepalive 的 named upstream

This commit is contained in:
ryan
2026-03-18 23:24:37 +08:00
parent 782304012c
commit 007b1d8929
10 changed files with 98 additions and 221 deletions
+1 -16
View File
@@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"github.com/gin-gonic/gin"
"net"
"net/http"
"openflare/common"
"openflare/model"
@@ -115,15 +114,7 @@ func validateOpenRestyOption(key string, value string) error {
return fmt.Errorf("%s 仅支持 epoll、kqueue、poll、select、rtsig、/dev/poll、eventport 或留空", key)
}
case "OpenRestyResolvers":
if trimmed == "" {
return nil
}
for _, token := range splitOpenRestyResolvers(trimmed) {
if net.ParseIP(token) == nil {
return fmt.Errorf("%s only supports IP resolver entries, invalid value %q", key, token)
}
}
return nil
return fmt.Errorf("%s 已废弃,不再支持配置 resolver", key)
case "OpenRestyEventsMultiAcceptEnabled",
"OpenRestyWebsocketEnabled",
"OpenRestyProxyRequestBufferingEnabled",
@@ -187,12 +178,6 @@ func validateOpenRestyOption(key string, value string) error {
}
}
func splitOpenRestyResolvers(value string) []string {
return strings.FieldsFunc(value, func(r rune) bool {
return r == ',' || r == '\n' || r == '\r' || r == '\t' || r == ' '
})
}
// GetOptions godoc
// @Summary List editable options
// @Tags Options