This commit is contained in:
Yuzuki616 2023-07-29 19:27:15 +08:00
parent 78ee16a505
commit ddafdf79b8
56 changed files with 129 additions and 119 deletions

View File

@ -126,13 +126,13 @@ jobs:
run: | run: |
echo "version: $version" echo "version: $version"
mkdir -p build_assets mkdir -p build_assets
go build -v -o build_assets/V2bX -tags "xray hy" -trimpath -ldflags "-X 'github.com/Yuzuki616/V2bX/cmd.version=$version' -s -w -buildid=" go build -v -o build_assets/V2bX -tags "xray hy" -trimpath -ldflags "-X 'github.com/InazumaV/V2bX/cmd.version=$version' -s -w -buildid="
- name: Build Mips softfloat V2bX - name: Build Mips softfloat V2bX
if: matrix.goarch == 'mips' || matrix.goarch == 'mipsle' if: matrix.goarch == 'mips' || matrix.goarch == 'mipsle'
run: | run: |
echo "version: $version" echo "version: $version"
GOMIPS=softfloat go build -v -o build_assets/V2bX_softfloat -tags "xray hy" -trimpath -ldflags "-X 'github.com/Yuzuki616/V2bX/cmd.version=$version' -s -w -buildid=" GOMIPS=softfloat go build -v -o build_assets/V2bX_softfloat -tags "xray hy" -trimpath -ldflags "-X 'github.com/InazumaV/V2bX/cmd.version=$version' -s -w -buildid="
- name: Rename Windows V2bX - name: Rename Windows V2bX
if: matrix.goos == 'windows' if: matrix.goos == 'windows'
run: | run: |

View File

@ -50,7 +50,7 @@ A V2board node server based on multi core, modified from XrayR.
### 一键安装 ### 一键安装
``` ```
wget -N https://raw.githubusercontents.com/Yuzuki616/V2bX-script/master/install.sh && bash install.sh wget -N https://raw.githubusercontents.com/InazumaV/V2bX-script/master/install.sh && bash install.sh
``` ```
### 手动安装 ### 手动安装
@ -85,4 +85,4 @@ go build -o V2bX -ldflags '-s -w' -gcflags="all=-trimpath=${PWD}" -asmflags="all
## Stars 增长记录 ## Stars 增长记录
[![Stargazers over time](https://starchart.cc/Yuzuki616/V2bX.svg)](https://starchart.cc/Yuzuki616/V2bX) [![Stargazers over time](https://starchart.cc/InazumaV/V2bX.svg)](https://starchart.cc/InazumaV/V2bX)

View File

@ -1,7 +1,7 @@
package iprecoder package iprecoder
import ( import (
"github.com/Yuzuki616/V2bX/limiter" "github.com/InazumaV/V2bX/limiter"
) )
type IpRecorder interface { type IpRecorder interface {

View File

@ -2,11 +2,12 @@ package iprecoder
import ( import (
"errors" "errors"
"github.com/Yuzuki616/V2bX/conf" "time"
"github.com/Yuzuki616/V2bX/limiter"
"github.com/InazumaV/V2bX/conf"
"github.com/InazumaV/V2bX/limiter"
"github.com/go-resty/resty/v2" "github.com/go-resty/resty/v2"
"github.com/goccy/go-json" "github.com/goccy/go-json"
"time"
) )
type Recorder struct { type Recorder struct {

View File

@ -3,11 +3,12 @@ package iprecoder
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/conf"
"github.com/Yuzuki616/V2bX/limiter"
"github.com/go-redis/redis/v8"
"strconv" "strconv"
"time" "time"
"github.com/InazumaV/V2bX/conf"
"github.com/InazumaV/V2bX/limiter"
"github.com/go-redis/redis/v8"
) )
type Redis struct { type Redis struct {

View File

@ -1,10 +1,11 @@
package iprecoder package iprecoder
import ( import (
"github.com/Yuzuki616/V2bX/conf"
"github.com/Yuzuki616/V2bX/limiter"
"log" "log"
"testing" "testing"
"github.com/InazumaV/V2bX/conf"
"github.com/InazumaV/V2bX/limiter"
) )
func TestRedis_SyncOnlineIp(t *testing.T) { func TestRedis_SyncOnlineIp(t *testing.T) {

View File

@ -10,7 +10,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/Yuzuki616/V2bX/common/crypt" "github.com/InazumaV/V2bX/common/crypt"
"github.com/goccy/go-json" "github.com/goccy/go-json"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
coreConf "github.com/xtls/xray-core/infra/conf" coreConf "github.com/xtls/xray-core/infra/conf"

View File

@ -4,7 +4,7 @@ import (
"log" "log"
"testing" "testing"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
) )
var client *Client var client *Client

View File

@ -10,7 +10,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
"github.com/go-resty/resty/v2" "github.com/go-resty/resty/v2"
) )

View File

@ -2,9 +2,10 @@ package cmd
import ( import (
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/common/exec"
"github.com/spf13/cobra"
"time" "time"
"github.com/InazumaV/V2bX/common/exec"
"github.com/spf13/cobra"
) )
var ( var (

View File

@ -3,7 +3,7 @@ package cmd
import ( import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
_ "github.com/Yuzuki616/V2bX/core/imports" _ "github.com/InazumaV/V2bX/core/imports"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -2,8 +2,9 @@ package cmd
import ( import (
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/common/exec"
"strings" "strings"
"github.com/InazumaV/V2bX/common/exec"
) )
const ( const (

View File

@ -2,10 +2,11 @@ package cmd
import ( import (
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/common/exec"
"github.com/spf13/cobra"
"os" "os"
"strings" "strings"
"github.com/InazumaV/V2bX/common/exec"
"github.com/spf13/cobra"
) )
var targetVersion string var targetVersion string
@ -16,7 +17,7 @@ var (
Short: "Update V2bX version", Short: "Update V2bX version",
Run: func(_ *cobra.Command, _ []string) { Run: func(_ *cobra.Command, _ []string) {
exec.RunCommandStd("bash", exec.RunCommandStd("bash",
"<(curl -Ls https://raw.githubusercontents.com/Yuzuki616/V2bX-script/master/install.sh)", "<(curl -Ls https://raw.githubusercontents.com/InazumaV/V2bX-script/master/install.sh)",
targetVersion) targetVersion)
}, },
Args: cobra.NoArgs, Args: cobra.NoArgs,

View File

@ -1,17 +1,18 @@
package cmd package cmd
import ( import (
log "github.com/sirupsen/logrus"
"os" "os"
"os/signal" "os/signal"
"runtime" "runtime"
"syscall" "syscall"
vCore "github.com/Yuzuki616/V2bX/core" log "github.com/sirupsen/logrus"
"github.com/Yuzuki616/V2bX/conf" vCore "github.com/InazumaV/V2bX/core"
"github.com/Yuzuki616/V2bX/limiter"
"github.com/Yuzuki616/V2bX/node" "github.com/InazumaV/V2bX/conf"
"github.com/InazumaV/V2bX/limiter"
"github.com/InazumaV/V2bX/node"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -3,7 +3,7 @@ package cmd
import ( import (
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/common/systime" "github.com/InazumaV/V2bX/common/systime"
"github.com/beevik/ntp" "github.com/beevik/ntp"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"strings" "strings"
vCore "github.com/Yuzuki616/V2bX/core" vCore "github.com/InazumaV/V2bX/core"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -6,7 +6,7 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/Yuzuki616/V2bX/common/crypt" "github.com/InazumaV/V2bX/common/crypt"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"golang.org/x/crypto/curve25519" "golang.org/x/crypto/curve25519"

View File

@ -4,7 +4,7 @@ import (
"errors" "errors"
"strings" "strings"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
) )
var ( var (

View File

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"sync" "sync"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
vCore "github.com/Yuzuki616/V2bX/core" vCore "github.com/InazumaV/V2bX/core"
"github.com/hashicorp/go-multierror" "github.com/hashicorp/go-multierror"
) )

View File

@ -4,9 +4,9 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
"github.com/Yuzuki616/V2bX/limiter" "github.com/InazumaV/V2bX/limiter"
) )
func (h *Hy) AddNode(tag string, info *panel.NodeInfo, c *conf.Options) error { func (h *Hy) AddNode(tag string, info *panel.NodeInfo, c *conf.Options) error {

View File

@ -9,11 +9,11 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/Yuzuki616/V2bX/common/counter" "github.com/InazumaV/V2bX/common/counter"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
"github.com/Yuzuki616/V2bX/limiter" "github.com/InazumaV/V2bX/limiter"
"github.com/Yuzuki616/hysteria/core/sockopt" "github.com/Yuzuki616/hysteria/core/sockopt"
"github.com/Yuzuki616/quic-go" "github.com/Yuzuki616/quic-go"

View File

@ -6,9 +6,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
"github.com/Yuzuki616/V2bX/limiter" "github.com/InazumaV/V2bX/limiter"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )

View File

@ -4,8 +4,8 @@ import (
"encoding/base64" "encoding/base64"
"errors" "errors"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/core" "github.com/InazumaV/V2bX/core"
) )
func (h *Hy) AddUsers(p *core.AddUsersParams) (int, error) { func (h *Hy) AddUsers(p *core.AddUsersParams) (int, error) {

View File

@ -3,4 +3,4 @@
package imports package imports
// not yet tested // not yet tested
import _ "github.com/Yuzuki616/V2bX/core/hy" import _ "github.com/InazumaV/V2bX/core/hy"

View File

@ -2,4 +2,4 @@
package imports package imports
import _ "github.com/Yuzuki616/V2bX/core/sing" import _ "github.com/InazumaV/V2bX/core/sing"

View File

@ -2,4 +2,4 @@
package imports package imports
import _ "github.com/Yuzuki616/V2bX/core/xray" import _ "github.com/InazumaV/V2bX/core/xray"

View File

@ -1,8 +1,8 @@
package core package core
import ( import (
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
) )
type AddUsersParams struct { type AddUsersParams struct {

View File

@ -4,8 +4,8 @@ import (
"errors" "errors"
"sync" "sync"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
"github.com/hashicorp/go-multierror" "github.com/hashicorp/go-multierror"
) )

View File

@ -5,11 +5,11 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/Yuzuki616/V2bX/common/rate" "github.com/InazumaV/V2bX/common/rate"
"github.com/Yuzuki616/V2bX/limiter" "github.com/InazumaV/V2bX/limiter"
"github.com/Yuzuki616/V2bX/common/counter" "github.com/InazumaV/V2bX/common/counter"
"github.com/inazumav/sing-box/adapter" "github.com/inazumav/sing-box/adapter"
"github.com/inazumav/sing-box/log" "github.com/inazumav/sing-box/log"
N "github.com/sagernet/sing/common/network" N "github.com/sagernet/sing/common/network"

View File

@ -14,8 +14,8 @@ import (
"github.com/inazumav/sing-box/inbound" "github.com/inazumav/sing-box/inbound"
F "github.com/sagernet/sing/common/format" F "github.com/sagernet/sing/common/format"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
"github.com/goccy/go-json" "github.com/goccy/go-json"
"github.com/inazumav/sing-box/option" "github.com/inazumav/sing-box/option"
) )

View File

@ -8,8 +8,8 @@ import (
"runtime/debug" "runtime/debug"
"time" "time"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
vCore "github.com/Yuzuki616/V2bX/core" vCore "github.com/InazumaV/V2bX/core"
"github.com/inazumav/sing-box/adapter" "github.com/inazumav/sing-box/adapter"
"github.com/inazumav/sing-box/inbound" "github.com/inazumav/sing-box/inbound"

View File

@ -3,9 +3,9 @@ package sing
import ( import (
"errors" "errors"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/common/counter" "github.com/InazumaV/V2bX/common/counter"
"github.com/Yuzuki616/V2bX/core" "github.com/InazumaV/V2bX/core"
"github.com/inazumav/sing-box/inbound" "github.com/inazumav/sing-box/inbound"
"github.com/inazumav/sing-box/option" "github.com/inazumav/sing-box/option"
) )

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2bx.core.app.dispatcher; package v2bx.core.app.dispatcher;
option csharp_namespace = "V2bX.core.app.dispatcher"; option csharp_namespace = "V2bX.core.app.dispatcher";
option go_package = "github.com/Yuzuki616/V2bX/core/xray/app/dispatcher"; option go_package = "github.com/InazumaV/V2bX/core/xray/app/dispatcher";
option java_package = "com.v2bx.core.app.dispatcher"; option java_package = "com.v2bx.core.app.dispatcher";
option java_multiple_files = true; option java_multiple_files = true;

View File

@ -9,8 +9,8 @@ import (
"sync" "sync"
"time" "time"
"github.com/Yuzuki616/V2bX/common/rate" "github.com/InazumaV/V2bX/common/rate"
"github.com/Yuzuki616/V2bX/limiter" "github.com/InazumaV/V2bX/limiter"
routingSession "github.com/xtls/xray-core/features/routing/session" routingSession "github.com/xtls/xray-core/features/routing/session"
"github.com/xtls/xray-core/common" "github.com/xtls/xray-core/common"

View File

@ -8,8 +8,8 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
"github.com/goccy/go-json" "github.com/goccy/go-json"
"github.com/xtls/xray-core/common/net" "github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/core" "github.com/xtls/xray-core/core"

View File

@ -4,8 +4,8 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
"github.com/xtls/xray-core/core" "github.com/xtls/xray-core/core"
"github.com/xtls/xray-core/features/inbound" "github.com/xtls/xray-core/features/inbound"
"github.com/xtls/xray-core/features/outbound" "github.com/xtls/xray-core/features/outbound"

View File

@ -3,7 +3,7 @@ package xray
import ( import (
"fmt" "fmt"
conf2 "github.com/Yuzuki616/V2bX/conf" conf2 "github.com/InazumaV/V2bX/conf"
"github.com/goccy/go-json" "github.com/goccy/go-json"
"github.com/xtls/xray-core/common/net" "github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/core" "github.com/xtls/xray-core/core"

View File

@ -4,8 +4,8 @@ import (
"encoding/base64" "encoding/base64"
"strings" "strings"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/common/format" "github.com/InazumaV/V2bX/common/format"
"github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/protocol"
"github.com/xtls/xray-core/common/serial" "github.com/xtls/xray-core/common/serial"
"github.com/xtls/xray-core/proxy/shadowsocks" "github.com/xtls/xray-core/proxy/shadowsocks"

View File

@ -1,8 +1,8 @@
package xray package xray
import ( import (
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/common/format" "github.com/InazumaV/V2bX/common/format"
"github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/protocol"
"github.com/xtls/xray-core/common/serial" "github.com/xtls/xray-core/common/serial"
"github.com/xtls/xray-core/proxy/trojan" "github.com/xtls/xray-core/proxy/trojan"

View File

@ -4,9 +4,9 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/common/format" "github.com/InazumaV/V2bX/common/format"
vCore "github.com/Yuzuki616/V2bX/core" vCore "github.com/InazumaV/V2bX/core"
"github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/protocol"
"github.com/xtls/xray-core/proxy" "github.com/xtls/xray-core/proxy"
) )

View File

@ -1,8 +1,8 @@
package xray package xray
import ( import (
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/common/format" "github.com/InazumaV/V2bX/common/format"
"github.com/xtls/xray-core/common/protocol" "github.com/xtls/xray-core/common/protocol"
"github.com/xtls/xray-core/common/serial" "github.com/xtls/xray-core/common/serial"
"github.com/xtls/xray-core/infra/conf" "github.com/xtls/xray-core/infra/conf"

View File

@ -4,10 +4,10 @@ import (
"os" "os"
"sync" "sync"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
vCore "github.com/Yuzuki616/V2bX/core" vCore "github.com/InazumaV/V2bX/core"
"github.com/Yuzuki616/V2bX/core/xray/app/dispatcher" "github.com/InazumaV/V2bX/core/xray/app/dispatcher"
_ "github.com/Yuzuki616/V2bX/core/xray/distro/all" _ "github.com/InazumaV/V2bX/core/xray/distro/all"
"github.com/goccy/go-json" "github.com/goccy/go-json"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/xtls/xray-core/app/proxyman" "github.com/xtls/xray-core/app/proxyman"

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/Yuzuki616/V2bX module github.com/InazumaV/V2bX
go 1.19 go 1.19

4
go.sum
View File

@ -204,8 +204,8 @@ github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344/go.mod h1:GIjDIg/heH
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY=
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-acme/lego/v4 v4.13.3 h1:aZ1S9FXIkCWG3Uw/rZKSD+MOuO8ZB1t6p9VCg6jJiNY= github.com/go-acme/lego/v4 v4.13.2 h1:liIHWM9Wr3bmQ5s8UukfPhC4HOOaue9jRkUyrd8Dk7Y=
github.com/go-acme/lego/v4 v4.13.3/go.mod h1:c/iodVGMeBXG/+KiQczoNkySo3YLWTVa0kiyeVd/FHc= github.com/go-acme/lego/v4 v4.13.2/go.mod h1:c/iodVGMeBXG/+KiQczoNkySo3YLWTVa0kiyeVd/FHc=
github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs=
github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk=
github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=

View File

@ -1,9 +1,10 @@
package limiter package limiter
import ( import (
"github.com/Yuzuki616/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/common/format"
"time" "time"
"github.com/InazumaV/V2bX/api/panel"
"github.com/InazumaV/V2bX/common/format"
) )
func (l *Limiter) AddDynamicSpeedLimit(tag string, userInfo *panel.UserInfo, limitNum int, expire int64) error { func (l *Limiter) AddDynamicSpeedLimit(tag string, userInfo *panel.UserInfo, limitNum int, expire int64) error {

View File

@ -6,9 +6,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/common/format" "github.com/InazumaV/V2bX/common/format"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
"github.com/juju/ratelimit" "github.com/juju/ratelimit"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/xtls/xray-core/common/task" "github.com/xtls/xray-core/common/task"

View File

@ -3,7 +3,7 @@ package limiter
import ( import (
"regexp" "regexp"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
) )
func (l *Limiter) CheckDomainRule(destination string) (reject bool) { func (l *Limiter) CheckDomainRule(destination string) (reject bool) {

View File

@ -1,6 +1,6 @@
package main package main
import "github.com/Yuzuki616/V2bX/cmd" import "github.com/InazumaV/V2bX/cmd"
func main() { func main() {
cmd.Run() cmd.Run()

View File

@ -3,8 +3,8 @@ package node
import ( import (
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/common/file" "github.com/InazumaV/V2bX/common/file"
"github.com/Yuzuki616/V2bX/node/lego" "github.com/InazumaV/V2bX/node/lego"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )

View File

@ -4,12 +4,12 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/api/iprecoder" "github.com/InazumaV/V2bX/api/iprecoder"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/common/task" "github.com/InazumaV/V2bX/common/task"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
vCore "github.com/Yuzuki616/V2bX/core" vCore "github.com/InazumaV/V2bX/core"
"github.com/Yuzuki616/V2bX/limiter" "github.com/InazumaV/V2bX/limiter"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -88,7 +88,6 @@ func (c *Controller) Start() error {
log.WithField("tag", c.tag).Infof("Added %d new users", added) log.WithField("tag", c.tag).Infof("Added %d new users", added)
c.info = node c.info = node
c.startTasks(node) c.startTasks(node)
c.info = node
return nil return nil
} }

View File

@ -2,12 +2,13 @@ package lego
import ( import (
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/common/file"
"github.com/Yuzuki616/V2bX/conf"
"github.com/go-acme/lego/v4/certcrypto"
"github.com/go-acme/lego/v4/lego"
"os" "os"
"path" "path"
"github.com/InazumaV/V2bX/common/file"
"github.com/InazumaV/V2bX/conf"
"github.com/go-acme/lego/v4/certcrypto"
"github.com/go-acme/lego/v4/lego"
) )
type Lego struct { type Lego struct {

View File

@ -1,10 +1,11 @@
package lego package lego
import ( import (
"github.com/Yuzuki616/V2bX/conf"
"log" "log"
"os" "os"
"testing" "testing"
"github.com/InazumaV/V2bX/conf"
) )
var l *Lego var l *Lego

View File

@ -8,11 +8,12 @@ import (
"crypto/x509" "crypto/x509"
"encoding/pem" "encoding/pem"
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/common/file" "os"
"github.com/InazumaV/V2bX/common/file"
"github.com/go-acme/lego/v4/lego" "github.com/go-acme/lego/v4/lego"
"github.com/go-acme/lego/v4/registration" "github.com/go-acme/lego/v4/registration"
"github.com/goccy/go-json" "github.com/goccy/go-json"
"os"
) )
type User struct { type User struct {

View File

@ -3,9 +3,9 @@ package node
import ( import (
"fmt" "fmt"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/conf" "github.com/InazumaV/V2bX/conf"
vCore "github.com/Yuzuki616/V2bX/core" vCore "github.com/InazumaV/V2bX/core"
) )
type Node struct { type Node struct {

View File

@ -3,10 +3,10 @@ package node
import ( import (
"time" "time"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/common/task" "github.com/InazumaV/V2bX/common/task"
vCore "github.com/Yuzuki616/V2bX/core" vCore "github.com/InazumaV/V2bX/core"
"github.com/Yuzuki616/V2bX/limiter" "github.com/InazumaV/V2bX/limiter"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -68,6 +68,7 @@ func (c *Controller) nodeInfoMonitor() (err error) {
return nil return nil
} }
if newNodeInfo != nil { if newNodeInfo != nil {
c.info = newNodeInfo
// nodeInfo changed // nodeInfo changed
if newUserInfo != nil { if newUserInfo != nil {
c.userList = newUserInfo c.userList = newUserInfo
@ -144,7 +145,6 @@ func (c *Controller) nodeInfoMonitor() (err error) {
_ = c.userReportPeriodic.Start(false) _ = c.userReportPeriodic.Start(false)
} }
log.WithField("tag", c.tag).Infof("Added %d new users", len(c.userList)) log.WithField("tag", c.tag).Infof("Added %d new users", len(c.userList))
c.info = newNodeInfo
// exit // exit
return nil return nil
} }

View File

@ -4,7 +4,7 @@ import (
"runtime" "runtime"
"strconv" "strconv"
"github.com/Yuzuki616/V2bX/api/panel" "github.com/InazumaV/V2bX/api/panel"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )