Refactor VPN proxy client implementation
Build and Deploy Gateway / build-and-push (push) Failing after 2s
Build and Deploy Gateway / deploy (push) Has been skipped

This commit is contained in:
2026-08-09 00:41:52 +03:00
parent 32be4380a3
commit 34d8b681ad
190 changed files with 20064 additions and 9761 deletions
+39
View File
@@ -0,0 +1,39 @@
export const HARBOR_VERSIONS = Object.freeze({
macClient: '0.20.36',
gatewayClient: '0.21.21',
gatewayBackend: '0.21.20',
});
export interface ParsedVersion {
major: number;
minor: number;
hotfix: number;
}
export interface HarborVersions {
macClient: string;
gatewayClient: string;
gatewayBackend: string;
}
export function parseVersion(value: unknown): ParsedVersion | null {
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(String(value || ''));
return match ? {
major: Number(match[1]),
minor: Number(match[2]),
hotfix: Number(match[3]),
} : null;
}
export function versionCompatibility(versions: Partial<HarborVersions> | null | undefined) {
const mac = parseVersion(versions?.macClient);
const client = parseVersion(versions?.gatewayClient);
const backend = parseVersion(versions?.gatewayBackend);
const major = Boolean(mac && client && backend
&& mac.major === client.major
&& client.major === backend.major);
const gateway = Boolean(client && backend
&& client.major === backend.major
&& client.minor === backend.minor);
return { compatible: major && gateway, major, gateway };
}