mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 12:40:11 +00:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d200a3336e | ||
|
|
6a95d576f1 | ||
|
|
dbe529bd48 | ||
|
|
8254e49297 | ||
|
|
9e8ad2619a | ||
|
|
d5fff6c433 | ||
|
|
fe896a61a3 | ||
|
|
a63198c20b | ||
|
|
180fb14dd1 | ||
|
|
44db7512d7 | ||
|
|
95263fea99 | ||
|
|
0b155bbf89 | ||
|
|
1c8c17b067 | ||
|
|
61606646b9 | ||
|
|
e2904ad126 | ||
|
|
903aef1fb5 | ||
|
|
2c43704090 | ||
|
|
d71df3a0df | ||
|
|
96baa0a99c | ||
|
|
e502624fe4 | ||
|
|
484faaf0c3 | ||
|
|
ec5dcc3c8a | ||
|
|
2f1362067b | ||
|
|
c755e9800b |
47
.github/workflows/Publish Docker image.yml
vendored
47
.github/workflows/Publish Docker image.yml
vendored
@@ -1,4 +1,5 @@
|
||||
name: Publish Docker image
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
@@ -6,6 +7,7 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- 'dev_new'
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository_owner }}/v2bx
|
||||
@@ -20,40 +22,51 @@ jobs:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
steps:
|
||||
- name: Prepare
|
||||
run: |
|
||||
platform=${{ matrix.platform }}
|
||||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push by digest
|
||||
id: build
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: ${{ matrix.platform }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
- name: Export digest
|
||||
run: |
|
||||
mkdir -p /tmp/digests
|
||||
digest="${{ steps.build.outputs.digest }}"
|
||||
touch "/tmp/digests/${digest#sha256:}"
|
||||
echo "${digest#sha256:}" > "/tmp/digests/${digest#sha256:}"
|
||||
|
||||
- name: Upload digest
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: digests
|
||||
name: digests-${{ env.PLATFORM_PAIR }}
|
||||
path: /tmp/digests/*
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
@@ -64,31 +77,37 @@ jobs:
|
||||
- build
|
||||
steps:
|
||||
- name: Download digests
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: digests
|
||||
path: /tmp/digests
|
||||
pattern: digests-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create manifest list and push
|
||||
working-directory: /tmp/digests
|
||||
run: |
|
||||
ls -al
|
||||
echo docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||
$(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
|
||||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||
$(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
|
||||
cd /tmp/digests
|
||||
tags=$(echo '${{ steps.meta.outputs.json }}' | jq -cr '.tags | map("-t " + .) | join(" ")')
|
||||
images=$(printf "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s " $(find . -type f -exec cat {} \;))
|
||||
echo "Creating manifest with tags: $tags"
|
||||
echo "Using images: $images"
|
||||
docker buildx imagetools create $tags $images
|
||||
|
||||
- name: Inspect image
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
|
||||
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
|
||||
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
@@ -10,14 +10,14 @@ on:
|
||||
- "**/*.go"
|
||||
- "go.mod"
|
||||
- "go.sum"
|
||||
- ".github/workflows/*.yml"
|
||||
- ".github/workflows/release.yml"
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- "**/*.go"
|
||||
- "go.mod"
|
||||
- "go.sum"
|
||||
- ".github/workflows/*.yml"
|
||||
- ".github/workflows/release.yml"
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
@@ -109,10 +109,11 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.23.2'
|
||||
go-version: '1.24.1'
|
||||
|
||||
- name: Get project dependencies
|
||||
run: go mod download
|
||||
run: |
|
||||
go mod download
|
||||
- name: Get release version
|
||||
if: ${{ github.event_name == 'release' }}
|
||||
run: |
|
||||
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "sing-box_mod"]
|
||||
path = sing-box_mod
|
||||
url = https://github.com/wyx2685/sing-box_mod.git
|
||||
@@ -1,5 +1,5 @@
|
||||
# Build go
|
||||
FROM golang:1.23.2-alpine AS builder
|
||||
FROM golang:1.24.1-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
ENV CGO_ENABLED=0
|
||||
|
||||
@@ -32,6 +32,7 @@ type NodeInfo struct {
|
||||
VAllss *VAllssNode
|
||||
Shadowsocks *ShadowsocksNode
|
||||
Trojan *TrojanNode
|
||||
Tuic *TuicNode
|
||||
Hysteria *HysteriaNode
|
||||
Hysteria2 *Hysteria2Node
|
||||
Common *CommonNode
|
||||
@@ -100,6 +101,12 @@ type TrojanNode struct {
|
||||
NetworkSettings json.RawMessage `json:"networkSettings"`
|
||||
}
|
||||
|
||||
type TuicNode struct {
|
||||
CommonNode
|
||||
CongestionControl string `json:"congestion_control"`
|
||||
ZeroRTTHandshake bool `json:"zero_rtt_handshake"`
|
||||
}
|
||||
|
||||
type HysteriaNode struct {
|
||||
CommonNode
|
||||
UpMbps int `json:"up_mbps"`
|
||||
@@ -109,10 +116,11 @@ type HysteriaNode struct {
|
||||
|
||||
type Hysteria2Node struct {
|
||||
CommonNode
|
||||
UpMbps int `json:"up_mbps"`
|
||||
DownMbps int `json:"down_mbps"`
|
||||
ObfsType string `json:"obfs"`
|
||||
ObfsPassword string `json:"obfs-password"`
|
||||
Ignore_Client_Bandwidth bool `json:"ignore_client_bandwidth"`
|
||||
UpMbps int `json:"up_mbps"`
|
||||
DownMbps int `json:"down_mbps"`
|
||||
ObfsType string `json:"obfs"`
|
||||
ObfsPassword string `json:"obfs-password"`
|
||||
}
|
||||
|
||||
type RawDNS struct {
|
||||
@@ -202,6 +210,15 @@ func (c *Client) GetNodeInfo() (node *NodeInfo, err error) {
|
||||
cm = &rsp.CommonNode
|
||||
node.Trojan = rsp
|
||||
node.Security = Tls
|
||||
case "tuic":
|
||||
rsp := &TuicNode{}
|
||||
err = json.Unmarshal(r.Body(), rsp)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("decode tuic params error: %s", err)
|
||||
}
|
||||
cm = &rsp.CommonNode
|
||||
node.Tuic = rsp
|
||||
node.Security = Tls
|
||||
case "hysteria":
|
||||
rsp := &HysteriaNode{}
|
||||
err = json.Unmarshal(r.Body(), rsp)
|
||||
|
||||
@@ -56,6 +56,7 @@ func New(c *conf.ApiConfig) (*Client, error) {
|
||||
"shadowsocks",
|
||||
"hysteria",
|
||||
"hysteria2",
|
||||
"tuic",
|
||||
"vless":
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported Node type: %s", c.NodeType)
|
||||
|
||||
@@ -63,10 +63,12 @@ func (c *Client) GetUserAlive() (map[int]int, error) {
|
||||
Get(path)
|
||||
if err != nil || r.StatusCode() >= 399 {
|
||||
c.AliveMap.Alive = make(map[int]int)
|
||||
return c.AliveMap.Alive, nil
|
||||
}
|
||||
if r == nil || r.RawResponse == nil {
|
||||
fmt.Printf("received nil response or raw response")
|
||||
c.AliveMap.Alive = make(map[int]int)
|
||||
return c.AliveMap.Alive, nil
|
||||
}
|
||||
defer r.RawResponse.Body.Close()
|
||||
if err := json.Unmarshal(r.Body(), c.AliveMap); err != nil {
|
||||
|
||||
@@ -5,10 +5,9 @@ import (
|
||||
)
|
||||
|
||||
type SingConfig struct {
|
||||
LogConfig SingLogConfig `json:"Log"`
|
||||
NtpConfig SingNtpConfig `json:"NTP"`
|
||||
EnableConnClear bool `json:"EnableConnClear"`
|
||||
OriginalPath string `json:"OriginalPath"`
|
||||
LogConfig SingLogConfig `json:"Log"`
|
||||
NtpConfig SingNtpConfig `json:"NTP"`
|
||||
OriginalPath string `json:"OriginalPath"`
|
||||
}
|
||||
|
||||
type SingLogConfig struct {
|
||||
|
||||
@@ -18,6 +18,8 @@ import (
|
||||
"github.com/apernet/hysteria/extras/v2/masq"
|
||||
"github.com/apernet/hysteria/extras/v2/obfs"
|
||||
"github.com/apernet/hysteria/extras/v2/outbounds"
|
||||
"github.com/apernet/hysteria/extras/v2/sniff"
|
||||
eUtils "github.com/apernet/hysteria/extras/v2/utils"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -161,6 +163,29 @@ func (n *Hysteria2node) getBandwidthConfig(info *panel.NodeInfo) *server.Bandwid
|
||||
return band
|
||||
}
|
||||
|
||||
func (n *Hysteria2node) getRequestHook(c *serverConfig) (server.RequestHook, error) {
|
||||
if c.Sniff.Enable {
|
||||
s := &sniff.Sniffer{
|
||||
Timeout: c.Sniff.Timeout,
|
||||
RewriteDomain: c.Sniff.RewriteDomain,
|
||||
}
|
||||
if c.Sniff.TCPPorts != "" {
|
||||
s.TCPPorts = eUtils.ParsePortUnion(c.Sniff.TCPPorts)
|
||||
if s.TCPPorts == nil {
|
||||
return nil, fmt.Errorf("sniff.tcpPorts: invalid port union")
|
||||
}
|
||||
}
|
||||
if c.Sniff.UDPPorts != "" {
|
||||
s.UDPPorts = eUtils.ParsePortUnion(c.Sniff.UDPPorts)
|
||||
if s.UDPPorts == nil {
|
||||
return nil, fmt.Errorf("sniff.udpPorts: invalid port union")
|
||||
}
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (n *Hysteria2node) getOutboundConfig(c *serverConfig) (server.Outbound, error) {
|
||||
// Resolver, ACL, actual outbound are all implemented through the Outbound interface.
|
||||
// Depending on the config, we build a chain like this:
|
||||
@@ -299,7 +324,7 @@ func (n *Hysteria2node) getMasqHandler(tlsconfig *server.TLSConfig, conn net.Pac
|
||||
req.Header.Set("X-Forwarded-For", clientIP)
|
||||
}
|
||||
|
||||
if !c.Masquerade.Proxy.RewriteHost {
|
||||
if c.Masquerade.Proxy.RewriteHost {
|
||||
req.Host = req.URL.Host
|
||||
}
|
||||
},
|
||||
@@ -368,6 +393,10 @@ func (n *Hysteria2node) getHyConfig(info *panel.NodeInfo, config *conf.Options,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sniff, err := n.getRequestHook(c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
Outbound, err := n.getOutboundConfig(c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -380,9 +409,10 @@ func (n *Hysteria2node) getHyConfig(info *panel.NodeInfo, config *conf.Options,
|
||||
TLSConfig: *tls,
|
||||
QUICConfig: *quic,
|
||||
Conn: conn,
|
||||
RequestHook: sniff,
|
||||
Outbound: Outbound,
|
||||
BandwidthConfig: *n.getBandwidthConfig(info),
|
||||
IgnoreClientBandwidth: c.IgnoreClientBandwidth,
|
||||
IgnoreClientBandwidth: info.Hysteria2.Ignore_Client_Bandwidth,
|
||||
DisableUDP: c.DisableUDP,
|
||||
UDPIdleTimeout: c.UDPIdleTimeout,
|
||||
EventLogger: n.EventLogger,
|
||||
|
||||
@@ -120,11 +120,11 @@ func (l *serverLogger) UDPError(addr net.Addr, uuid string, sessionId uint32, er
|
||||
func initLogger(logLevel string, logFormat string) (*zap.Logger, error) {
|
||||
level, ok := logLevelMap[strings.ToLower(logLevel)]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf(fmt.Sprintf("unsupported log level: %s\n", logLevel))
|
||||
return nil, fmt.Errorf("unsupported log level: %s", logLevel)
|
||||
}
|
||||
enc, ok := logFormatMap[strings.ToLower(logFormat)]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf(fmt.Sprintf("unsupported log format: %s\n", logFormat))
|
||||
return nil, fmt.Errorf("unsupported log format: %s", logFormat)
|
||||
}
|
||||
c := zap.Config{
|
||||
Level: zap.NewAtomicLevelAt(level),
|
||||
@@ -137,7 +137,7 @@ func initLogger(logLevel string, logFormat string) (*zap.Logger, error) {
|
||||
}
|
||||
logger, err := c.Build()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(fmt.Sprintf("failed to initialize logger: %s\n", err))
|
||||
return nil, fmt.Errorf("failed to initialize logger: %s", err)
|
||||
}
|
||||
return logger, nil
|
||||
}
|
||||
|
||||
@@ -17,10 +17,12 @@ type serverConfig struct {
|
||||
QUIC serverConfigQUIC `mapstructure:"quic"`
|
||||
Bandwidth serverConfigBandwidth `mapstructure:"bandwidth"`
|
||||
IgnoreClientBandwidth bool `mapstructure:"ignoreClientBandwidth"`
|
||||
SpeedTest bool `mapstructure:"speedTest"`
|
||||
DisableUDP bool `mapstructure:"disableUDP"`
|
||||
UDPIdleTimeout time.Duration `mapstructure:"udpIdleTimeout"`
|
||||
Auth serverConfigAuth `mapstructure:"auth"`
|
||||
Resolver serverConfigResolver `mapstructure:"resolver"`
|
||||
Sniff serverConfigSniff `mapstructure:"sniff"`
|
||||
ACL serverConfigACL `mapstructure:"acl"`
|
||||
Outbounds []serverConfigOutboundEntry `mapstructure:"outbounds"`
|
||||
TrafficStats serverConfigTrafficStats `mapstructure:"trafficStats"`
|
||||
@@ -112,6 +114,14 @@ type serverConfigResolver struct {
|
||||
HTTPS serverConfigResolverHTTPS `mapstructure:"https"`
|
||||
}
|
||||
|
||||
type serverConfigSniff struct {
|
||||
Enable bool `mapstructure:"enable"`
|
||||
Timeout time.Duration `mapstructure:"timeout"`
|
||||
RewriteDomain bool `mapstructure:"rewriteDomain"`
|
||||
TCPPorts string `mapstructure:"tcpPorts"`
|
||||
UDPPorts string `mapstructure:"udpPorts"`
|
||||
}
|
||||
|
||||
type serverConfigACL struct {
|
||||
File string `mapstructure:"file"`
|
||||
Inline []string `mapstructure:"inline"`
|
||||
|
||||
@@ -41,7 +41,7 @@ func (h *Hysteria2) AddUsers(p *vCore.AddUsersParams) (added int, err error) {
|
||||
return len(p.Users), nil
|
||||
}
|
||||
|
||||
func (h *Hysteria2) DelUsers(users []panel.UserInfo, tag string) error {
|
||||
func (h *Hysteria2) DelUsers(users []panel.UserInfo, tag string, _ *panel.NodeInfo) error {
|
||||
var wg sync.WaitGroup
|
||||
for _, user := range users {
|
||||
wg.Add(1)
|
||||
|
||||
@@ -18,7 +18,7 @@ type Core interface {
|
||||
DelNode(tag string) error
|
||||
AddUsers(p *AddUsersParams) (added int, err error)
|
||||
GetUserTraffic(tag, uuid string, reset bool) (up int64, down int64)
|
||||
DelUsers(users []panel.UserInfo, tag string) error
|
||||
DelUsers(users []panel.UserInfo, tag string, info *panel.NodeInfo) error
|
||||
Protocols() []string
|
||||
Type() string
|
||||
}
|
||||
|
||||
@@ -3,10 +3,11 @@ package core
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/hashicorp/go-multierror"
|
||||
|
||||
"github.com/InazumaV/V2bX/api/panel"
|
||||
"github.com/InazumaV/V2bX/conf"
|
||||
)
|
||||
@@ -135,12 +136,12 @@ func (s *Selector) GetUserTraffic(tag, uuid string, reset bool) (up int64, down
|
||||
return t.(Core).GetUserTraffic(tag, uuid, reset)
|
||||
}
|
||||
|
||||
func (s *Selector) DelUsers(users []panel.UserInfo, tag string) error {
|
||||
func (s *Selector) DelUsers(users []panel.UserInfo, tag string, info *panel.NodeInfo) error {
|
||||
t, e := s.nodes.Load(tag)
|
||||
if !e {
|
||||
return errors.New("the node is not have")
|
||||
}
|
||||
return t.(Core).DelUsers(users, tag)
|
||||
return t.(Core).DelUsers(users, tag, info)
|
||||
}
|
||||
|
||||
func (s *Selector) Protocols() []string {
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
package sing
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/InazumaV/V2bX/api/panel"
|
||||
"github.com/goccy/go-json"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func updateDNSConfig(node *panel.NodeInfo) (err error) {
|
||||
dnsPath := os.Getenv("SING_DNS_PATH")
|
||||
if len(node.RawDNS.DNSJson) != 0 {
|
||||
var prettyJSON bytes.Buffer
|
||||
if err := json.Indent(&prettyJSON, node.RawDNS.DNSJson, "", " "); err != nil {
|
||||
return err
|
||||
}
|
||||
err = saveDnsConfig(prettyJSON.Bytes(), dnsPath)
|
||||
} else if len(node.RawDNS.DNSMap) != 0 {
|
||||
dnsConfig := DNSConfig{
|
||||
Servers: []map[string]interface{}{
|
||||
{
|
||||
"tag": "default",
|
||||
"address": "https://8.8.8.8/dns-query",
|
||||
"detour": "direct",
|
||||
},
|
||||
},
|
||||
}
|
||||
for id, value := range node.RawDNS.DNSMap {
|
||||
dnsConfig.Servers = append(dnsConfig.Servers,
|
||||
map[string]interface{}{
|
||||
"tag": id,
|
||||
"address": value["address"],
|
||||
"address_resolver": "default",
|
||||
"detour": "direct",
|
||||
},
|
||||
)
|
||||
rule := map[string]interface{}{
|
||||
"server": id,
|
||||
"disable_cache": true,
|
||||
}
|
||||
for _, ruleType := range []string{"domain_suffix", "domain_keyword", "domain_regex", "geosite"} {
|
||||
var domains []string
|
||||
for _, v := range value["domains"].([]string) {
|
||||
split := strings.SplitN(v, ":", 2)
|
||||
prefix := strings.ToLower(split[0])
|
||||
if prefix == ruleType || (prefix == "domain" && ruleType == "domain_suffix") {
|
||||
if len(split) > 1 {
|
||||
domains = append(domains, split[1])
|
||||
}
|
||||
if len(domains) > 0 {
|
||||
rule[ruleType] = domains
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dnsConfig.Rules = append(dnsConfig.Rules, rule)
|
||||
}
|
||||
dnsConfigJSON, err := json.MarshalIndent(dnsConfig, "", " ")
|
||||
if err != nil {
|
||||
log.WithField("err", err).Error("Error marshaling dnsConfig to JSON")
|
||||
return err
|
||||
}
|
||||
err = saveDnsConfig(dnsConfigJSON, dnsPath)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func saveDnsConfig(dns []byte, dnsPath string) (err error) {
|
||||
currentData, err := os.ReadFile(dnsPath)
|
||||
if err != nil {
|
||||
log.WithField("err", err).Error("Failed to read SING_DNS_PATH")
|
||||
return err
|
||||
}
|
||||
if !bytes.Equal(currentData, dns) {
|
||||
if err = os.Truncate(dnsPath, 0); err != nil {
|
||||
log.WithField("err", err).Error("Failed to clear SING DNS PATH file")
|
||||
}
|
||||
if err = os.WriteFile(dnsPath, dns, 0644); err != nil {
|
||||
log.WithField("err", err).Error("Failed to write DNS to SING DNS PATH file")
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package sing
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"fmt"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
@@ -20,47 +20,16 @@ import (
|
||||
var _ adapter.ConnectionTracker = (*HookServer)(nil)
|
||||
|
||||
type HookServer struct {
|
||||
EnableConnClear bool
|
||||
counter sync.Map
|
||||
connClears sync.Map
|
||||
}
|
||||
|
||||
type ConnClear struct {
|
||||
lock sync.RWMutex
|
||||
conns map[int]io.Closer
|
||||
}
|
||||
|
||||
func (c *ConnClear) AddConn(cn io.Closer) (key int) {
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
key = len(c.conns)
|
||||
c.conns[key] = cn
|
||||
return
|
||||
}
|
||||
|
||||
func (c *ConnClear) DelConn(key int) {
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
delete(c.conns, key)
|
||||
}
|
||||
|
||||
func (c *ConnClear) ClearConn() {
|
||||
c.lock.Lock()
|
||||
defer c.lock.Unlock()
|
||||
for _, c := range c.conns {
|
||||
c.Close()
|
||||
}
|
||||
counter sync.Map //map[string]*counter.TrafficCounter
|
||||
}
|
||||
|
||||
func (h *HookServer) ModeList() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewHookServer(enableClear bool) *HookServer {
|
||||
func NewHookServer() *HookServer {
|
||||
server := &HookServer{
|
||||
EnableConnClear: enableClear,
|
||||
counter: sync.Map{},
|
||||
connClears: sync.Map{},
|
||||
counter: sync.Map{},
|
||||
}
|
||||
return server
|
||||
}
|
||||
@@ -71,31 +40,46 @@ func (h *HookServer) RoutedConnection(_ context.Context, conn net.Conn, m adapte
|
||||
log.Warn("get limiter for ", m.Inbound, " error: ", err)
|
||||
return conn
|
||||
}
|
||||
taguuid := format.UserTag(m.Inbound, m.User)
|
||||
ip := m.Source.Addr.String()
|
||||
if b, r := l.CheckLimit(format.UserTag(m.Inbound, m.User), ip, true, true); r {
|
||||
if b, r := l.CheckLimit(taguuid, ip, true, true); r {
|
||||
conn.Close()
|
||||
log.Error("[", m.Inbound, "] ", "Limited ", m.User, " by ip or conn")
|
||||
return conn
|
||||
} else if b != nil {
|
||||
conn = rate.NewConnRateLimiter(conn, b)
|
||||
}
|
||||
if h.EnableConnClear {
|
||||
cc := &ConnClear{
|
||||
conns: map[int]io.Closer{
|
||||
0: conn,
|
||||
},
|
||||
if l != nil {
|
||||
destStr := m.Destination.AddrString()
|
||||
protocol := m.Destination.Network()
|
||||
if l.CheckDomainRule(destStr) {
|
||||
log.Error(fmt.Sprintf(
|
||||
"User %s access domain %s reject by rule",
|
||||
m.User,
|
||||
destStr))
|
||||
conn.Close()
|
||||
return conn
|
||||
}
|
||||
if v, ok := h.connClears.LoadOrStore(m.Inbound+m.User, cc); ok {
|
||||
cc = v.(*ConnClear)
|
||||
if len(protocol) != 0 {
|
||||
if l.CheckProtocolRule(protocol) {
|
||||
log.Error(fmt.Sprintf(
|
||||
"User %s access protocol %s reject by rule",
|
||||
m.User,
|
||||
protocol))
|
||||
conn.Close()
|
||||
return conn
|
||||
}
|
||||
}
|
||||
}
|
||||
if c, ok := h.counter.Load(m.Inbound); ok {
|
||||
return counter.NewConnCounter(conn, c.(*counter.TrafficCounter).GetCounter(m.User))
|
||||
var t *counter.TrafficCounter
|
||||
if c, ok := h.counter.Load(m.Inbound); !ok {
|
||||
t = counter.NewTrafficCounter()
|
||||
h.counter.Store(m.Inbound, t)
|
||||
} else {
|
||||
c := counter.NewTrafficCounter()
|
||||
h.counter.Store(m.Inbound, c)
|
||||
return counter.NewConnCounter(conn, c.GetCounter(m.User))
|
||||
t = c.(*counter.TrafficCounter)
|
||||
}
|
||||
conn = counter.NewConnCounter(conn, t.GetCounter(m.User))
|
||||
return conn
|
||||
}
|
||||
|
||||
func (h *HookServer) RoutedPacketConnection(_ context.Context, conn N.PacketConn, m adapter.InboundContext, _ adapter.Rule, _ adapter.Outbound) N.PacketConn {
|
||||
@@ -105,35 +89,43 @@ func (h *HookServer) RoutedPacketConnection(_ context.Context, conn N.PacketConn
|
||||
return conn
|
||||
}
|
||||
ip := m.Source.Addr.String()
|
||||
if b, r := l.CheckLimit(format.UserTag(m.Inbound, m.User), ip, false, false); r {
|
||||
taguuid := format.UserTag(m.Inbound, m.User)
|
||||
if b, r := l.CheckLimit(taguuid, ip, false, false); r {
|
||||
conn.Close()
|
||||
log.Error("[", m.Inbound, "] ", "Limited ", m.User, " by ip or conn")
|
||||
return conn
|
||||
} else if b != nil {
|
||||
//conn = rate.NewPacketConnCounter(conn, b)
|
||||
}
|
||||
if h.EnableConnClear {
|
||||
cc := &ConnClear{
|
||||
conns: map[int]io.Closer{
|
||||
0: conn,
|
||||
},
|
||||
if l != nil {
|
||||
destStr := m.Destination.AddrString()
|
||||
protocol := m.Destination.Network()
|
||||
if l.CheckDomainRule(destStr) {
|
||||
log.Error(fmt.Sprintf(
|
||||
"User %s access domain %s reject by rule",
|
||||
m.User,
|
||||
destStr))
|
||||
conn.Close()
|
||||
return conn
|
||||
}
|
||||
if v, ok := h.connClears.LoadOrStore(m.Inbound+m.User, cc); ok {
|
||||
cc = v.(*ConnClear)
|
||||
if len(protocol) != 0 {
|
||||
if l.CheckProtocolRule(protocol) {
|
||||
log.Error(fmt.Sprintf(
|
||||
"User %s access protocol %s reject by rule",
|
||||
m.User,
|
||||
protocol))
|
||||
conn.Close()
|
||||
return conn
|
||||
}
|
||||
}
|
||||
}
|
||||
if c, ok := h.counter.Load(m.Inbound); ok {
|
||||
return counter.NewPacketConnCounter(conn, c.(*counter.TrafficCounter).GetCounter(m.User))
|
||||
var t *counter.TrafficCounter
|
||||
if c, ok := h.counter.Load(m.Inbound); !ok {
|
||||
t = counter.NewTrafficCounter()
|
||||
h.counter.Store(m.Inbound, t)
|
||||
} else {
|
||||
c := counter.NewTrafficCounter()
|
||||
h.counter.Store(m.Inbound, c)
|
||||
return counter.NewPacketConnCounter(conn, c.GetCounter(m.User))
|
||||
}
|
||||
}
|
||||
|
||||
func (h *HookServer) ClearConn(inbound string, user string) {
|
||||
if v, ok := h.connClears.Load(inbound + user); ok {
|
||||
v.(*ConnClear).ClearConn()
|
||||
h.connClears.Delete(inbound + user)
|
||||
t = c.(*counter.TrafficCounter)
|
||||
}
|
||||
conn = counter.NewPacketConnCounter(conn, t.GetCounter(m.User))
|
||||
return conn
|
||||
}
|
||||
|
||||
@@ -343,6 +343,17 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
|
||||
}
|
||||
}
|
||||
in.Options = trojanoption
|
||||
case "tuic":
|
||||
in.Type = "tuic"
|
||||
tls.ALPN = append(tls.ALPN, "h3")
|
||||
in.Options = &option.TUICInboundOptions{
|
||||
ListenOptions: listen,
|
||||
CongestionControl: info.Tuic.CongestionControl,
|
||||
ZeroRTTHandshake: info.Tuic.ZeroRTTHandshake,
|
||||
InboundTLSOptionsContainer: option.InboundTLSOptionsContainer{
|
||||
TLS: &tls,
|
||||
},
|
||||
}
|
||||
case "hysteria":
|
||||
in.Type = "hysteria"
|
||||
in.Options = &option.HysteriaInboundOptions{
|
||||
@@ -369,10 +380,11 @@ func getInboundOptions(tag string, info *panel.NodeInfo, c *conf.Options) (optio
|
||||
}
|
||||
}
|
||||
in.Options = &option.Hysteria2InboundOptions{
|
||||
ListenOptions: listen,
|
||||
UpMbps: info.Hysteria2.UpMbps,
|
||||
DownMbps: info.Hysteria2.DownMbps,
|
||||
Obfs: obfs,
|
||||
ListenOptions: listen,
|
||||
UpMbps: info.Hysteria2.UpMbps,
|
||||
DownMbps: info.Hysteria2.DownMbps,
|
||||
IgnoreClientBandwidth: info.Hysteria2.Ignore_Client_Bandwidth,
|
||||
Obfs: obfs,
|
||||
InboundTLSOptionsContainer: option.InboundTLSOptionsContainer{
|
||||
TLS: &tls,
|
||||
},
|
||||
|
||||
@@ -29,7 +29,6 @@ type Sing struct {
|
||||
hookServer *HookServer
|
||||
router adapter.Router
|
||||
logFactory log.Factory
|
||||
inbounds map[string]adapter.Inbound
|
||||
}
|
||||
|
||||
func init() {
|
||||
@@ -38,7 +37,7 @@ func init() {
|
||||
|
||||
func New(c *conf.CoreConfig) (vCore.Core, error) {
|
||||
ctx := context.Background()
|
||||
ctx = box.Context(ctx, include.InboundRegistry(), include.OutboundRegistry(), include.EndpointRegistry())
|
||||
ctx = box.Context(ctx, include.InboundRegistry(), include.OutboundRegistry(), include.EndpointRegistry(), include.DNSTransportRegistry())
|
||||
options := option.Options{}
|
||||
if len(c.SingConfig.OriginalPath) != 0 {
|
||||
data, err := os.ReadFile(c.SingConfig.OriginalPath)
|
||||
@@ -72,7 +71,7 @@ func New(c *conf.CoreConfig) (vCore.Core, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
hs := NewHookServer(c.SingConfig.EnableConnClear)
|
||||
hs := NewHookServer()
|
||||
b.Router().SetTracker(hs)
|
||||
return &Sing{
|
||||
ctx: b.Router().GetCtx(),
|
||||
@@ -97,6 +96,7 @@ func (b *Sing) Protocols() []string {
|
||||
"vless",
|
||||
"shadowsocks",
|
||||
"trojan",
|
||||
"tuic",
|
||||
"hysteria",
|
||||
"hysteria2",
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/sagernet/sing-box/protocol/hysteria2"
|
||||
"github.com/sagernet/sing-box/protocol/shadowsocks"
|
||||
"github.com/sagernet/sing-box/protocol/trojan"
|
||||
"github.com/sagernet/sing-box/protocol/tuic"
|
||||
"github.com/sagernet/sing-box/protocol/vless"
|
||||
"github.com/sagernet/sing-box/protocol/vmess"
|
||||
)
|
||||
@@ -22,27 +23,25 @@ func (b *Sing) AddUsers(p *core.AddUsersParams) (added int, err error) {
|
||||
return 0, errors.New("the inbound not found")
|
||||
}
|
||||
switch p.NodeInfo.Type {
|
||||
case "vmess", "vless":
|
||||
if p.NodeInfo.Type == "vless" {
|
||||
us := make([]option.VLESSUser, len(p.Users))
|
||||
for i := range p.Users {
|
||||
us[i] = option.VLESSUser{
|
||||
Name: p.Users[i].Uuid,
|
||||
Flow: p.VAllss.Flow,
|
||||
UUID: p.Users[i].Uuid,
|
||||
}
|
||||
case "vless":
|
||||
us := make([]option.VLESSUser, len(p.Users))
|
||||
for i := range p.Users {
|
||||
us[i] = option.VLESSUser{
|
||||
Name: p.Users[i].Uuid,
|
||||
Flow: p.VAllss.Flow,
|
||||
UUID: p.Users[i].Uuid,
|
||||
}
|
||||
err = in.(*vless.Inbound).AddUsers(us)
|
||||
} else {
|
||||
us := make([]option.VMessUser, len(p.Users))
|
||||
for i := range p.Users {
|
||||
us[i] = option.VMessUser{
|
||||
Name: p.Users[i].Uuid,
|
||||
UUID: p.Users[i].Uuid,
|
||||
}
|
||||
}
|
||||
err = in.(*vmess.Inbound).AddUsers(us)
|
||||
}
|
||||
err = in.(*vless.Inbound).AddUsers(us)
|
||||
case "vmess":
|
||||
us := make([]option.VMessUser, len(p.Users))
|
||||
for i := range p.Users {
|
||||
us[i] = option.VMessUser{
|
||||
Name: p.Users[i].Uuid,
|
||||
UUID: p.Users[i].Uuid,
|
||||
}
|
||||
}
|
||||
err = in.(*vmess.Inbound).AddUsers(us)
|
||||
case "shadowsocks":
|
||||
us := make([]option.ShadowsocksUser, len(p.Users))
|
||||
for i := range p.Users {
|
||||
@@ -68,6 +67,18 @@ func (b *Sing) AddUsers(p *core.AddUsersParams) (added int, err error) {
|
||||
}
|
||||
}
|
||||
err = in.(*trojan.Inbound).AddUsers(us)
|
||||
case "tuic":
|
||||
us := make([]option.TUICUser, len(p.Users))
|
||||
id := make([]int, len(p.Users))
|
||||
for i := range p.Users {
|
||||
us[i] = option.TUICUser{
|
||||
Name: p.Users[i].Uuid,
|
||||
UUID: p.Users[i].Uuid,
|
||||
Password: p.Users[i].Uuid,
|
||||
}
|
||||
id[i] = p.Users[i].Id
|
||||
}
|
||||
err = in.(*tuic.Inbound).AddUsers(us, id)
|
||||
case "hysteria":
|
||||
us := make([]option.HysteriaUser, len(p.Users))
|
||||
for i := range p.Users {
|
||||
@@ -112,10 +123,10 @@ type UserDeleter interface {
|
||||
DelUsers(uuid []string) error
|
||||
}
|
||||
|
||||
func (b *Sing) DelUsers(users []panel.UserInfo, tag string) error {
|
||||
func (b *Sing) DelUsers(users []panel.UserInfo, tag string, info *panel.NodeInfo) error {
|
||||
var del UserDeleter
|
||||
if i, ok := b.inbounds[tag]; ok {
|
||||
switch i.Type() {
|
||||
if i, found := b.box.Inbound().Get(tag); found {
|
||||
switch info.Type {
|
||||
case "vmess":
|
||||
del = i.(*vmess.Inbound)
|
||||
case "vless":
|
||||
@@ -124,6 +135,8 @@ func (b *Sing) DelUsers(users []panel.UserInfo, tag string) error {
|
||||
del = i.(*shadowsocks.MultiInbound)
|
||||
case "trojan":
|
||||
del = i.(*trojan.Inbound)
|
||||
case "tuic":
|
||||
del = i.(*tuic.Inbound)
|
||||
case "hysteria":
|
||||
del = i.(*hysteria.Inbound)
|
||||
case "hysteria2":
|
||||
@@ -134,7 +147,6 @@ func (b *Sing) DelUsers(users []panel.UserInfo, tag string) error {
|
||||
}
|
||||
uuids := make([]string, len(users))
|
||||
for i := range users {
|
||||
b.hookServer.ClearConn(tag, users[i].Uuid)
|
||||
uuids[i] = users[i].Uuid
|
||||
}
|
||||
err := del.DelUsers(uuids)
|
||||
|
||||
@@ -45,8 +45,14 @@ func (r *cachedReader) Cache(b *buf.Buffer) {
|
||||
if !mb.IsEmpty() {
|
||||
r.cache, _ = buf.MergeMulti(r.cache, mb)
|
||||
}
|
||||
b.Clear()
|
||||
rawBytes := b.Extend(buf.Size)
|
||||
cacheLen := r.cache.Len()
|
||||
if cacheLen <= b.Cap() {
|
||||
b.Clear()
|
||||
} else {
|
||||
b.Release()
|
||||
*b = *buf.NewWithSize(cacheLen)
|
||||
}
|
||||
rawBytes := b.Extend(cacheLen)
|
||||
n := r.cache.Copy(rawBytes)
|
||||
b.Resize(0, int32(n))
|
||||
r.Unlock()
|
||||
@@ -106,7 +112,7 @@ func init() {
|
||||
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
||||
d := new(DefaultDispatcher)
|
||||
if err := core.RequireFeatures(ctx, func(om outbound.Manager, router routing.Router, pm policy.Manager, sm stats.Manager, dc dns.Client) error {
|
||||
core.RequireFeatures(ctx, func(fdns dns.FakeDNSEngine) {
|
||||
core.OptionalFeatures(ctx, func(fdns dns.FakeDNSEngine) {
|
||||
d.fdns = fdns
|
||||
})
|
||||
return d.Init(config.(*Config), om, router, pm, sm, dc)
|
||||
|
||||
@@ -27,7 +27,7 @@ func (c *Xray) GetUserManager(tag string) (proxy.UserManager, error) {
|
||||
return userManager, nil
|
||||
}
|
||||
|
||||
func (c *Xray) DelUsers(users []panel.UserInfo, tag string) error {
|
||||
func (c *Xray) DelUsers(users []panel.UserInfo, tag string, _ *panel.NodeInfo) error {
|
||||
userManager, err := c.GetUserManager(tag)
|
||||
if err != nil {
|
||||
return fmt.Errorf("get user manager error: %s", err)
|
||||
|
||||
@@ -28,9 +28,7 @@
|
||||
},
|
||||
"DnsConfigPath": "/etc/V2bX/dns.json",
|
||||
// SingBox源配置文件目录,用于引用标准SingBox配置文件
|
||||
"OriginalPath": "/etc/V2bX/sing_origin.json",
|
||||
// 在删除用户时清理已建立的连接
|
||||
"EnableConnClear": false,
|
||||
"OriginalPath": "/etc/V2bX/sing_origin.json"
|
||||
},
|
||||
{
|
||||
"Type": "sing",
|
||||
|
||||
263
go.mod
263
go.mod
@@ -1,44 +1,45 @@
|
||||
module github.com/InazumaV/V2bX
|
||||
|
||||
go 1.23
|
||||
go 1.24
|
||||
|
||||
toolchain go1.23.2
|
||||
toolchain go1.24.1
|
||||
|
||||
require (
|
||||
github.com/apernet/hysteria/core/v2 v2.6.0
|
||||
github.com/apernet/hysteria/extras/v2 v2.6.0
|
||||
github.com/apernet/quic-go v0.48.2-0.20241104191913-cb103fcecfe7
|
||||
github.com/beevik/ntp v1.2.0
|
||||
github.com/fsnotify/fsnotify v1.7.0
|
||||
github.com/go-acme/lego/v4 v4.19.3-0.20241028134924-480950181787
|
||||
github.com/go-resty/resty/v2 v2.15.3
|
||||
github.com/goccy/go-json v0.10.3
|
||||
github.com/hashicorp/go-multierror v1.1.2-0.20240618221538-6fa16eae919d
|
||||
github.com/apernet/hysteria/core/v2 v2.6.1
|
||||
github.com/apernet/hysteria/extras/v2 v2.6.1
|
||||
github.com/apernet/quic-go v0.49.1-0.20250204013113-43c72b1281a0
|
||||
github.com/beevik/ntp v1.4.4-0.20240716062501-06ef196b89ec
|
||||
github.com/fsnotify/fsnotify v1.8.0
|
||||
github.com/go-acme/lego/v4 v4.21.1-0.20241220151055-ee7a9e4fa04f
|
||||
github.com/go-resty/resty/v2 v2.16.2
|
||||
github.com/goccy/go-json v0.10.4
|
||||
github.com/hashicorp/go-multierror v1.1.2-0.20241119060415-613124da9385
|
||||
github.com/juju/ratelimit v1.0.2
|
||||
github.com/sagernet/sing v0.6.0-beta.6
|
||||
github.com/sagernet/sing-box v1.10.4
|
||||
github.com/sagernet/sing v0.6.2-0.20250210072154-8dff604468ff
|
||||
github.com/sagernet/sing-box v1.12.0
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/spf13/cobra v1.8.1
|
||||
github.com/spf13/viper v1.18.2
|
||||
github.com/xtls/xray-core v1.8.25-0.20241215123619-7d0a80b501d4
|
||||
github.com/spf13/viper v1.19.0
|
||||
github.com/xtls/xray-core v1.250306.1-0.20250331123338-ab5d7cf3d2d6
|
||||
go.uber.org/zap v1.27.0
|
||||
golang.org/x/crypto v0.30.0
|
||||
golang.org/x/sys v0.28.0
|
||||
google.golang.org/protobuf v1.35.2
|
||||
golang.org/x/crypto v0.36.0
|
||||
golang.org/x/sys v0.31.0
|
||||
google.golang.org/protobuf v1.36.6
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1
|
||||
)
|
||||
|
||||
require (
|
||||
cloud.google.com/go/auth v0.9.3 // indirect
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.5.1 // indirect
|
||||
cloud.google.com/go/auth v0.13.0 // indirect
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect
|
||||
cloud.google.com/go/compute/metadata v0.6.0 // indirect
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
github.com/AdamSLevy/jsonrpc2/v14 v14.1.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dns/armdns v1.2.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.2.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.3.0 // indirect
|
||||
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcegraph/armresourcegraph v0.9.0 // indirect
|
||||
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
|
||||
github.com/Azure/go-autorest/autorest v0.11.29 // indirect
|
||||
@@ -53,46 +54,60 @@ require (
|
||||
github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87 // indirect
|
||||
github.com/ajg/form v1.5.1 // indirect
|
||||
github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 // indirect
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v1.63.15 // indirect
|
||||
github.com/akutz/memconn v0.1.0 // indirect
|
||||
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa // indirect
|
||||
github.com/aliyun/alibaba-cloud-sdk-go v1.63.72 // indirect
|
||||
github.com/andybalholm/brotli v1.1.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2 v1.30.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.33 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.32 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 // indirect
|
||||
github.com/anytls/sing-anytls v0.0.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2 v1.32.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/config v1.28.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.48 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/lightsail v1.40.6 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/route53 v1.43.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.22.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 // indirect
|
||||
github.com/aws/smithy-go v1.20.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/lightsail v1.42.8 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/route53 v1.46.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.33.3 // indirect
|
||||
github.com/aws/smithy-go v1.22.1 // indirect
|
||||
github.com/babolivier/go-doh-client v0.0.0-20201028162107-a76cff4cb8b6 // indirect
|
||||
github.com/benbjohnson/clock v1.3.0 // indirect
|
||||
github.com/bits-and-blooms/bitset v1.13.0 // indirect
|
||||
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
|
||||
github.com/caddyserver/certmagic v0.20.0 // indirect
|
||||
github.com/caddyserver/certmagic v0.21.7 // indirect
|
||||
github.com/caddyserver/zerossl v0.1.3 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/civo/civogo v0.3.11 // indirect
|
||||
github.com/cloudflare/circl v1.4.0 // indirect
|
||||
github.com/cloudflare/cloudflare-go v0.104.0 // indirect
|
||||
github.com/cloudflare/circl v1.6.0 // indirect
|
||||
github.com/cloudflare/cloudflare-go v0.112.0 // indirect
|
||||
github.com/coder/websocket v1.8.12 // indirect
|
||||
github.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6 // indirect
|
||||
github.com/cpu/goacmedns v0.1.1 // indirect
|
||||
github.com/cretz/bine v0.2.0 // indirect
|
||||
github.com/database64128/netx-go v0.0.0-20240905055117-62795b8b054a // indirect
|
||||
github.com/database64128/tfo-go/v2 v2.2.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa // indirect
|
||||
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 // indirect
|
||||
github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e // indirect
|
||||
github.com/dimchansky/utfbom v1.1.1 // indirect
|
||||
github.com/dnsimple/dnsimple-go v1.7.0 // indirect
|
||||
github.com/exoscale/egoscale/v3 v3.1.5 // indirect
|
||||
github.com/exoscale/egoscale/v3 v3.1.7 // indirect
|
||||
github.com/fatih/structs v1.1.0 // indirect
|
||||
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.6.0 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
|
||||
github.com/gaissmai/bart v0.11.1 // indirect
|
||||
github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344 // indirect
|
||||
github.com/go-chi/chi/v5 v5.1.0 // indirect
|
||||
github.com/go-chi/chi/v5 v5.2.1 // indirect
|
||||
github.com/go-chi/render v1.0.3 // indirect
|
||||
github.com/go-errors/errors v1.0.1 // indirect
|
||||
github.com/go-jose/go-jose/v4 v4.0.4 // indirect
|
||||
github.com/go-json-experiment/json v0.0.0-20231102232822-2e55bd4e08b0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-ole/go-ole v1.3.0 // indirect
|
||||
@@ -100,24 +115,28 @@ require (
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.16.0 // indirect
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.1.0 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
|
||||
github.com/gobwas/httphead v0.1.0 // indirect
|
||||
github.com/gobwas/pool v0.2.1 // indirect
|
||||
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // indirect
|
||||
github.com/gofrs/flock v0.12.1 // indirect
|
||||
github.com/gofrs/uuid/v5 v5.3.0 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
|
||||
github.com/gofrs/uuid/v5 v5.3.1 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
|
||||
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/google/btree v1.1.3 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/google/go-querystring v1.1.0 // indirect
|
||||
github.com/google/nftables v0.2.1-0.20240414091927-5e242ec57806 // indirect
|
||||
github.com/google/pprof v0.0.0-20240528025155-186aa0362fba // indirect
|
||||
github.com/google/s2a-go v0.1.8 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
|
||||
github.com/gophercloud/gophercloud v1.14.0 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.14.0 // indirect
|
||||
github.com/gophercloud/gophercloud v1.14.1 // indirect
|
||||
github.com/gophercloud/utils v0.0.0-20231010081019-80377eca5d56 // indirect
|
||||
github.com/gorilla/csrf v1.7.2 // indirect
|
||||
github.com/gorilla/securecookie v1.1.2 // indirect
|
||||
github.com/gorilla/websocket v1.5.3 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
@@ -126,18 +145,22 @@ require (
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.5 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/yamux v0.1.2 // indirect
|
||||
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.114 // indirect
|
||||
github.com/hdevalence/ed25519consensus v0.2.0 // indirect
|
||||
github.com/huaweicloud/huaweicloud-sdk-go-v3 v0.1.128 // indirect
|
||||
github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df // indirect
|
||||
github.com/illarion/gonotify/v2 v2.0.3 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/infobloxopen/infoblox-go-client v1.1.1 // indirect
|
||||
github.com/insomniacslk/dhcp v0.0.0-20231206064809-8c70d406f6d2 // indirect
|
||||
github.com/insomniacslk/dhcp v0.0.0-20250109001534-8abf58130905 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/josharian/native v1.1.0 // indirect
|
||||
github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 // indirect
|
||||
github.com/jsimonetti/rtnetlink v1.4.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 // indirect
|
||||
github.com/klauspost/compress v1.17.9 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
|
||||
github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b // indirect
|
||||
github.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a // indirect
|
||||
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||
github.com/labbsr0x/bindman-dns-webhook v1.0.2 // indirect
|
||||
github.com/labbsr0x/goh v1.0.1 // indirect
|
||||
@@ -145,28 +168,31 @@ require (
|
||||
github.com/libdns/alidns v1.0.3 // indirect
|
||||
github.com/libdns/cloudflare v0.1.1 // indirect
|
||||
github.com/libdns/libdns v0.2.2 // indirect
|
||||
github.com/linode/linodego v1.40.0 // indirect
|
||||
github.com/linode/linodego v1.44.0 // indirect
|
||||
github.com/liquidweb/liquidweb-cli v0.6.9 // indirect
|
||||
github.com/liquidweb/liquidweb-go v1.6.4 // indirect
|
||||
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mdlayher/genetlink v1.3.2 // indirect
|
||||
github.com/mdlayher/netlink v1.7.2 // indirect
|
||||
github.com/mdlayher/socket v0.4.1 // indirect
|
||||
github.com/metacubex/tfo-go v0.0.0-20241006021335-daedaf0ca7aa // indirect
|
||||
github.com/mholt/acmez v1.2.0 // indirect
|
||||
github.com/miekg/dns v1.1.62 // indirect
|
||||
github.com/mdlayher/sdnotify v1.0.0 // indirect
|
||||
github.com/mdlayher/socket v0.5.1 // indirect
|
||||
github.com/metacubex/tfo-go v0.0.0-20241231083714-66613d49c422 // indirect
|
||||
github.com/mholt/acmez/v3 v3.0.1 // indirect
|
||||
github.com/miekg/dns v1.1.64 // indirect
|
||||
github.com/mimuret/golang-iij-dpf v0.9.1 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/go-ps v1.0.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04 // indirect
|
||||
github.com/nrdcg/auroradns v1.1.0 // indirect
|
||||
github.com/nrdcg/bunny-go v0.0.0-20240207213615-dde5bf4577a3 // indirect
|
||||
github.com/nrdcg/desec v0.8.0 // indirect
|
||||
github.com/nrdcg/desec v0.10.0 // indirect
|
||||
github.com/nrdcg/dnspod-go v0.4.0 // indirect
|
||||
github.com/nrdcg/freemyip v0.2.0 // indirect
|
||||
github.com/nrdcg/freemyip v0.3.0 // indirect
|
||||
github.com/nrdcg/goinwx v0.10.0 // indirect
|
||||
github.com/nrdcg/mailinabox v0.2.0 // indirect
|
||||
github.com/nrdcg/namesilo v0.2.1 // indirect
|
||||
@@ -175,43 +201,45 @@ require (
|
||||
github.com/nzdjb/go-metaname v1.0.0 // indirect
|
||||
github.com/onsi/ginkgo/v2 v2.19.0 // indirect
|
||||
github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect
|
||||
github.com/oracle/oci-go-sdk/v65 v65.73.0 // indirect
|
||||
github.com/oschwald/maxminddb-golang v1.12.0 // indirect
|
||||
github.com/oracle/oci-go-sdk/v65 v65.81.1 // indirect
|
||||
github.com/ovh/go-ovh v1.6.0 // indirect
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.17 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
|
||||
github.com/peterhellberg/link v1.2.0 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.21 // indirect
|
||||
github.com/pires/go-proxyproto v0.8.0 // indirect
|
||||
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/pquerna/otp v1.4.0 // indirect
|
||||
github.com/prometheus-community/pro-bing v0.4.0 // indirect
|
||||
github.com/quic-go/qpack v0.5.1 // indirect
|
||||
github.com/quic-go/qtls-go1-20 v0.4.1 // indirect
|
||||
github.com/quic-go/quic-go v0.46.0 // indirect
|
||||
github.com/quic-go/quic-go v0.50.1 // indirect
|
||||
github.com/refraction-networking/utls v1.6.7 // indirect
|
||||
github.com/regfish/regfish-dnsapi-go v0.1.1 // indirect
|
||||
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect
|
||||
github.com/sacloud/api-client-go v0.2.10 // indirect
|
||||
github.com/sacloud/go-http v0.1.8 // indirect
|
||||
github.com/sacloud/iaas-api-go v1.12.0 // indirect
|
||||
github.com/sacloud/iaas-api-go v1.14.0 // indirect
|
||||
github.com/sacloud/packages-go v0.0.10 // indirect
|
||||
github.com/safchain/ethtool v0.3.0 // indirect
|
||||
github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a // indirect
|
||||
github.com/sagernet/cloudflare-tls v0.0.0-20231208171750-a4483c1b7cd1 // indirect
|
||||
github.com/sagernet/cors v1.2.1 // indirect
|
||||
github.com/sagernet/fswatch v0.1.1 // indirect
|
||||
github.com/sagernet/gvisor v0.0.0-20241123041152-536d05261cff // indirect
|
||||
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a // indirect
|
||||
github.com/sagernet/nftables v0.3.0-beta.4 // indirect
|
||||
github.com/sagernet/quic-go v0.48.2-beta.1 // indirect
|
||||
github.com/sagernet/sing-dns v0.4.0-beta.1 // indirect
|
||||
github.com/sagernet/sing-mux v0.3.0-alpha.1 // indirect
|
||||
github.com/sagernet/sing-quic v0.4.0-alpha.4 // indirect
|
||||
github.com/sagernet/quic-go v0.49.0-beta.1 // indirect
|
||||
github.com/sagernet/sing-mux v0.3.1 // indirect
|
||||
github.com/sagernet/sing-quic v0.4.1-beta.1 // indirect
|
||||
github.com/sagernet/sing-shadowsocks v0.2.7 // indirect
|
||||
github.com/sagernet/sing-shadowsocks2 v0.2.0 // indirect
|
||||
github.com/sagernet/sing-shadowtls v0.2.0-alpha.2 // indirect
|
||||
github.com/sagernet/sing-tun v0.6.0-beta.2 // indirect
|
||||
github.com/sagernet/sing-vmess v0.2.0-beta.1 // indirect
|
||||
github.com/sagernet/sing-shadowtls v0.2.0 // indirect
|
||||
github.com/sagernet/sing-tun v0.6.1 // indirect
|
||||
github.com/sagernet/sing-vmess v0.2.0 // indirect
|
||||
github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7 // indirect
|
||||
github.com/sagernet/tailscale v1.79.0-mod.1 // indirect
|
||||
github.com/sagernet/utls v1.6.7 // indirect
|
||||
github.com/sagernet/wireguard-go v0.0.1-beta.5 // indirect
|
||||
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854 // indirect
|
||||
@@ -220,10 +248,10 @@ require (
|
||||
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30 // indirect
|
||||
github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 // indirect
|
||||
github.com/selectel/domains-go v1.1.0 // indirect
|
||||
github.com/selectel/go-selvpcclient/v3 v3.1.1 // indirect
|
||||
github.com/selectel/go-selvpcclient/v3 v3.2.1 // indirect
|
||||
github.com/shopspring/decimal v1.3.1 // indirect
|
||||
github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9 // indirect
|
||||
github.com/softlayer/softlayer-go v1.1.5 // indirect
|
||||
github.com/softlayer/softlayer-go v1.1.7 // indirect
|
||||
github.com/softlayer/xmlrpc v0.0.0-20200409220501-5f089df7cb7e // indirect
|
||||
github.com/sony/gobreaker v0.5.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||
@@ -233,58 +261,73 @@ require (
|
||||
github.com/stretchr/objx v0.5.2 // indirect
|
||||
github.com/stretchr/testify v1.10.0 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1002 // indirect
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1002 // indirect
|
||||
github.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e // indirect
|
||||
github.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 // indirect
|
||||
github.com/tailscale/golang-x-crypto v0.0.0-20240604161659-3fde5e568aa4 // indirect
|
||||
github.com/tailscale/goupnp v1.0.1-0.20210804011211-c64d0f06ea05 // indirect
|
||||
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a // indirect
|
||||
github.com/tailscale/netlink v1.1.1-0.20240822203006-4d49adab4de7 // indirect
|
||||
github.com/tailscale/peercred v0.0.0-20240214030740-b535050b2aa4 // indirect
|
||||
github.com/tailscale/web-client-prebuilt v0.0.0-20240226180453-5db17b287bf1 // indirect
|
||||
github.com/tcnksm/go-httpstat v0.2.0 // indirect
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1065 // indirect
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.1065 // indirect
|
||||
github.com/tjfoc/gmsm v1.4.1 // indirect
|
||||
github.com/transip/gotransip/v6 v6.26.0 // indirect
|
||||
github.com/txthinking/runnergroup v0.0.0-20210608031112-152c7c4432bf // indirect
|
||||
github.com/txthinking/socks5 v0.0.0-20230325130024-4230056ae301 // indirect
|
||||
github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923 // indirect
|
||||
github.com/ultradns/ultradns-go-sdk v1.7.0-20240913052650-970ca9a // indirect
|
||||
github.com/u-root/uio v0.0.0-20240118234441-a3c409a6018e // indirect
|
||||
github.com/ultradns/ultradns-go-sdk v1.8.0-20241010134910-243eeec // indirect
|
||||
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e // indirect
|
||||
github.com/vinyldns/go-vinyldns v0.9.16 // indirect
|
||||
github.com/vishvananda/netlink v1.3.0 // indirect
|
||||
github.com/vishvananda/netns v0.0.4 // indirect
|
||||
github.com/volcengine/volc-sdk-golang v1.0.177 // indirect
|
||||
github.com/volcengine/volc-sdk-golang v1.0.189 // indirect
|
||||
github.com/vultr/govultr/v3 v3.9.1 // indirect
|
||||
github.com/wyx2685/sing-vmess v0.0.0-20241213093025-7de21a950272 // indirect
|
||||
github.com/wyx2685/sing-vmess v0.0.0-20250208043059-9bd6d628dc1c // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
github.com/xtls/reality v0.0.0-20240909153216-e26ae2305463 // indirect
|
||||
github.com/yandex-cloud/go-genproto v0.0.0-20240911120709-1fa0cb6f47c2 // indirect
|
||||
github.com/yandex-cloud/go-sdk v0.0.0-20240911121212-e4e74d0d02f5 // indirect
|
||||
github.com/zeebo/blake3 v0.2.3 // indirect
|
||||
github.com/yandex-cloud/go-genproto v0.0.0-20241220122821-aeb3b05efd1c // indirect
|
||||
github.com/yandex-cloud/go-sdk v0.0.0-20241220131134-2393e243c134 // indirect
|
||||
github.com/zeebo/blake3 v0.2.4 // indirect
|
||||
go.mongodb.org/mongo-driver v1.12.0 // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
|
||||
go.opentelemetry.io/otel v1.29.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.29.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.29.0 // indirect
|
||||
go.uber.org/mock v0.4.0 // indirect
|
||||
go.opentelemetry.io/otel v1.34.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.34.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.34.0 // indirect
|
||||
go.uber.org/atomic v1.10.0 // indirect
|
||||
go.uber.org/mock v0.5.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/ratelimit v0.3.0 // indirect
|
||||
go.uber.org/zap/exp v0.3.0 // indirect
|
||||
go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect
|
||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
|
||||
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
|
||||
golang.org/x/mod v0.21.0 // indirect
|
||||
golang.org/x/net v0.32.0 // indirect
|
||||
golang.org/x/oauth2 v0.23.0 // indirect
|
||||
golang.org/x/sync v0.10.0 // indirect
|
||||
golang.org/x/text v0.21.0 // indirect
|
||||
golang.org/x/time v0.7.0 // indirect
|
||||
golang.org/x/tools v0.25.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect
|
||||
golang.org/x/mod v0.23.0 // indirect
|
||||
golang.org/x/net v0.38.0 // indirect
|
||||
golang.org/x/oauth2 v0.25.0 // indirect
|
||||
golang.org/x/sync v0.12.0 // indirect
|
||||
golang.org/x/term v0.30.0 // indirect
|
||||
golang.org/x/text v0.23.0 // indirect
|
||||
golang.org/x/time v0.8.0 // indirect
|
||||
golang.org/x/tools v0.30.0 // indirect
|
||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
|
||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 // indirect
|
||||
google.golang.org/api v0.197.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
|
||||
google.golang.org/grpc v1.67.1 // indirect
|
||||
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
|
||||
google.golang.org/api v0.214.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20241021214115-324edc3d5d38 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
|
||||
google.golang.org/grpc v1.71.0 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/ns1/ns1-go.v2 v2.12.0 // indirect
|
||||
gopkg.in/ns1/ns1-go.v2 v2.13.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489 // indirect
|
||||
lukechampine.com/blake3 v1.3.0 // indirect
|
||||
gvisor.dev/gvisor v0.0.0-20240320123526-dc6abceb7ff0 // indirect
|
||||
lukechampine.com/blake3 v1.4.0 // indirect
|
||||
)
|
||||
|
||||
//replace github.com/sagernet/sing-box v1.10.4 => /root/sing-box_mod
|
||||
//replace github.com/sagernet/sing-box v1.12.0 => ./sing-box_mod
|
||||
|
||||
replace github.com/sagernet/sing-box v1.10.4 => github.com/wyx2685/sing-box_mod v0.0.0-20241213112838-c7faac61b3fe
|
||||
replace github.com/sagernet/sing-box v1.12.0 => github.com/wyx2685/sing-box_mod v1.12.0-test.0.20250308224353-2190e88e821f
|
||||
|
||||
@@ -37,7 +37,7 @@ type Limiter struct {
|
||||
ProtocolRules []string
|
||||
SpeedLimit int
|
||||
UserOnlineIP *sync.Map // Key: Name, value: {Key: Ip, value: Uid}
|
||||
OldUserOnline *sync.Map // Key: Ip, value: Uid
|
||||
OldUserOnline *sync.Map // Key: Ip, value: Uid
|
||||
UUIDtoUID map[string]int // Key: UUID, value: Uid
|
||||
UserLimitInfo *sync.Map // Key: Uid value: UserLimitInfo
|
||||
ConnLimiter *ConnLimiter // Key: Uid value: ConnLimiter
|
||||
@@ -164,6 +164,8 @@ func (l *Limiter) CheckLimit(taguuid string, ip string, isTcp bool, noSSUDP bool
|
||||
} else {
|
||||
userLimit = determineSpeedLimit(u.SpeedLimit, u.DynamicSpeedLimit)
|
||||
}
|
||||
} else {
|
||||
return nil, true
|
||||
}
|
||||
if noSSUDP {
|
||||
// Store online user for device limit
|
||||
@@ -181,8 +183,8 @@ func (l *Limiter) CheckLimit(taguuid string, ip string, isTcp bool, noSSUDP bool
|
||||
return nil, true
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if v, ok := l.OldUserOnline.Load(ip); ok{
|
||||
}
|
||||
} else if v, ok := l.OldUserOnline.Load(ip); ok {
|
||||
if v.(int) == uid {
|
||||
l.OldUserOnline.Delete(ip)
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ func (c *Controller) nodeInfoMonitor() (err error) {
|
||||
log.WithFields(log.Fields{
|
||||
"tag": c.tag,
|
||||
"err": err,
|
||||
}).Error("Delete node failed")
|
||||
}).Panic("Delete node failed")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ func (c *Controller) nodeInfoMonitor() (err error) {
|
||||
log.WithFields(log.Fields{
|
||||
"tag": c.tag,
|
||||
"err": err,
|
||||
}).Error("Add node failed")
|
||||
}).Panic("Add node failed")
|
||||
return nil
|
||||
}
|
||||
_, err = c.server.AddUsers(&vCore.AddUsersParams{
|
||||
@@ -178,7 +178,7 @@ func (c *Controller) nodeInfoMonitor() (err error) {
|
||||
deleted, added := compareUserList(c.userList, newU)
|
||||
if len(deleted) > 0 {
|
||||
// have deleted users
|
||||
err = c.server.DelUsers(deleted, c.tag)
|
||||
err = c.server.DelUsers(deleted, c.tag, c.info)
|
||||
if err != nil {
|
||||
log.WithFields(log.Fields{
|
||||
"tag": c.tag,
|
||||
|
||||
Reference in New Issue
Block a user