mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 18:08:14 -05:00
complete original config support for sing, fix DelUsers for vless
This commit is contained in:
parent
f6b4c04f43
commit
cb868c7411
@ -3,6 +3,7 @@ package sing
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/goccy/go-json"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
@ -41,6 +42,17 @@ func init() {
|
|||||||
|
|
||||||
func New(c *conf.CoreConfig) (vCore.Core, error) {
|
func New(c *conf.CoreConfig) (vCore.Core, error) {
|
||||||
options := option.Options{}
|
options := option.Options{}
|
||||||
|
if len(c.SingConfig.OriginalPath) != 0 {
|
||||||
|
f, err := os.Open(c.SingConfig.OriginalPath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("open original config error: %s", err)
|
||||||
|
}
|
||||||
|
defer f.Close()
|
||||||
|
err = json.NewDecoder(f).Decode(options)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("decode original config error: %s", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
options.Log = &option.LogOptions{
|
options.Log = &option.LogOptions{
|
||||||
Disabled: c.SingConfig.LogConfig.Disabled,
|
Disabled: c.SingConfig.LogConfig.Disabled,
|
||||||
Level: c.SingConfig.LogConfig.Level,
|
Level: c.SingConfig.LogConfig.Level,
|
||||||
|
@ -98,6 +98,8 @@ func (b *Box) DelUsers(users []panel.UserInfo, tag string) error {
|
|||||||
switch i.Type() {
|
switch i.Type() {
|
||||||
case "vmess":
|
case "vmess":
|
||||||
del = i.(*inbound.VMess)
|
del = i.(*inbound.VMess)
|
||||||
|
case "vless":
|
||||||
|
del = i.(*inbound.VLESS)
|
||||||
case "shadowsocks":
|
case "shadowsocks":
|
||||||
del = i.(*inbound.ShadowsocksMulti)
|
del = i.(*inbound.ShadowsocksMulti)
|
||||||
case "trojan":
|
case "trojan":
|
||||||
|
Loading…
Reference in New Issue
Block a user