Enable connectivity diagnostics in Connect mode
Build and Deploy Gateway / build-and-push (push) Successful in 13s
Build and Deploy Gateway / deploy (push) Successful in 13s

This commit is contained in:
2026-08-07 21:43:09 +03:00
parent 70cc221f34
commit d32bc14108
12 changed files with 60 additions and 31 deletions
@@ -1,10 +1,14 @@
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import test from 'node:test';
import {
createConnectivityDiagnosticsService,
CURL_META_MARKER,
} from '../../src/server/services/connectivityDiagnosticsService.js';
const server = fs.readFileSync(path.resolve(import.meta.dirname, '../../src/server/index.js'), 'utf8');
function response(body = '', overrides = {}) {
return {
exitCode: 0,
@@ -48,6 +52,11 @@ test('connectivity diagnostics force separate direct and VPN paths', async () =>
assert.ok(calls.some((args) => args.includes('--proxy') && args.includes('http://127.0.0.1:18080')));
});
test('connectivity diagnostics endpoint is available in Connect and Gateway', () => {
assert.match(server, /const localConnectivityDiagnostics = !remoteDataplane/);
assert.doesNotMatch(server, /settings\.appMode !== 'gateway'[\s\S]{0,120}ENDPOINT_NOT_FOUND/);
});
test('connectivity diagnostics reports a likely direct restriction without claiming its owner', async () => {
const attempts = new Map();
const execute = async (args) => {