Files
Zakk b1ca0c6edc fix(service): every state-changing handler takes the mutation turn; a truncated link cannot panic the parser
PostImport, PutPorts, PutDnsRules, PutRoutingA, PutGFWList,
DeleteGFWList, PutDomainsExcluded, PutTproxyWhiteIpGroups, PostOutbound
and PutOutbound wrote the store and regenerated the core outside the
mutation turn, so two of them could interleave core restarts with each
other or with a latency test. They take it like the rest.

ParseSSURL and ParseVmessURL sliced past the end of a link shorter than
its scheme prefix ("ss:", "vmess:x"), a panic reachable from a
subscription line.
2026-09-20 09:59:29 +10:00

35 lines
891 B
Go

package controller
import (
"github.com/gin-gonic/gin"
"github.com/v2rayA/v2rayA/common"
"github.com/v2rayA/v2rayA/db/configure"
)
func GetTproxyWhiteIpGroups(ctx *gin.Context) {
resp := configure.GetTproxyWhiteIpGroups()
common.ResponseSuccess(ctx, gin.H{
"countryCodes": resp.CountryCodes,
"customIps": resp.CustomIps,
})
}
func PutTproxyWhiteIpGroups(ctx *gin.Context) {
release, ok := beginMutation(ctx)
if !ok {
return
}
defer release()
var data struct {
CountryCodes []string `json:"countryCodes"`
CustomIps []string `json:"customIps"`
}
err := ctx.ShouldBindJSON(&data)
if err != nil {
common.ResponseError(ctx, badRequest("countryCodes and customIps", "request body must be {\"countryCodes\": [string], \"customIps\": [string]}"))
return
}
configure.SetTproxyWhiteIpGroups(data.CountryCodes, data.CustomIps)
common.ResponseSuccess(ctx, nil)
}