mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-03 19:55:04 +03:00
feat(amneziawg): support persistent keepalive ranges (#6881)
AmneziaWG clients accept a randomised PersistentKeepalive range such as 15-25, which makes keepalive timing harder to fingerprint; the panel only stored a single number. A client's keepalive may now be a range, validated the way AmneziaWG parses it. The downloadable .conf and vpn:// profile carry the range, Clash/Mihomo output gets its lower bound, and plain WireGuard stays scalar-only. The range lives in an additive wg_keep_alive_range column, so the integer column and an older panel binary keep working after a rollback.
This commit is contained in:
@@ -70,6 +70,12 @@ func zodTypeExpr(t TypeRef) string {
|
||||
return "z.array(" + zodTypeExpr(*t.Element) + ")"
|
||||
case KindMap:
|
||||
return "z.record(" + zodTypeExpr(*t.Key) + ", " + zodTypeExpr(*t.Value) + ")"
|
||||
case KindUnion:
|
||||
parts := make([]string, 0, len(t.Variants))
|
||||
for _, variant := range t.Variants {
|
||||
parts = append(parts, zodTypeExpr(variant))
|
||||
}
|
||||
return "z.union([" + strings.Join(parts, ", ") + "])"
|
||||
case KindRef:
|
||||
if t.Name == "nullable" {
|
||||
return zodTypeExpr(*t.Inner) + ".nullable()"
|
||||
|
||||
Reference in New Issue
Block a user