换成单集群模式

This commit is contained in:
robin
2026-03-02 20:07:53 +08:00
parent 5d0b7c7e91
commit 2a76d1773d
432 changed files with 5681 additions and 5095 deletions

View File

@@ -31,6 +31,7 @@ import (
"os"
"os/exec"
"os/signal"
"regexp"
"runtime"
"runtime/debug"
"syscall"
@@ -328,6 +329,13 @@ func (this *DNSNode) start() {
apiConfig.NumberId = config.Id
}
// 验证 NodeId 防止路径遍历
var nodeIdRegexp = regexp.MustCompile(`^[a-zA-Z0-9_\-]+$`)
if !nodeIdRegexp.MatchString(config.NodeId) {
remotelogs.Error("NODE", "invalid NodeId: contains illegal characters")
return
}
var db = dbs.NewDB(Tea.Root + "/data/data-" + types.String(config.Id) + "-" + config.NodeId + "-v0.1.0.db")
err = db.Init()
if err != nil {