Skip to content

Commit bbb9cfd

Browse files
committed
添加 appBuildDate
1 parent ff07c81 commit bbb9cfd

File tree

7 files changed

+64
-66
lines changed

7 files changed

+64
-66
lines changed

build_docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ echo $ver
88
# 生成时间 2024-01-30T21:41:27+08:00
99
# date -Iseconds
1010

11-
docker run -it --rm -v $PWD/web:/app -w /app node:16-alpine \
12-
sh -c "yarn install --registry=https://registry.npmmirror.com && yarn run build"
11+
#docker run -it --rm -v $PWD/web:/app -w /app node:16-alpine \
12+
# sh -c "yarn install --registry=https://registry.npmmirror.com && yarn run build"
1313

1414
docker buildx build -t bjdgyc/anylink:latest --progress=plain --build-arg CN="yes" --build-arg appVer=$ver \
1515
--build-arg commitId=$(git rev-parse HEAD) -f docker/Dockerfile .

docker/init_build.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [[ $CN == "yes" ]]; then
88
export GOPROXY=https://goproxy.cn
99
fi
1010

11-
apk add build-base tzdata gcc musl-dev upx
11+
apk add build-base tzdata gcc g++ musl musl-dev upx
1212

1313
uname -a
1414
env
@@ -20,12 +20,10 @@ go mod tidy
2020

2121
echo "start build"
2222

23-
extldflags="-static"
24-
ldflags="-s -w -X main.appVer=$appVer -X main.commitId=$commitId -X main.buildDate=$(date -Iseconds) \
25-
-extldflags \"$extldflags\" "
23+
ldflags="-s -w -X main.appVer=$appVer -X main.commitId=$commitId -X main.buildDate=$(date -Iseconds) -extldflags '-static' "
2624

2725
export CGO_ENABLED=1
28-
go build -o anylink -trimpath -ldflags "$ldflags"
26+
go build -v -o anylink -trimpath -ldflags "$ldflags"
2927

3028
ls -lh /server/
3129

docker/init_release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [[ $CN == "yes" ]]; then
88
export GOPROXY=https://goproxy.cn
99
fi
1010

11-
#兼容老版 iptables
11+
# alpine:3.19 兼容老版 iptables
1212
apk add --no-cache iptables iptables-legacy
1313
rm /sbin/iptables
1414
ln -s /sbin/iptables-legacy /sbin/iptables

server/admin/api_set.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@ func SetSystem(w http.ResponseWriter, r *http.Request) {
6666
hi, _ := host.Info()
6767
l, _ := load.Avg()
6868
data["sys"] = map[string]interface{}{
69-
"goOs": runtime.GOOS,
70-
"goArch": runtime.GOARCH,
71-
"goVersion": runtime.Version(),
72-
"goroutine": runtime.NumGoroutine(),
73-
"appVersion": "v" + base.APP_VER,
74-
"appCommitId": base.CommitId,
69+
"goOs": runtime.GOOS,
70+
"goArch": runtime.GOARCH,
71+
"goVersion": runtime.Version(),
72+
"goroutine": runtime.NumGoroutine(),
73+
"appVersion": "v" + base.APP_VER,
74+
"appCommitId": base.CommitId,
75+
"appBuildDate": base.BuildDate,
7576

7677
"hostname": hi.Hostname,
7778
"platform": fmt.Sprintf("%v %v %v", hi.Platform, hi.PlatformFamily, hi.PlatformVersion),

server/go.mod

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.20
55
require (
66
github.com/arl/statsviz v0.6.0
77
github.com/deckarep/golang-set v1.8.0
8-
github.com/go-acme/lego/v4 v4.14.2
8+
github.com/go-acme/lego/v4 v4.15.0
99
github.com/go-co-op/gocron v1.37.0
1010
github.com/go-ldap/ldap v3.0.3+incompatible
1111
github.com/go-sql-driver/mysql v1.7.1
@@ -17,9 +17,9 @@ require (
1717
github.com/ivpusic/grpool v1.0.0
1818
github.com/lanrenwo/lzsgo v0.0.2
1919
github.com/lib/pq v1.10.9
20-
github.com/mattn/go-sqlite3 v1.14.19
20+
github.com/mattn/go-sqlite3 v1.14.22
2121
github.com/orcaman/concurrent-map v1.0.0
22-
github.com/pion/dtls/v2 v2.2.9
22+
github.com/pion/dtls/v2 v2.2.10
2323
github.com/pion/logging v0.2.2
2424
github.com/pires/go-proxyproto v0.7.0
2525
github.com/shirou/gopsutil v3.21.11+incompatible
@@ -34,23 +34,23 @@ require (
3434
github.com/xlzd/gotp v0.1.0
3535
github.com/xuri/excelize/v2 v2.8.0
3636
go.uber.org/atomic v1.11.0
37-
golang.org/x/crypto v0.18.0
38-
golang.org/x/net v0.20.0
37+
golang.org/x/crypto v0.19.0
38+
golang.org/x/net v0.21.0
3939
golang.org/x/text v0.14.0
4040
golang.org/x/time v0.5.0
4141
layeh.com/radius v0.0.0-20231213012653-1006025d24f8
42-
xorm.io/xorm v1.3.7
42+
xorm.io/xorm v1.3.8
4343
)
4444

4545
require (
46-
github.com/aliyun/alibaba-cloud-sdk-go v1.62.664 // indirect
46+
github.com/aliyun/alibaba-cloud-sdk-go v1.62.679 // indirect
4747
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
48-
github.com/cloudflare/cloudflare-go v0.86.0 // indirect
48+
github.com/cloudflare/cloudflare-go v0.88.0 // indirect
4949
github.com/felixge/httpsnoop v1.0.4 // indirect
5050
github.com/go-jose/go-jose/v3 v3.0.1 // indirect
5151
github.com/go-test/deep v1.1.0 // indirect
5252
github.com/google/go-querystring v1.1.0 // indirect
53-
github.com/google/uuid v1.5.0 // indirect
53+
github.com/google/uuid v1.6.0 // indirect
5454
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
5555
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
5656
github.com/jmespath/go-jmespath v0.4.0 // indirect
@@ -61,14 +61,14 @@ require (
6161
github.com/sagikazarmark/locafero v0.4.0 // indirect
6262
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
6363
github.com/sourcegraph/conc v0.3.0 // indirect
64-
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.846 // indirect
65-
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.846 // indirect
64+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.859 // indirect
65+
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dnspod v1.0.859 // indirect
6666
github.com/toorop/go-dkim v0.0.0-20240103092955-90b7d1423f92 // indirect
67-
github.com/yusufpapurcu/wmi v1.2.3 // indirect
67+
github.com/yusufpapurcu/wmi v1.2.4 // indirect
6868
go.uber.org/multierr v1.11.0 // indirect
69-
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect
70-
golang.org/x/mod v0.14.0 // indirect
71-
golang.org/x/tools v0.17.0 // indirect
69+
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect
70+
golang.org/x/mod v0.15.0 // indirect
71+
golang.org/x/tools v0.18.0 // indirect
7272
)
7373

7474
require (
@@ -99,7 +99,7 @@ require (
9999
github.com/tklauser/numcpus v0.7.0 // indirect
100100
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 // indirect
101101
github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05 // indirect
102-
golang.org/x/sys v0.16.0 // indirect
102+
golang.org/x/sys v0.17.0 // indirect
103103
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
104104
gopkg.in/ini.v1 v1.67.0 // indirect
105105
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)