Add native traffic inspection to Harbor Connect and Gateway

This commit is contained in:
2026-08-31 05:19:15 +03:00
parent 116686a138
commit 4d066cb879
62 changed files with 10975 additions and 220 deletions
+27 -12
View File
@@ -152,22 +152,37 @@ test('production paths use only the compiled dispatcher', () => {
assert.match(workflow, /command -v npm[^']+command -v git[^']+test -x \/bin\/bash/);
assert.doesNotMatch(workflow, /docker image inspect "\$\{\{ env\.NODE_BUILD_IMAGE \}\}"/);
assert.match(legacyBuild, /npm run build:production && docker build/);
assert.match(legacyBuild, /docker run --rm[^;]+sing-box version[^;]+grep -Fx/);
assert.match(legacyBuild, /docker run --rm --entrypoint sing-box[^;]+version[^;]+grep -Fx/);
assert.match(dockerignore, /^dist$/m);
});
test('every shipped build defaults to sing-box 1.13.18', () => {
for (const file of [
'.env.example',
'.gitea/workflows/gateway-build.yml',
'Dockerfile',
'Dockerfile.client',
'Dockerfile.runtime-base',
'docker-compose.client.yml',
'docker-compose.gateway.yml',
'scripts/build-on-107-deploy-111.sh',
'scripts/build-runtime-base.sh',
test('Mac client builds default to exact sing-box 1.14.0-rc.5', () => {
assert.match(
fs.readFileSync(path.join(root, 'Dockerfile.client'), 'utf8'),
/^ARG SINGBOX_VERSION=1\.14\.0-rc\.5$/m,
);
assert.match(
fs.readFileSync(path.join(root, 'docker-compose.client.yml'), 'utf8'),
/SINGBOX_VERSION: \$\{SINGBOX_VERSION:-1\.14\.0-rc\.5\}/,
);
});
test('Gateway builds use the Mac-qualified exact sing-box 1.14.0-rc.5', () => {
for (const [file, pin] of [
['.env.example', /^SINGBOX_VERSION=1\.14\.0-rc\.5$/m],
['.gitea/workflows/gateway-build.yml', /^\s*SINGBOX_VERSION: 1\.14\.0-rc\.5$/m],
['Dockerfile', /^ARG SINGBOX_VERSION=1\.14\.0-rc\.5$/m],
['Dockerfile.runtime-base', /^ARG SINGBOX_VERSION=1\.14\.0-rc\.5$/m],
['docker-compose.gateway.yml', /SINGBOX_VERSION: \$\{SINGBOX_VERSION:-1\.14\.0-rc\.5\}/],
['scripts/build-on-107-deploy-111.sh', /^SINGBOX_VERSION="\$\{SINGBOX_VERSION:-1\.14\.0-rc\.5\}"$/m],
['scripts/build-runtime-base.sh', /^SINGBOX_VERSION="\$\{SINGBOX_VERSION:-1\.14\.0-rc\.5\}"$/m],
]) {
assert.match(fs.readFileSync(path.join(root, file), 'utf8'), /SINGBOX_VERSION[^\n]*1\.13\.18/);
assert.match(fs.readFileSync(path.join(root, file), 'utf8'), pin);
}
const gatewayDockerfile = fs.readFileSync(path.join(root, 'Dockerfile'), 'utf8');
for (const dependency of ['@bufbuild/protobuf', '@connectrpc/connect', '@connectrpc/connect-node']) {
assert.match(gatewayDockerfile, new RegExp(`/src/node_modules/${dependency.replace('/', '\\/')}`));
}
});