Bump Harbor versions and add direct .ru routing
All checks were successful
Build and Deploy Gateway / build-and-push (push) Successful in 15s
Build and Deploy Gateway / deploy (push) Successful in 12s

This commit is contained in:
2026-07-11 21:36:04 +03:00
parent 7a6f9a26ac
commit 306a9b8ced
14 changed files with 279 additions and 25 deletions

View File

@@ -27,6 +27,7 @@ test('client exposes one local proxy and routes it through the selected VPN', ()
assert.deepEqual(config.inbounds.map((inbound) => inbound.tag), ['mixed-in']);
assert.equal(config.inbounds[0].listen_port, 8082);
assert.deepEqual(config.route.rules, [
{ domain_suffix: ['ru'], outbound: 'direct' },
{ inbound: ['mixed-in'], outbound: 'test-vpn' },
]);
assert.equal(config.route.final, 'test-vpn');
@@ -37,6 +38,7 @@ test('client keeps its local proxy but routes directly when Harbor Gateway is ah
const config = buildGatewayConfig(subscriptionConfig, 'test-vpn', { clientDirect: true });
assert.deepEqual(config.route.rules, [
{ domain_suffix: ['ru'], outbound: 'direct' },
{ inbound: ['mixed-in'], outbound: 'direct' },
]);
assert.equal(config.route.final, 'direct');

View File

@@ -21,11 +21,12 @@ const subscriptionConfig = {
}],
};
test('gateway routes transparent and proxy traffic only through the selected VPN', () => {
test('gateway routes .ru domains directly and other traffic through the selected VPN', () => {
const config = buildGatewayConfig(subscriptionConfig, 'test-vpn');
assert.deepEqual(config.route.rule_set, []);
assert.deepEqual(config.route.rules, [
{ domain_suffix: ['ru'], outbound: 'direct' },
{ inbound: ['tproxy-in'], outbound: 'test-vpn' },
{ inbound: ['mixed-in'], outbound: 'test-vpn' },
]);

View File

@@ -11,6 +11,7 @@ import {
createStateSnapshot,
normalizeStoredState,
} from '../../src/shared/contracts/state.js';
import { HARBOR_VERSIONS } from '../../src/shared/versions.js';
const root = path.resolve(import.meta.dirname, '../..');
@@ -163,7 +164,7 @@ setInterval(() => {}, 60_000);
assert.deepEqual(version, {
apiVersion: 1,
location: 'mac',
components: { macClient: '0.1.0' },
components: { macClient: HARBOR_VERSIONS.macClient },
runtime: { singBox: '1.12.13' },
});
assertStateSnapshot(initial);

View File

@@ -0,0 +1,39 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { affectedComponents, bumpVersions } from '../scripts/harbor-version.mjs';
const versions = {
macClient: '2.4.3',
gatewayClient: '2.7.1',
gatewayBackend: '2.7.8',
};
test('version paths map to the components actually shipped by this repository', () => {
assert.deepEqual(affectedComponents(['src/web/App.jsx']), ['macClient', 'gatewayClient']);
assert.deepEqual(affectedComponents(['src/server/index.js']), ['macClient', 'gatewayBackend']);
assert.deepEqual(affectedComponents(['package-lock.json']), [
'macClient',
'gatewayClient',
'gatewayBackend',
]);
assert.deepEqual(affectedComponents(['README.md', 'test/server/version.test.js']), []);
});
test('version bumps follow ecosystem, linked-component and local scopes', () => {
assert.deepEqual(bumpVersions(versions, 'major'), {
macClient: '3.0.0',
gatewayClient: '3.0.0',
gatewayBackend: '3.0.0',
});
assert.deepEqual(bumpVersions(versions, 'minor', ['gateway-backend']), {
macClient: '2.4.3',
gatewayClient: '2.8.0',
gatewayBackend: '2.8.0',
});
assert.deepEqual(bumpVersions(versions, 'hotfix', ['mac']), {
macClient: '2.4.4',
gatewayClient: '2.7.1',
gatewayBackend: '2.7.8',
});
});