Compare commits
75 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| af5bd9f75d | |||
| 0fd36e4e6d | |||
| 0f29e2ad31 | |||
| 4ce3647670 | |||
| 90976cded1 | |||
| f5714eccee | |||
| e84f7530e3 | |||
| 63cc7ca957 | |||
| c8432fda54 | |||
| 022574a1d7 | |||
| 76ab5e2ccc | |||
| 10ba989175 | |||
| 46434a6b3f | |||
| c5e07ba076 | |||
| d5c6bdaeff | |||
| f69b55f721 | |||
| 3c9d178709 | |||
| 14013b7d70 | |||
| 9d367fb83d | |||
| 0ef5db4846 | |||
| 94cc29edf5 | |||
| 40e2b4cc8a | |||
| 2b0006f8c8 | |||
| 216a76051e | |||
| a0d7bcc829 | |||
| 87e3118d6b | |||
| 9bc4fe843b | |||
| b779e3b825 | |||
| 4e97afebab | |||
| 3de228ebcd | |||
| abd1c378d5 | |||
| de7197cc58 | |||
| 7a4c010a45 | |||
| 09e94c6213 | |||
| fc88f5a509 | |||
| 1c34e146c1 | |||
| de30e17707 | |||
| 7a9f3196c7 | |||
| 65e51f8aea | |||
| d31a78b625 | |||
| d6c4d9a497 | |||
| 7b979b95d4 | |||
| 64979e6725 | |||
| 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 |
@@ -10,11 +10,11 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5.0.0
|
uses: actions/checkout@v6.0.2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
- name: Install dependencies and build frontend
|
- name: Install dependencies and build frontend
|
||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
- name: Upload frontend build artifact
|
- name: Upload frontend build artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: frontend-dist
|
name: frontend-dist
|
||||||
path: frontend/dist/
|
path: frontend/dist/
|
||||||
@@ -33,9 +33,9 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5.0.0
|
uses: actions/checkout@v6.0.2
|
||||||
- name: Download frontend build artifact
|
- name: Download frontend build artifact
|
||||||
uses: actions/download-artifact@v5
|
uses: actions/download-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: frontend-dist
|
name: frontend-dist
|
||||||
path: frontend_dist
|
path: frontend_dist
|
||||||
@@ -58,7 +58,7 @@ jobs:
|
|||||||
install: true
|
install: true
|
||||||
buildkitd-flags: --debug
|
buildkitd-flags: --debug
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/release.yml'
|
- '.github/workflows/release.yml'
|
||||||
- 'frontend/**'
|
- 'frontend/**'
|
||||||
@@ -31,19 +33,19 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5.0.0
|
uses: actions/checkout@v6.0.2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
cache: false
|
cache: false
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '22'
|
node-version: '22'
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
@@ -100,7 +102,7 @@ jobs:
|
|||||||
run: tar -zcvf s-ui-linux-${{ matrix.platform }}.tar.gz s-ui
|
run: tar -zcvf s-ui-linux-${{ matrix.platform }}.tar.gz s-ui
|
||||||
|
|
||||||
- name: Upload files to Artifacts
|
- name: Upload files to Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: s-ui-linux-${{ matrix.platform }}
|
name: s-ui-linux-${{ matrix.platform }}
|
||||||
path: ./s-ui-linux-${{ matrix.platform }}.tar.gz
|
path: ./s-ui-linux-${{ matrix.platform }}.tar.gz
|
||||||
@@ -108,7 +110,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload to Release
|
- name: Upload to Release
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
if: github.event_name == 'release' && github.event.action == 'published'
|
if: |
|
||||||
|
(github.event_name == 'release' && github.event.action == 'published') ||
|
||||||
|
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/windows.yml'
|
- '.github/workflows/windows.yml'
|
||||||
- 'frontend/**'
|
- 'frontend/**'
|
||||||
@@ -20,19 +22,19 @@ jobs:
|
|||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5.0.0
|
uses: actions/checkout@v6.0.2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
cache: false
|
cache: false
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '22'
|
node-version: '22'
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
@@ -83,7 +85,7 @@ jobs:
|
|||||||
zip -r "s-ui-windows-amd64.zip" s-ui-windows
|
zip -r "s-ui-windows-amd64.zip" s-ui-windows
|
||||||
|
|
||||||
- name: Upload files to Artifacts
|
- name: Upload files to Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: s-ui-windows-amd64
|
name: s-ui-windows-amd64
|
||||||
path: ./s-ui-windows-amd64.zip
|
path: ./s-ui-windows-amd64.zip
|
||||||
@@ -104,19 +106,19 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5.0.0
|
uses: actions/checkout@v6.0.2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
cache: false
|
cache: false
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '22'
|
node-version: '22'
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
@@ -153,7 +155,7 @@ jobs:
|
|||||||
zip -r "s-ui-windows-arm64.zip" s-ui-windows
|
zip -r "s-ui-windows-arm64.zip" s-ui-windows
|
||||||
|
|
||||||
- name: Upload ARM64 files to Artifacts
|
- name: Upload ARM64 files to Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: s-ui-windows-arm64
|
name: s-ui-windows-arm64
|
||||||
path: ./s-ui-windows-arm64.zip
|
path: ./s-ui-windows-arm64.zip
|
||||||
|
|||||||
+1
-2
@@ -33,8 +33,7 @@ FROM --platform=$TARGETPLATFORM alpine
|
|||||||
LABEL org.opencontainers.image.authors="alireza7@gmail.com"
|
LABEL org.opencontainers.image.authors="alireza7@gmail.com"
|
||||||
ENV TZ=Asia/Tehran
|
ENV TZ=Asia/Tehran
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apk add --no-cache --update ca-certificates tzdata
|
RUN set -ex && apk add --no-cache --upgrade bash tzdata ca-certificates nftables
|
||||||
COPY --from=backend-builder /app/sui /app/
|
COPY --from=backend-builder /app/sui /app/
|
||||||
COPY entrypoint.sh /app/
|
COPY entrypoint.sh /app/
|
||||||
VOLUME [ "s-ui" ]
|
|
||||||
ENTRYPOINT [ "./entrypoint.sh" ]
|
ENTRYPOINT [ "./entrypoint.sh" ]
|
||||||
@@ -29,8 +29,7 @@ FROM --platform=$TARGETPLATFORM alpine
|
|||||||
LABEL org.opencontainers.image.authors="alireza7@gmail.com"
|
LABEL org.opencontainers.image.authors="alireza7@gmail.com"
|
||||||
ENV TZ=Asia/Tehran
|
ENV TZ=Asia/Tehran
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apk add --no-cache --update ca-certificates tzdata
|
RUN set -ex && apk add --no-cache --upgrade bash tzdata ca-certificates nftables
|
||||||
COPY --from=backend-builder /app/sui /app/
|
COPY --from=backend-builder /app/sui /app/
|
||||||
COPY entrypoint.sh /app/
|
COPY entrypoint.sh /app/
|
||||||
VOLUME [ "s-ui" ]
|
|
||||||
ENTRYPOINT [ "./entrypoint.sh" ]
|
ENTRYPOINT [ "./entrypoint.sh" ]
|
||||||
@@ -13,7 +13,9 @@
|
|||||||
|
|
||||||
[](https://www.buymeacoffee.com/alireza7)
|
[](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
|
## Quick Overview
|
||||||
| Features | Enable? |
|
| Features | Enable? |
|
||||||
@@ -134,7 +136,7 @@ docker compose up -d
|
|||||||
mkdir s-ui && cd s-ui
|
mkdir s-ui && cd s-ui
|
||||||
docker run -itd \
|
docker run -itd \
|
||||||
-p 2095:2095 -p 2096:2096 -p 443:443 -p 80:80 \
|
-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/ \
|
-v $PWD/cert/:/root/cert/ \
|
||||||
--name s-ui --restart=unless-stopped \
|
--name s-ui --restart=unless-stopped \
|
||||||
alireza7/s-ui:latest
|
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)
|
- HTTPS for secure access to the web panel and subscription service (self-provided domain + SSL certificate)
|
||||||
- Dark/Light theme
|
- 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
|
## Environment Variables
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
|||||||
+4
-1
@@ -1,9 +1,10 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"s-ui/util/common"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/util/common"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -94,6 +95,8 @@ func (a *APIHandler) getHandler(c *gin.Context) {
|
|||||||
a.ApiService.GetDb(c)
|
a.ApiService.GetDb(c)
|
||||||
case "tokens":
|
case "tokens":
|
||||||
a.ApiService.GetTokens(c)
|
a.ApiService.GetTokens(c)
|
||||||
|
case "singbox-config":
|
||||||
|
a.ApiService.GetSingboxConfig(c)
|
||||||
default:
|
default:
|
||||||
jsonMsg(c, "failed", common.NewError("unknown action: ", action))
|
jsonMsg(c, "failed", common.NewError("unknown action: ", action))
|
||||||
}
|
}
|
||||||
|
|||||||
+29
-6
@@ -2,14 +2,14 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/logger"
|
|
||||||
"s-ui/service"
|
|
||||||
"s-ui/util"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
"time"
|
"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"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -86,7 +86,11 @@ func (a *ApiService) getData(c *gin.Context) (interface{}, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
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 {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@@ -98,6 +102,7 @@ func (a *ApiService) getData(c *gin.Context) (interface{}, error) {
|
|||||||
data["endpoints"] = endpoints
|
data["endpoints"] = endpoints
|
||||||
data["services"] = services
|
data["services"] = services
|
||||||
data["subURI"] = subURI
|
data["subURI"] = subURI
|
||||||
|
data["enableTraffic"] = trafficAge > 0
|
||||||
data["onlines"] = onlines
|
data["onlines"] = onlines
|
||||||
} else {
|
} else {
|
||||||
data["onlines"] = onlines
|
data["onlines"] = onlines
|
||||||
@@ -373,3 +378,21 @@ func (a *ApiService) DeleteToken(c *gin.Context) {
|
|||||||
err := a.UserService.DeleteToken(tokenId)
|
err := a.UserService.DeleteToken(tokenId)
|
||||||
jsonMsg(c, "", err)
|
jsonMsg(c, "", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *ApiService) GetSingboxConfig(c *gin.Context) {
|
||||||
|
config, err := a.ConfigService.GetConfig("")
|
||||||
|
if err != nil {
|
||||||
|
c.Status(400)
|
||||||
|
c.Writer.WriteString(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
rawConfig, err := json.MarshalIndent(config, "", " ")
|
||||||
|
if err != nil {
|
||||||
|
c.Status(400)
|
||||||
|
c.Writer.WriteString(err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
c.Header("Content-Type", "application/json")
|
||||||
|
c.Header("Content-Disposition", "attachment; filename=config_"+time.Now().Format("20060102-150405")+".json")
|
||||||
|
c.Writer.Write(rawConfig)
|
||||||
|
}
|
||||||
|
|||||||
+3
-2
@@ -2,10 +2,11 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"s-ui/logger"
|
|
||||||
"s-ui/util/common"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/logger"
|
||||||
|
"github.com/alireza0/s-ui/util/common"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,8 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
"s-ui/database/model"
|
|
||||||
|
"github.com/alireza0/s-ui/database/model"
|
||||||
|
|
||||||
"github.com/gin-contrib/sessions"
|
"github.com/gin-contrib/sessions"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|||||||
+6
-2
@@ -3,9 +3,10 @@ package api
|
|||||||
import (
|
import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"s-ui/logger"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/logger"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -29,8 +30,11 @@ func getRemoteIp(c *gin.Context) string {
|
|||||||
|
|
||||||
func getHostname(c *gin.Context) string {
|
func getHostname(c *gin.Context) string {
|
||||||
host := c.Request.Host
|
host := c.Request.Host
|
||||||
if colonIndex := strings.LastIndex(host, ":"); colonIndex != -1 {
|
if strings.Contains(host, ":") {
|
||||||
host, _, _ = net.SplitHostPort(c.Request.Host)
|
host, _, _ = net.SplitHostPort(c.Request.Host)
|
||||||
|
if strings.Contains(host, ":") {
|
||||||
|
host = "[" + host + "]"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return host
|
return host
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-8
@@ -2,14 +2,15 @@ package app
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"s-ui/config"
|
|
||||||
"s-ui/core"
|
"github.com/alireza0/s-ui/config"
|
||||||
"s-ui/cronjob"
|
"github.com/alireza0/s-ui/core"
|
||||||
"s-ui/database"
|
"github.com/alireza0/s-ui/cronjob"
|
||||||
"s-ui/logger"
|
"github.com/alireza0/s-ui/database"
|
||||||
"s-ui/service"
|
"github.com/alireza0/s-ui/logger"
|
||||||
"s-ui/sub"
|
"github.com/alireza0/s-ui/service"
|
||||||
"s-ui/web"
|
"github.com/alireza0/s-ui/sub"
|
||||||
|
"github.com/alireza0/s-ui/web"
|
||||||
|
|
||||||
"github.com/op/go-logging"
|
"github.com/op/go-logging"
|
||||||
)
|
)
|
||||||
|
|||||||
+4
-3
@@ -2,9 +2,10 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"s-ui/config"
|
|
||||||
"s-ui/database"
|
"github.com/alireza0/s-ui/config"
|
||||||
"s-ui/service"
|
"github.com/alireza0/s-ui/database"
|
||||||
|
"github.com/alireza0/s-ui/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
func resetAdmin() {
|
func resetAdmin() {
|
||||||
|
|||||||
+3
-2
@@ -5,8 +5,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"s-ui/cmd/migration"
|
|
||||||
"s-ui/config"
|
"github.com/alireza0/s-ui/cmd/migration"
|
||||||
|
"github.com/alireza0/s-ui/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ParseCmd() {
|
func ParseCmd() {
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ package migration
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"s-ui/database/model"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/database/model"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"s-ui/database/model"
|
|
||||||
|
"github.com/alireza0/s-ui/database/model"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,10 +3,11 @@ package migration
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/url"
|
"net/url"
|
||||||
"s-ui/database/model"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/database/model"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"s-ui/config"
|
|
||||||
|
"github.com/alireza0/s-ui/config"
|
||||||
|
|
||||||
"gorm.io/driver/sqlite"
|
"gorm.io/driver/sqlite"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|||||||
+57
-11
@@ -4,10 +4,13 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"s-ui/config"
|
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/service"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/config"
|
||||||
|
"github.com/alireza0/s-ui/database"
|
||||||
|
"github.com/alireza0/s-ui/service"
|
||||||
|
|
||||||
"github.com/shirou/gopsutil/v4/net"
|
"github.com/shirou/gopsutil/v4/net"
|
||||||
)
|
)
|
||||||
@@ -109,6 +112,54 @@ func showSetting() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getPublicIP() string {
|
||||||
|
apis := []string{
|
||||||
|
"https://api64.ipify.org",
|
||||||
|
"https://ip.sb",
|
||||||
|
"https://icanhazip.com",
|
||||||
|
"https://ipinfo.io/ip",
|
||||||
|
"https://checkip.amazonaws.com",
|
||||||
|
}
|
||||||
|
type result struct {
|
||||||
|
ip string
|
||||||
|
err error
|
||||||
|
}
|
||||||
|
ch := make(chan result, len(apis))
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
client := &http.Client{Timeout: 3 * time.Second}
|
||||||
|
|
||||||
|
for _, api := range apis {
|
||||||
|
wg.Add(1)
|
||||||
|
go func(url string) {
|
||||||
|
defer wg.Done()
|
||||||
|
resp, err := client.Get(url)
|
||||||
|
if err != nil {
|
||||||
|
ch <- result{"", err}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
body, err := io.ReadAll(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
ch <- result{"", err}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ch <- result{string(body), nil}
|
||||||
|
}(api)
|
||||||
|
}
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
wg.Wait()
|
||||||
|
close(ch)
|
||||||
|
}()
|
||||||
|
|
||||||
|
for res := range ch {
|
||||||
|
if res.err == nil && res.ip != "" {
|
||||||
|
return strings.TrimSpace(res.ip)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func getPanelURI() {
|
func getPanelURI() {
|
||||||
err := database.InitDB(config.GetDBPath())
|
err := database.InitDB(config.GetDBPath())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -145,7 +196,6 @@ func getPanelURI() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
fmt.Println("Local address:")
|
fmt.Println("Local address:")
|
||||||
// get ip address
|
|
||||||
netInterfaces, _ := net.Interfaces()
|
netInterfaces, _ := net.Interfaces()
|
||||||
for i := 0; i < len(netInterfaces); i++ {
|
for i := 0; i < len(netInterfaces); i++ {
|
||||||
if len(netInterfaces[i].Flags) > 2 && netInterfaces[i].Flags[0] == "up" && netInterfaces[i].Flags[1] != "loopback" {
|
if len(netInterfaces[i].Flags) > 2 && netInterfaces[i].Flags[0] == "up" && netInterfaces[i].Flags[1] != "loopback" {
|
||||||
@@ -160,12 +210,8 @@ func getPanelURI() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resp, err := http.Get("https://api.ipify.org?format=text")
|
pubIP := getPublicIP()
|
||||||
if err == nil {
|
if pubIP != "" {
|
||||||
defer resp.Body.Close()
|
fmt.Printf("\nGlobal address:\n%s%s%s\n", Proto, pubIP, PortText+BasePath)
|
||||||
ip, err := io.ReadAll(resp.Body)
|
|
||||||
if err == nil {
|
|
||||||
fmt.Printf("\nGlobal address:\n%s%s%s%s\n", Proto, ip, PortText, BasePath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
1.3.3
|
1.3.9
|
||||||
+2
-1
@@ -5,9 +5,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"s-ui/util/common"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/util/common"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
"github.com/sagernet/sing-box/adapter/endpoint"
|
"github.com/sagernet/sing-box/adapter/endpoint"
|
||||||
"github.com/sagernet/sing-box/adapter/inbound"
|
"github.com/sagernet/sing-box/adapter/inbound"
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
package core
|
package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"s-ui/logger"
|
"github.com/alireza0/s-ui/logger"
|
||||||
"s-ui/util/common"
|
"github.com/alireza0/s-ui/util/common"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
"github.com/sagernet/sing-box/option"
|
"github.com/sagernet/sing-box/option"
|
||||||
|
|||||||
+2
-1
@@ -4,9 +4,10 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
suiLog "s-ui/logger"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
suiLog "github.com/alireza0/s-ui/logger"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/log"
|
"github.com/sagernet/sing-box/log"
|
||||||
"github.com/sagernet/sing/common"
|
"github.com/sagernet/sing/common"
|
||||||
F "github.com/sagernet/sing/common/format"
|
F "github.com/sagernet/sing/common/format"
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,8 @@ package core
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"s-ui/logger"
|
|
||||||
|
"github.com/alireza0/s-ui/logger"
|
||||||
|
|
||||||
sb "github.com/sagernet/sing-box"
|
sb "github.com/sagernet/sing-box"
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
|
|||||||
@@ -3,10 +3,11 @@ package core
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net"
|
"net"
|
||||||
"s-ui/database/model"
|
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/database/model"
|
||||||
|
|
||||||
"github.com/sagernet/sing-box/adapter"
|
"github.com/sagernet/sing-box/adapter"
|
||||||
"github.com/sagernet/sing/common/atomic"
|
"github.com/sagernet/sing/common/atomic"
|
||||||
"github.com/sagernet/sing/common/bufio"
|
"github.com/sagernet/sing/common/bufio"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cronjob
|
package cronjob
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"s-ui/service"
|
"github.com/alireza0/s-ui/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CheckCoreJob struct {
|
type CheckCoreJob struct {
|
||||||
|
|||||||
+4
-2
@@ -20,11 +20,13 @@ func (c *CronJob) Start(loc *time.Location, trafficAge int) error {
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
// Start stats job
|
// Start stats job
|
||||||
c.cron.AddJob("@every 10s", NewStatsJob())
|
c.cron.AddJob("@every 10s", NewStatsJob(trafficAge > 0))
|
||||||
// Start expiry job
|
// Start expiry job
|
||||||
c.cron.AddJob("@every 1m", NewDepleteJob())
|
c.cron.AddJob("@every 1m", NewDepleteJob())
|
||||||
// Start deleting old stats
|
// 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
|
// Start core if it is not running
|
||||||
c.cron.AddJob("@every 5s", NewCheckCoreJob())
|
c.cron.AddJob("@every 5s", NewCheckCoreJob())
|
||||||
}()
|
}()
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package cronjob
|
package cronjob
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"s-ui/logger"
|
"github.com/alireza0/s-ui/logger"
|
||||||
"s-ui/service"
|
"github.com/alireza0/s-ui/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DelStatsJob struct {
|
type DelStatsJob struct {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package cronjob
|
package cronjob
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"s-ui/database"
|
"github.com/alireza0/s-ui/database"
|
||||||
"s-ui/logger"
|
"github.com/alireza0/s-ui/logger"
|
||||||
"s-ui/service"
|
"github.com/alireza0/s-ui/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DepleteJob struct {
|
type DepleteJob struct {
|
||||||
|
|||||||
+8
-5
@@ -1,20 +1,23 @@
|
|||||||
package cronjob
|
package cronjob
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"s-ui/logger"
|
"github.com/alireza0/s-ui/logger"
|
||||||
"s-ui/service"
|
"github.com/alireza0/s-ui/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StatsJob struct {
|
type StatsJob struct {
|
||||||
service.StatsService
|
service.StatsService
|
||||||
|
enableTraffic bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewStatsJob() *StatsJob {
|
func NewStatsJob(saveTraffic bool) *StatsJob {
|
||||||
return &StatsJob{}
|
return &StatsJob{
|
||||||
|
enableTraffic: saveTraffic,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StatsJob) Run() {
|
func (s *StatsJob) Run() {
|
||||||
err := s.StatsService.SaveStats()
|
err := s.StatsService.SaveStats(s.enableTraffic)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Warning("Get stats failed: ", err)
|
logger.Warning("Get stats failed: ", err)
|
||||||
return
|
return
|
||||||
|
|||||||
+6
-5
@@ -8,15 +8,16 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"s-ui/cmd/migration"
|
|
||||||
"s-ui/config"
|
|
||||||
"s-ui/database/model"
|
|
||||||
"s-ui/logger"
|
|
||||||
"s-ui/util/common"
|
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"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/driver/sqlite"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|||||||
+10
-3
@@ -4,8 +4,10 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"s-ui/config"
|
"strings"
|
||||||
"s-ui/database/model"
|
|
||||||
|
"github.com/alireza0/s-ui/config"
|
||||||
|
"github.com/alireza0/s-ui/database/model"
|
||||||
|
|
||||||
"gorm.io/driver/sqlite"
|
"gorm.io/driver/sqlite"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
@@ -48,7 +50,12 @@ func OpenDB(dbPath string) error {
|
|||||||
c := &gorm.Config{
|
c := &gorm.Config{
|
||||||
Logger: gormLogger,
|
Logger: gormLogger,
|
||||||
}
|
}
|
||||||
db, err = gorm.Open(sqlite.Open(dbPath), c)
|
sep := "?"
|
||||||
|
if strings.Contains(dbPath, "?") {
|
||||||
|
sep = "&"
|
||||||
|
}
|
||||||
|
dsn := dbPath + sep + "_busy_timeout=10000"
|
||||||
|
db, err = gorm.Open(sqlite.Open(dsn), c)
|
||||||
|
|
||||||
if config.IsDebug() {
|
if config.IsDebug() {
|
||||||
db = db.Debug()
|
db = db.Debug()
|
||||||
|
|||||||
+1
-1
Submodule frontend updated: 462018335e...ade7c316e7
@@ -1,22 +1,22 @@
|
|||||||
module s-ui
|
module github.com/alireza0/s-ui
|
||||||
|
|
||||||
go 1.25.0
|
go 1.25.6
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/gin-contrib/gzip v1.2.3
|
github.com/gin-contrib/gzip v1.2.5
|
||||||
github.com/gin-contrib/sessions v1.0.4
|
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/gofrs/uuid/v5 v5.4.0
|
||||||
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
|
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
|
||||||
github.com/robfig/cron/v3 v3.0.1
|
github.com/robfig/cron/v3 v3.0.1
|
||||||
github.com/sagernet/sing v0.7.6-0.20250815070458-d33ece7a184f
|
github.com/sagernet/sing v0.7.18
|
||||||
github.com/sagernet/sing-box v1.12.3
|
github.com/sagernet/sing-box v1.12.21
|
||||||
github.com/sagernet/sing-dns v0.4.6
|
github.com/sagernet/sing-dns v0.4.6
|
||||||
github.com/shirou/gopsutil/v4 v4.25.7
|
github.com/shirou/gopsutil/v4 v4.26.1
|
||||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20241231184526-a9ab2273dd10
|
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20241231184526-a9ab2273dd10
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
gorm.io/driver/sqlite v1.6.0
|
gorm.io/driver/sqlite v1.6.0
|
||||||
gorm.io/gorm v1.30.1
|
gorm.io/gorm v1.31.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@@ -25,22 +25,23 @@ require (
|
|||||||
github.com/akutz/memconn v0.1.0 // indirect
|
github.com/akutz/memconn v0.1.0 // indirect
|
||||||
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa // indirect
|
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa // indirect
|
||||||
github.com/andybalholm/brotli v1.1.0 // indirect
|
github.com/andybalholm/brotli v1.1.0 // indirect
|
||||||
github.com/anytls/sing-anytls v0.0.8 // indirect
|
github.com/anytls/sing-anytls v0.0.11 // indirect
|
||||||
github.com/bits-and-blooms/bitset v1.13.0 // indirect
|
github.com/bits-and-blooms/bitset v1.13.0 // indirect
|
||||||
github.com/bytedance/sonic v1.13.3 // indirect
|
github.com/bytedance/gopkg v0.1.3 // indirect
|
||||||
github.com/bytedance/sonic/loader v0.3.0 // indirect
|
github.com/bytedance/sonic v1.15.0 // indirect
|
||||||
|
github.com/bytedance/sonic/loader v0.5.0 // indirect
|
||||||
github.com/caddyserver/certmagic v0.23.0 // indirect
|
github.com/caddyserver/certmagic v0.23.0 // indirect
|
||||||
github.com/caddyserver/zerossl v0.1.3 // 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/coder/websocket v1.8.13 // indirect
|
||||||
github.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6 // indirect
|
github.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6 // indirect
|
||||||
github.com/cretz/bine v0.2.0 // indirect
|
github.com/cretz/bine v0.2.0 // indirect
|
||||||
github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa // indirect
|
github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa // indirect
|
||||||
github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e // indirect
|
github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e // indirect
|
||||||
github.com/ebitengine/purego v0.8.4 // indirect
|
github.com/ebitengine/purego v0.9.1 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||||
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
||||||
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
|
github.com/gabriel-vasile/mimetype v1.4.10 // indirect
|
||||||
github.com/gaissmai/bart v0.11.1 // indirect
|
github.com/gaissmai/bart v0.11.1 // indirect
|
||||||
github.com/gin-contrib/sse v1.1.0 // indirect
|
github.com/gin-contrib/sse v1.1.0 // indirect
|
||||||
github.com/go-chi/chi/v5 v5.2.2 // indirect
|
github.com/go-chi/chi/v5 v5.2.2 // indirect
|
||||||
@@ -49,10 +50,11 @@ require (
|
|||||||
github.com/go-ole/go-ole v1.3.0 // indirect
|
github.com/go-ole/go-ole v1.3.0 // indirect
|
||||||
github.com/go-playground/locales v0.14.1 // indirect
|
github.com/go-playground/locales v0.14.1 // indirect
|
||||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||||
github.com/go-playground/validator/v10 v10.27.0 // indirect
|
github.com/go-playground/validator/v10 v10.28.0 // indirect
|
||||||
github.com/gobwas/httphead v0.1.0 // indirect
|
github.com/gobwas/httphead v0.1.0 // indirect
|
||||||
github.com/gobwas/pool v0.2.1 // indirect
|
github.com/gobwas/pool v0.2.1 // indirect
|
||||||
github.com/goccy/go-json v0.10.5 // indirect
|
github.com/goccy/go-json v0.10.5 // indirect
|
||||||
|
github.com/goccy/go-yaml v1.19.2 // indirect
|
||||||
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // 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/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
github.com/google/btree v1.1.3 // indirect
|
github.com/google/btree v1.1.3 // indirect
|
||||||
@@ -72,7 +74,7 @@ require (
|
|||||||
github.com/jsimonetti/rtnetlink v1.4.0 // indirect
|
github.com/jsimonetti/rtnetlink v1.4.0 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/klauspost/compress v1.18.0 // 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/kortschak/wol v0.0.0-20200729010619-da482cc4850a // indirect
|
||||||
github.com/leodido/go-urn v1.4.0 // indirect
|
github.com/leodido/go-urn v1.4.0 // indirect
|
||||||
github.com/libdns/alidns v1.0.5-libdns.v1.beta1 // indirect
|
github.com/libdns/alidns v1.0.5-libdns.v1.beta1 // indirect
|
||||||
@@ -86,8 +88,8 @@ require (
|
|||||||
github.com/mdlayher/netlink v1.7.3-0.20250113171957-fbb4dce95f42 // indirect
|
github.com/mdlayher/netlink v1.7.3-0.20250113171957-fbb4dce95f42 // indirect
|
||||||
github.com/mdlayher/sdnotify v1.0.0 // indirect
|
github.com/mdlayher/sdnotify v1.0.0 // indirect
|
||||||
github.com/mdlayher/socket v0.5.1 // indirect
|
github.com/mdlayher/socket v0.5.1 // indirect
|
||||||
github.com/metacubex/tfo-go v0.0.0-20250516165257-e29c16ae41d4 // indirect
|
github.com/metacubex/tfo-go v0.0.0-20250921095601-b102db4216c0 // indirect
|
||||||
github.com/metacubex/utls v1.8.0 // indirect
|
github.com/metacubex/utls v1.8.4 // indirect
|
||||||
github.com/mholt/acmez/v3 v3.1.2 // indirect
|
github.com/mholt/acmez/v3 v3.1.2 // indirect
|
||||||
github.com/miekg/dns v1.1.67 // indirect
|
github.com/miekg/dns v1.1.67 // indirect
|
||||||
github.com/mitchellh/go-ps v1.0.0 // indirect
|
github.com/mitchellh/go-ps v1.0.0 // indirect
|
||||||
@@ -98,6 +100,7 @@ require (
|
|||||||
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
|
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
|
||||||
github.com/prometheus-community/pro-bing v0.4.0 // indirect
|
github.com/prometheus-community/pro-bing v0.4.0 // indirect
|
||||||
github.com/quic-go/qpack v0.5.1 // indirect
|
github.com/quic-go/qpack v0.5.1 // indirect
|
||||||
|
github.com/quic-go/quic-go v0.55.0 // indirect
|
||||||
github.com/safchain/ethtool v0.3.0 // indirect
|
github.com/safchain/ethtool v0.3.0 // indirect
|
||||||
github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a // indirect
|
github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a // indirect
|
||||||
github.com/sagernet/cors v1.2.1 // indirect
|
github.com/sagernet/cors v1.2.1 // indirect
|
||||||
@@ -105,16 +108,16 @@ require (
|
|||||||
github.com/sagernet/gvisor v0.0.0-20250325023245-7a9c0f5725fb // indirect
|
github.com/sagernet/gvisor v0.0.0-20250325023245-7a9c0f5725fb // indirect
|
||||||
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a // indirect
|
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a // indirect
|
||||||
github.com/sagernet/nftables v0.3.0-beta.4 // indirect
|
github.com/sagernet/nftables v0.3.0-beta.4 // indirect
|
||||||
github.com/sagernet/quic-go v0.52.0-beta.1 // indirect
|
github.com/sagernet/quic-go v0.52.0-sing-box-mod.3 // indirect
|
||||||
github.com/sagernet/sing-mux v0.3.3 // indirect
|
github.com/sagernet/sing-mux v0.3.4 // indirect
|
||||||
github.com/sagernet/sing-quic v0.5.0 // indirect
|
github.com/sagernet/sing-quic v0.5.3 // indirect
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.8 // indirect
|
github.com/sagernet/sing-shadowsocks v0.2.8 // indirect
|
||||||
github.com/sagernet/sing-shadowsocks2 v0.2.1 // 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-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.11 // indirect
|
||||||
github.com/sagernet/sing-vmess v0.2.7 // indirect
|
github.com/sagernet/sing-vmess v0.2.7 // indirect
|
||||||
github.com/sagernet/smux v1.5.34-mod.2 // indirect
|
github.com/sagernet/smux v1.5.50-sing-box-mod.1 // indirect
|
||||||
github.com/sagernet/tailscale v1.80.3-mod.5 // indirect
|
github.com/sagernet/tailscale v1.80.3-sing-box-1.12-mod.2 // indirect
|
||||||
github.com/sagernet/wireguard-go v0.0.1-beta.7 // indirect
|
github.com/sagernet/wireguard-go v0.0.1-beta.7 // indirect
|
||||||
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854 // indirect
|
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854 // indirect
|
||||||
github.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e // indirect
|
github.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e // indirect
|
||||||
@@ -125,8 +128,8 @@ require (
|
|||||||
github.com/tailscale/netlink v1.1.1-0.20240822203006-4d49adab4de7 // indirect
|
github.com/tailscale/netlink v1.1.1-0.20240822203006-4d49adab4de7 // indirect
|
||||||
github.com/tailscale/peercred v0.0.0-20250107143737-35a0c7bd7edc // indirect
|
github.com/tailscale/peercred v0.0.0-20250107143737-35a0c7bd7edc // indirect
|
||||||
github.com/tailscale/web-client-prebuilt v0.0.0-20250124233751-d4cd19a26976 // indirect
|
github.com/tailscale/web-client-prebuilt v0.0.0-20250124233751-d4cd19a26976 // indirect
|
||||||
github.com/tklauser/go-sysconf v0.3.15 // indirect
|
github.com/tklauser/go-sysconf v0.3.16 // indirect
|
||||||
github.com/tklauser/numcpus v0.10.0 // indirect
|
github.com/tklauser/numcpus v0.11.0 // indirect
|
||||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||||
github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 // indirect
|
github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 // indirect
|
||||||
github.com/ugorji/go/codec v1.3.0 // indirect
|
github.com/ugorji/go/codec v1.3.0 // indirect
|
||||||
@@ -139,21 +142,21 @@ require (
|
|||||||
go.uber.org/zap/exp v0.3.0 // indirect
|
go.uber.org/zap/exp v0.3.0 // indirect
|
||||||
go4.org/mem v0.0.0-20240501181205-ae6ca9944745 // indirect
|
go4.org/mem v0.0.0-20240501181205-ae6ca9944745 // indirect
|
||||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
|
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
|
||||||
golang.org/x/arch v0.19.0 // indirect
|
golang.org/x/arch v0.22.0 // indirect
|
||||||
golang.org/x/crypto v0.41.0 // indirect
|
golang.org/x/crypto v0.46.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect
|
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect
|
||||||
golang.org/x/mod v0.27.0 // indirect
|
golang.org/x/mod v0.30.0 // indirect
|
||||||
golang.org/x/net v0.43.0 // indirect
|
golang.org/x/net v0.47.0 // indirect
|
||||||
golang.org/x/sync v0.16.0 // indirect
|
golang.org/x/sync v0.19.0 // indirect
|
||||||
golang.org/x/sys v0.35.0 // indirect
|
golang.org/x/sys v0.40.0 // indirect
|
||||||
golang.org/x/term v0.34.0 // indirect
|
golang.org/x/term v0.38.0 // indirect
|
||||||
golang.org/x/text v0.28.0 // indirect
|
golang.org/x/text v0.32.0 // indirect
|
||||||
golang.org/x/time v0.9.0 // indirect
|
golang.org/x/time v0.9.0 // indirect
|
||||||
golang.org/x/tools v0.36.0 // indirect
|
golang.org/x/tools v0.39.0 // indirect
|
||||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
|
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
|
||||||
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
|
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
|
||||||
google.golang.org/grpc v1.73.0 // indirect
|
google.golang.org/grpc v1.73.0 // indirect
|
||||||
google.golang.org/protobuf v1.36.6 // indirect
|
google.golang.org/protobuf v1.36.10 // indirect
|
||||||
lukechampine.com/blake3 v1.4.1 // indirect
|
lukechampine.com/blake3 v1.4.1 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,24 +8,24 @@ github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa h1:LHTHcTQiSGT7V
|
|||||||
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4=
|
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4=
|
||||||
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
|
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
|
||||||
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
|
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
|
||||||
github.com/anytls/sing-anytls v0.0.8 h1:1u/fnH1HoeeMV5mX7/eUOjLBvPdkd1UJRmXiRi6Vymc=
|
github.com/anytls/sing-anytls v0.0.11 h1:w8e9Uj1oP3m4zxkyZDewPk0EcQbvVxb7Nn+rapEx4fc=
|
||||||
github.com/anytls/sing-anytls v0.0.8/go.mod h1:7rjN6IukwysmdusYsrV51Fgu1uW6vsrdd6ctjnEAln8=
|
github.com/anytls/sing-anytls v0.0.11/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 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE=
|
||||||
github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
|
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/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M=
|
||||||
github.com/bytedance/sonic v1.13.3/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
|
github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
|
||||||
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
|
github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE=
|
||||||
github.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=
|
github.com/bytedance/sonic v1.15.0/go.mod h1:tFkWrPz0/CUCLEF4ri4UkHekCIcdnkqXw9VduqpJh0k=
|
||||||
github.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
|
github.com/bytedance/sonic/loader v0.5.0 h1:gXH3KVnatgY7loH5/TkeVyXPfESoqSBSBEiDd5VjlgE=
|
||||||
|
github.com/bytedance/sonic/loader v0.5.0/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo=
|
||||||
github.com/caddyserver/certmagic v0.23.0 h1:CfpZ/50jMfG4+1J/u2LV6piJq4HOfO6ppOnOf7DkFEU=
|
github.com/caddyserver/certmagic v0.23.0 h1:CfpZ/50jMfG4+1J/u2LV6piJq4HOfO6ppOnOf7DkFEU=
|
||||||
github.com/caddyserver/certmagic v0.23.0/go.mod h1:9mEZIWqqWoI+Gf+4Trh04MOVPD0tGSxtqsxg87hAIH4=
|
github.com/caddyserver/certmagic v0.23.0/go.mod h1:9mEZIWqqWoI+Gf+4Trh04MOVPD0tGSxtqsxg87hAIH4=
|
||||||
github.com/caddyserver/zerossl v0.1.3 h1:onS+pxp3M8HnHpN5MMbOMyNjmTheJyWRaZYwn+YTAyA=
|
github.com/caddyserver/zerossl v0.1.3 h1:onS+pxp3M8HnHpN5MMbOMyNjmTheJyWRaZYwn+YTAyA=
|
||||||
github.com/caddyserver/zerossl v0.1.3/go.mod h1:CxA0acn7oEGO6//4rtrRjYgEoa4MFw/XofZnrYwGqG4=
|
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 h1:7NxJhNiBT3NG8pZJ3c+yfrVdHY8ScgKD27sScgjLMMk=
|
||||||
github.com/cilium/ebpf v0.15.0/go.mod h1:DHp1WyrLeiBh19Cf/tfiSMhqheEiK8fXFZ4No0P1Hso=
|
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.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=
|
||||||
github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
|
github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=
|
||||||
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
|
|
||||||
github.com/coder/websocket v1.8.13 h1:f3QZdXy7uGVz+4uCJy2nTZyM0yTBj8yANEHhqlXZ9FE=
|
github.com/coder/websocket v1.8.13 h1:f3QZdXy7uGVz+4uCJy2nTZyM0yTBj8yANEHhqlXZ9FE=
|
||||||
github.com/coder/websocket v1.8.13/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=
|
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=
|
github.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6 h1:8h5+bWd7R6AYUslN6c6iuZWTKsKxUFDlpnmilO6R2n0=
|
||||||
@@ -40,24 +40,24 @@ github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa h1:h8TfIT1xc8FWbww
|
|||||||
github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa/go.mod h1:Nx87SkVqTKd8UtT+xu7sM/l+LgXs6c0aHrlKusR+2EQ=
|
github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa/go.mod h1:Nx87SkVqTKd8UtT+xu7sM/l+LgXs6c0aHrlKusR+2EQ=
|
||||||
github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e h1:vUmf0yezR0y7jJ5pceLHthLaYf4bA5T14B6q39S4q2Q=
|
github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e h1:vUmf0yezR0y7jJ5pceLHthLaYf4bA5T14B6q39S4q2Q=
|
||||||
github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e/go.mod h1:YTIHhz/QFSYnu/EhlF2SpU2Uk+32abacUYA5ZPljz1A=
|
github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e/go.mod h1:YTIHhz/QFSYnu/EhlF2SpU2Uk+32abacUYA5ZPljz1A=
|
||||||
github.com/ebitengine/purego v0.8.4 h1:CF7LEKg5FFOsASUj0+QwaXf8Ht6TlFxg09+S9wz0omw=
|
github.com/ebitengine/purego v0.9.1 h1:a/k2f2HQU3Pi399RPW1MOaZyhKJL9w/xFpKAg4q1s0A=
|
||||||
github.com/ebitengine/purego v0.8.4/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
|
github.com/ebitengine/purego v0.9.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
|
||||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||||
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
|
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
|
||||||
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
|
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
|
||||||
github.com/gabriel-vasile/mimetype v1.4.9 h1:5k+WDwEsD9eTLL8Tz3L0VnmVh9QxGjRmjBvAG7U/oYY=
|
github.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=
|
||||||
github.com/gabriel-vasile/mimetype v1.4.9/go.mod h1:WnSQhFKJuBlRyLiKohA/2DtIlPFAbguNaG7QCHcyGok=
|
github.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
||||||
github.com/gaissmai/bart v0.11.1 h1:5Uv5XwsaFBRo4E5VBcb9TzY8B7zxFf+U7isDxqOrRfc=
|
github.com/gaissmai/bart v0.11.1 h1:5Uv5XwsaFBRo4E5VBcb9TzY8B7zxFf+U7isDxqOrRfc=
|
||||||
github.com/gaissmai/bart v0.11.1/go.mod h1:KHeYECXQiBjTzQz/om2tqn3sZF1J7hw9m6z41ftj3fg=
|
github.com/gaissmai/bart v0.11.1/go.mod h1:KHeYECXQiBjTzQz/om2tqn3sZF1J7hw9m6z41ftj3fg=
|
||||||
github.com/gin-contrib/gzip v1.2.3 h1:dAhT722RuEG330ce2agAs75z7yB+NKvX/ZM1r8w0u2U=
|
github.com/gin-contrib/gzip v1.2.5 h1:fIZs0S+l17pIu1P5XRJOo/YNqfIuPCrZZ3TWB7pjckI=
|
||||||
github.com/gin-contrib/gzip v1.2.3/go.mod h1:ad72i4Bzmaypk8M762gNXa2wkxxjbz0icRNnuLJ9a/c=
|
github.com/gin-contrib/gzip v1.2.5/go.mod h1:aomRgR7ftdZV3uWY0gW/m8rChfxau0n8YVvwlOHONzw=
|
||||||
github.com/gin-contrib/sessions v1.0.4 h1:ha6CNdpYiTOK/hTp05miJLbpTSNfOnFg5Jm2kbcqy8U=
|
github.com/gin-contrib/sessions v1.0.4 h1:ha6CNdpYiTOK/hTp05miJLbpTSNfOnFg5Jm2kbcqy8U=
|
||||||
github.com/gin-contrib/sessions v1.0.4/go.mod h1:ccmkrb2z6iU2osiAHZG3x3J4suJK+OU27oqzlWOqQgs=
|
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 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=
|
||||||
github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM=
|
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.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=
|
||||||
github.com/gin-gonic/gin v1.10.1/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y=
|
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 h1:Km/MVOFvclqxPM9dZBC4+QE564nU4gz4iZ0D9pMw28I=
|
||||||
github.com/github/fakeca v0.1.0/go.mod h1:+bormgoGMMuamOscx7N91aOuUST7wdaJ2rNjeohylyo=
|
github.com/github/fakeca v0.1.0/go.mod h1:+bormgoGMMuamOscx7N91aOuUST7wdaJ2rNjeohylyo=
|
||||||
github.com/go-chi/chi/v5 v5.2.2 h1:CMwsvRVTbXVytCk1Wd72Zy1LAsAh9GxMmSNWLHCG618=
|
github.com/go-chi/chi/v5 v5.2.2 h1:CMwsvRVTbXVytCk1Wd72Zy1LAsAh9GxMmSNWLHCG618=
|
||||||
@@ -79,18 +79,20 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
|
|||||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||||
github.com/go-playground/validator/v10 v10.27.0 h1:w8+XrWVMhGkxOaaowyKH35gFydVHOvC0/uWoy2Fzwn4=
|
github.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=
|
||||||
github.com/go-playground/validator/v10 v10.27.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
|
github.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=
|
||||||
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
|
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
|
||||||
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
|
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
|
||||||
github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
|
github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og=
|
||||||
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
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 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
|
||||||
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||||
|
github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM=
|
||||||
|
github.com/goccy/go-yaml v1.19.2/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 h1:sQspH8M4niEijh3PFscJRLDnkL547IeP7kpPe3uUhEg=
|
||||||
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466/go.mod h1:ZiQxhyQ+bbbfxUKVvjfO498oPYvtYhZzycal3G/NHmU=
|
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=
|
github.com/gofrs/uuid/v5 v5.4.0 h1:EfbpCTjqMuGyq5ZJwxqzn3Cbr2d0rUZU7v5ycAk/e/0=
|
||||||
github.com/gofrs/uuid/v5 v5.3.2/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
|
github.com/gofrs/uuid/v5 v5.4.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||||
@@ -132,10 +134,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/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 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
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.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
|
||||||
github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
|
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||||
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/kortschak/wol v0.0.0-20200729010619-da482cc4850a h1:+RR6SqnTkDLWyICxS1xpjCi/3dhyV+TgZwA6Ww3KncQ=
|
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/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=
|
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
||||||
@@ -163,10 +163,10 @@ github.com/mdlayher/sdnotify v1.0.0 h1:Ma9XeLVN/l0qpyx1tNeMSeTjCPH6NtuD6/N9XdTlQ
|
|||||||
github.com/mdlayher/sdnotify v1.0.0/go.mod h1:HQUmpM4XgYkhDLtd+Uad8ZFK1T9D5+pNxnXQjCeJlGE=
|
github.com/mdlayher/sdnotify v1.0.0/go.mod h1:HQUmpM4XgYkhDLtd+Uad8ZFK1T9D5+pNxnXQjCeJlGE=
|
||||||
github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos=
|
github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos=
|
||||||
github.com/mdlayher/socket v0.5.1/go.mod h1:TjPLHI1UgwEv5J1B5q0zTZq12A/6H7nKmtTanQE37IQ=
|
github.com/mdlayher/socket v0.5.1/go.mod h1:TjPLHI1UgwEv5J1B5q0zTZq12A/6H7nKmtTanQE37IQ=
|
||||||
github.com/metacubex/tfo-go v0.0.0-20250516165257-e29c16ae41d4 h1:j1VRTiC9JLR4nUbSikx9OGdu/3AgFDqgcLj4GoqyQkc=
|
github.com/metacubex/tfo-go v0.0.0-20250921095601-b102db4216c0 h1:Ui+/2s5Qz0lSnDUBmEL12M5Oi/PzvFxGTNohm8ZcsmE=
|
||||||
github.com/metacubex/tfo-go v0.0.0-20250516165257-e29c16ae41d4/go.mod h1:l9oLnLoEXyGZ5RVLsh7QCC5XsouTUyKk4F2nLm2DHLw=
|
github.com/metacubex/tfo-go v0.0.0-20250921095601-b102db4216c0/go.mod h1:l9oLnLoEXyGZ5RVLsh7QCC5XsouTUyKk4F2nLm2DHLw=
|
||||||
github.com/metacubex/utls v1.8.0 h1:mSYi6FMnmc5riARl5UZDmWVy710z+P5b7xuGW0lV9ac=
|
github.com/metacubex/utls v1.8.4 h1:HmL9nUApDdWSkgUyodfwF6hSjtiwCGGdyhaSpEejKpg=
|
||||||
github.com/metacubex/utls v1.8.0/go.mod h1:FdjYzVfCtgtna19hX0ER1Xsa5uJInwdQ4IcaaI98lEQ=
|
github.com/metacubex/utls v1.8.4/go.mod h1:kncGGVhFaoGn5M3pFe3SXhZCzsbCJayNOH4UEqTKTko=
|
||||||
github.com/mholt/acmez/v3 v3.1.2 h1:auob8J/0FhmdClQicvJvuDavgd5ezwLBfKuYmynhYzc=
|
github.com/mholt/acmez/v3 v3.1.2 h1:auob8J/0FhmdClQicvJvuDavgd5ezwLBfKuYmynhYzc=
|
||||||
github.com/mholt/acmez/v3 v3.1.2/go.mod h1:L1wOU06KKvq7tswuMDwKdcHeKpFFgkppZy/y0DFxagQ=
|
github.com/mholt/acmez/v3 v3.1.2/go.mod h1:L1wOU06KKvq7tswuMDwKdcHeKpFFgkppZy/y0DFxagQ=
|
||||||
github.com/miekg/dns v1.1.67 h1:kg0EHj0G4bfT5/oOys6HhZw4vmMlnoZ+gDu8tJ/AlI0=
|
github.com/miekg/dns v1.1.67 h1:kg0EHj0G4bfT5/oOys6HhZw4vmMlnoZ+gDu8tJ/AlI0=
|
||||||
@@ -195,6 +195,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/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 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
|
||||||
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
|
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
|
||||||
|
github.com/quic-go/quic-go v0.55.0 h1:zccPQIqYCXDt5NmcEabyYvOnomjs8Tlwl7tISjJh9Mk=
|
||||||
|
github.com/quic-go/quic-go v0.55.0/go.mod h1:DR51ilwU1uE164KuWXhinFcKWGlEjzys2l8zUl5Ss1U=
|
||||||
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
|
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/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
|
||||||
github.com/safchain/ethtool v0.3.0 h1:gimQJpsI6sc1yIqP/y8GYgiXn/NjgvpM0RNoWLVVmP0=
|
github.com/safchain/ethtool v0.3.0 h1:gimQJpsI6sc1yIqP/y8GYgiXn/NjgvpM0RNoWLVVmP0=
|
||||||
@@ -211,39 +213,38 @@ github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a h1:ObwtHN2VpqE0ZN
|
|||||||
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM=
|
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM=
|
||||||
github.com/sagernet/nftables v0.3.0-beta.4 h1:kbULlAwAC3jvdGAC1P5Fa3GSxVwQJibNenDW2zaXr8I=
|
github.com/sagernet/nftables v0.3.0-beta.4 h1:kbULlAwAC3jvdGAC1P5Fa3GSxVwQJibNenDW2zaXr8I=
|
||||||
github.com/sagernet/nftables v0.3.0-beta.4/go.mod h1:OQXAjvjNGGFxaTgVCSTRIhYB5/llyVDeapVoENYBDS8=
|
github.com/sagernet/nftables v0.3.0-beta.4/go.mod h1:OQXAjvjNGGFxaTgVCSTRIhYB5/llyVDeapVoENYBDS8=
|
||||||
github.com/sagernet/quic-go v0.52.0-beta.1 h1:hWkojLg64zjV+MJOvJU/kOeWndm3tiEfBLx5foisszs=
|
github.com/sagernet/quic-go v0.52.0-sing-box-mod.3 h1:ySqffGm82rPqI1TUPqmtHIYd12pfEGScygnOxjTL56w=
|
||||||
github.com/sagernet/quic-go v0.52.0-beta.1/go.mod h1:OV+V5kEBb8kJS7k29MzDu6oj9GyMc7HA07sE1tedxz4=
|
github.com/sagernet/quic-go v0.52.0-sing-box-mod.3/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.18 h1:iZHkaru1/MoHugx3G+9S3WG4owMewKO/KvieE2Pzk4E=
|
||||||
github.com/sagernet/sing v0.7.6-0.20250815070458-d33ece7a184f h1:HIBo8l+tsS3wLwuI1E56uRTQw46QytXSUpZTP3vwG/U=
|
github.com/sagernet/sing v0.7.18/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
|
||||||
github.com/sagernet/sing v0.7.6-0.20250815070458-d33ece7a184f/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
|
github.com/sagernet/sing-box v1.12.21 h1:SyTTag/f/JQmP7/1tTVlbhfKgAzB84sFhocmnwmANB8=
|
||||||
github.com/sagernet/sing-box v1.12.3 h1:EWtKXSJ0L8OVHS4Swl8HsakMOwwiEC68AU+pEkcUlQw=
|
github.com/sagernet/sing-box v1.12.21/go.mod h1:jjM3DQWWJSMW3U0uv3AxYRjyLnHu/SXN3A6Svex83/w=
|
||||||
github.com/sagernet/sing-box v1.12.3/go.mod h1:spyNZpDcPQIl5VUL/6rnDF7x/SFtQ0u0dybT5hIuU/c=
|
|
||||||
github.com/sagernet/sing-dns v0.4.6 h1:mjZC0o6d5sQ1sraoOBbK3G3apCbuL8wWYwu2RNu5rbM=
|
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-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.4 h1:ZQplKl8MNXutjzbMVtWvWG31fohhgOfCuUZR4dVQ8+s=
|
||||||
github.com/sagernet/sing-mux v0.3.3/go.mod h1:pht8iFY4c9Xltj7rhVd208npkNaeCxzyXCgulDPLUDA=
|
github.com/sagernet/sing-mux v0.3.4/go.mod h1:QvlKMyNBNrQoyX4x+gq028uPbLM2XeRpWtDsWBJbFSk=
|
||||||
github.com/sagernet/sing-quic v0.5.0 h1:jNLIyVk24lFPvu8A4x+ZNEnZdI+Tg1rp7eCJ6v0Csak=
|
github.com/sagernet/sing-quic v0.5.3 h1:K937DKJN98xqyztijRkLJqbBfyV4rEZcYxFyP3EBikU=
|
||||||
github.com/sagernet/sing-quic v0.5.0/go.mod h1:SAv/qdeDN+75msGG5U5ZIwG+3Ua50jVIKNrRSY8pkx0=
|
github.com/sagernet/sing-quic v0.5.3/go.mod h1:evP1e++ZG8TJHVV5HudXV4vWeYzGfCdF4HwSJZcdqkI=
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.8 h1:PURj5PRoAkqeHh2ZW205RWzN9E9RtKCVCzByXruQWfE=
|
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-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 h1:dWV9OXCeFPuYGHb6IRqlSptVnSzOelnqqs2gQ2/Qioo=
|
||||||
github.com/sagernet/sing-shadowsocks2 v0.2.1/go.mod h1:RnXS0lExcDAovvDeniJ4IKa2IuChrdipolPYWBv9hWQ=
|
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 h1:tK+75l64tm9WvEFrYRE1t0YxoFdWQqw/h7Uhzj0vJ+w=
|
||||||
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11/go.mod h1:sWqKnGlMipCHaGsw1sTTlimyUpgzP4WP3pjhCsYt9oA=
|
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.11 h1:qB7jy8JKqXg73fYBsDkBSy4ulRSbLrFut0e+y+QPhqU=
|
||||||
github.com/sagernet/sing-tun v0.7.0-beta.1/go.mod h1:AHJuRrLbNRJuivuFZ2VhXwDj4ViYp14szG5EkkKAqRQ=
|
github.com/sagernet/sing-tun v0.7.11/go.mod h1:pUEjh9YHQ2gJT6Lk0TYDklh3WJy7lz+848vleGM3JPM=
|
||||||
github.com/sagernet/sing-vmess v0.2.7 h1:2ee+9kO0xW5P4mfe6TYVWf9VtY8k1JhNysBqsiYj0sk=
|
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/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.50-sing-box-mod.1 h1:XkJcivBC9V4wBjiGXIXZ229aZCU1hzcbp6kSkkyQ478=
|
||||||
github.com/sagernet/smux v1.5.34-mod.2/go.mod h1:0KW0+R+ycvA2INW4gbsd7BNyg+HEfLIAxa5N02/28Zc=
|
github.com/sagernet/smux v1.5.50-sing-box-mod.1/go.mod h1:NjhsCEWedJm7eFLyhuBgIEzwfhRmytrUoiLluxs5Sk8=
|
||||||
github.com/sagernet/tailscale v1.80.3-mod.5 h1:7V7z+p2C//TGtff20pPnDCt3qP6uFyY62peJoKF9z/A=
|
github.com/sagernet/tailscale v1.80.3-sing-box-1.12-mod.2 h1:MO7s4ni2bSfAOhcan2rdQSWCztkMXmqyg6jYPZp8bEE=
|
||||||
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.2/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 h1:ltgBwYHfr+9Wz1eG59NiWnHrYEkDKHG7otNZvu85DXI=
|
||||||
github.com/sagernet/wireguard-go v0.0.1-beta.7/go.mod h1:jGXij2Gn2wbrWuYNUmmNhf1dwcZtvyAvQoe8Xd8MbUo=
|
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 h1:6uUiZcDRnZSAegryaUGwPC/Fj13JSHwiTftrXhMmYOc=
|
||||||
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854/go.mod h1:LtfoSK3+NG57tvnVEHgcuBW9ujgE8enPSgzgwStwCAA=
|
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.26.1 h1:TOkEyriIXk2HX9d4isZJtbjXbEjf5qyKPAzbzY0JWSo=
|
||||||
github.com/shirou/gopsutil/v4 v4.25.7/go.mod h1:XV/egmwJtd3ZQjBpJVY5kndsiOO4IRqy9TQnmm6VP7U=
|
github.com/shirou/gopsutil/v4 v4.26.1/go.mod h1:medLI9/UNAb0dOI9Q3/7yWSqKkj00u+1tgY8nvv41pc=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
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.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
@@ -252,11 +253,10 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
|
|||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
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.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.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 h1:PtWT87weP5LWHEY//SWsYkSO3RWRZo4OSWagh3YD2vQ=
|
||||||
github.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e/go.mod h1:XrBNfAFN+pwoWuksbFS9Ccxnopa15zJGgXRFN90l3K4=
|
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=
|
github.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 h1:Gzfnfk2TWrk8Jj4P4c1a3CtQyMaTVCznlkLZI++hok4=
|
||||||
@@ -275,10 +275,10 @@ github.com/tailscale/web-client-prebuilt v0.0.0-20250124233751-d4cd19a26976 h1:U
|
|||||||
github.com/tailscale/web-client-prebuilt v0.0.0-20250124233751-d4cd19a26976/go.mod h1:agQPE6y6ldqCOui2gkIh7ZMztTkIQKH049tv8siLuNQ=
|
github.com/tailscale/web-client-prebuilt v0.0.0-20250124233751-d4cd19a26976/go.mod h1:agQPE6y6ldqCOui2gkIh7ZMztTkIQKH049tv8siLuNQ=
|
||||||
github.com/tc-hib/winres v0.2.1 h1:YDE0FiP0VmtRaDn7+aaChp1KiF4owBiJa5l964l5ujA=
|
github.com/tc-hib/winres v0.2.1 h1:YDE0FiP0VmtRaDn7+aaChp1KiF4owBiJa5l964l5ujA=
|
||||||
github.com/tc-hib/winres v0.2.1/go.mod h1:C/JaNhH3KBvhNKVbvdlDWkbMDO9H4fKKDaN7/07SSuk=
|
github.com/tc-hib/winres v0.2.1/go.mod h1:C/JaNhH3KBvhNKVbvdlDWkbMDO9H4fKKDaN7/07SSuk=
|
||||||
github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4=
|
github.com/tklauser/go-sysconf v0.3.16 h1:frioLaCQSsF5Cy1jgRBrzr6t502KIIwQ0MArYICU0nA=
|
||||||
github.com/tklauser/go-sysconf v0.3.15/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4=
|
github.com/tklauser/go-sysconf v0.3.16/go.mod h1:/qNL9xxDhc7tx3HSRsLWNnuzbVfh3e7gh/BmM179nYI=
|
||||||
github.com/tklauser/numcpus v0.10.0 h1:18njr6LDBk1zuna922MgdjQuJFjrdppsZG60sHGfjso=
|
github.com/tklauser/numcpus v0.11.0 h1:nSTwhKH5e1dMNsCdVBukSZrURJRoHbSEQjdEbY+9RXw=
|
||||||
github.com/tklauser/numcpus v0.10.0/go.mod h1:BiTKazU708GQTYF4mB+cmlpT2Is1gLk7XVuEeem8LsQ=
|
github.com/tklauser/numcpus v0.11.0/go.mod h1:z+LwcLq54uWZTX0u/bGobaV34u6V7KNlTZejzM6/3MQ=
|
||||||
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
||||||
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
||||||
github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 h1:pyC9PaHYZFgEKFdlp3G8RaCKgVpHZnecvArXvPXcFkM=
|
github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 h1:pyC9PaHYZFgEKFdlp3G8RaCKgVpHZnecvArXvPXcFkM=
|
||||||
@@ -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.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 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||||
|
go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
|
||||||
|
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
|
||||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
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/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||||
@@ -322,24 +324,24 @@ 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/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 h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M=
|
||||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
|
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.22.0 h1:c/Zle32i5ttqRXjdLyyHZESLD/bB90DCU1g9l/0YBDI=
|
||||||
golang.org/x/arch v0.19.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
|
golang.org/x/arch v0.22.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=
|
||||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
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.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
|
||||||
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
|
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
|
||||||
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI=
|
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI=
|
||||||
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
|
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
|
||||||
golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68=
|
golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68=
|
||||||
golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY=
|
golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY=
|
||||||
golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ=
|
golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=
|
||||||
golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
|
golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
|
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
|
||||||
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
|
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
|
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
|
||||||
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
@@ -349,21 +351,20 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20220817070843-5a390386f1f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220817070843-5a390386f1f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
|
||||||
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
|
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||||
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4=
|
golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q=
|
||||||
golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
|
golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
|
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
|
||||||
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
|
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
|
||||||
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
|
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
|
||||||
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
|
golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=
|
||||||
golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
|
golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ=
|
||||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg=
|
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg=
|
||||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
|
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
|
||||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20241231184526-a9ab2273dd10 h1:3GDAcqdIg1ozBNLgPy4SLT84nfcBjr6rhGtXYtrkWLU=
|
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20241231184526-a9ab2273dd10 h1:3GDAcqdIg1ozBNLgPy4SLT84nfcBjr6rhGtXYtrkWLU=
|
||||||
@@ -374,8 +375,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/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 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok=
|
||||||
google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc=
|
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.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
|
||||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
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/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=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
@@ -383,10 +384,9 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
|||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
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 h1:WHRRrIiulaPiPFmDcod6prc4l2VGVWHz80KspNsxSfQ=
|
||||||
gorm.io/driver/sqlite v1.6.0/go.mod h1:AO9V1qIQddBESngQUKWL9yoH93HIeA1X6V633rBwyT8=
|
gorm.io/driver/sqlite v1.6.0/go.mod h1:AO9V1qIQddBESngQUKWL9yoH93HIeA1X6V633rBwyT8=
|
||||||
gorm.io/gorm v1.30.1 h1:lSHg33jJTBxs2mgJRfRZeLDG+WZaHYCk3Wtfl6Ngzo4=
|
gorm.io/gorm v1.31.1 h1:7CA8FTFz/gRfgqgpeKIBcervUn3xSyPUmr6B2WXJ7kg=
|
||||||
gorm.io/gorm v1.30.1/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE=
|
gorm.io/gorm v1.31.1/go.mod h1:XyQVbO2k6YkOis7C2437jSit3SsDK72s7n7rsSHd+Gs=
|
||||||
lukechampine.com/blake3 v1.4.1 h1:I3Smz7gso8w4/TunLKec6K2fn+kyKtDxr/xcQEN84Wg=
|
lukechampine.com/blake3 v1.4.1 h1:I3Smz7gso8w4/TunLKec6K2fn+kyKtDxr/xcQEN84Wg=
|
||||||
lukechampine.com/blake3 v1.4.1/go.mod h1:QFosUxmjB8mnrWFSNwKmvxHpfY72bmD2tQ0kBMM3kwo=
|
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 h1:H2g08FrTvSFKUj+D309j1DPfk5APnIdAQAB8aEykJ5k=
|
||||||
software.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI=
|
software.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI=
|
||||||
|
|||||||
-60
@@ -38,66 +38,6 @@ arch() {
|
|||||||
|
|
||||||
echo "arch: $(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() {
|
install_base() {
|
||||||
case "${release}" in
|
case "${release}" in
|
||||||
centos | almalinux | rocky | oracle)
|
centos | almalinux | rocky | oracle)
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"s-ui/app"
|
|
||||||
"s-ui/cmd"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/app"
|
||||||
|
"github.com/alireza0/s-ui/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
func runApp() {
|
func runApp() {
|
||||||
|
|||||||
+7
-6
@@ -3,14 +3,15 @@ package service
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/database/model"
|
|
||||||
"s-ui/logger"
|
|
||||||
"s-ui/util"
|
|
||||||
"s-ui/util/common"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"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"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -283,7 +284,7 @@ func (s *ClientService) UpdateLinksByInboundChange(tx *gorm.DB, inbounds *[]mode
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
for _, clientLink := range clientLinks {
|
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)
|
newClientLinks = append(newClientLinks, clientLink)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-7
@@ -2,13 +2,14 @@ package service
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"s-ui/core"
|
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/database/model"
|
|
||||||
"s-ui/logger"
|
|
||||||
"s-ui/util/common"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"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 (
|
var (
|
||||||
@@ -142,7 +143,8 @@ func (s *ConfigService) Save(obj string, act string, data json.RawMessage, initU
|
|||||||
|
|
||||||
switch obj {
|
switch obj {
|
||||||
case "clients":
|
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 {
|
if err == nil && len(inboundIds) > 0 {
|
||||||
objs = append(objs, "inbounds")
|
objs = append(objs, "inbounds")
|
||||||
err = s.InboundService.RestartInbounds(tx, inboundIds)
|
err = s.InboundService.RestartInbounds(tx, inboundIds)
|
||||||
@@ -167,7 +169,9 @@ func (s *ConfigService) Save(obj string, act string, data json.RawMessage, initU
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
err = s.restartCoreWithConfig(data)
|
configData := make(json.RawMessage, len(data))
|
||||||
|
copy(configData, data)
|
||||||
|
go func() { _ = s.restartCoreWithConfig(configData) }()
|
||||||
case "settings":
|
case "settings":
|
||||||
err = s.SettingService.Save(tx, data)
|
err = s.SettingService.Save(tx, data)
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ package service
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"os"
|
"os"
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/database/model"
|
"github.com/alireza0/s-ui/database"
|
||||||
"s-ui/util/common"
|
"github.com/alireza0/s-ui/database/model"
|
||||||
|
"github.com/alireza0/s-ui/util/common"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|||||||
+5
-4
@@ -4,12 +4,13 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/database/model"
|
|
||||||
"s-ui/util"
|
|
||||||
"s-ui/util/common"
|
|
||||||
"strings"
|
"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"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ package service
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"os"
|
"os"
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/database/model"
|
"github.com/alireza0/s-ui/database"
|
||||||
"s-ui/util/common"
|
"github.com/alireza0/s-ui/database/model"
|
||||||
|
"github.com/alireza0/s-ui/util/common"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|||||||
+2
-1
@@ -3,9 +3,10 @@ package service
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"s-ui/logger"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PanelService struct {
|
type PanelService struct {
|
||||||
|
|||||||
+36
-13
@@ -4,12 +4,15 @@ import (
|
|||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"s-ui/config"
|
|
||||||
"s-ui/logger"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"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/sagernet/sing-box/common/tls"
|
"github.com/sagernet/sing-box/common/tls"
|
||||||
"github.com/shirou/gopsutil/v4/cpu"
|
"github.com/shirou/gopsutil/v4/cpu"
|
||||||
"github.com/shirou/gopsutil/v4/disk"
|
"github.com/shirou/gopsutil/v4/disk"
|
||||||
@@ -39,10 +42,11 @@ func (s *ServerService) GetStatus(request string) *map[string]interface{} {
|
|||||||
case "net":
|
case "net":
|
||||||
status["net"] = s.GetNetInfo()
|
status["net"] = s.GetNetInfo()
|
||||||
case "sys":
|
case "sys":
|
||||||
status["uptime"] = s.GetUptime()
|
|
||||||
status["sys"] = s.GetSystemInfo()
|
status["sys"] = s.GetSystemInfo()
|
||||||
case "sbd":
|
case "sbd":
|
||||||
status["sbd"] = s.GetSingboxInfo()
|
status["sbd"] = s.GetSingboxInfo()
|
||||||
|
case "db":
|
||||||
|
status["db"] = s.GetDatabaseInfo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return &status
|
return &status
|
||||||
@@ -58,16 +62,6 @@ func (s *ServerService) GetCpuPercent() float64 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ServerService) GetUptime() uint64 {
|
|
||||||
upTime, err := host.Uptime()
|
|
||||||
if err != nil {
|
|
||||||
logger.Warning("get uptime failed:", err)
|
|
||||||
return 0
|
|
||||||
} else {
|
|
||||||
return upTime
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *ServerService) GetMemInfo() map[string]interface{} {
|
func (s *ServerService) GetMemInfo() map[string]interface{} {
|
||||||
info := make(map[string]interface{}, 0)
|
info := make(map[string]interface{}, 0)
|
||||||
memInfo, err := mem.VirtualMemory()
|
memInfo, err := mem.VirtualMemory()
|
||||||
@@ -191,6 +185,7 @@ func (s *ServerService) GetSystemInfo() map[string]interface{} {
|
|||||||
}
|
}
|
||||||
info["ipv4"] = ipv4
|
info["ipv4"] = ipv4
|
||||||
info["ipv6"] = ipv6
|
info["ipv6"] = ipv6
|
||||||
|
info["bootTime"], _ = host.BootTime()
|
||||||
|
|
||||||
return info
|
return info
|
||||||
}
|
}
|
||||||
@@ -258,3 +253,31 @@ func (s *ServerService) generateWireGuardKey(pk string) []string {
|
|||||||
}
|
}
|
||||||
return []string{"PrivateKey: " + wgKeys.String(), "PublicKey: " + wgKeys.PublicKey().String()}
|
return []string{"PrivateKey: " + wgKeys.String(), "PublicKey: " + wgKeys.PublicKey().String()}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *ServerService) GetDatabaseInfo() map[string]int64 {
|
||||||
|
info := make(map[string]int64, 0)
|
||||||
|
db := database.GetDB()
|
||||||
|
if db == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var clientsCount, inboundsCount, outboundsCount, servicesCount, endpointsCount, clientUp, clientDown int64
|
||||||
|
|
||||||
|
db.Model(&model.Client{}).Count(&clientsCount)
|
||||||
|
db.Model(&model.Inbound{}).Count(&inboundsCount)
|
||||||
|
db.Model(&model.Outbound{}).Count(&outboundsCount)
|
||||||
|
db.Model(&model.Service{}).Count(&servicesCount)
|
||||||
|
db.Model(&model.Endpoint{}).Count(&endpointsCount)
|
||||||
|
db.Model(&model.Client{}).Select("COALESCE(SUM(up),0)").Scan(&clientUp)
|
||||||
|
db.Model(&model.Client{}).Select("COALESCE(SUM(down),0)").Scan(&clientDown)
|
||||||
|
|
||||||
|
info["clients"] = clientsCount
|
||||||
|
info["inbounds"] = inboundsCount
|
||||||
|
info["outbounds"] = outboundsCount
|
||||||
|
info["services"] = servicesCount
|
||||||
|
info["endpoints"] = endpointsCount
|
||||||
|
info["clientUp"] = clientUp
|
||||||
|
info["clientDown"] = clientDown
|
||||||
|
|
||||||
|
return info
|
||||||
|
}
|
||||||
|
|||||||
+4
-3
@@ -3,9 +3,10 @@ package service
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"os"
|
"os"
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/database/model"
|
"github.com/alireza0/s-ui/database"
|
||||||
"s-ui/util/common"
|
"github.com/alireza0/s-ui/database/model"
|
||||||
|
"github.com/alireza0/s-ui/util/common"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|||||||
+13
-5
@@ -4,15 +4,16 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"s-ui/config"
|
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/database/model"
|
|
||||||
"s-ui/logger"
|
|
||||||
"s-ui/util/common"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"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"
|
"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
|
err = tx.Model(model.Setting{}).Where("key = ?", key).Update("value", obj).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
+8
-5
@@ -1,10 +1,11 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/database/model"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/database"
|
||||||
|
"github.com/alireza0/s-ui/database/model"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ var onlineResources = &onlines{}
|
|||||||
type StatsService struct {
|
type StatsService struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StatsService) SaveStats() error {
|
func (s *StatsService) SaveStats(enableTraffic bool) error {
|
||||||
if !corePtr.IsRunning() {
|
if !corePtr.IsRunning() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -70,8 +71,10 @@ func (s *StatsService) SaveStats() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = tx.Create(&stats).Error
|
if !enableTraffic {
|
||||||
return err
|
return nil
|
||||||
|
}
|
||||||
|
return tx.Create(&stats).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StatsService) GetStats(resource string, tag string, limit int) ([]model.Stats, error) {
|
func (s *StatsService) GetStats(resource string, tag string, limit int) ([]model.Stats, error) {
|
||||||
|
|||||||
+4
-3
@@ -2,9 +2,10 @@ package service
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/database/model"
|
"github.com/alireza0/s-ui/database"
|
||||||
"s-ui/util/common"
|
"github.com/alireza0/s-ui/database/model"
|
||||||
|
"github.com/alireza0/s-ui/util/common"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|||||||
+5
-4
@@ -2,11 +2,12 @@ package service
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/database/model"
|
|
||||||
"s-ui/logger"
|
|
||||||
"s-ui/util/common"
|
|
||||||
"time"
|
"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 {
|
type UserService struct {
|
||||||
|
|||||||
+4
-3
@@ -8,12 +8,13 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"s-ui/database/model"
|
|
||||||
"s-ui/logger"
|
|
||||||
"s-ui/util/common"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"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"
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+47
-10
@@ -1,11 +1,12 @@
|
|||||||
package sub
|
package sub
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"s-ui/logger"
|
|
||||||
"s-ui/service"
|
|
||||||
"s-ui/util"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/logger"
|
||||||
|
"github.com/alireza0/s-ui/service"
|
||||||
|
"github.com/alireza0/s-ui/util"
|
||||||
|
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -73,8 +74,12 @@ func (s *ClashService) GetClash(subId string) (*string, []string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
links := s.LinkService.GetLinks(&client.Links, "external", "")
|
links := s.LinkService.GetLinks(&client.Links, "external", "")
|
||||||
|
tagNumEnable := 0
|
||||||
|
if len(links) > 1 {
|
||||||
|
tagNumEnable = 1
|
||||||
|
}
|
||||||
for index, link := range links {
|
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 {
|
if err == nil && len(tag) > 0 {
|
||||||
*outbounds = append(*outbounds, *json)
|
*outbounds = append(*outbounds, *json)
|
||||||
*outTags = append(*outTags, tag)
|
*outTags = append(*outTags, tag)
|
||||||
@@ -87,6 +92,9 @@ func (s *ClashService) GetClash(subId string) (*string, []string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
result, err := s.ConvertToClashMeta(outbounds)
|
result, err := s.ConvertToClashMeta(outbounds)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
resultStr := othersStr + "\n" + string(result)
|
resultStr := othersStr + "\n" + string(result)
|
||||||
|
|
||||||
updateInterval, _ := s.SettingService.GetSubUpdates()
|
updateInterval, _ := s.SettingService.GetSubUpdates()
|
||||||
@@ -117,14 +125,24 @@ func (s *ClashService) ConvertToClashMeta(outbounds *[]map[string]interface{}) (
|
|||||||
proxy := make(map[string]interface{})
|
proxy := make(map[string]interface{})
|
||||||
proxy["name"] = obMap["tag"]
|
proxy["name"] = obMap["tag"]
|
||||||
proxy["type"] = t
|
proxy["type"] = t
|
||||||
proxy["server"] = obMap["server"]
|
|
||||||
|
server, _ := obMap["server"].(string)
|
||||||
|
if len(server) > 0 && strings.Contains(server, ":") && !strings.Contains(server, ".") && !(strings.HasPrefix(server, "[") && strings.HasSuffix(server, "]")) {
|
||||||
|
server = "'[" + server + "]'"
|
||||||
|
}
|
||||||
|
proxy["server"] = server
|
||||||
|
|
||||||
proxy["port"] = obMap["server_port"]
|
proxy["port"] = obMap["server_port"]
|
||||||
|
|
||||||
switch t {
|
switch t {
|
||||||
case "vmess", "vless", "tuic":
|
case "vmess", "vless", "tuic":
|
||||||
proxy["uuid"] = obMap["uuid"]
|
proxy["uuid"] = obMap["uuid"]
|
||||||
if t == "vmess" {
|
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"
|
proxy["cipher"] = "auto"
|
||||||
}
|
}
|
||||||
if t == "vless" {
|
if t == "vless" {
|
||||||
@@ -184,6 +202,16 @@ func (s *ClashService) ConvertToClashMeta(outbounds *[]map[string]interface{}) (
|
|||||||
proxy["sni"] = tls["server_name"]
|
proxy["sni"] = tls["server_name"]
|
||||||
proxy["skip-cert-verify"] = tls["insecure"]
|
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:
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -197,10 +225,6 @@ func (s *ClashService) ConvertToClashMeta(outbounds *[]map[string]interface{}) (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if isTls {
|
if isTls {
|
||||||
// ignore ech outbounds
|
|
||||||
if _, ok := tls["ech"].(interface{}); ok {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
proxy["tls"] = tls["enabled"]
|
proxy["tls"] = tls["enabled"]
|
||||||
|
|
||||||
// ALPN if exists
|
// ALPN if exists
|
||||||
@@ -236,6 +260,19 @@ func (s *ClashService) ConvertToClashMeta(outbounds *[]map[string]interface{}) (
|
|||||||
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
||||||
proxy["skip-cert-verify"] = insecure
|
proxy["skip-cert-verify"] = insecure
|
||||||
}
|
}
|
||||||
|
// ech outbounds
|
||||||
|
if ech, ok := tls["ech"].(interface{}); ok {
|
||||||
|
ech_data, _ := ech.(map[string]interface{})
|
||||||
|
ech_config, _ := ech_data["config"].([]interface{})
|
||||||
|
ech_string := ""
|
||||||
|
for i := 1; i < len(ech_config)-1; i++ {
|
||||||
|
ech_string += ech_config[i].(string)
|
||||||
|
}
|
||||||
|
proxy["ech-opts"] = map[string]interface{}{
|
||||||
|
"enable": true,
|
||||||
|
"config": ech_string,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transport if exist
|
// Transport if exist
|
||||||
|
|||||||
+10
-5
@@ -3,11 +3,12 @@ package sub
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/database/model"
|
|
||||||
"s-ui/service"
|
|
||||||
"s-ui/util"
|
|
||||||
"strings"
|
"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 = `
|
const defaultJson = `
|
||||||
@@ -61,8 +62,12 @@ func (j *JsonService) GetJson(subId string, format string) (*string, []string, e
|
|||||||
}
|
}
|
||||||
|
|
||||||
links := j.LinkService.GetLinks(&client.Links, "external", "")
|
links := j.LinkService.GetLinks(&client.Links, "external", "")
|
||||||
|
tagNumEnable := 0
|
||||||
|
if len(links) > 1 {
|
||||||
|
tagNumEnable = 1
|
||||||
|
}
|
||||||
for index, link := range links {
|
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 {
|
if err == nil && len(tag) > 0 {
|
||||||
*outbounds = append(*outbounds, *json)
|
*outbounds = append(*outbounds, *json)
|
||||||
*outTags = append(*outTags, tag)
|
*outTags = append(*outTags, tag)
|
||||||
|
|||||||
+3
-2
@@ -5,9 +5,10 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"s-ui/logger"
|
|
||||||
"s-ui/util"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/logger"
|
||||||
|
"github.com/alireza0/s-ui/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Link struct {
|
type Link struct {
|
||||||
|
|||||||
+6
-5
@@ -6,13 +6,14 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"s-ui/config"
|
|
||||||
"s-ui/logger"
|
|
||||||
"s-ui/middleware"
|
|
||||||
"s-ui/network"
|
|
||||||
"s-ui/service"
|
|
||||||
"strconv"
|
"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"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+26
-6
@@ -1,8 +1,8 @@
|
|||||||
package sub
|
package sub
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"s-ui/logger"
|
"github.com/alireza0/s-ui/logger"
|
||||||
"s-ui/service"
|
"github.com/alireza0/s-ui/service"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
@@ -21,6 +21,7 @@ func NewSubHandler(g *gin.RouterGroup) {
|
|||||||
|
|
||||||
func (s *SubHandler) initRouter(g *gin.RouterGroup) {
|
func (s *SubHandler) initRouter(g *gin.RouterGroup) {
|
||||||
g.GET("/:subid", s.subs)
|
g.GET("/:subid", s.subs)
|
||||||
|
g.HEAD("/:subid", s.subHeaders)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SubHandler) subs(c *gin.Context) {
|
func (s *SubHandler) subs(c *gin.Context) {
|
||||||
@@ -49,10 +50,29 @@ func (s *SubHandler) subs(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add headers
|
|
||||||
c.Writer.Header().Set("Subscription-Userinfo", headers[0])
|
s.addHeaders(c, headers)
|
||||||
c.Writer.Header().Set("Profile-Update-Interval", headers[1])
|
|
||||||
c.Writer.Header().Set("Profile-Title", headers[2])
|
|
||||||
|
|
||||||
c.String(200, *result)
|
c.String(200, *result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *SubHandler) subHeaders(c *gin.Context) {
|
||||||
|
subId := c.Param("subid")
|
||||||
|
client, err := s.SubService.getClientBySubId(subId)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error(err)
|
||||||
|
c.String(400, "Error!")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
headers := s.SubService.getClientHeaders(client)
|
||||||
|
s.addHeaders(c, headers)
|
||||||
|
|
||||||
|
c.Status(200)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *SubHandler) addHeaders(c *gin.Context, headers []string) {
|
||||||
|
c.Writer.Header().Set("Subscription-Userinfo", headers[0])
|
||||||
|
c.Writer.Header().Set("Profile-Update-Interval", headers[1])
|
||||||
|
c.Writer.Header().Set("Profile-Title", headers[2])
|
||||||
|
}
|
||||||
|
|||||||
+22
-9
@@ -3,12 +3,13 @@ package sub
|
|||||||
import (
|
import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
"s-ui/database"
|
|
||||||
"s-ui/database/model"
|
|
||||||
"s-ui/service"
|
|
||||||
"s-ui/util"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"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 {
|
type SubService struct {
|
||||||
@@ -19,9 +20,7 @@ type SubService struct {
|
|||||||
func (s *SubService) GetSubs(subId string) (*string, []string, error) {
|
func (s *SubService) GetSubs(subId string) (*string, []string, error) {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
db := database.GetDB()
|
client, err := s.getClientBySubId(subId)
|
||||||
client := &model.Client{}
|
|
||||||
err = db.Model(model.Client{}).Where("enable = true and name = ?", subId).First(client).Error
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
@@ -35,8 +34,7 @@ func (s *SubService) GetSubs(subId string) (*string, []string, error) {
|
|||||||
linksArray := s.LinkService.GetLinks(&client.Links, "all", clientInfo)
|
linksArray := s.LinkService.GetLinks(&client.Links, "all", clientInfo)
|
||||||
result := strings.Join(linksArray, "\n")
|
result := strings.Join(linksArray, "\n")
|
||||||
|
|
||||||
updateInterval, _ := s.SettingService.GetSubUpdates()
|
headers := s.getClientHeaders(client)
|
||||||
headers := util.GetHeaders(client, updateInterval)
|
|
||||||
|
|
||||||
subEncode, _ := s.SettingService.GetSubEncode()
|
subEncode, _ := s.SettingService.GetSubEncode()
|
||||||
if subEncode {
|
if subEncode {
|
||||||
@@ -46,6 +44,21 @@ func (s *SubService) GetSubs(subId string) (*string, []string, error) {
|
|||||||
return &result, headers, nil
|
return &result, headers, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (j *SubService) getClientBySubId(subId string) (*model.Client, error) {
|
||||||
|
db := database.GetDB()
|
||||||
|
client := &model.Client{}
|
||||||
|
err := db.Model(model.Client{}).Where("enable = true and name = ?", subId).First(client).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return client, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *SubService) getClientHeaders(client *model.Client) []string {
|
||||||
|
updateInterval, _ := s.SettingService.GetSubUpdates()
|
||||||
|
return util.GetHeaders(client, updateInterval)
|
||||||
|
}
|
||||||
|
|
||||||
func (s *SubService) getClientInfo(c *model.Client) string {
|
func (s *SubService) getClientInfo(c *model.Client) string {
|
||||||
now := time.Now().Unix()
|
now := time.Now().Unix()
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -3,7 +3,8 @@ package common
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"s-ui/logger"
|
|
||||||
|
"github.com/alireza0/s-ui/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewErrorf(format string, a ...interface{}) error {
|
func NewErrorf(format string, a ...interface{}) error {
|
||||||
|
|||||||
+40
-15
@@ -1,30 +1,55 @@
|
|||||||
package common
|
package common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
crand "crypto/rand"
|
||||||
|
"math/big"
|
||||||
|
mrand "math/rand"
|
||||||
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
allSeq []rune
|
allSeq []rune = []rune{
|
||||||
rnd = rand.New(rand.NewSource(time.Now().UnixNano()))
|
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||||
|
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||||
|
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||||
|
}
|
||||||
|
|
||||||
|
fallbackRand = mrand.New(mrand.NewSource(time.Now().UnixNano()))
|
||||||
|
fallbackMu = sync.Mutex{}
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
chars := "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
|
||||||
for _, char := range chars {
|
|
||||||
allSeq = append(allSeq, char)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func Random(n int) string {
|
func Random(n int) string {
|
||||||
runes := make([]rune, n)
|
if n <= 0 || len(allSeq) == 0 {
|
||||||
for i := 0; i < n; i++ {
|
return ""
|
||||||
runes[i] = allSeq[rnd.Intn(len(allSeq))]
|
|
||||||
}
|
}
|
||||||
return string(runes)
|
result := make([]rune, n)
|
||||||
|
maxBig := big.NewInt(int64(len(allSeq)))
|
||||||
|
for i := 0; i < n; i++ {
|
||||||
|
num, err := crand.Int(crand.Reader, maxBig)
|
||||||
|
if err != nil {
|
||||||
|
// fallback
|
||||||
|
fallbackMu.Lock()
|
||||||
|
result[i] = allSeq[fallbackRand.Intn(len(allSeq))]
|
||||||
|
fallbackMu.Unlock()
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
result[i] = allSeq[int(num.Int64())]
|
||||||
|
}
|
||||||
|
return string(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
func RandomInt(n int) int {
|
func RandomInt(n int) int {
|
||||||
return rnd.Intn(n)
|
if n <= 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
max := big.NewInt(int64(n))
|
||||||
|
result, err := crand.Int(crand.Reader, max)
|
||||||
|
if err != nil {
|
||||||
|
// fallback
|
||||||
|
fallbackMu.Lock()
|
||||||
|
defer fallbackMu.Unlock()
|
||||||
|
return fallbackRand.Intn(n)
|
||||||
|
}
|
||||||
|
return int(result.Int64())
|
||||||
}
|
}
|
||||||
|
|||||||
+216
-232
@@ -5,13 +5,19 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
"s-ui/database/model"
|
|
||||||
"s-ui/util/common"
|
|
||||||
"strings"
|
"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"}
|
var InboundTypeWithLink = []string{"socks", "http", "mixed", "shadowsocks", "naive", "hysteria", "hysteria2", "anytls", "tuic", "vless", "trojan", "vmess"}
|
||||||
|
|
||||||
|
type LinkParam struct {
|
||||||
|
Key string
|
||||||
|
Value string
|
||||||
|
}
|
||||||
|
|
||||||
func LinkGenerator(clientConfig json.RawMessage, i *model.Inbound, hostname string) []string {
|
func LinkGenerator(clientConfig json.RawMessage, i *model.Inbound, hostname string) []string {
|
||||||
inbound, err := i.MarshalFull()
|
inbound, err := i.MarshalFull()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -29,7 +35,9 @@ func LinkGenerator(clientConfig json.RawMessage, i *model.Inbound, hostname stri
|
|||||||
}
|
}
|
||||||
|
|
||||||
var Addrs []map[string]interface{}
|
var Addrs []map[string]interface{}
|
||||||
json.Unmarshal(i.Addrs, &Addrs)
|
if err := json.Unmarshal(i.Addrs, &Addrs); err != nil {
|
||||||
|
return []string{}
|
||||||
|
}
|
||||||
if len(Addrs) == 0 {
|
if len(Addrs) == 0 {
|
||||||
Addrs = append(Addrs, map[string]interface{}{
|
Addrs = append(Addrs, map[string]interface{}{
|
||||||
"server": hostname,
|
"server": hostname,
|
||||||
@@ -62,12 +70,14 @@ func LinkGenerator(clientConfig json.RawMessage, i *model.Inbound, hostname stri
|
|||||||
|
|
||||||
switch i.Type {
|
switch i.Type {
|
||||||
case "socks":
|
case "socks":
|
||||||
return socksLink(userConfig["socks"], *inbound, Addrs)
|
return socksLink(userConfig["socks"], Addrs)
|
||||||
case "http":
|
case "http":
|
||||||
return httpLink(userConfig["http"], *inbound, Addrs)
|
return httpLink(userConfig["http"], Addrs)
|
||||||
case "mixed":
|
case "mixed":
|
||||||
return append(
|
return append(
|
||||||
socksLink(userConfig["socks"], *inbound, Addrs), httpLink(userConfig["http"], *inbound, Addrs)...)
|
socksLink(userConfig["socks"], Addrs),
|
||||||
|
httpLink(userConfig["http"], Addrs)...,
|
||||||
|
)
|
||||||
case "shadowsocks":
|
case "shadowsocks":
|
||||||
return shadowsocksLink(userConfig, *inbound, Addrs)
|
return shadowsocksLink(userConfig, *inbound, Addrs)
|
||||||
case "naive":
|
case "naive":
|
||||||
@@ -93,8 +103,12 @@ func LinkGenerator(clientConfig json.RawMessage, i *model.Inbound, hostname stri
|
|||||||
|
|
||||||
func prepareTls(t *model.Tls) map[string]interface{} {
|
func prepareTls(t *model.Tls) map[string]interface{} {
|
||||||
var iTls, oTls map[string]interface{}
|
var iTls, oTls map[string]interface{}
|
||||||
json.Unmarshal(t.Client, &oTls)
|
if err := json.Unmarshal(t.Client, &oTls); err != nil {
|
||||||
json.Unmarshal(t.Server, &iTls)
|
return nil
|
||||||
|
}
|
||||||
|
if err := json.Unmarshal(t.Server, &iTls); err != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
for k, v := range iTls {
|
for k, v := range iTls {
|
||||||
switch k {
|
switch k {
|
||||||
@@ -104,8 +118,8 @@ func prepareTls(t *model.Tls) map[string]interface{} {
|
|||||||
reality := v.(map[string]interface{})
|
reality := v.(map[string]interface{})
|
||||||
clientReality := oTls["reality"].(map[string]interface{})
|
clientReality := oTls["reality"].(map[string]interface{})
|
||||||
clientReality["enabled"] = reality["enabled"]
|
clientReality["enabled"] = reality["enabled"]
|
||||||
if short_ids, hasSIds := reality["short_id"].([]interface{}); hasSIds && len(short_ids) > 0 {
|
if shortIDs, hasSIds := reality["short_id"].([]interface{}); hasSIds && len(shortIDs) > 0 {
|
||||||
clientReality["short_id"] = short_ids[common.RandomInt(len(short_ids))]
|
clientReality["short_id"] = shortIDs[common.RandomInt(len(shortIDs))]
|
||||||
}
|
}
|
||||||
oTls["reality"] = clientReality
|
oTls["reality"] = clientReality
|
||||||
}
|
}
|
||||||
@@ -113,7 +127,7 @@ func prepareTls(t *model.Tls) map[string]interface{} {
|
|||||||
return oTls
|
return oTls
|
||||||
}
|
}
|
||||||
|
|
||||||
func socksLink(userConfig map[string]interface{}, inbound map[string]interface{}, addrs []map[string]interface{}) []string {
|
func socksLink(userConfig map[string]interface{}, addrs []map[string]interface{}) []string {
|
||||||
var links []string
|
var links []string
|
||||||
for _, addr := range addrs {
|
for _, addr := range addrs {
|
||||||
links = append(links, fmt.Sprintf("socks5://%s:%s@%s:%d", userConfig["username"], userConfig["password"], addr["server"].(string), uint(addr["server_port"].(float64))))
|
links = append(links, fmt.Sprintf("socks5://%s:%s@%s:%d", userConfig["username"], userConfig["password"], addr["server"].(string), uint(addr["server_port"].(float64))))
|
||||||
@@ -121,9 +135,9 @@ func socksLink(userConfig map[string]interface{}, inbound map[string]interface{}
|
|||||||
return links
|
return links
|
||||||
}
|
}
|
||||||
|
|
||||||
func httpLink(userConfig map[string]interface{}, inbound map[string]interface{}, addrs []map[string]interface{}) []string {
|
func httpLink(userConfig map[string]interface{}, addrs []map[string]interface{}) []string {
|
||||||
var links []string
|
var links []string
|
||||||
var protocol string = "http"
|
protocol := "http"
|
||||||
for _, addr := range addrs {
|
for _, addr := range addrs {
|
||||||
if addr["tls"] != nil {
|
if addr["tls"] != nil {
|
||||||
protocol = "https"
|
protocol = "https"
|
||||||
@@ -157,7 +171,7 @@ func shadowsocksLink(
|
|||||||
var links []string
|
var links []string
|
||||||
for _, addr := range addrs {
|
for _, addr := range addrs {
|
||||||
port, _ := addr["server_port"].(float64)
|
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
|
return links
|
||||||
}
|
}
|
||||||
@@ -174,31 +188,31 @@ func naiveLink(
|
|||||||
var links []string
|
var links []string
|
||||||
|
|
||||||
for _, addr := range addrs {
|
for _, addr := range addrs {
|
||||||
params := map[string]string{}
|
var params []LinkParam
|
||||||
params["padding"] = "1"
|
params = append(params, LinkParam{"padding", "1"})
|
||||||
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
||||||
if sni, ok := tls["server_name"].(string); ok {
|
if sni, ok := tls["server_name"].(string); ok {
|
||||||
params["peer"] = sni
|
params = append(params, LinkParam{"peer", sni})
|
||||||
}
|
}
|
||||||
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
||||||
alpnList := make([]string, len(alpn))
|
alpnList := make([]string, len(alpn))
|
||||||
for i, v := range alpn {
|
for i, v := range alpn {
|
||||||
alpnList[i] = v.(string)
|
alpnList[i] = v.(string)
|
||||||
}
|
}
|
||||||
params["alpn"] = strings.Join(alpnList, ",")
|
params = append(params, LinkParam{"alpn", strings.Join(alpnList, ",")})
|
||||||
}
|
}
|
||||||
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
||||||
params["insecure"] = "1"
|
params = append(params, LinkParam{"insecure", "1"})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if tfo, ok := inbound["tcp_fast_open"].(bool); ok && tfo {
|
if tfo, ok := inbound["tcp_fast_open"].(bool); ok && tfo {
|
||||||
params["tfo"] = "1"
|
params = append(params, LinkParam{"tfo", "1"})
|
||||||
} else {
|
} else {
|
||||||
params["tfo"] = "0"
|
params = append(params, LinkParam{"tfo", "0"})
|
||||||
}
|
}
|
||||||
|
|
||||||
port, _ := addr["server_port"].(float64)
|
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)))
|
links = append(links, addParams(uri, params, addr["remark"].(string)))
|
||||||
}
|
}
|
||||||
return links
|
return links
|
||||||
@@ -213,42 +227,41 @@ func hysteriaLink(
|
|||||||
var links []string
|
var links []string
|
||||||
|
|
||||||
for _, addr := range addrs {
|
for _, addr := range addrs {
|
||||||
params := map[string]string{}
|
var params []LinkParam
|
||||||
if upmbps, ok := inbound["up_mbps"].(string); ok {
|
if upmbps, ok := inbound["up_mbps"].(float64); ok {
|
||||||
params["up_mbps"] = upmbps
|
params = append(params, LinkParam{"downmbps", fmt.Sprintf("%.0f", upmbps)})
|
||||||
}
|
}
|
||||||
if downmbps, ok := inbound["down_mbps"].(string); ok {
|
if downmbps, ok := inbound["down_mbps"].(float64); ok {
|
||||||
params["down_mbps"] = downmbps
|
params = append(params, LinkParam{"upmbps", fmt.Sprintf("%.0f", downmbps)})
|
||||||
}
|
}
|
||||||
if auth, ok := userConfig["auth_str"].(string); ok {
|
if auth, ok := userConfig["auth_str"].(string); ok {
|
||||||
params["auth"] = auth
|
params = append(params, LinkParam{"auth", auth})
|
||||||
}
|
}
|
||||||
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
||||||
if sni, ok := tls["server_name"].(string); ok {
|
getTlsParams(¶ms, tls, "insecure")
|
||||||
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"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if obfs, ok := inbound["obfs"].(string); ok {
|
if obfs, ok := inbound["obfs"].(string); ok {
|
||||||
params["obfs"] = obfs
|
params = append(params, LinkParam{"obfs", obfs})
|
||||||
}
|
}
|
||||||
if tfo, ok := inbound["tcp_fast_open"].(bool); ok && tfo {
|
if tfo, ok := inbound["tcp_fast_open"].(bool); ok && tfo {
|
||||||
params["fastopen"] = "1"
|
params = append(params, LinkParam{"fastopen", "1"})
|
||||||
} else {
|
} else {
|
||||||
params["fastopen"] = "0"
|
params = append(params, LinkParam{"fastopen", "0"})
|
||||||
|
}
|
||||||
|
var outJson map[string]interface{}
|
||||||
|
if err := json.Unmarshal(inbound["out_json"].(json.RawMessage), &outJson); err != nil {
|
||||||
|
return []string{} // Handle error
|
||||||
|
}
|
||||||
|
if mport, ok := outJson["server_ports"].([]interface{}); ok {
|
||||||
|
mportList := make([]string, len(mport))
|
||||||
|
for i, v := range mport {
|
||||||
|
mportList[i] = v.(string)
|
||||||
|
}
|
||||||
|
params = append(params, LinkParam{"mport", strings.Join(mportList, ",")})
|
||||||
}
|
}
|
||||||
|
|
||||||
port, _ := addr["server_port"].(float64)
|
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)))
|
links = append(links, addParams(uri, params, addr["remark"].(string)))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,44 +278,43 @@ func hysteria2Link(
|
|||||||
var links []string
|
var links []string
|
||||||
|
|
||||||
for _, addr := range addrs {
|
for _, addr := range addrs {
|
||||||
params := map[string]string{}
|
var params []LinkParam
|
||||||
if upmbps, ok := inbound["up_mbps"].(string); ok {
|
if upmbps, ok := inbound["up_mbps"].(float64); ok {
|
||||||
params["up_mbps"] = upmbps
|
params = append(params, LinkParam{"downmbps", fmt.Sprintf("%.0f", upmbps)})
|
||||||
}
|
}
|
||||||
if downmbps, ok := inbound["down_mbps"].(string); ok {
|
if downmbps, ok := inbound["down_mbps"].(float64); ok {
|
||||||
params["down_mbps"] = downmbps
|
params = append(params, LinkParam{"upmbps", fmt.Sprintf("%.0f", downmbps)})
|
||||||
}
|
}
|
||||||
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
||||||
if sni, ok := tls["server_name"].(string); ok {
|
getTlsParams(¶ms, tls, "insecure")
|
||||||
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 obfs, ok := inbound["obfs"].(map[string]interface{}); ok {
|
if obfs, ok := inbound["obfs"].(map[string]interface{}); ok {
|
||||||
if obfsType, ok := obfs["type"].(string); ok {
|
if obfsType, ok := obfs["type"].(string); ok {
|
||||||
params["obfs"] = obfsType
|
params = append(params, LinkParam{"obfs", obfsType})
|
||||||
}
|
}
|
||||||
if obfsPassword, ok := obfs["password"].(string); ok {
|
if obfsPassword, ok := obfs["password"].(string); ok {
|
||||||
params["obfs-password"] = obfsPassword
|
params = append(params, LinkParam{"obfs-password", obfsPassword})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if tfo, ok := inbound["tcp_fast_open"].(bool); ok && tfo {
|
if tfo, ok := inbound["tcp_fast_open"].(bool); ok && tfo {
|
||||||
params["fastopen"] = "1"
|
params = append(params, LinkParam{"fastopen", "1"})
|
||||||
} else {
|
} else {
|
||||||
params["fastopen"] = "0"
|
params = append(params, LinkParam{"fastopen", "0"})
|
||||||
|
}
|
||||||
|
var outJson map[string]interface{}
|
||||||
|
if err := json.Unmarshal(inbound["out_json"].(json.RawMessage), &outJson); err != nil {
|
||||||
|
return []string{} // Handle error
|
||||||
|
}
|
||||||
|
if mport, ok := outJson["server_ports"].([]interface{}); ok {
|
||||||
|
mportList := make([]string, len(mport))
|
||||||
|
for i, v := range mport {
|
||||||
|
mportList[i] = v.(string)
|
||||||
|
}
|
||||||
|
params = append(params, LinkParam{"mport", strings.Join(mportList, ",")})
|
||||||
}
|
}
|
||||||
|
|
||||||
port, _ := addr["server_port"].(float64)
|
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)))
|
links = append(links, addParams(uri, params, addr["remark"].(string)))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,25 +330,13 @@ func anytlsLink(
|
|||||||
var links []string
|
var links []string
|
||||||
|
|
||||||
for _, addr := range addrs {
|
for _, addr := range addrs {
|
||||||
params := map[string]string{}
|
var params []LinkParam
|
||||||
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
||||||
if sni, ok := tls["server_name"].(string); ok {
|
getTlsParams(¶ms, tls, "insecure")
|
||||||
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"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
port, _ := addr["server_port"].(float64)
|
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)))
|
links = append(links, addParams(uri, params, addr["remark"].(string)))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,31 +354,16 @@ func tuicLink(
|
|||||||
var links []string
|
var links []string
|
||||||
|
|
||||||
for _, addr := range addrs {
|
for _, addr := range addrs {
|
||||||
params := map[string]string{}
|
var params []LinkParam
|
||||||
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
if tls, ok := addr["tls"].(map[string]interface{}); ok {
|
||||||
if sni, ok := tls["server_name"].(string); ok {
|
getTlsParams(¶ms, tls, "insecure")
|
||||||
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"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if congestionControl, ok := inbound["congestion_control"].(string); ok {
|
if congestionControl, ok := inbound["congestion_control"].(string); ok {
|
||||||
params["congestion_control"] = congestionControl
|
params = append(params, LinkParam{"congestion_control", congestionControl})
|
||||||
}
|
}
|
||||||
|
|
||||||
port, _ := addr["server_port"].(float64)
|
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)))
|
links = append(links, addParams(uri, params, addr["remark"].(string)))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,41 +380,16 @@ func vlessLink(
|
|||||||
var links []string
|
var links []string
|
||||||
|
|
||||||
for _, addr := range addrs {
|
for _, addr := range addrs {
|
||||||
params := baseParams
|
params := make([]LinkParam, len(baseParams))
|
||||||
|
copy(params, baseParams)
|
||||||
if tls, ok := addr["tls"].(map[string]interface{}); ok && tls["enabled"].(bool) {
|
if tls, ok := addr["tls"].(map[string]interface{}); ok && tls["enabled"].(bool) {
|
||||||
if reality, ok := tls["reality"].(map[string]interface{}); ok && reality["enabled"].(bool) {
|
getTlsParams(¶ms, tls, "allowInsecure")
|
||||||
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 flow, ok := userConfig["flow"].(string); ok {
|
if flow, ok := userConfig["flow"].(string); ok {
|
||||||
params["flow"] = flow
|
params = append(params, LinkParam{"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)
|
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))
|
uri = addParams(uri, params, addr["remark"].(string))
|
||||||
links = append(links, uri)
|
links = append(links, uri)
|
||||||
}
|
}
|
||||||
@@ -446,38 +406,13 @@ func trojanLink(
|
|||||||
var links []string
|
var links []string
|
||||||
|
|
||||||
for _, addr := range addrs {
|
for _, addr := range addrs {
|
||||||
params := baseParams
|
params := make([]LinkParam, len(baseParams))
|
||||||
|
copy(params, baseParams)
|
||||||
if tls, ok := addr["tls"].(map[string]interface{}); ok && tls["enabled"].(bool) {
|
if tls, ok := addr["tls"].(map[string]interface{}); ok && tls["enabled"].(bool) {
|
||||||
if reality, ok := tls["reality"].(map[string]interface{}); ok && reality["enabled"].(bool) {
|
getTlsParams(¶ms, tls, "allowInsecure")
|
||||||
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, ",")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
port, _ := addr["server_port"].(float64)
|
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))
|
uri = addParams(uri, params, addr["remark"].(string))
|
||||||
links = append(links, uri)
|
links = append(links, uri)
|
||||||
}
|
}
|
||||||
@@ -491,58 +426,58 @@ func vmessLink(
|
|||||||
addrs []map[string]interface{}) []string {
|
addrs []map[string]interface{}) []string {
|
||||||
|
|
||||||
uuid, _ := userConfig["uuid"].(string)
|
uuid, _ := userConfig["uuid"].(string)
|
||||||
trasportParams := getTransportParams(inbound["transport"])
|
transportParams := getTransportParams(inbound["transport"])
|
||||||
var links []string
|
var links []string
|
||||||
|
|
||||||
baseParams := map[string]interface{}{
|
baseParams := map[string]interface{}{
|
||||||
"v": 2,
|
"v": "2",
|
||||||
"id": uuid,
|
"id": uuid,
|
||||||
"aid": 0,
|
"aid": 0,
|
||||||
}
|
}
|
||||||
if trasportParams["type"] == "http" || trasportParams["type"] == "tcp" {
|
|
||||||
|
var net, typ, host, path string
|
||||||
|
for _, p := range transportParams {
|
||||||
|
switch p.Key {
|
||||||
|
case "type":
|
||||||
|
net = p.Value
|
||||||
|
case "host":
|
||||||
|
host = p.Value
|
||||||
|
case "path":
|
||||||
|
path = p.Value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if net == "http" || net == "tcp" {
|
||||||
baseParams["net"] = "tcp"
|
baseParams["net"] = "tcp"
|
||||||
if trasportParams["type"] == "http" {
|
if net == "http" {
|
||||||
baseParams["type"] = "http"
|
typ = "http"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
baseParams["net"] = trasportParams["type"]
|
baseParams["net"] = net
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, addr := range addrs {
|
for _, addr := range addrs {
|
||||||
obj := baseParams
|
obj := make(map[string]interface{})
|
||||||
obj["add"], _ = addr["server"].(string)
|
for k, v := range baseParams {
|
||||||
port, _ := addr["server_port"].(float64)
|
obj[k] = v
|
||||||
obj["port"] = uint(port)
|
|
||||||
obj["ps"], _ = addr["remark"].(string)
|
|
||||||
if trasportParams["host"] != "" {
|
|
||||||
obj["host"] = trasportParams["host"]
|
|
||||||
}
|
|
||||||
if trasportParams["path"] != "" {
|
|
||||||
obj["path"] = trasportParams["path"]
|
|
||||||
}
|
|
||||||
if tls, ok := addr["tls"].(map[string]interface{}); ok && tls["enabled"].(bool) {
|
|
||||||
obj["tls"] = "tls"
|
|
||||||
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
|
||||||
obj["allowInsecure"] = 1
|
|
||||||
}
|
|
||||||
if sni, ok := tls["server_name"].(string); ok {
|
|
||||||
obj["sni"] = sni
|
|
||||||
}
|
|
||||||
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
|
||||||
alpnList := make([]string, len(alpn))
|
|
||||||
for i, v := range alpn {
|
|
||||||
alpnList[i] = v.(string)
|
|
||||||
}
|
|
||||||
obj["alpn"] = strings.Join(alpnList, ",")
|
|
||||||
}
|
|
||||||
if utls, ok := tls["utls"].(map[string]interface{}); ok {
|
|
||||||
obj["fp"], _ = utls["fingerprint"].(string)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
obj["tls"] = "none"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
jsonStr, _ := json.MarshalIndent(obj, "", " ")
|
obj["add"], _ = addr["server"].(string)
|
||||||
|
port, _ := addr["server_port"].(float64)
|
||||||
|
obj["port"] = fmt.Sprintf("%.0f", port)
|
||||||
|
obj["ps"], _ = addr["remark"].(string)
|
||||||
|
if typ != "" {
|
||||||
|
obj["type"] = typ
|
||||||
|
}
|
||||||
|
if host != "" {
|
||||||
|
obj["host"] = host
|
||||||
|
}
|
||||||
|
if path != "" {
|
||||||
|
obj["path"] = path
|
||||||
|
}
|
||||||
|
populateVmessTlsParams(obj, addr["tls"])
|
||||||
|
|
||||||
|
jsonStr, _ := json.Marshal(obj)
|
||||||
|
|
||||||
uri := fmt.Sprintf("vmess://%s", toBase64(jsonStr))
|
uri := fmt.Sprintf("vmess://%s", toBase64(jsonStr))
|
||||||
links = append(links, uri)
|
links = append(links, uri)
|
||||||
@@ -550,82 +485,131 @@ func vmessLink(
|
|||||||
return links
|
return links
|
||||||
}
|
}
|
||||||
|
|
||||||
func toBase64(d []byte) string {
|
func populateVmessTlsParams(obj map[string]interface{}, tlsConfig interface{}) {
|
||||||
return base64.StdEncoding.EncodeToString([]byte(d))
|
if tlsMap, ok := tlsConfig.(map[string]interface{}); ok && tlsMap["enabled"].(bool) {
|
||||||
|
obj["tls"] = "tls"
|
||||||
|
var tlsParams []LinkParam
|
||||||
|
getTlsParams(&tlsParams, tlsMap, "allowInsecure")
|
||||||
|
for _, p := range tlsParams {
|
||||||
|
switch p.Key {
|
||||||
|
case "security":
|
||||||
|
// ignore, as "tls" is already set
|
||||||
|
case "allowInsecure":
|
||||||
|
obj["allowInsecure"] = 1
|
||||||
|
case "sni":
|
||||||
|
obj["sni"] = p.Value
|
||||||
|
case "fp":
|
||||||
|
obj["fp"] = p.Value
|
||||||
|
case "alpn":
|
||||||
|
obj["alpn"] = p.Value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
obj["tls"] = "none"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func addParams(uri string, params map[string]string, remark string) string {
|
func toBase64(d []byte) string {
|
||||||
|
return base64.StdEncoding.EncodeToString(d)
|
||||||
|
}
|
||||||
|
|
||||||
|
func addParams(uri string, params []LinkParam, remark string) string {
|
||||||
URL, _ := url.Parse(uri)
|
URL, _ := url.Parse(uri)
|
||||||
q := URL.Query()
|
var q []string
|
||||||
for k, v := range params {
|
for _, p := range params {
|
||||||
q.Add(k, v)
|
switch p.Key {
|
||||||
|
case "mport", "alpn":
|
||||||
|
q = append(q, fmt.Sprintf("%s=%s", p.Key, p.Value))
|
||||||
|
default:
|
||||||
|
q = append(q, fmt.Sprintf("%s=%s", p.Key, url.QueryEscape(p.Value)))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
URL.RawQuery = q.Encode()
|
URL.RawQuery = strings.Join(q, "&")
|
||||||
URL.Fragment = remark
|
URL.Fragment = remark
|
||||||
return URL.String()
|
return URL.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
func getTransportParams(t interface{}) map[string]string {
|
func getTransportParams(t interface{}) []LinkParam {
|
||||||
params := map[string]string{}
|
var params []LinkParam
|
||||||
trasport, _ := t.(map[string]interface{})
|
trasport, _ := t.(map[string]interface{})
|
||||||
if transportType, ok := trasport["type"].(string); ok {
|
var transportType string
|
||||||
params["type"] = transportType
|
if tt, ok := trasport["type"].(string); ok {
|
||||||
|
transportType = tt
|
||||||
} else {
|
} else {
|
||||||
params["type"] = "tcp"
|
transportType = "tcp"
|
||||||
|
}
|
||||||
|
params = append(params, LinkParam{"type", transportType})
|
||||||
|
if transportType == "tcp" {
|
||||||
return params
|
return params
|
||||||
}
|
}
|
||||||
switch params["type"] {
|
|
||||||
|
switch transportType {
|
||||||
case "http":
|
case "http":
|
||||||
if host, ok := trasport["host"].([]interface{}); ok {
|
if host, ok := trasport["host"].([]interface{}); ok {
|
||||||
var hosts []string
|
var hosts []string
|
||||||
for _, v := range host {
|
for _, v := range host {
|
||||||
hosts = append(hosts, v.(string))
|
hosts = append(hosts, v.(string))
|
||||||
}
|
}
|
||||||
params["host"] = strings.Join(hosts, ",")
|
params = append(params, LinkParam{"host", strings.Join(hosts, ",")})
|
||||||
}
|
}
|
||||||
if path, ok := trasport["path"].(string); ok {
|
if path, ok := trasport["path"].(string); ok {
|
||||||
params["path"] = path
|
params = append(params, LinkParam{"path", path})
|
||||||
}
|
}
|
||||||
case "ws":
|
case "ws":
|
||||||
if path, ok := trasport["path"].(string); ok {
|
if path, ok := trasport["path"].(string); ok {
|
||||||
params["path"] = path
|
params = append(params, LinkParam{"path", path})
|
||||||
}
|
}
|
||||||
if headers, ok := trasport["headers"].(map[string]interface{}); ok {
|
if headers, ok := trasport["headers"].(map[string]interface{}); ok {
|
||||||
if host, ok := headers["Host"].(string); ok {
|
if host, ok := headers["Host"].(string); ok {
|
||||||
params["host"] = host
|
params = append(params, LinkParam{"host", host})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "grpc":
|
case "grpc":
|
||||||
if serviceName, ok := trasport["service_name"].(string); ok {
|
if serviceName, ok := trasport["service_name"].(string); ok {
|
||||||
params["serviceName"] = serviceName
|
params = append(params, LinkParam{"serviceName", serviceName})
|
||||||
}
|
}
|
||||||
case "httpupgrade":
|
case "httpupgrade":
|
||||||
if host, ok := trasport["host"].(string); ok {
|
if host, ok := trasport["host"].(string); ok {
|
||||||
params["host"] = host
|
params = append(params, LinkParam{"host", host})
|
||||||
}
|
}
|
||||||
if path, ok := trasport["path"].(string); ok {
|
if path, ok := trasport["path"].(string); ok {
|
||||||
params["path"] = path
|
params = append(params, LinkParam{"path", path})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return params
|
return params
|
||||||
}
|
}
|
||||||
|
|
||||||
func getTlsParams(t interface{}) map[string]string {
|
func getTlsParams(params *[]LinkParam, tls map[string]interface{}, insecureKey string) {
|
||||||
params := map[string]string{}
|
if reality, ok := tls["reality"].(map[string]interface{}); ok && reality["enabled"].(bool) {
|
||||||
if tls, hasTls := t.(map[string]interface{}); hasTls {
|
*params = append(*params, LinkParam{"security", "reality"})
|
||||||
if sni, ok := tls["server_name"].(string); ok {
|
if pbk, ok := reality["public_key"].(string); ok {
|
||||||
params["sni"] = sni
|
*params = append(*params, LinkParam{"pbk", pbk})
|
||||||
}
|
}
|
||||||
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
if sid, ok := reality["short_id"].(string); ok {
|
||||||
alpnList := make([]string, len(alpn))
|
*params = append(*params, LinkParam{"sid", sid})
|
||||||
for i, v := range alpn {
|
|
||||||
alpnList[i] = v.(string)
|
|
||||||
}
|
|
||||||
params["alpn"] = strings.Join(alpnList, ",")
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
*params = append(*params, LinkParam{"security", "tls"})
|
||||||
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
if insecure, ok := tls["insecure"].(bool); ok && insecure {
|
||||||
params["insecure"] = "1"
|
*params = append(*params, LinkParam{insecureKey, "1"})
|
||||||
|
}
|
||||||
|
if disableSni, ok := tls["disable_sni"].(bool); ok && disableSni {
|
||||||
|
*params = append(*params, LinkParam{"disable_sni", "1"})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return params
|
if utls, ok := tls["utls"].(map[string]interface{}); ok {
|
||||||
|
if fingerprint, ok := utls["fingerprint"].(string); ok {
|
||||||
|
*params = append(*params, LinkParam{"fp", fingerprint})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if sni, ok := tls["server_name"].(string); ok {
|
||||||
|
*params = append(*params, LinkParam{"sni", sni})
|
||||||
|
}
|
||||||
|
if alpn, ok := tls["alpn"].([]interface{}); ok {
|
||||||
|
alpnList := make([]string, len(alpn))
|
||||||
|
for i, v := range alpn {
|
||||||
|
alpnList[i] = v.(string)
|
||||||
|
}
|
||||||
|
*params = append(*params, LinkParam{"alpn", strings.Join(alpnList, ",")})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-8
@@ -5,9 +5,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
"s-ui/util/common"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/util/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetOutbound(uri string, i int) (*map[string]interface{}, string, error) {
|
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 {
|
if i > 0 {
|
||||||
tag = fmt.Sprintf("%d.%s", i, tag)
|
tag = fmt.Sprintf("%d.%s", i, tag)
|
||||||
}
|
}
|
||||||
alter_id, ok := dataJson["aid"].(int)
|
alter_id := 0
|
||||||
if !ok {
|
if aid, ok := dataJson["aid"].(float64); ok {
|
||||||
alter_id = 0
|
alter_id = int(aid)
|
||||||
}
|
}
|
||||||
vmess := map[string]interface{}{
|
vmess := map[string]interface{}{
|
||||||
"type": "vmess",
|
"type": "vmess",
|
||||||
@@ -435,7 +436,7 @@ func ss(u *url.URL, i int) (*map[string]interface{}, string, error) {
|
|||||||
return &ss, tag, nil
|
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{}{}
|
transport := map[string]interface{}{}
|
||||||
tp_host := q.Get("host")
|
tp_host := q.Get("host")
|
||||||
tp_path := q.Get("path")
|
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["path"] = tp_path
|
||||||
transport["host"] = tp_host
|
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 := map[string]interface{}{}
|
||||||
tls_fp := q.Get("fp")
|
tls_fp := q.Get("fp")
|
||||||
tls_sni := q.Get("sni")
|
tls_sni := q.Get("sni")
|
||||||
@@ -516,5 +517,5 @@ func getTls(security string, q *url.Values) *map[string]interface{} {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return &tls
|
return tls
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-3
@@ -2,8 +2,10 @@ package util
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"math/rand"
|
|
||||||
"s-ui/database/model"
|
"github.com/alireza0/s-ui/util/common"
|
||||||
|
|
||||||
|
"github.com/alireza0/s-ui/database/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill Inbound's out_json
|
// Fill Inbound's out_json
|
||||||
@@ -107,7 +109,7 @@ func addTls(out *map[string]interface{}, tls *model.Tls) {
|
|||||||
realityConfig := tlsConfig["reality"].(map[string]interface{})
|
realityConfig := tlsConfig["reality"].(map[string]interface{})
|
||||||
realityConfig["enabled"] = true
|
realityConfig["enabled"] = true
|
||||||
if shortIDs, ok := reality["short_id"].([]interface{}); ok && len(shortIDs) > 0 {
|
if shortIDs, ok := reality["short_id"].([]interface{}); ok && len(shortIDs) > 0 {
|
||||||
realityConfig["short_id"] = shortIDs[rand.Intn(len(shortIDs))]
|
realityConfig["short_id"] = shortIDs[common.RandomInt(len(shortIDs))]
|
||||||
}
|
}
|
||||||
tlsConfig["reality"] = realityConfig
|
tlsConfig["reality"] = realityConfig
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,8 @@ package util
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"s-ui/database/model"
|
|
||||||
|
"github.com/alireza0/s-ui/database/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetHeaders(client *model.Client, updateInterval int) []string {
|
func GetHeaders(client *model.Client, updateInterval int) []string {
|
||||||
|
|||||||
+7
-6
@@ -9,15 +9,16 @@ import (
|
|||||||
"io/fs"
|
"io/fs"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"s-ui/api"
|
|
||||||
"s-ui/config"
|
|
||||||
"s-ui/logger"
|
|
||||||
"s-ui/middleware"
|
|
||||||
"s-ui/network"
|
|
||||||
"s-ui/service"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"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/gzip"
|
||||||
"github.com/gin-contrib/sessions"
|
"github.com/gin-contrib/sessions"
|
||||||
"github.com/gin-contrib/sessions/cookie"
|
"github.com/gin-contrib/sessions/cookie"
|
||||||
|
|||||||
Reference in New Issue
Block a user