channel 表添加 IP 白名单字段用于快照保存与展示

This commit is contained in:
2025-05-22 15:22:40 +08:00
parent 15ffccf554
commit 09a9cc573e
5 changed files with 18 additions and 6 deletions

View File

@@ -512,6 +512,7 @@ func assignShortChannels(
if config.AuthIp {
portConf.Whitelist = &config.Whitelists
newChannel.AuthIP = true
newChannel.Whitelists = strings.Join(config.Whitelists, ",")
}
if config.AuthPass {
@@ -637,6 +638,9 @@ func assignLongChannels(q *q.Query, userId int32, count int, config ChannelCreat
ProxyHost: edge.Host,
ProxyPort: edge.ProxyPort,
}
if config.AuthIp {
channel.Whitelists = strings.Join(config.Whitelists, ",")
}
if config.AuthPass {
username, password := genPassPair()
channel.Username = username