diff --git a/.oss-scanner/Dockerfile b/.oss-scanner/Dockerfile index e1956b546..d08e5489e 100644 --- a/.oss-scanner/Dockerfile +++ b/.oss-scanner/Dockerfile @@ -41,8 +41,13 @@ RUN ./DockerInit.sh "$(dpkg --print-architecture)" \ && ln -s "/src/build/bin/xray-linux-$(dpkg --print-architecture)" /usr/local/bin/xray \ && xray version -# Turns on the xray gRPC end-to-end tests (internal/xray, internal/amneziawgnet) against the real core. -ENV XRAY_E2E_BINARY=/usr/local/bin/xray +# The real-core tests get the core go.mod pins, built as `make xray-e2e` builds it in CI: +# the release binary above lags whenever go.mod moves to an unreleased commit. +RUN go build -o /usr/local/bin/xray-e2e github.com/xtls/xray-core/main \ + && xray-e2e version + +# Turns on every test gated on XRAY_E2E_BINARY (internal/xray, internal/amneziawgnet, internal/web/service). +ENV XRAY_E2E_BINARY=/usr/local/bin/xray-e2e # Baseline tests: also warms the build cache. A failure is logged, never fatal. RUN go test -count=1 -timeout 30m ./... > /src/.oss-scanner-go-test.log 2>&1 \ diff --git a/.oss-scanner/threat_model.md b/.oss-scanner/threat_model.md index aca8897f1..d53c87aa8 100644 --- a/.oss-scanner/threat_model.md +++ b/.oss-scanner/threat_model.md @@ -207,8 +207,10 @@ or the admin's browser as something other than data. ## How to exercise it - Checkout at `/src`. The panel binary is `/usr/local/bin/x-ui` (built with - `-N -l`), Xray-core is `/usr/local/bin/xray`, and the sidecars and geo - files are in `/src/build/bin`. `sqlite3`, `curl` and `jq` are installed. + `-N -l`), Xray-core is `/usr/local/bin/xray` (the release build the panel + runs), and the sidecars and geo files are in `/src/build/bin`. + `/usr/local/bin/xray-e2e` is the core built from the `go.mod` pin, which + `XRAY_E2E_BINARY` points at. `sqlite3`, `curl` and `jq` are installed. There is no network; `GOPROXY=off` and npm is offline. - Go tests: `cd /src && go test -count=1 ./...`. Real-DB helpers live in `internal/database/dbtest` (`dbtest.InitDB(t, path)`); `internal/sub`'s