Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e3e2d0b18 | |||
| 6d52ad13c5 | |||
| 7c406cfd1c | |||
| c5ccfb6ead | |||
| 5aa5393ada | |||
| 15d171f94e | |||
| 7751c8fce0 | |||
| 9d1ad833f9 | |||
| e6f7354ce7 | |||
| a2c3033f5a | |||
| 03cda07c9d | |||
| fb999b4ee8 | |||
| e3ebfcf721 | |||
| 33071deb53 | |||
| 9b3b8d4540 | |||
| 98bf124078 | |||
| abc73a6525 | |||
| 2276175354 | |||
| 7f24735677 | |||
| 4d1544864d | |||
| 4aadee7ca0 | |||
| 6aba1354d5 | |||
| 63b229143d | |||
| f861950c50 | |||
| 97d1694bfa | |||
| 2d28d9b409 | |||
| 560c41acbe | |||
| e3c33bf649 | |||
| 216db63551 | |||
| 05d8a6bf85 | |||
| 1e6c2b9598 | |||
| f006323f54 |
@@ -14,7 +14,7 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Install dependencies and build frontend
|
||||
|
||||
@@ -37,13 +37,13 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
cache: false
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: '22'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
@@ -26,13 +26,13 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
cache: false
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: '22'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
@@ -110,13 +110,13 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
cache: false
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: '22'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
|
||||
[](https://www.buymeacoffee.com/alireza7)
|
||||
|
||||
- USDT (TRC20): `TYTq73Gj6dJ67qe58JVPD9zpjW2cc9XgVz`
|
||||
<a href="https://nowpayments.io/donation/alireza7" target="_blank" rel="noreferrer noopener">
|
||||
<img src="https://nowpayments.io/images/embeds/donation-button-white.svg" alt="Crypto donation button by NOWPayments">
|
||||
</a>
|
||||
|
||||
## Quick Overview
|
||||
| Features | Enable? |
|
||||
@@ -134,7 +136,7 @@ docker compose up -d
|
||||
mkdir s-ui && cd s-ui
|
||||
docker run -itd \
|
||||
-p 2095:2095 -p 2096:2096 -p 443:443 -p 80:80 \
|
||||
-v $PWD/db/:/usr/local/s-ui/db/ \
|
||||
-v $PWD/db/:/app/db/ \
|
||||
-v $PWD/cert/:/root/cert/ \
|
||||
--name s-ui --restart=unless-stopped \
|
||||
alireza7/s-ui:latest
|
||||
@@ -217,21 +219,6 @@ To run backend (from root folder of repository):
|
||||
- HTTPS for secure access to the web panel and subscription service (self-provided domain + SSL certificate)
|
||||
- Dark/Light theme
|
||||
|
||||
## Recommended OS
|
||||
|
||||
- Ubuntu 22.04+
|
||||
- Debian 12+
|
||||
- CentOS 9+
|
||||
- Fedora 36+
|
||||
- Arch Linux
|
||||
- Parch Linux
|
||||
- Manjaro
|
||||
- Armbian
|
||||
- AlmaLinux 9.5+
|
||||
- Rocky Linux 9.5+
|
||||
- Oracle Linux 8+
|
||||
- OpenSUSE Tubleweed
|
||||
|
||||
## Environment Variables
|
||||
|
||||
<details>
|
||||
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"s-ui/util/common"
|
||||
"strings"
|
||||
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
+11
-6
@@ -2,14 +2,14 @@ package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"s-ui/database"
|
||||
"s-ui/logger"
|
||||
"s-ui/service"
|
||||
"s-ui/util"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
"github.com/alireza0/s-ui/util"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -86,7 +86,11 @@ func (a *ApiService) getData(c *gin.Context) (interface{}, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
subURI, err := a.SettingService.GetFinalSubURI(strings.Split(c.Request.Host, ":")[0])
|
||||
subURI, err := a.SettingService.GetFinalSubURI(getHostname(c))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
trafficAge, err := a.SettingService.GetTrafficAge()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -98,6 +102,7 @@ func (a *ApiService) getData(c *gin.Context) (interface{}, error) {
|
||||
data["endpoints"] = endpoints
|
||||
data["services"] = services
|
||||
data["subURI"] = subURI
|
||||
data["enableTraffic"] = trafficAge > 0
|
||||
data["onlines"] = onlines
|
||||
} else {
|
||||
data["onlines"] = onlines
|
||||
|
||||
+3
-2
@@ -2,10 +2,11 @@ package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"s-ui/logger"
|
||||
"s-ui/util/common"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
+2
-1
@@ -2,7 +2,8 @@ package api
|
||||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"s-ui/database/model"
|
||||
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
+6
-2
@@ -3,9 +3,10 @@ package api
|
||||
import (
|
||||
"net"
|
||||
"net/http"
|
||||
"s-ui/logger"
|
||||
"strings"
|
||||
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -29,8 +30,11 @@ func getRemoteIp(c *gin.Context) string {
|
||||
|
||||
func getHostname(c *gin.Context) string {
|
||||
host := c.Request.Host
|
||||
if colonIndex := strings.LastIndex(host, ":"); colonIndex != -1 {
|
||||
if strings.Contains(host, ":") {
|
||||
host, _, _ = net.SplitHostPort(c.Request.Host)
|
||||
if strings.Contains(host, ":") {
|
||||
host = "[" + host + "]"
|
||||
}
|
||||
}
|
||||
return host
|
||||
}
|
||||
|
||||
+9
-8
@@ -2,14 +2,15 @@ package app
|
||||
|
||||
import (
|
||||
"log"
|
||||
"s-ui/config"
|
||||
"s-ui/core"
|
||||
"s-ui/cronjob"
|
||||
"s-ui/database"
|
||||
"s-ui/logger"
|
||||
"s-ui/service"
|
||||
"s-ui/sub"
|
||||
"s-ui/web"
|
||||
|
||||
"github.com/alireza0/s-ui/config"
|
||||
"github.com/alireza0/s-ui/core"
|
||||
"github.com/alireza0/s-ui/cronjob"
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
"github.com/alireza0/s-ui/sub"
|
||||
"github.com/alireza0/s-ui/web"
|
||||
|
||||
"github.com/op/go-logging"
|
||||
)
|
||||
|
||||
+4
-3
@@ -2,9 +2,10 @@ package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"s-ui/config"
|
||||
"s-ui/database"
|
||||
"s-ui/service"
|
||||
|
||||
"github.com/alireza0/s-ui/config"
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
)
|
||||
|
||||
func resetAdmin() {
|
||||
|
||||
+3
-2
@@ -5,8 +5,9 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime/debug"
|
||||
"s-ui/cmd/migration"
|
||||
"s-ui/config"
|
||||
|
||||
"github.com/alireza0/s-ui/cmd/migration"
|
||||
"github.com/alireza0/s-ui/config"
|
||||
)
|
||||
|
||||
func ParseCmd() {
|
||||
|
||||
@@ -3,9 +3,10 @@ package migration
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"s-ui/database/model"
|
||||
"strings"
|
||||
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@ import (
|
||||
"errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"s-ui/database/model"
|
||||
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -3,10 +3,11 @@ package migration
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/url"
|
||||
"s-ui/database/model"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"s-ui/config"
|
||||
|
||||
"github.com/alireza0/s-ui/config"
|
||||
|
||||
"gorm.io/driver/sqlite"
|
||||
"gorm.io/gorm"
|
||||
|
||||
+4
-3
@@ -4,11 +4,12 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"s-ui/config"
|
||||
"s-ui/database"
|
||||
"s-ui/service"
|
||||
"strings"
|
||||
|
||||
"github.com/alireza0/s-ui/config"
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
|
||||
"github.com/shirou/gopsutil/v4/net"
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.3.3
|
||||
1.3.7
|
||||
+2
-1
@@ -5,9 +5,10 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"s-ui/util/common"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"github.com/sagernet/sing-box/adapter"
|
||||
"github.com/sagernet/sing-box/adapter/endpoint"
|
||||
"github.com/sagernet/sing-box/adapter/inbound"
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"s-ui/logger"
|
||||
"s-ui/util/common"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"github.com/sagernet/sing-box/adapter"
|
||||
"github.com/sagernet/sing-box/option"
|
||||
|
||||
+2
-1
@@ -4,9 +4,10 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
"os"
|
||||
suiLog "s-ui/logger"
|
||||
"time"
|
||||
|
||||
suiLog "github.com/alireza0/s-ui/logger"
|
||||
|
||||
"github.com/sagernet/sing-box/log"
|
||||
"github.com/sagernet/sing/common"
|
||||
F "github.com/sagernet/sing/common/format"
|
||||
|
||||
+2
-1
@@ -2,7 +2,8 @@ package core
|
||||
|
||||
import (
|
||||
"context"
|
||||
"s-ui/logger"
|
||||
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
|
||||
sb "github.com/sagernet/sing-box"
|
||||
"github.com/sagernet/sing-box/adapter"
|
||||
|
||||
@@ -3,10 +3,11 @@ package core
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"s-ui/database/model"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
|
||||
"github.com/sagernet/sing-box/adapter"
|
||||
"github.com/sagernet/sing/common/atomic"
|
||||
"github.com/sagernet/sing/common/bufio"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cronjob
|
||||
|
||||
import (
|
||||
"s-ui/service"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
)
|
||||
|
||||
type CheckCoreJob struct {
|
||||
|
||||
+4
-2
@@ -20,11 +20,13 @@ func (c *CronJob) Start(loc *time.Location, trafficAge int) error {
|
||||
|
||||
go func() {
|
||||
// Start stats job
|
||||
c.cron.AddJob("@every 10s", NewStatsJob())
|
||||
c.cron.AddJob("@every 10s", NewStatsJob(trafficAge > 0))
|
||||
// Start expiry job
|
||||
c.cron.AddJob("@every 1m", NewDepleteJob())
|
||||
// Start deleting old stats
|
||||
c.cron.AddJob("@daily", NewDelStatsJob(trafficAge))
|
||||
if trafficAge > 0 {
|
||||
c.cron.AddJob("@daily", NewDelStatsJob(trafficAge))
|
||||
}
|
||||
// Start core if it is not running
|
||||
c.cron.AddJob("@every 5s", NewCheckCoreJob())
|
||||
}()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package cronjob
|
||||
|
||||
import (
|
||||
"s-ui/logger"
|
||||
"s-ui/service"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
)
|
||||
|
||||
type DelStatsJob struct {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package cronjob
|
||||
|
||||
import (
|
||||
"s-ui/database"
|
||||
"s-ui/logger"
|
||||
"s-ui/service"
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
)
|
||||
|
||||
type DepleteJob struct {
|
||||
|
||||
+8
-5
@@ -1,20 +1,23 @@
|
||||
package cronjob
|
||||
|
||||
import (
|
||||
"s-ui/logger"
|
||||
"s-ui/service"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
)
|
||||
|
||||
type StatsJob struct {
|
||||
service.StatsService
|
||||
enableTraffic bool
|
||||
}
|
||||
|
||||
func NewStatsJob() *StatsJob {
|
||||
return &StatsJob{}
|
||||
func NewStatsJob(saveTraffic bool) *StatsJob {
|
||||
return &StatsJob{
|
||||
enableTraffic: saveTraffic,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *StatsJob) Run() {
|
||||
err := s.StatsService.SaveStats()
|
||||
err := s.StatsService.SaveStats(s.enableTraffic)
|
||||
if err != nil {
|
||||
logger.Warning("Get stats failed: ", err)
|
||||
return
|
||||
|
||||
+6
-5
@@ -8,15 +8,16 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"s-ui/cmd/migration"
|
||||
"s-ui/config"
|
||||
"s-ui/database/model"
|
||||
"s-ui/logger"
|
||||
"s-ui/util/common"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/cmd/migration"
|
||||
"github.com/alireza0/s-ui/config"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"gorm.io/driver/sqlite"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
+3
-2
@@ -4,8 +4,9 @@ import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"path"
|
||||
"s-ui/config"
|
||||
"s-ui/database/model"
|
||||
|
||||
"github.com/alireza0/s-ui/config"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
|
||||
"gorm.io/driver/sqlite"
|
||||
"gorm.io/gorm"
|
||||
|
||||
+1
-1
Submodule frontend updated: 462018335e...2d0e1fd379
@@ -1,22 +1,22 @@
|
||||
module s-ui
|
||||
module github.com/alireza0/s-ui
|
||||
|
||||
go 1.25.0
|
||||
go 1.25.1
|
||||
|
||||
require (
|
||||
github.com/gin-contrib/gzip v1.2.3
|
||||
github.com/gin-contrib/sessions v1.0.4
|
||||
github.com/gin-gonic/gin v1.10.1
|
||||
github.com/gin-gonic/gin v1.11.0
|
||||
github.com/gofrs/uuid/v5 v5.3.2
|
||||
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
|
||||
github.com/robfig/cron/v3 v3.0.1
|
||||
github.com/sagernet/sing v0.7.6-0.20250815070458-d33ece7a184f
|
||||
github.com/sagernet/sing-box v1.12.3
|
||||
github.com/sagernet/sing v0.7.10
|
||||
github.com/sagernet/sing-box v1.12.8
|
||||
github.com/sagernet/sing-dns v0.4.6
|
||||
github.com/shirou/gopsutil/v4 v4.25.7
|
||||
github.com/shirou/gopsutil/v4 v4.25.8
|
||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20241231184526-a9ab2273dd10
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
gorm.io/driver/sqlite v1.6.0
|
||||
gorm.io/gorm v1.30.1
|
||||
gorm.io/gorm v1.31.0
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -27,11 +27,11 @@ require (
|
||||
github.com/andybalholm/brotli v1.1.0 // indirect
|
||||
github.com/anytls/sing-anytls v0.0.8 // indirect
|
||||
github.com/bits-and-blooms/bitset v1.13.0 // indirect
|
||||
github.com/bytedance/sonic v1.13.3 // indirect
|
||||
github.com/bytedance/sonic v1.14.0 // indirect
|
||||
github.com/bytedance/sonic/loader v0.3.0 // indirect
|
||||
github.com/caddyserver/certmagic v0.23.0 // indirect
|
||||
github.com/caddyserver/zerossl v0.1.3 // indirect
|
||||
github.com/cloudwego/base64x v0.1.5 // indirect
|
||||
github.com/cloudwego/base64x v0.1.6 // indirect
|
||||
github.com/coder/websocket v1.8.13 // indirect
|
||||
github.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6 // indirect
|
||||
github.com/cretz/bine v0.2.0 // indirect
|
||||
@@ -53,6 +53,7 @@ require (
|
||||
github.com/gobwas/httphead v0.1.0 // indirect
|
||||
github.com/gobwas/pool v0.2.1 // indirect
|
||||
github.com/goccy/go-json v0.10.5 // indirect
|
||||
github.com/goccy/go-yaml v1.18.0 // indirect
|
||||
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/google/btree v1.1.3 // indirect
|
||||
@@ -72,7 +73,7 @@ require (
|
||||
github.com/jsimonetti/rtnetlink v1.4.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
||||
github.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a // indirect
|
||||
github.com/leodido/go-urn v1.4.0 // indirect
|
||||
github.com/libdns/alidns v1.0.5-libdns.v1.beta1 // indirect
|
||||
@@ -98,6 +99,7 @@ require (
|
||||
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
|
||||
github.com/prometheus-community/pro-bing v0.4.0 // indirect
|
||||
github.com/quic-go/qpack v0.5.1 // indirect
|
||||
github.com/quic-go/quic-go v0.54.0 // indirect
|
||||
github.com/safchain/ethtool v0.3.0 // indirect
|
||||
github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a // indirect
|
||||
github.com/sagernet/cors v1.2.1 // indirect
|
||||
@@ -107,14 +109,14 @@ require (
|
||||
github.com/sagernet/nftables v0.3.0-beta.4 // indirect
|
||||
github.com/sagernet/quic-go v0.52.0-beta.1 // indirect
|
||||
github.com/sagernet/sing-mux v0.3.3 // indirect
|
||||
github.com/sagernet/sing-quic v0.5.0 // indirect
|
||||
github.com/sagernet/sing-quic v0.5.2-0.20250909083218-00a55617c0fb // indirect
|
||||
github.com/sagernet/sing-shadowsocks v0.2.8 // indirect
|
||||
github.com/sagernet/sing-shadowsocks2 v0.2.1 // indirect
|
||||
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11 // indirect
|
||||
github.com/sagernet/sing-tun v0.7.0-beta.1 // indirect
|
||||
github.com/sagernet/sing-tun v0.7.2 // indirect
|
||||
github.com/sagernet/sing-vmess v0.2.7 // indirect
|
||||
github.com/sagernet/smux v1.5.34-mod.2 // indirect
|
||||
github.com/sagernet/tailscale v1.80.3-mod.5 // indirect
|
||||
github.com/sagernet/tailscale v1.80.3-sing-box-1.12-mod.1 // indirect
|
||||
github.com/sagernet/wireguard-go v0.0.1-beta.7 // indirect
|
||||
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854 // indirect
|
||||
github.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e // indirect
|
||||
@@ -134,12 +136,13 @@ require (
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
||||
github.com/zeebo/blake3 v0.2.4 // indirect
|
||||
go.uber.org/mock v0.5.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
go.uber.org/zap v1.27.0 // indirect
|
||||
go.uber.org/zap/exp v0.3.0 // indirect
|
||||
go4.org/mem v0.0.0-20240501181205-ae6ca9944745 // indirect
|
||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
|
||||
golang.org/x/arch v0.19.0 // indirect
|
||||
golang.org/x/arch v0.20.0 // indirect
|
||||
golang.org/x/crypto v0.41.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect
|
||||
golang.org/x/mod v0.27.0 // indirect
|
||||
@@ -154,6 +157,6 @@ require (
|
||||
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
|
||||
google.golang.org/grpc v1.73.0 // indirect
|
||||
google.golang.org/protobuf v1.36.6 // indirect
|
||||
google.golang.org/protobuf v1.36.9 // indirect
|
||||
lukechampine.com/blake3 v1.4.1 // indirect
|
||||
)
|
||||
|
||||
@@ -12,9 +12,8 @@ github.com/anytls/sing-anytls v0.0.8 h1:1u/fnH1HoeeMV5mX7/eUOjLBvPdkd1UJRmXiRi6V
|
||||
github.com/anytls/sing-anytls v0.0.8/go.mod h1:7rjN6IukwysmdusYsrV51Fgu1uW6vsrdd6ctjnEAln8=
|
||||
github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE=
|
||||
github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
|
||||
github.com/bytedance/sonic v1.13.3 h1:MS8gmaH16Gtirygw7jV91pDCN33NyMrPbN7qiYhEsF0=
|
||||
github.com/bytedance/sonic v1.13.3/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
|
||||
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
|
||||
github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=
|
||||
github.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=
|
||||
github.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=
|
||||
github.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
|
||||
github.com/caddyserver/certmagic v0.23.0 h1:CfpZ/50jMfG4+1J/u2LV6piJq4HOfO6ppOnOf7DkFEU=
|
||||
@@ -23,9 +22,8 @@ github.com/caddyserver/zerossl v0.1.3 h1:onS+pxp3M8HnHpN5MMbOMyNjmTheJyWRaZYwn+Y
|
||||
github.com/caddyserver/zerossl v0.1.3/go.mod h1:CxA0acn7oEGO6//4rtrRjYgEoa4MFw/XofZnrYwGqG4=
|
||||
github.com/cilium/ebpf v0.15.0 h1:7NxJhNiBT3NG8pZJ3c+yfrVdHY8ScgKD27sScgjLMMk=
|
||||
github.com/cilium/ebpf v0.15.0/go.mod h1:DHp1WyrLeiBh19Cf/tfiSMhqheEiK8fXFZ4No0P1Hso=
|
||||
github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4=
|
||||
github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
|
||||
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
|
||||
github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=
|
||||
github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=
|
||||
github.com/coder/websocket v1.8.13 h1:f3QZdXy7uGVz+4uCJy2nTZyM0yTBj8yANEHhqlXZ9FE=
|
||||
github.com/coder/websocket v1.8.13/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=
|
||||
github.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6 h1:8h5+bWd7R6AYUslN6c6iuZWTKsKxUFDlpnmilO6R2n0=
|
||||
@@ -56,8 +54,8 @@ github.com/gin-contrib/sessions v1.0.4 h1:ha6CNdpYiTOK/hTp05miJLbpTSNfOnFg5Jm2kb
|
||||
github.com/gin-contrib/sessions v1.0.4/go.mod h1:ccmkrb2z6iU2osiAHZG3x3J4suJK+OU27oqzlWOqQgs=
|
||||
github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=
|
||||
github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM=
|
||||
github.com/gin-gonic/gin v1.10.1 h1:T0ujvqyCSqRopADpgPgiTT63DUQVSfojyME59Ei63pQ=
|
||||
github.com/gin-gonic/gin v1.10.1/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y=
|
||||
github.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=
|
||||
github.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=
|
||||
github.com/github/fakeca v0.1.0 h1:Km/MVOFvclqxPM9dZBC4+QE564nU4gz4iZ0D9pMw28I=
|
||||
github.com/github/fakeca v0.1.0/go.mod h1:+bormgoGMMuamOscx7N91aOuUST7wdaJ2rNjeohylyo=
|
||||
github.com/go-chi/chi/v5 v5.2.2 h1:CMwsvRVTbXVytCk1Wd72Zy1LAsAh9GxMmSNWLHCG618=
|
||||
@@ -87,6 +85,8 @@ github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
|
||||
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
|
||||
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
|
||||
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
|
||||
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 h1:sQspH8M4niEijh3PFscJRLDnkL547IeP7kpPe3uUhEg=
|
||||
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466/go.mod h1:ZiQxhyQ+bbbfxUKVvjfO498oPYvtYhZzycal3G/NHmU=
|
||||
github.com/gofrs/uuid/v5 v5.3.2 h1:2jfO8j3XgSwlz/wHqemAEugfnTlikAYHhnqQ8Xh4fE0=
|
||||
@@ -132,10 +132,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
|
||||
github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
|
||||
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
|
||||
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||
github.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a h1:+RR6SqnTkDLWyICxS1xpjCi/3dhyV+TgZwA6Ww3KncQ=
|
||||
github.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a/go.mod h1:YTtCCM3ryyfiu4F7t8HQ1mxvp1UBdWM2r6Xa+nGWvDk=
|
||||
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
||||
@@ -195,6 +193,8 @@ github.com/prometheus-community/pro-bing v0.4.0 h1:YMbv+i08gQz97OZZBwLyvmmQEEzyf
|
||||
github.com/prometheus-community/pro-bing v0.4.0/go.mod h1:b7wRYZtCcPmt4Sz319BykUU241rWLe1VFXyiyWK/dH4=
|
||||
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
|
||||
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
|
||||
github.com/quic-go/quic-go v0.54.0 h1:6s1YB9QotYI6Ospeiguknbp2Znb/jZYjZLRXn9kMQBg=
|
||||
github.com/quic-go/quic-go v0.54.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=
|
||||
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
|
||||
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
|
||||
github.com/safchain/ethtool v0.3.0 h1:gimQJpsI6sc1yIqP/y8GYgiXn/NjgvpM0RNoWLVVmP0=
|
||||
@@ -214,36 +214,36 @@ github.com/sagernet/nftables v0.3.0-beta.4/go.mod h1:OQXAjvjNGGFxaTgVCSTRIhYB5/l
|
||||
github.com/sagernet/quic-go v0.52.0-beta.1 h1:hWkojLg64zjV+MJOvJU/kOeWndm3tiEfBLx5foisszs=
|
||||
github.com/sagernet/quic-go v0.52.0-beta.1/go.mod h1:OV+V5kEBb8kJS7k29MzDu6oj9GyMc7HA07sE1tedxz4=
|
||||
github.com/sagernet/sing v0.6.9/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
|
||||
github.com/sagernet/sing v0.7.6-0.20250815070458-d33ece7a184f h1:HIBo8l+tsS3wLwuI1E56uRTQw46QytXSUpZTP3vwG/U=
|
||||
github.com/sagernet/sing v0.7.6-0.20250815070458-d33ece7a184f/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
|
||||
github.com/sagernet/sing-box v1.12.3 h1:EWtKXSJ0L8OVHS4Swl8HsakMOwwiEC68AU+pEkcUlQw=
|
||||
github.com/sagernet/sing-box v1.12.3/go.mod h1:spyNZpDcPQIl5VUL/6rnDF7x/SFtQ0u0dybT5hIuU/c=
|
||||
github.com/sagernet/sing v0.7.10 h1:2yPhZFx+EkyHPH8hXNezgyRSHyGY12CboId7CtwLROw=
|
||||
github.com/sagernet/sing v0.7.10/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
|
||||
github.com/sagernet/sing-box v1.12.8 h1:XnDRmD5tT5PsBPvMQ6zmLtbAKD3/l/6mHUfCJYa+L2g=
|
||||
github.com/sagernet/sing-box v1.12.8/go.mod h1:HRB+cgvwOMnoNmVhJm2DoFQPbJvDSRDaLonaMlT4tjo=
|
||||
github.com/sagernet/sing-dns v0.4.6 h1:mjZC0o6d5sQ1sraoOBbK3G3apCbuL8wWYwu2RNu5rbM=
|
||||
github.com/sagernet/sing-dns v0.4.6/go.mod h1:dweQs54ng2YGzoJfz+F9dGuDNdP5pJ3PLeggnK5VWc8=
|
||||
github.com/sagernet/sing-mux v0.3.3 h1:YFgt9plMWzH994BMZLmyKL37PdIVaIilwP0Jg+EcLfw=
|
||||
github.com/sagernet/sing-mux v0.3.3/go.mod h1:pht8iFY4c9Xltj7rhVd208npkNaeCxzyXCgulDPLUDA=
|
||||
github.com/sagernet/sing-quic v0.5.0 h1:jNLIyVk24lFPvu8A4x+ZNEnZdI+Tg1rp7eCJ6v0Csak=
|
||||
github.com/sagernet/sing-quic v0.5.0/go.mod h1:SAv/qdeDN+75msGG5U5ZIwG+3Ua50jVIKNrRSY8pkx0=
|
||||
github.com/sagernet/sing-quic v0.5.2-0.20250909083218-00a55617c0fb h1:5Wx3XeTiKrrrcrAky7Hc1bO3CGxrvho2Vu5b/adlEIM=
|
||||
github.com/sagernet/sing-quic v0.5.2-0.20250909083218-00a55617c0fb/go.mod h1:evP1e++ZG8TJHVV5HudXV4vWeYzGfCdF4HwSJZcdqkI=
|
||||
github.com/sagernet/sing-shadowsocks v0.2.8 h1:PURj5PRoAkqeHh2ZW205RWzN9E9RtKCVCzByXruQWfE=
|
||||
github.com/sagernet/sing-shadowsocks v0.2.8/go.mod h1:lo7TWEMDcN5/h5B8S0ew+r78ZODn6SwVaFhvB6H+PTI=
|
||||
github.com/sagernet/sing-shadowsocks2 v0.2.1 h1:dWV9OXCeFPuYGHb6IRqlSptVnSzOelnqqs2gQ2/Qioo=
|
||||
github.com/sagernet/sing-shadowsocks2 v0.2.1/go.mod h1:RnXS0lExcDAovvDeniJ4IKa2IuChrdipolPYWBv9hWQ=
|
||||
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11 h1:tK+75l64tm9WvEFrYRE1t0YxoFdWQqw/h7Uhzj0vJ+w=
|
||||
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11/go.mod h1:sWqKnGlMipCHaGsw1sTTlimyUpgzP4WP3pjhCsYt9oA=
|
||||
github.com/sagernet/sing-tun v0.7.0-beta.1 h1:mBIFXYAnGO5ey/HcCYanqnBx61E7yF8zTFGRZonGYmY=
|
||||
github.com/sagernet/sing-tun v0.7.0-beta.1/go.mod h1:AHJuRrLbNRJuivuFZ2VhXwDj4ViYp14szG5EkkKAqRQ=
|
||||
github.com/sagernet/sing-tun v0.7.2 h1:uJkAZM0KBqIYzrq077QGqdvj/+4i/pMOx6Pnx0jYqAs=
|
||||
github.com/sagernet/sing-tun v0.7.2/go.mod h1:pUEjh9YHQ2gJT6Lk0TYDklh3WJy7lz+848vleGM3JPM=
|
||||
github.com/sagernet/sing-vmess v0.2.7 h1:2ee+9kO0xW5P4mfe6TYVWf9VtY8k1JhNysBqsiYj0sk=
|
||||
github.com/sagernet/sing-vmess v0.2.7/go.mod h1:5aYoOtYksAyS0NXDm0qKeTYW1yoE1bJVcv+XLcVoyJs=
|
||||
github.com/sagernet/smux v1.5.34-mod.2 h1:gkmBjIjlJ2zQKpLigOkFur5kBKdV6bNRoFu2WkltRQ4=
|
||||
github.com/sagernet/smux v1.5.34-mod.2/go.mod h1:0KW0+R+ycvA2INW4gbsd7BNyg+HEfLIAxa5N02/28Zc=
|
||||
github.com/sagernet/tailscale v1.80.3-mod.5 h1:7V7z+p2C//TGtff20pPnDCt3qP6uFyY62peJoKF9z/A=
|
||||
github.com/sagernet/tailscale v1.80.3-mod.5/go.mod h1:EBxXsWu4OH2ELbQLq32WoBeIubG8KgDrg4/Oaxjs6lI=
|
||||
github.com/sagernet/tailscale v1.80.3-sing-box-1.12-mod.1 h1:gMC0q+0VvZBotZMZ9G0R8ZMEIT/Q6KnXbw0/OgMjmdk=
|
||||
github.com/sagernet/tailscale v1.80.3-sing-box-1.12-mod.1/go.mod h1:EBxXsWu4OH2ELbQLq32WoBeIubG8KgDrg4/Oaxjs6lI=
|
||||
github.com/sagernet/wireguard-go v0.0.1-beta.7 h1:ltgBwYHfr+9Wz1eG59NiWnHrYEkDKHG7otNZvu85DXI=
|
||||
github.com/sagernet/wireguard-go v0.0.1-beta.7/go.mod h1:jGXij2Gn2wbrWuYNUmmNhf1dwcZtvyAvQoe8Xd8MbUo=
|
||||
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854 h1:6uUiZcDRnZSAegryaUGwPC/Fj13JSHwiTftrXhMmYOc=
|
||||
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854/go.mod h1:LtfoSK3+NG57tvnVEHgcuBW9ujgE8enPSgzgwStwCAA=
|
||||
github.com/shirou/gopsutil/v4 v4.25.7 h1:bNb2JuqKuAu3tRlPv5piSmBZyMfecwQ+t/ILq+1JqVM=
|
||||
github.com/shirou/gopsutil/v4 v4.25.7/go.mod h1:XV/egmwJtd3ZQjBpJVY5kndsiOO4IRqy9TQnmm6VP7U=
|
||||
github.com/shirou/gopsutil/v4 v4.25.8 h1:NnAsw9lN7587WHxjJA9ryDnqhJpFH6A+wagYWTOH970=
|
||||
github.com/shirou/gopsutil/v4 v4.25.8/go.mod h1:q9QdMmfAOVIw7a+eF86P7ISEU6ka+NLgkUxlopV4RwI=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
@@ -255,8 +255,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e h1:PtWT87weP5LWHEY//SWsYkSO3RWRZo4OSWagh3YD2vQ=
|
||||
github.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e/go.mod h1:XrBNfAFN+pwoWuksbFS9Ccxnopa15zJGgXRFN90l3K4=
|
||||
github.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 h1:Gzfnfk2TWrk8Jj4P4c1a3CtQyMaTVCznlkLZI++hok4=
|
||||
@@ -312,6 +312,8 @@ go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt
|
||||
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=
|
||||
go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||
@@ -322,8 +324,8 @@ go4.org/mem v0.0.0-20240501181205-ae6ca9944745 h1:Tl++JLUCe4sxGu8cTpDzRLd3tN7US4
|
||||
go4.org/mem v0.0.0-20240501181205-ae6ca9944745/go.mod h1:reUoABIJ9ikfM5sgtSF3Wushcza7+WeD01VB9Lirh3g=
|
||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M=
|
||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
|
||||
golang.org/x/arch v0.19.0 h1:LmbDQUodHThXE+htjrnmVD73M//D9GTH6wFZjyDkjyU=
|
||||
golang.org/x/arch v0.19.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
|
||||
golang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=
|
||||
golang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
|
||||
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
|
||||
@@ -374,8 +376,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
|
||||
google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok=
|
||||
google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw=
|
||||
google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
@@ -383,10 +385,9 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gorm.io/driver/sqlite v1.6.0 h1:WHRRrIiulaPiPFmDcod6prc4l2VGVWHz80KspNsxSfQ=
|
||||
gorm.io/driver/sqlite v1.6.0/go.mod h1:AO9V1qIQddBESngQUKWL9yoH93HIeA1X6V633rBwyT8=
|
||||
gorm.io/gorm v1.30.1 h1:lSHg33jJTBxs2mgJRfRZeLDG+WZaHYCk3Wtfl6Ngzo4=
|
||||
gorm.io/gorm v1.30.1/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE=
|
||||
gorm.io/gorm v1.31.0 h1:0VlycGreVhK7RF/Bwt51Fk8v0xLiiiFdbGDPIZQ7mJY=
|
||||
gorm.io/gorm v1.31.0/go.mod h1:XyQVbO2k6YkOis7C2437jSit3SsDK72s7n7rsSHd+Gs=
|
||||
lukechampine.com/blake3 v1.4.1 h1:I3Smz7gso8w4/TunLKec6K2fn+kyKtDxr/xcQEN84Wg=
|
||||
lukechampine.com/blake3 v1.4.1/go.mod h1:QFosUxmjB8mnrWFSNwKmvxHpfY72bmD2tQ0kBMM3kwo=
|
||||
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
|
||||
software.sslmate.com/src/go-pkcs12 v0.4.0 h1:H2g08FrTvSFKUj+D309j1DPfk5APnIdAQAB8aEykJ5k=
|
||||
software.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI=
|
||||
|
||||
-60
@@ -38,66 +38,6 @@ arch() {
|
||||
|
||||
echo "arch: $(arch)"
|
||||
|
||||
os_version=""
|
||||
os_version=$(grep -i version_id /etc/os-release | cut -d \" -f2 | cut -d . -f1)
|
||||
|
||||
if [[ "${release}" == "arch" ]]; then
|
||||
echo "Your OS is Arch Linux"
|
||||
elif [[ "${release}" == "parch" ]]; then
|
||||
echo "Your OS is Parch linux"
|
||||
elif [[ "${release}" == "manjaro" ]]; then
|
||||
echo "Your OS is Manjaro"
|
||||
elif [[ "${release}" == "armbian" ]]; then
|
||||
echo "Your OS is Armbian"
|
||||
elif [[ "${release}" == "opensuse-tumbleweed" ]]; then
|
||||
echo "Your OS is OpenSUSE Tumbleweed"
|
||||
elif [[ "${release}" == "centos" ]]; then
|
||||
if [[ ${os_version} -lt 9 ]]; then
|
||||
echo -e "${red} Please use CentOS 9 or higher ${plain}\n" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "ubuntu" ]]; then
|
||||
if [[ ${os_version} -lt 22 ]]; then
|
||||
echo -e "${red} Please use Ubuntu 22 or higher version!${plain}\n" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "fedora" ]]; then
|
||||
if [[ ${os_version} -lt 36 ]]; then
|
||||
echo -e "${red} Please use Fedora 36 or higher version!${plain}\n" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "debian" ]]; then
|
||||
if [[ ${os_version} -lt 12 ]]; then
|
||||
echo -e "${red} Please use Debian 12 or higher ${plain}\n" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "almalinux" ]]; then
|
||||
if [[ ${os_version} -lt 95 ]]; then
|
||||
echo -e "${red} Please use AlmaLinux 9.5 or higher ${plain}\n" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "rocky" ]]; then
|
||||
if [[ ${os_version} -lt 95 ]]; then
|
||||
echo -e "${red} Please use Rocky Linux 9.5 or higher ${plain}\n" && exit 1
|
||||
fi
|
||||
elif [[ "${release}" == "ol" ]]; then
|
||||
if [[ ${os_version} -lt 8 ]]; then
|
||||
echo -e "${red} Please use Oracle Linux 8 or higher ${plain}\n" && exit 1
|
||||
fi
|
||||
else
|
||||
echo -e "${red}Your operating system is not supported by this script.${plain}\n"
|
||||
echo "Please ensure you are using one of the following supported operating systems:"
|
||||
echo "- Ubuntu 22.04+"
|
||||
echo "- Debian 12+"
|
||||
echo "- CentOS 9+"
|
||||
echo "- Fedora 36+"
|
||||
echo "- Arch Linux"
|
||||
echo "- Parch Linux"
|
||||
echo "- Manjaro"
|
||||
echo "- Armbian"
|
||||
echo "- AlmaLinux 9.5+"
|
||||
echo "- Rocky Linux 9.5+"
|
||||
echo "- Oracle Linux 8+"
|
||||
echo "- OpenSUSE Tumbleweed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
install_base() {
|
||||
case "${release}" in
|
||||
centos | almalinux | rocky | oracle)
|
||||
|
||||
@@ -4,9 +4,10 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"s-ui/app"
|
||||
"s-ui/cmd"
|
||||
"syscall"
|
||||
|
||||
"github.com/alireza0/s-ui/app"
|
||||
"github.com/alireza0/s-ui/cmd"
|
||||
)
|
||||
|
||||
func runApp() {
|
||||
|
||||
+7
-6
@@ -3,14 +3,15 @@ package service
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"s-ui/database"
|
||||
"s-ui/database/model"
|
||||
"s-ui/logger"
|
||||
"s-ui/util"
|
||||
"s-ui/util/common"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/util"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -283,7 +284,7 @@ func (s *ClientService) UpdateLinksByInboundChange(tx *gorm.DB, inbounds *[]mode
|
||||
})
|
||||
}
|
||||
for _, clientLink := range clientLinks {
|
||||
if clientLink["remark"] != inbound.Tag && clientLink["remark"] != oldTag {
|
||||
if clientLink["type"] != "local" || (clientLink["remark"] != inbound.Tag && clientLink["remark"] != oldTag) {
|
||||
newClientLinks = append(newClientLinks, clientLink)
|
||||
}
|
||||
}
|
||||
|
||||
+8
-6
@@ -2,13 +2,14 @@ package service
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"s-ui/core"
|
||||
"s-ui/database"
|
||||
"s-ui/database/model"
|
||||
"s-ui/logger"
|
||||
"s-ui/util/common"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/core"
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -142,7 +143,8 @@ func (s *ConfigService) Save(obj string, act string, data json.RawMessage, initU
|
||||
|
||||
switch obj {
|
||||
case "clients":
|
||||
inboundIds, err := s.ClientService.Save(tx, act, data, hostname)
|
||||
var inboundIds []uint
|
||||
inboundIds, err = s.ClientService.Save(tx, act, data, hostname)
|
||||
if err == nil && len(inboundIds) > 0 {
|
||||
objs = append(objs, "inbounds")
|
||||
err = s.InboundService.RestartInbounds(tx, inboundIds)
|
||||
|
||||
@@ -3,9 +3,10 @@ package service
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"s-ui/database"
|
||||
"s-ui/database/model"
|
||||
"s-ui/util/common"
|
||||
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
+5
-4
@@ -4,12 +4,13 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"s-ui/database"
|
||||
"s-ui/database/model"
|
||||
"s-ui/util"
|
||||
"s-ui/util/common"
|
||||
"strings"
|
||||
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/util"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,9 +3,10 @@ package service
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"s-ui/database"
|
||||
"s-ui/database/model"
|
||||
"s-ui/util/common"
|
||||
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
+2
-1
@@ -3,9 +3,10 @@ package service
|
||||
import (
|
||||
"os"
|
||||
"runtime"
|
||||
"s-ui/logger"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
)
|
||||
|
||||
type PanelService struct {
|
||||
|
||||
+3
-2
@@ -4,12 +4,13 @@ import (
|
||||
"encoding/base64"
|
||||
"os"
|
||||
"runtime"
|
||||
"s-ui/config"
|
||||
"s-ui/logger"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/config"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
|
||||
"github.com/sagernet/sing-box/common/tls"
|
||||
"github.com/shirou/gopsutil/v4/cpu"
|
||||
"github.com/shirou/gopsutil/v4/disk"
|
||||
|
||||
+4
-3
@@ -3,9 +3,10 @@ package service
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"s-ui/database"
|
||||
"s-ui/database/model"
|
||||
"s-ui/util/common"
|
||||
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
+13
-5
@@ -4,15 +4,16 @@ import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"runtime"
|
||||
"s-ui/config"
|
||||
"s-ui/database"
|
||||
"s-ui/database/model"
|
||||
"s-ui/logger"
|
||||
"s-ui/util/common"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/config"
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -391,6 +392,13 @@ func (s *SettingService) Save(tx *gorm.DB, data json.RawMessage) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Delete all stats if it is set to 0
|
||||
if key == "trafficAge" && obj == "0" {
|
||||
err = tx.Where("id > 0").Delete(model.Stats{}).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
err = tx.Model(model.Setting{}).Where("key = ?", key).Update("value", obj).Error
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
+8
-5
@@ -1,10 +1,11 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"s-ui/database"
|
||||
"s-ui/database/model"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -19,7 +20,7 @@ var onlineResources = &onlines{}
|
||||
type StatsService struct {
|
||||
}
|
||||
|
||||
func (s *StatsService) SaveStats() error {
|
||||
func (s *StatsService) SaveStats(enableTraffic bool) error {
|
||||
if !corePtr.IsRunning() {
|
||||
return nil
|
||||
}
|
||||
@@ -70,8 +71,10 @@ func (s *StatsService) SaveStats() error {
|
||||
}
|
||||
}
|
||||
|
||||
err = tx.Create(&stats).Error
|
||||
return err
|
||||
if !enableTraffic {
|
||||
return nil
|
||||
}
|
||||
return tx.Create(&stats).Error
|
||||
}
|
||||
|
||||
func (s *StatsService) GetStats(resource string, tag string, limit int) ([]model.Stats, error) {
|
||||
|
||||
+4
-3
@@ -2,9 +2,10 @@ package service
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"s-ui/database"
|
||||
"s-ui/database/model"
|
||||
"s-ui/util/common"
|
||||
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
+5
-4
@@ -2,11 +2,12 @@ package service
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"s-ui/database"
|
||||
"s-ui/database/model"
|
||||
"s-ui/logger"
|
||||
"s-ui/util/common"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
)
|
||||
|
||||
type UserService struct {
|
||||
|
||||
+4
-3
@@ -8,12 +8,13 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"s-ui/database/model"
|
||||
"s-ui/logger"
|
||||
"s-ui/util/common"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
|
||||
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
||||
)
|
||||
|
||||
|
||||
+24
-5
@@ -1,11 +1,12 @@
|
||||
package sub
|
||||
|
||||
import (
|
||||
"s-ui/logger"
|
||||
"s-ui/service"
|
||||
"s-ui/util"
|
||||
"strings"
|
||||
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
"github.com/alireza0/s-ui/util"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
@@ -73,8 +74,12 @@ func (s *ClashService) GetClash(subId string) (*string, []string, error) {
|
||||
}
|
||||
|
||||
links := s.LinkService.GetLinks(&client.Links, "external", "")
|
||||
tagNumEnable := 0
|
||||
if len(links) > 1 {
|
||||
tagNumEnable = 1
|
||||
}
|
||||
for index, link := range links {
|
||||
json, tag, err := util.GetOutbound(link, index)
|
||||
json, tag, err := util.GetOutbound(link, (index+1)*tagNumEnable)
|
||||
if err == nil && len(tag) > 0 {
|
||||
*outbounds = append(*outbounds, *json)
|
||||
*outTags = append(*outTags, tag)
|
||||
@@ -124,7 +129,11 @@ func (s *ClashService) ConvertToClashMeta(outbounds *[]map[string]interface{}) (
|
||||
case "vmess", "vless", "tuic":
|
||||
proxy["uuid"] = obMap["uuid"]
|
||||
if t == "vmess" {
|
||||
proxy["alterId"] = obMap["alter_id"]
|
||||
if alterId, ok := obMap["alter_id"].(float64); ok {
|
||||
proxy["alterId"] = int(alterId)
|
||||
} else {
|
||||
proxy["alterId"] = 0
|
||||
}
|
||||
proxy["cipher"] = "auto"
|
||||
}
|
||||
if t == "vless" {
|
||||
@@ -184,6 +193,16 @@ func (s *ClashService) ConvertToClashMeta(outbounds *[]map[string]interface{}) (
|
||||
proxy["sni"] = tls["server_name"]
|
||||
proxy["skip-cert-verify"] = tls["insecure"]
|
||||
}
|
||||
case "shadowsocks":
|
||||
proxy["type"] = "ss"
|
||||
proxy["cipher"] = obMap["method"]
|
||||
proxy["password"] = obMap["password"]
|
||||
if network, ok := obMap["network"].(string); ok && network != "tcp" {
|
||||
proxy["udp"] = true
|
||||
}
|
||||
if uot, ok := obMap["udp_over_tcp"].(bool); ok && uot {
|
||||
proxy["udp-over-tcp"] = true
|
||||
}
|
||||
default:
|
||||
continue
|
||||
}
|
||||
|
||||
+10
-5
@@ -3,11 +3,12 @@ package sub
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"s-ui/database"
|
||||
"s-ui/database/model"
|
||||
"s-ui/service"
|
||||
"s-ui/util"
|
||||
"strings"
|
||||
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
"github.com/alireza0/s-ui/util"
|
||||
)
|
||||
|
||||
const defaultJson = `
|
||||
@@ -61,8 +62,12 @@ func (j *JsonService) GetJson(subId string, format string) (*string, []string, e
|
||||
}
|
||||
|
||||
links := j.LinkService.GetLinks(&client.Links, "external", "")
|
||||
tagNumEnable := 0
|
||||
if len(links) > 1 {
|
||||
tagNumEnable = 1
|
||||
}
|
||||
for index, link := range links {
|
||||
json, tag, err := util.GetOutbound(link, index)
|
||||
json, tag, err := util.GetOutbound(link, (index+1)*tagNumEnable)
|
||||
if err == nil && len(tag) > 0 {
|
||||
*outbounds = append(*outbounds, *json)
|
||||
*outTags = append(*outTags, tag)
|
||||
|
||||
+3
-2
@@ -5,9 +5,10 @@ import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
"s-ui/logger"
|
||||
"s-ui/util"
|
||||
"strings"
|
||||
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/util"
|
||||
)
|
||||
|
||||
type Link struct {
|
||||
|
||||
+6
-5
@@ -6,13 +6,14 @@ import (
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"s-ui/config"
|
||||
"s-ui/logger"
|
||||
"s-ui/middleware"
|
||||
"s-ui/network"
|
||||
"s-ui/service"
|
||||
"strconv"
|
||||
|
||||
"github.com/alireza0/s-ui/config"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/middleware"
|
||||
"github.com/alireza0/s-ui/network"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package sub
|
||||
|
||||
import (
|
||||
"s-ui/logger"
|
||||
"s-ui/service"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
+5
-4
@@ -3,12 +3,13 @@ package sub
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"s-ui/database"
|
||||
"s-ui/database/model"
|
||||
"s-ui/service"
|
||||
"s-ui/util"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/alireza0/s-ui/database"
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
"github.com/alireza0/s-ui/util"
|
||||
)
|
||||
|
||||
type SubService struct {
|
||||
|
||||
+2
-1
@@ -3,7 +3,8 @@ package common
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"s-ui/logger"
|
||||
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
)
|
||||
|
||||
func NewErrorf(format string, a ...interface{}) error {
|
||||
|
||||
+80
-144
@@ -5,9 +5,10 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"s-ui/database/model"
|
||||
"s-ui/util/common"
|
||||
"strings"
|
||||
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
)
|
||||
|
||||
var InboundTypeWithLink = []string{"socks", "http", "mixed", "shadowsocks", "naive", "hysteria", "hysteria2", "anytls", "tuic", "vless", "trojan", "vmess"}
|
||||
@@ -67,7 +68,9 @@ func LinkGenerator(clientConfig json.RawMessage, i *model.Inbound, hostname stri
|
||||
return httpLink(userConfig["http"], *inbound, Addrs)
|
||||
case "mixed":
|
||||
return append(
|
||||
socksLink(userConfig["socks"], *inbound, Addrs), httpLink(userConfig["http"], *inbound, Addrs)...)
|
||||
socksLink(userConfig["socks"], *inbound, Addrs),
|
||||
httpLink(userConfig["http"], *inbound, Addrs)...,
|
||||
)
|
||||
case "shadowsocks":
|
||||
return shadowsocksLink(userConfig, *inbound, Addrs)
|
||||
case "naive":
|
||||
@@ -157,7 +160,7 @@ func shadowsocksLink(
|
||||
var links []string
|
||||
for _, addr := range addrs {
|
||||
port, _ := addr["server_port"].(float64)
|
||||
links = append(links, fmt.Sprintf("%s@%s:%d#%s", uriBase, addr["server"].(string), uint(port), addr["remark"].(string)))
|
||||
links = append(links, fmt.Sprintf("%s@%s:%.0f#%s", uriBase, addr["server"].(string), port, addr["remark"].(string)))
|
||||
}
|
||||
return links
|
||||
}
|
||||
@@ -198,7 +201,7 @@ func naiveLink(
|
||||
}
|
||||
|
||||
port, _ := addr["server_port"].(float64)
|
||||
uri := baseUri + toBase64([]byte(fmt.Sprintf("%s:%s@%s:%d", username, password, addr["server"].(string), uint(port))))
|
||||
uri := baseUri + toBase64([]byte(fmt.Sprintf("%s:%s@%s:%.0f", username, password, addr["server"].(string), port)))
|
||||
links = append(links, addParams(uri, params, addr["remark"].(string)))
|
||||
}
|
||||
return links
|
||||
@@ -214,29 +217,17 @@ func hysteriaLink(
|
||||
|
||||
for _, addr := range addrs {
|
||||
params := map[string]string{}
|
||||
if upmbps, ok := inbound["up_mbps"].(string); ok {
|
||||
params["up_mbps"] = upmbps
|
||||
if upmbps, ok := inbound["up_mbps"].(float64); ok {
|
||||
params["downmbps"] = fmt.Sprintf("%.0f", upmbps)
|
||||
}
|
||||
if downmbps, ok := inbound["down_mbps"].(string); ok {
|
||||
params["down_mbps"] = downmbps
|
||||
if downmbps, ok := inbound["down_mbps"].(float64); ok {
|
||||
params["upmbps"] = fmt.Sprintf("%.0f", downmbps)
|
||||
}
|
||||
if auth, ok := userConfig["auth_str"].(string); ok {
|
||||
params["auth"] = auth
|
||||
}
|
||||
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
||||
if sni, ok := tls["server_name"].(string); ok {
|
||||
params["peer"] = sni
|
||||
}
|
||||
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
||||
alpnList := make([]string, len(alpn))
|
||||
for i, v := range alpn {
|
||||
alpnList[i] = v.(string)
|
||||
}
|
||||
params["alpn"] = strings.Join(alpnList, ",")
|
||||
}
|
||||
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
||||
params["insecure"] = "1"
|
||||
}
|
||||
getTlsParams(¶ms, tls, "insecure")
|
||||
}
|
||||
if obfs, ok := inbound["obfs"].(string); ok {
|
||||
params["obfs"] = obfs
|
||||
@@ -246,9 +237,18 @@ func hysteriaLink(
|
||||
} else {
|
||||
params["fastopen"] = "0"
|
||||
}
|
||||
var outJson map[string]interface{}
|
||||
json.Unmarshal(inbound["out_json"].(json.RawMessage), &outJson)
|
||||
if mport, ok := outJson["server_ports"].([]interface{}); ok {
|
||||
mportList := make([]string, len(mport))
|
||||
for i, v := range mport {
|
||||
mportList[i] = v.(string)
|
||||
}
|
||||
params["mport"] = strings.Join(mportList, ",")
|
||||
}
|
||||
|
||||
port, _ := addr["server_port"].(float64)
|
||||
uri := fmt.Sprintf("%s%s:%d", baseUri, addr["server"].(string), uint(port))
|
||||
uri := fmt.Sprintf("%s%s:%.0f", baseUri, addr["server"].(string), port)
|
||||
links = append(links, addParams(uri, params, addr["remark"].(string)))
|
||||
}
|
||||
|
||||
@@ -266,26 +266,14 @@ func hysteria2Link(
|
||||
|
||||
for _, addr := range addrs {
|
||||
params := map[string]string{}
|
||||
if upmbps, ok := inbound["up_mbps"].(string); ok {
|
||||
params["up_mbps"] = upmbps
|
||||
if upmbps, ok := inbound["up_mbps"].(float64); ok {
|
||||
params["downmbps"] = fmt.Sprintf("%.0f", upmbps)
|
||||
}
|
||||
if downmbps, ok := inbound["down_mbps"].(string); ok {
|
||||
params["down_mbps"] = downmbps
|
||||
if downmbps, ok := inbound["down_mbps"].(float64); ok {
|
||||
params["upmbps"] = fmt.Sprintf("%.0f", downmbps)
|
||||
}
|
||||
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
||||
if sni, ok := tls["server_name"].(string); ok {
|
||||
params["sni"] = sni
|
||||
}
|
||||
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
||||
alpnList := make([]string, len(alpn))
|
||||
for i, v := range alpn {
|
||||
alpnList[i] = v.(string)
|
||||
}
|
||||
params["alpn"] = strings.Join(alpnList, ",")
|
||||
}
|
||||
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
||||
params["insecure"] = "1"
|
||||
}
|
||||
getTlsParams(¶ms, tls, "insecure")
|
||||
}
|
||||
if obfs, ok := inbound["obfs"].(map[string]interface{}); ok {
|
||||
if obfsType, ok := obfs["type"].(string); ok {
|
||||
@@ -300,9 +288,18 @@ func hysteria2Link(
|
||||
} else {
|
||||
params["fastopen"] = "0"
|
||||
}
|
||||
var outJson map[string]interface{}
|
||||
json.Unmarshal(inbound["out_json"].(json.RawMessage), &outJson)
|
||||
if mport, ok := outJson["server_ports"].([]interface{}); ok {
|
||||
mportList := make([]string, len(mport))
|
||||
for i, v := range mport {
|
||||
mportList[i] = v.(string)
|
||||
}
|
||||
params["mport"] = strings.Join(mportList, ",")
|
||||
}
|
||||
|
||||
port, _ := addr["server_port"].(float64)
|
||||
uri := fmt.Sprintf("%s%s:%d", baseUri, addr["server"].(string), uint(port))
|
||||
uri := fmt.Sprintf("%s%s:%.0f", baseUri, addr["server"].(string), port)
|
||||
links = append(links, addParams(uri, params, addr["remark"].(string)))
|
||||
}
|
||||
|
||||
@@ -320,23 +317,11 @@ func anytlsLink(
|
||||
for _, addr := range addrs {
|
||||
params := map[string]string{}
|
||||
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
||||
if sni, ok := tls["server_name"].(string); ok {
|
||||
params["sni"] = sni
|
||||
}
|
||||
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
||||
alpnList := make([]string, len(alpn))
|
||||
for i, v := range alpn {
|
||||
alpnList[i] = v.(string)
|
||||
}
|
||||
params["alpn"] = strings.Join(alpnList, ",")
|
||||
}
|
||||
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
||||
params["insecure"] = "1"
|
||||
}
|
||||
getTlsParams(¶ms, tls, "insecure")
|
||||
}
|
||||
|
||||
port, _ := addr["server_port"].(float64)
|
||||
uri := fmt.Sprintf("%s%s:%d", baseUri, addr["server"].(string), uint(port))
|
||||
uri := fmt.Sprintf("%s%s:%.0f", baseUri, addr["server"].(string), port)
|
||||
links = append(links, addParams(uri, params, addr["remark"].(string)))
|
||||
}
|
||||
|
||||
@@ -356,29 +341,14 @@ func tuicLink(
|
||||
for _, addr := range addrs {
|
||||
params := map[string]string{}
|
||||
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
||||
if sni, ok := tls["server_name"].(string); ok {
|
||||
params["sni"] = sni
|
||||
}
|
||||
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
||||
alpnList := make([]string, len(alpn))
|
||||
for i, v := range alpn {
|
||||
alpnList[i] = v.(string)
|
||||
}
|
||||
params["alpn"] = strings.Join(alpnList, ",")
|
||||
}
|
||||
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
||||
params["insecure"] = "1"
|
||||
}
|
||||
if disableSni, ok := tls["disable_sni"].(bool); ok && disableSni {
|
||||
params["disable_sni"] = "1"
|
||||
}
|
||||
getTlsParams(¶ms, tls, "insecure")
|
||||
}
|
||||
if congestionControl, ok := inbound["congestion_control"].(string); ok {
|
||||
params["congestion_control"] = congestionControl
|
||||
}
|
||||
|
||||
port, _ := addr["server_port"].(float64)
|
||||
uri := fmt.Sprintf("%s%s:%d", baseUri, addr["server"].(string), uint(port))
|
||||
uri := fmt.Sprintf("%s%s:%.0f", baseUri, addr["server"].(string), port)
|
||||
links = append(links, addParams(uri, params, addr["remark"].(string)))
|
||||
}
|
||||
|
||||
@@ -397,39 +367,13 @@ func vlessLink(
|
||||
for _, addr := range addrs {
|
||||
params := baseParams
|
||||
if tls, ok := addr["tls"].(map[string]interface{}); ok && tls["enabled"].(bool) {
|
||||
if reality, ok := tls["reality"].(map[string]interface{}); ok && reality["enabled"].(bool) {
|
||||
params["security"] = "reality"
|
||||
if pbk, ok := reality["public_key"].(string); ok {
|
||||
params["pbk"] = pbk
|
||||
}
|
||||
if sid, ok := reality["short_id"].(string); ok {
|
||||
params["sid"] = sid
|
||||
}
|
||||
} else {
|
||||
params["security"] = "tls"
|
||||
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
||||
params["allowInsecure"] = "1"
|
||||
}
|
||||
}
|
||||
getTlsParams(¶ms, tls, "allowInsecure")
|
||||
if flow, ok := userConfig["flow"].(string); ok {
|
||||
params["flow"] = flow
|
||||
}
|
||||
if utls, ok := tls["utls"].(map[string]interface{}); ok {
|
||||
params["fp"], _ = utls["fingerprint"].(string)
|
||||
}
|
||||
if sni, ok := tls["server_name"].(string); ok {
|
||||
params["sni"] = sni
|
||||
}
|
||||
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
||||
alpnList := make([]string, len(alpn))
|
||||
for i, v := range alpn {
|
||||
alpnList[i] = v.(string)
|
||||
}
|
||||
params["alpn"] = strings.Join(alpnList, ",")
|
||||
}
|
||||
}
|
||||
port, _ := addr["server_port"].(float64)
|
||||
uri := fmt.Sprintf("vless://%s@%s:%d", uuid, addr["server"].(string), uint(port))
|
||||
uri := fmt.Sprintf("vless://%s@%s:%.0f", uuid, addr["server"].(string), port)
|
||||
uri = addParams(uri, params, addr["remark"].(string))
|
||||
links = append(links, uri)
|
||||
}
|
||||
@@ -448,36 +392,10 @@ func trojanLink(
|
||||
for _, addr := range addrs {
|
||||
params := baseParams
|
||||
if tls, ok := addr["tls"].(map[string]interface{}); ok && tls["enabled"].(bool) {
|
||||
if reality, ok := tls["reality"].(map[string]interface{}); ok && reality["enabled"].(bool) {
|
||||
params["security"] = "reality"
|
||||
if pbk, ok := reality["public_key"].(string); ok {
|
||||
params["pbk"] = pbk
|
||||
}
|
||||
if sid, ok := reality["short_id"].(string); ok {
|
||||
params["sid"] = sid
|
||||
}
|
||||
} else {
|
||||
params["security"] = "tls"
|
||||
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
||||
params["allowInsecure"] = "1"
|
||||
}
|
||||
}
|
||||
if utls, ok := tls["utls"].(map[string]interface{}); ok {
|
||||
params["fp"], _ = utls["fingerprint"].(string)
|
||||
}
|
||||
if sni, ok := tls["server_name"].(string); ok {
|
||||
params["sni"] = sni
|
||||
}
|
||||
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
||||
alpnList := make([]string, len(alpn))
|
||||
for i, v := range alpn {
|
||||
alpnList[i] = v.(string)
|
||||
}
|
||||
params["alpn"] = strings.Join(alpnList, ",")
|
||||
}
|
||||
getTlsParams(¶ms, tls, "allowInsecure")
|
||||
}
|
||||
port, _ := addr["server_port"].(float64)
|
||||
uri := fmt.Sprintf("trojan://%s@%s:%d", password, addr["server"].(string), uint(port))
|
||||
uri := fmt.Sprintf("trojan://%s@%s:%.0f", password, addr["server"].(string), port)
|
||||
uri = addParams(uri, params, addr["remark"].(string))
|
||||
links = append(links, uri)
|
||||
}
|
||||
@@ -556,11 +474,16 @@ func toBase64(d []byte) string {
|
||||
|
||||
func addParams(uri string, params map[string]string, remark string) string {
|
||||
URL, _ := url.Parse(uri)
|
||||
q := URL.Query()
|
||||
var q []string
|
||||
for k, v := range params {
|
||||
q.Add(k, v)
|
||||
switch k {
|
||||
case "mport", "alpn":
|
||||
q = append(q, fmt.Sprintf("%s=%s", k, v))
|
||||
default:
|
||||
q = append(q, fmt.Sprintf("%s=%s", k, url.QueryEscape(v)))
|
||||
}
|
||||
}
|
||||
URL.RawQuery = q.Encode()
|
||||
URL.RawQuery = strings.Join(q, "&")
|
||||
URL.Fragment = remark
|
||||
return URL.String()
|
||||
}
|
||||
@@ -610,22 +533,35 @@ func getTransportParams(t interface{}) map[string]string {
|
||||
return params
|
||||
}
|
||||
|
||||
func getTlsParams(t interface{}) map[string]string {
|
||||
params := map[string]string{}
|
||||
if tls, hasTls := t.(map[string]interface{}); hasTls {
|
||||
if sni, ok := tls["server_name"].(string); ok {
|
||||
params["sni"] = sni
|
||||
func getTlsParams(params *map[string]string, tls map[string]interface{}, insecureKey string) {
|
||||
if reality, ok := tls["reality"].(map[string]interface{}); ok && reality["enabled"].(bool) {
|
||||
(*params)["security"] = "reality"
|
||||
if pbk, ok := reality["public_key"].(string); ok {
|
||||
(*params)["pbk"] = pbk
|
||||
}
|
||||
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
||||
alpnList := make([]string, len(alpn))
|
||||
for i, v := range alpn {
|
||||
alpnList[i] = v.(string)
|
||||
}
|
||||
params["alpn"] = strings.Join(alpnList, ",")
|
||||
if sid, ok := reality["short_id"].(string); ok {
|
||||
(*params)["sid"] = sid
|
||||
}
|
||||
} else {
|
||||
(*params)["security"] = "tls"
|
||||
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
||||
params["insecure"] = "1"
|
||||
(*params)[insecureKey] = "1"
|
||||
}
|
||||
if disableSni, ok := tls["disable_sni"].(bool); ok && disableSni {
|
||||
(*params)["disable_sni"] = "1"
|
||||
}
|
||||
}
|
||||
return params
|
||||
if utls, ok := tls["utls"].(map[string]interface{}); ok {
|
||||
(*params)["fp"], _ = utls["fingerprint"].(string)
|
||||
}
|
||||
if sni, ok := tls["server_name"].(string); ok {
|
||||
(*params)["sni"] = sni
|
||||
}
|
||||
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
||||
alpnList := make([]string, len(alpn))
|
||||
for i, v := range alpn {
|
||||
alpnList[i] = v.(string)
|
||||
}
|
||||
(*params)["alpn"] = strings.Join(alpnList, ",")
|
||||
}
|
||||
}
|
||||
|
||||
+9
-8
@@ -5,9 +5,10 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"net/url"
|
||||
"s-ui/util/common"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/alireza0/s-ui/util/common"
|
||||
)
|
||||
|
||||
func GetOutbound(uri string, i int) (*map[string]interface{}, string, error) {
|
||||
@@ -114,9 +115,9 @@ func vmess(data string, i int) (*map[string]interface{}, string, error) {
|
||||
if i > 0 {
|
||||
tag = fmt.Sprintf("%d.%s", i, tag)
|
||||
}
|
||||
alter_id, ok := dataJson["aid"].(int)
|
||||
if !ok {
|
||||
alter_id = 0
|
||||
alter_id := 0
|
||||
if aid, ok := dataJson["aid"].(float64); ok {
|
||||
alter_id = int(aid)
|
||||
}
|
||||
vmess := map[string]interface{}{
|
||||
"type": "vmess",
|
||||
@@ -435,7 +436,7 @@ func ss(u *url.URL, i int) (*map[string]interface{}, string, error) {
|
||||
return &ss, tag, nil
|
||||
}
|
||||
|
||||
func getTransport(tp_type string, q *url.Values) *map[string]interface{} {
|
||||
func getTransport(tp_type string, q *url.Values) map[string]interface{} {
|
||||
transport := map[string]interface{}{}
|
||||
tp_host := q.Get("host")
|
||||
tp_path := q.Get("path")
|
||||
@@ -472,10 +473,10 @@ func getTransport(tp_type string, q *url.Values) *map[string]interface{} {
|
||||
transport["path"] = tp_path
|
||||
transport["host"] = tp_host
|
||||
}
|
||||
return &transport
|
||||
return transport
|
||||
}
|
||||
|
||||
func getTls(security string, q *url.Values) *map[string]interface{} {
|
||||
func getTls(security string, q *url.Values) map[string]interface{} {
|
||||
tls := map[string]interface{}{}
|
||||
tls_fp := q.Get("fp")
|
||||
tls_sni := q.Get("sni")
|
||||
@@ -516,5 +517,5 @@ func getTls(security string, q *url.Values) *map[string]interface{} {
|
||||
},
|
||||
}
|
||||
}
|
||||
return &tls
|
||||
return tls
|
||||
}
|
||||
|
||||
+2
-1
@@ -3,7 +3,8 @@ package util
|
||||
import (
|
||||
"encoding/json"
|
||||
"math/rand"
|
||||
"s-ui/database/model"
|
||||
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
)
|
||||
|
||||
// Fill Inbound's out_json
|
||||
|
||||
+2
-1
@@ -2,7 +2,8 @@ package util
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"s-ui/database/model"
|
||||
|
||||
"github.com/alireza0/s-ui/database/model"
|
||||
)
|
||||
|
||||
func GetHeaders(client *model.Client, updateInterval int) []string {
|
||||
|
||||
+7
-6
@@ -9,15 +9,16 @@ import (
|
||||
"io/fs"
|
||||
"net"
|
||||
"net/http"
|
||||
"s-ui/api"
|
||||
"s-ui/config"
|
||||
"s-ui/logger"
|
||||
"s-ui/middleware"
|
||||
"s-ui/network"
|
||||
"s-ui/service"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/alireza0/s-ui/api"
|
||||
"github.com/alireza0/s-ui/config"
|
||||
"github.com/alireza0/s-ui/logger"
|
||||
"github.com/alireza0/s-ui/middleware"
|
||||
"github.com/alireza0/s-ui/network"
|
||||
"github.com/alireza0/s-ui/service"
|
||||
|
||||
"github.com/gin-contrib/gzip"
|
||||
"github.com/gin-contrib/sessions"
|
||||
"github.com/gin-contrib/sessions/cookie"
|
||||
|
||||
Reference in New Issue
Block a user