Merge branch 'master' into cursor/delete-service-metrics-when-service-is-deleted-30a8

pull/806/head
云昊 2025-10-28 17:10:23 +08:00 committed by GitHub
commit 7a96fa0e00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 87 additions and 10 deletions

View File

@ -21,8 +21,12 @@ jobs:
- run: git fetch --force --tags - run: git fetch --force --tags
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: '1.24' go-version: '1.25'
cache: true cache: true
- name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
# More assembly might be required: Docker logins, GPG, etc. It all depends # More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs. # on your needs.
- uses: goreleaser/goreleaser-action@v6 - uses: goreleaser/goreleaser-action@v6

View File

@ -3,7 +3,7 @@ name: Trigger nightly build
on: on:
schedule: schedule:
# * is a special character in YAML, so you have to quote this string # * is a special character in YAML, so you have to quote this string
- cron: '30 15 * * *' - cron: '00 15 * * *'
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@ -46,8 +46,9 @@ jobs:
DESCRIBE=`git tag -l --sort=-v:refname | grep -v nightly | head -n 1` DESCRIBE=`git tag -l --sort=-v:refname | grep -v nightly | head -n 1`
MAJOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[1]}'` MAJOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[1]}'`
MINOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[2]}'` MINOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[2]}'`
# MINOR_VERSION="$((${MINOR_VERSION} + 1))" PATCH_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[3]}'`
TAG="${MAJOR_VERSION}.${MINOR_VERSION}.0-nightly.$(date +'%Y%m%d')" PATCH_VERSION="$((${PATCH_VERSION} + 1))"
TAG="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-nightly.$(date +'%Y%m%d')"
git tag -a $TAG -m "$TAG: nightly build" git tag -a $TAG -m "$TAG: nightly build"
git push origin $TAG git push origin $TAG
- name: 'Clean up nightly releases' - name: 'Clean up nightly releases'

View File

@ -38,6 +38,67 @@ builds:
ldflags: ldflags:
- "-s -w -X 'main.version={{ .Tag }}'" - "-s -w -X 'main.version={{ .Tag }}'"
upx:
- # Whether to enable it or not.
#
# Templates: allowed.
enabled: true
# Filter by build ID.
# ids: [build1, build2]
# Filter by GOOS.
goos: [linux]
# Filter by GOARCH.
goarch: [arm, arm64, amd64]
# Filter by GOARM.
# goarm: [8]
# Filter by GOAMD64.
# goamd64: [v1]
# Compress argument.
# Valid options are from '1' (faster) to '9' (better), and 'best'.
compress: best
# Whether to try LZMA (slower).
lzma: true
# Whether to try all methods and filters (slow).
brute: true
- # Whether to enable it or not.
#
# Templates: allowed.
enabled: true
# Filter by build ID.
# ids: [build1, build2]
# Filter by GOOS.
goos: [windows]
# Filter by GOARCH.
goarch: [amd64]
# Filter by GOARM.
# goarm: [8]
# Filter by GOAMD64.
# goamd64: [v1]
# Compress argument.
# Valid options are from '1' (faster) to '9' (better), and 'best'.
compress: best
# Whether to try LZMA (slower).
lzma: true
# Whether to try all methods and filters (slow).
brute: true
archives: archives:
- format: tar.gz - format: tar.gz
# use zip for windows archives # use zip for windows archives

View File

@ -1,6 +1,9 @@
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.6.1 AS xx FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.6.1 AS xx
FROM --platform=$BUILDPLATFORM golang:1.24-alpine3.22 AS builder FROM --platform=$BUILDPLATFORM golang:1.25-alpine3.22 AS builder
# add upx for binary compression
RUN apk add --no-cache upx || echo "upx not found"
COPY --from=xx / / COPY --from=xx / /
@ -17,8 +20,9 @@ WORKDIR /app
COPY . . COPY . .
RUN cd cmd/gost && \ RUN cd cmd/gost && \
xx-go build && \ xx-go build -ldflags "-s -w" && \
xx-verify gost xx-verify gost && \
{ upx --best gost || true; }
FROM alpine:3.22 FROM alpine:3.22

View File

@ -13,7 +13,7 @@
- [x] [反向代理](https://gost.run/tutorials/reverse-proxy/)和[隧道](https://gost.run/tutorials/reverse-proxy-tunnel/) - [x] [反向代理](https://gost.run/tutorials/reverse-proxy/)和[隧道](https://gost.run/tutorials/reverse-proxy-tunnel/)
- [x] [TCP/UDP透明代理](https://gost.run/tutorials/redirect/) - [x] [TCP/UDP透明代理](https://gost.run/tutorials/redirect/)
- [x] DNS[解析](https://gost.run/concepts/resolver/)和[代理](https://gost.run/tutorials/dns/) - [x] DNS[解析](https://gost.run/concepts/resolver/)和[代理](https://gost.run/tutorials/dns/)
- [x] [TUN/TAP设备](https://gost.run/tutorials/tuntap/) - [x] [TUN/TAP设备](https://gost.run/tutorials/tuntap/)与[TUN2SOCKS](https://gost.run/tutorials/tungo/)
- [x] [负载均衡](https://gost.run/concepts/selector/) - [x] [负载均衡](https://gost.run/concepts/selector/)
- [x] [路由控制](https://gost.run/concepts/bypass/) - [x] [路由控制](https://gost.run/concepts/bypass/)
- [x] [准入控制](https://gost.run/concepts/admission/) - [x] [准入控制](https://gost.run/concepts/admission/)

View File

@ -13,7 +13,7 @@
- [x] [Reverse Proxy](https://gost.run/en/tutorials/reverse-proxy/) and [Tunnel](https://gost.run/en/tutorials/reverse-proxy-tunnel/) - [x] [Reverse Proxy](https://gost.run/en/tutorials/reverse-proxy/) and [Tunnel](https://gost.run/en/tutorials/reverse-proxy-tunnel/)
- [x] [TCP/UDP transparent proxy](https://gost.run/en/tutorials/redirect/) - [x] [TCP/UDP transparent proxy](https://gost.run/en/tutorials/redirect/)
- [x] DNS [resolver](https://gost.run/en/concepts/resolver/) and [proxy](https://gost.run/en/tutorials/dns/) - [x] DNS [resolver](https://gost.run/en/concepts/resolver/) and [proxy](https://gost.run/en/tutorials/dns/)
- [x] [TUN/TAP device](https://gost.run/en/tutorials/tuntap/) - [x] [TUN/TAP device](https://gost.run/en/tutorials/tuntap/) and [TUN2SOCKS](https://gost.run/en/tutorials/tungo/)
- [x] [Load balancing](https://gost.run/en/concepts/selector/) - [x] [Load balancing](https://gost.run/en/concepts/selector/)
- [x] [Routing control](https://gost.run/en/concepts/bypass/) - [x] [Routing control](https://gost.run/en/concepts/bypass/)
- [x] [Admission control](https://gost.run/en/concepts/limiter/) - [x] [Admission control](https://gost.run/en/concepts/limiter/)

View File

@ -70,6 +70,7 @@ import (
_ "github.com/go-gost/x/handler/sshd" _ "github.com/go-gost/x/handler/sshd"
_ "github.com/go-gost/x/handler/tap" _ "github.com/go-gost/x/handler/tap"
_ "github.com/go-gost/x/handler/tun" _ "github.com/go-gost/x/handler/tun"
_ "github.com/go-gost/x/handler/tungo"
_ "github.com/go-gost/x/handler/tunnel" _ "github.com/go-gost/x/handler/tunnel"
_ "github.com/go-gost/x/handler/unix" _ "github.com/go-gost/x/handler/unix"
@ -103,6 +104,7 @@ import (
_ "github.com/go-gost/x/listener/tcp" _ "github.com/go-gost/x/listener/tcp"
_ "github.com/go-gost/x/listener/tls" _ "github.com/go-gost/x/listener/tls"
_ "github.com/go-gost/x/listener/tun" _ "github.com/go-gost/x/listener/tun"
_ "github.com/go-gost/x/listener/tungo"
_ "github.com/go-gost/x/listener/udp" _ "github.com/go-gost/x/listener/udp"
_ "github.com/go-gost/x/listener/unix" _ "github.com/go-gost/x/listener/unix"
_ "github.com/go-gost/x/listener/ws" _ "github.com/go-gost/x/listener/ws"

View File

@ -1,5 +1,5 @@
package main package main
var ( var (
version = "3.1.1" version = "3.2.5"
) )

3
go.mod
View File

@ -41,6 +41,7 @@ require (
github.com/goccy/go-json v0.10.2 // indirect github.com/goccy/go-json v0.10.2 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang/snappy v0.0.4 // indirect github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/gopacket v1.1.19 // indirect github.com/google/gopacket v1.1.19 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect github.com/google/uuid v1.6.0 // indirect
@ -95,6 +96,7 @@ require (
github.com/vishvananda/netlink v1.1.1-0.20211118161826-650dca95af54 // indirect github.com/vishvananda/netlink v1.1.1-0.20211118161826-650dca95af54 // indirect
github.com/vishvananda/netns v0.0.4 // indirect github.com/vishvananda/netns v0.0.4 // indirect
github.com/vulcand/predicate v1.2.0 // indirect github.com/vulcand/predicate v1.2.0 // indirect
github.com/xjasonlyu/tun2socks/v2 v2.6.0 // indirect
github.com/xtaci/kcp-go/v5 v5.6.5 // indirect github.com/xtaci/kcp-go/v5 v5.6.5 // indirect
github.com/xtaci/smux v1.5.31 // indirect github.com/xtaci/smux v1.5.31 // indirect
github.com/xtaci/tcpraw v1.2.25 // indirect github.com/xtaci/tcpraw v1.2.25 // indirect
@ -121,6 +123,7 @@ require (
gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
gvisor.dev/gvisor v0.0.0-20250523182742-eede7a881b20 // indirect
) )
replace github.com/go-gost/x => ./x replace github.com/go-gost/x => ./x

2
go.sum
View File

@ -246,6 +246,8 @@ github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1Y
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM= github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
github.com/vulcand/predicate v1.2.0 h1:uFsW1gcnnR7R+QTID+FVcs0sSYlIGntoGOTb3rQJt50= github.com/vulcand/predicate v1.2.0 h1:uFsW1gcnnR7R+QTID+FVcs0sSYlIGntoGOTb3rQJt50=
github.com/vulcand/predicate v1.2.0/go.mod h1:VipoNYXny6c8N381zGUWkjuuNHiRbeAZhE7Qm9c+2GA= github.com/vulcand/predicate v1.2.0/go.mod h1:VipoNYXny6c8N381zGUWkjuuNHiRbeAZhE7Qm9c+2GA=
github.com/xjasonlyu/tun2socks/v2 v2.6.0 h1:gI9saJT3XgH4e6v9jBuHRLwK7l3aN9YFWec/SsDTDx4=
github.com/xjasonlyu/tun2socks/v2 v2.6.0/go.mod h1:35AwqxIxnMkfBfT0UJ1Lku7PZm2ZiZJ8sxHyp0gt1yw=
github.com/xtaci/kcp-go/v5 v5.6.5 h1:oxGZNobj3OddrLzwdJYnR/waNgwrL98u02u0DWNHE3k= github.com/xtaci/kcp-go/v5 v5.6.5 h1:oxGZNobj3OddrLzwdJYnR/waNgwrL98u02u0DWNHE3k=
github.com/xtaci/kcp-go/v5 v5.6.5/go.mod h1:Qy3Zf2tWTdFdEs0E8JvhrX+39r5UDZoYac8anvud7/Q= github.com/xtaci/kcp-go/v5 v5.6.5/go.mod h1:Qy3Zf2tWTdFdEs0E8JvhrX+39r5UDZoYac8anvud7/Q=
github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae h1:J0GxkO96kL4WF+AIT3M4mfUVinOCPgf2uUWYFUzN0sM= github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae h1:J0GxkO96kL4WF+AIT3M4mfUVinOCPgf2uUWYFUzN0sM=