Merge pull request #1 from InazumaV/master

Sync
This commit is contained in:
Yuzuki 2023-07-29 19:27:51 +08:00 committed by GitHub
commit a18cd2f134
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 128 additions and 117 deletions

View File

@ -126,13 +126,13 @@ jobs:
run: |
echo "version: $version"
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
if: matrix.goarch == 'mips' || matrix.goarch == 'mipsle'
run: |
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
if: matrix.goos == 'windows'
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 增长记录
[![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
import (
"github.com/Yuzuki616/V2bX/limiter"
"github.com/InazumaV/V2bX/limiter"
)
type IpRecorder interface {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,10 +2,11 @@ package cmd
import (
"fmt"
"github.com/Yuzuki616/V2bX/common/exec"
"github.com/spf13/cobra"
"os"
"strings"
"github.com/InazumaV/V2bX/common/exec"
"github.com/spf13/cobra"
)
var targetVersion string
@ -16,7 +17,7 @@ var (
Short: "Update V2bX version",
Run: func(_ *cobra.Command, _ []string) {
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)
},
Args: cobra.NoArgs,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,4 +3,4 @@
package imports
// 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
import _ "github.com/Yuzuki616/V2bX/core/sing"
import _ "github.com/InazumaV/V2bX/core/sing"

View File

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

View File

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

View File

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

View File

@ -5,11 +5,11 @@ import (
"strings"
"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/log"
N "github.com/sagernet/sing/common/network"

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package 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_multiple_files = true;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,10 +4,10 @@ import (
"os"
"sync"
"github.com/Yuzuki616/V2bX/conf"
vCore "github.com/Yuzuki616/V2bX/core"
"github.com/Yuzuki616/V2bX/core/xray/app/dispatcher"
_ "github.com/Yuzuki616/V2bX/core/xray/distro/all"
"github.com/InazumaV/V2bX/conf"
vCore "github.com/InazumaV/V2bX/core"
"github.com/InazumaV/V2bX/core/xray/app/dispatcher"
_ "github.com/InazumaV/V2bX/core/xray/distro/all"
"github.com/goccy/go-json"
log "github.com/sirupsen/logrus"
"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

View File

@ -1,9 +1,10 @@
package limiter
import (
"github.com/Yuzuki616/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/common/format"
"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 {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,12 +2,13 @@ package lego
import (
"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"
"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 {

View File

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

View File

@ -8,11 +8,12 @@ import (
"crypto/x509"
"encoding/pem"
"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/registration"
"github.com/goccy/go-json"
"os"
)
type User struct {

View File

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

View File

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

View File

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