From 8db9729913c9ca26ad8d0b1835be7133d2563477 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Mon, 1 Jun 2026 02:23:57 +0200 Subject: [PATCH] fix(model): accept tun protocol in inbound validation Adding a TUN inbound failed with "request body failed validation" because the Inbound.Protocol oneof allowlist omitted "tun". Add it so the validator matches the protocol the frontend already offers. Closes #4736 --- database/model/model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/model/model.go b/database/model/model.go index 372a452a..baa9c3e9 100644 --- a/database/model/model.go +++ b/database/model/model.go @@ -56,7 +56,7 @@ type Inbound struct { // Xray configuration fields Listen string `json:"listen" form:"listen"` Port int `json:"port" form:"port" validate:"gte=1,lte=65535"` - Protocol Protocol `json:"protocol" form:"protocol" validate:"required,oneof=vmess vless trojan shadowsocks wireguard hysteria http mixed tunnel"` + Protocol Protocol `json:"protocol" form:"protocol" validate:"required,oneof=vmess vless trojan shadowsocks wireguard hysteria http mixed tunnel tun"` Settings string `json:"settings" form:"settings"` StreamSettings string `json:"streamSettings" form:"streamSettings"` Tag string `json:"tag" form:"tag" gorm:"unique"`