Skip to content

Commit 79924f6

Browse files
feat(health): expand health check capabilities with new metrics and UI enhancements
- Introduced new health check metrics including DPI classification, reality verification, and pageload performance. - Updated the health check configuration to include new fields for SNI, pageload URL, and stability duration. - Enhanced the web interface to support subscription link testing and improved user experience with a new mode for proxy management. - Added a new CI workflow for building and testing the server module with Docker. These changes significantly enhance the functionality and usability of the health check system, providing users with more comprehensive insights and a better interface for managing health checks and subscriptions.
1 parent 45ce560 commit 79924f6

55 files changed

Lines changed: 4385 additions & 8 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,35 @@ jobs:
9797
report.html
9898
result.json
9999
100+
server:
101+
name: Server (module + Docker)
102+
runs-on: ubuntu-latest
103+
steps:
104+
- uses: actions/checkout@v4
105+
106+
- name: Set up Go
107+
uses: actions/setup-go@v5
108+
with:
109+
go-version-file: server/go.mod
110+
cache: true
111+
cache-dependency-path: server/go.sum
112+
113+
- name: Vet + build + test server module
114+
working-directory: server
115+
run: |
116+
go mod verify
117+
go vet ./...
118+
go build -o /dev/null .
119+
go test ./...
120+
121+
- name: Validate docker-compose
122+
working-directory: server
123+
run: docker compose config -q
124+
125+
- name: Build server Docker image
126+
working-directory: server
127+
run: docker build -t health-check-server:ci .
128+
100129
cross-compile:
101130
name: Cross-compile
102131
runs-on: ubuntu-latest

Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Client web UI (hiddify-health serve) with sing-box + xray cores bundled, so
2+
# proxy/subscription testing works inside the container.
3+
4+
# --- build the Go binary ---
5+
FROM golang:1.25 AS build
6+
WORKDIR /src
7+
COPY go.mod go.sum ./
8+
RUN go mod download
9+
COPY . .
10+
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o /hiddify-health ./cmd
11+
12+
# --- fetch the cores ---
13+
FROM --platform=$BUILDPLATFORM debian:bookworm-slim AS cores
14+
ARG SB_VER=1.13.13
15+
ARG XR_VER=26.3.27
16+
ARG TARGETARCH
17+
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates unzip && rm -rf /var/lib/apt/lists/*
18+
RUN curl -fsSL -o /tmp/sb.tgz \
19+
"https://github.com/SagerNet/sing-box/releases/download/v${SB_VER}/sing-box-${SB_VER}-linux-${TARGETARCH}.tar.gz" \
20+
&& tar -xzf /tmp/sb.tgz -C /tmp \
21+
&& mv "/tmp/sing-box-${SB_VER}-linux-${TARGETARCH}/sing-box" /usr/local/bin/sing-box
22+
RUN XR_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "arm64-v8a" || echo "64") \
23+
&& curl -fsSL -o /tmp/xray.zip \
24+
"https://github.com/XTLS/Xray-core/releases/download/v${XR_VER}/Xray-linux-${XR_ARCH}.zip" \
25+
&& unzip -o /tmp/xray.zip xray -d /usr/local/bin
26+
27+
# --- runtime ---
28+
FROM debian:bookworm-slim
29+
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*
30+
COPY --from=build /hiddify-health /usr/local/bin/hiddify-health
31+
COPY --from=cores /usr/local/bin/sing-box /usr/local/bin/sing-box
32+
COPY --from=cores /usr/local/bin/xray /usr/local/bin/xray
33+
ENV SINGBOX_BIN=/usr/local/bin/sing-box \
34+
XRAY_BIN=/usr/local/bin/xray \
35+
XRAY_CLIENT_PATH=/usr/local/bin/xray \
36+
XRAY_SERVER_PATH=/usr/local/bin/xray
37+
EXPOSE 8090
38+
ENTRYPOINT ["hiddify-health", "serve", "--addr", ":8090"]

cmd/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ func rootCmd() *cobra.Command {
142142
checkCmd(),
143143
serveCmd(),
144144
historyCmd(),
145+
proxyCmd(),
146+
proxiesCmd(),
147+
subCmd(),
145148
reportCmd(),
146149
)
147150
return root

0 commit comments

Comments
 (0)