Handle rejected subscriptions and add local client compose
This commit is contained in:
@@ -54,6 +54,14 @@ export function createStateSnapshot({
|
||||
: configExists ? 'running' : 'stopped';
|
||||
const servers = stored.servers;
|
||||
const routeMode = mode === 'client' ? gatewayAuto?.mode || 'local-vpn' : 'gateway-transparent';
|
||||
const gatewayAutoEnabled = stored.gatewayAutoEnabled !== false;
|
||||
const routeReason = mode !== 'client'
|
||||
? 'gateway-host'
|
||||
: !gatewayAutoEnabled
|
||||
? 'disabled'
|
||||
: routeMode === 'gateway-direct'
|
||||
? gatewayAuto?.failures ? 'gateway-stale' : 'gateway-found'
|
||||
: gatewayAuto?.lastError ? 'gateway-lost' : 'local';
|
||||
const activeLocalRules = runtime?.running ? stored.appliedRouteRules : [];
|
||||
|
||||
return assertStateSnapshot({
|
||||
@@ -80,8 +88,11 @@ export function createStateSnapshot({
|
||||
route: {
|
||||
mode: routeMode,
|
||||
gatewayAddress: mode === 'client' ? gatewayAuto?.gateway?.gateway || null : null,
|
||||
lastVerifiedAt: null,
|
||||
reason: mode === 'client' && stored.gatewayAutoEnabled !== false ? 'auto' : 'manual',
|
||||
gatewayUiOrigin: mode === 'client' ? gatewayAuto?.uiOrigin || null : null,
|
||||
lastVerifiedAt: mode === 'client' ? dateOrNull(gatewayAuto?.lastVerifiedAt) : null,
|
||||
autoEnabled: mode === 'client' && gatewayAutoEnabled,
|
||||
fallbackPreference: mode === 'client' ? 'local-vpn' : 'none',
|
||||
reason: routeReason,
|
||||
localRules: stored.routeRules,
|
||||
activeLocalRules,
|
||||
localRulesRevision: stored.routeRulesRevision,
|
||||
@@ -122,6 +133,7 @@ export function withStateV0Compatibility(snapshot, {
|
||||
enabled: stored.gatewayAutoEnabled !== false,
|
||||
available: Boolean(gatewayAuto?.gatewayId),
|
||||
address: gatewayAuto?.gateway?.gateway || '',
|
||||
uiOrigin: gatewayAuto?.uiOrigin || '',
|
||||
interface: gatewayAuto?.gateway?.interface || '',
|
||||
failures: Number(gatewayAuto?.failures) || 0,
|
||||
lastError: gatewayAuto?.lastError || '',
|
||||
@@ -175,7 +187,10 @@ export function assertStateSnapshot(snapshot) {
|
||||
!snapshot.route ||
|
||||
typeof snapshot.route.mode !== 'string' ||
|
||||
!nullableString(snapshot.route.gatewayAddress) ||
|
||||
!nullableString(snapshot.route.gatewayUiOrigin) ||
|
||||
!nullableDate(snapshot.route.lastVerifiedAt) ||
|
||||
typeof snapshot.route.autoEnabled !== 'boolean' ||
|
||||
typeof snapshot.route.fallbackPreference !== 'string' ||
|
||||
typeof snapshot.route.reason !== 'string' ||
|
||||
!Array.isArray(snapshot.route.localRules) ||
|
||||
!snapshot.route.localRules.every(validRouteRule) ||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export const HARBOR_VERSIONS = Object.freeze({
|
||||
macClient: '0.7.36',
|
||||
gatewayClient: '0.7.34',
|
||||
gatewayBackend: '0.7.5',
|
||||
macClient: '0.8.0',
|
||||
gatewayClient: '0.8.0',
|
||||
gatewayBackend: '0.8.0',
|
||||
});
|
||||
|
||||
export function parseVersion(value) {
|
||||
|
||||
Reference in New Issue
Block a user