feat: add sequential port allocation with atomic reservations (#584)

Adapt the optional sequential allocation feature from #583 by xigua761. Preserve commercial licensing and serialize port reservations across SQLite/PostgreSQL instances.

Co-authored-by: xigua761 <xigua1166@outlook.com>
This commit is contained in:
sagit
2026-11-15 12:08:33 +08:00
committed by GitHub
parent 8339f52280
commit f357b30500
14 changed files with 773 additions and 201 deletions
@@ -1123,6 +1123,14 @@ func normalizeAndValidateConfigValue(key, value string) (string, error) {
}
return pngDataURLPrefix + payload, nil
case sequentialPortConfigKey:
normalized := strings.TrimSpace(strings.ToLower(value))
switch normalized {
case "true", "false":
return normalized, nil
default:
return "", fmt.Errorf("顺次分配端口开关配置值无效")
}
case monitorTunnelQualityEnabledConfigKey:
normalized := strings.TrimSpace(strings.ToLower(value))
switch normalized {