mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
refactor(ssh): fence the legacy relay in ssh/legacy-relay/ and drop the relay name from live deploy primitives (#30292)
Moves legacy-relay-bridge/ plus the relay-only census and endpoint files into ssh/legacy-relay/, so the 2027-01-15 retirement deletes one folder. Live install, exec and framing modules that only carried the relay name become remote-*. git mv plus import, path-literal, routing and workflow path-filter rewrites only; no remote file name or path changes.
This commit is contained in:
@@ -9,14 +9,13 @@ on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft]
|
||||
paths:
|
||||
# The managed deploy still runs on these relay-named install and runtime primitives.
|
||||
- 'src/main/ssh/ssh-relay-*'
|
||||
# The managed deploy runs on these remote install and runtime primitives.
|
||||
- 'src/main/ssh/remote-*'
|
||||
- 'src/main/ssh/*runtime*'
|
||||
- 'src/main/ssh/orcad-*'
|
||||
- 'src/main/orcad/orcad-artifact-materializer.ts'
|
||||
- 'src/main/orcad/orcad-host-unavailable.ts'
|
||||
- 'src/main/node-runtime/**'
|
||||
- 'src/main/ssh/remote-install-*'
|
||||
- 'src/main/ssh/ssh-remote-*'
|
||||
- 'src/main/ssh/ssh-hostile-host-*'
|
||||
- 'src/main/ssh/sftp-*'
|
||||
|
||||
@@ -8,13 +8,12 @@ on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft]
|
||||
paths:
|
||||
- 'src/main/ssh/ssh-relay-*'
|
||||
- 'src/main/ssh/remote-*'
|
||||
- 'src/main/ssh/*runtime*'
|
||||
- 'src/main/ssh/orcad-*'
|
||||
- 'src/main/orcad/orcad-artifact-materializer.ts'
|
||||
- 'src/main/orcad/orcad-host-unavailable.ts'
|
||||
- 'src/main/node-runtime/**'
|
||||
- 'src/main/ssh/remote-install-*'
|
||||
- 'src/main/ssh/ssh-remote-*'
|
||||
- 'src/main/ssh/ssh-hostile-host-*'
|
||||
- 'src/main/ssh/ssh-windows-host-*'
|
||||
|
||||
@@ -5581,10 +5581,10 @@
|
||||
"src/main/sqlite/sync-database.test.ts": 877,
|
||||
"src/main/ssh-expired-lease-pane-readoption.test.ts": 1555,
|
||||
"src/main/ssh-reattach-pane-cardinality.test.ts": 1274,
|
||||
"src/main/ssh/legacy-relay-bridge/legacy-relay-bridge-teardown.test.ts": 326,
|
||||
"src/main/ssh/legacy-relay-bridge/legacy-relay-client.test.ts": 196,
|
||||
"src/main/ssh/legacy-relay-bridge/legacy-relay-endpoints.test.ts": 173,
|
||||
"src/main/ssh/legacy-relay-bridge/legacy-relay-target-bridge.test.ts": 74,
|
||||
"src/main/ssh/legacy-relay/legacy-relay-bridge-teardown.test.ts": 326,
|
||||
"src/main/ssh/legacy-relay/legacy-relay-client.test.ts": 196,
|
||||
"src/main/ssh/legacy-relay/legacy-relay-endpoints.test.ts": 173,
|
||||
"src/main/ssh/legacy-relay/legacy-relay-target-bridge.test.ts": 74,
|
||||
"src/main/ssh/managed-server-fence-recheck.test.ts": 484,
|
||||
"src/main/ssh/orcad-activation-crash-recovery.test.ts": 1032,
|
||||
"src/main/ssh/orcad-activation-fence-generation.test.ts": 826,
|
||||
@@ -5685,7 +5685,7 @@
|
||||
"src/main/ssh/pinned-runtime-host-target.test.ts": 51,
|
||||
"src/main/ssh/relay-bundle-paths.test.ts": 32,
|
||||
"src/main/ssh/relay-install-artifacts.test.ts": 37,
|
||||
"src/main/ssh/relay-protocol.test.ts": 113,
|
||||
"src/main/ssh/remote-frame-protocol.test.ts": 113,
|
||||
"src/main/ssh/remote-install-gc-termination.test.ts": 187,
|
||||
"src/main/ssh/remote-install-model.test.ts": 184,
|
||||
"src/main/ssh/remote-node-runtime-store-gc.test.ts": 1625,
|
||||
@@ -5746,11 +5746,11 @@
|
||||
"src/main/ssh/ssh-host-key-store.test.ts": 207,
|
||||
"src/main/ssh/ssh-host-key-verifier.test.ts": 77,
|
||||
"src/main/ssh/ssh-host-platform-memo.test.ts": 51,
|
||||
"src/main/ssh/ssh-host-relay-census-for-target.test.ts": 43,
|
||||
"src/main/ssh/ssh-host-relay-endpoint-census.test.ts": 133,
|
||||
"src/main/ssh/ssh-host-relay-terminals-on-connect.test.ts": 272,
|
||||
"src/main/ssh/ssh-host-relay-windows-census.test.ts": 247,
|
||||
"src/main/ssh/ssh-host-relay-windows-inventory.test.ts": 201,
|
||||
"src/main/ssh/legacy-relay/ssh-host-relay-census-for-target.test.ts": 43,
|
||||
"src/main/ssh/legacy-relay/ssh-host-relay-endpoint-census.test.ts": 133,
|
||||
"src/main/ssh/legacy-relay/ssh-host-relay-terminals-on-connect.test.ts": 272,
|
||||
"src/main/ssh/legacy-relay/ssh-host-relay-windows-census.test.ts": 247,
|
||||
"src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.test.ts": 201,
|
||||
"src/main/ssh/ssh-host-server-on-connect-stopped-elsewhere.test.ts": 865,
|
||||
"src/main/ssh/ssh-host-server-on-connect-telemetry.test.ts": 597,
|
||||
"src/main/ssh/ssh-host-server-on-connect.test.ts": 553,
|
||||
@@ -5773,25 +5773,25 @@
|
||||
"src/main/ssh/ssh-quit-abort-upload.test.ts": 252,
|
||||
"src/main/ssh/ssh-reconnect-error-classification.test.ts": 98,
|
||||
"src/main/ssh/ssh-reconnect-ladder.test.ts": 75,
|
||||
"src/main/ssh/ssh-relay-answered-failure-producers.test.ts": 321,
|
||||
"src/main/ssh/ssh-relay-endpoint-incumbent-shell.integration.test.ts": 1326,
|
||||
"src/main/ssh/ssh-relay-endpoint-incumbent.test.ts": 100,
|
||||
"src/main/ssh/ssh-relay-endpoint-pty-count.test.ts": 90,
|
||||
"src/main/ssh/ssh-relay-endpoint-runtime.test.ts": 69,
|
||||
"src/main/ssh/ssh-relay-exec-closed-stdin.test.ts": 89,
|
||||
"src/main/ssh/ssh-relay-exec-command.test.ts": 130,
|
||||
"src/main/ssh/ssh-relay-exec-input.test.ts": 92,
|
||||
"src/main/ssh/ssh-relay-gc-claim-termination.test.ts": 249,
|
||||
"src/main/ssh/ssh-relay-host-answered-failure.test.ts": 101,
|
||||
"src/main/ssh/ssh-relay-incumbent-process.test.ts": 5329,
|
||||
"src/main/ssh/ssh-relay-install-lock-exited-owner.test.ts": 380,
|
||||
"src/main/ssh/ssh-relay-install-lock-termination.test.ts": 276,
|
||||
"src/main/ssh/ssh-relay-install-lock.test.ts": 157,
|
||||
"src/main/ssh/ssh-relay-install-noisy-sftp-wire.test.ts": 299,
|
||||
"src/main/ssh/ssh-relay-install-transfers-exec-fallback.test.ts": 101,
|
||||
"src/main/ssh/ssh-relay-sentinel-copy-budget.test.ts": 114,
|
||||
"src/main/ssh/ssh-relay-sentinel.test.ts": 400,
|
||||
"src/main/ssh/ssh-relay-versioned-install-termination.test.ts": 236,
|
||||
"src/main/ssh/remote-host-answered-failure-producers.test.ts": 321,
|
||||
"src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent-shell.integration.test.ts": 1326,
|
||||
"src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent.test.ts": 100,
|
||||
"src/main/ssh/legacy-relay/ssh-relay-endpoint-pty-count.test.ts": 90,
|
||||
"src/main/ssh/legacy-relay/ssh-relay-endpoint-runtime.test.ts": 69,
|
||||
"src/main/ssh/remote-exec-closed-stdin.test.ts": 89,
|
||||
"src/main/ssh/remote-exec-command.test.ts": 130,
|
||||
"src/main/ssh/remote-exec-input.test.ts": 92,
|
||||
"src/main/ssh/remote-install-gc-claim-termination.test.ts": 249,
|
||||
"src/main/ssh/remote-host-answered-failure.test.ts": 101,
|
||||
"src/main/ssh/legacy-relay/ssh-relay-incumbent-process.test.ts": 5329,
|
||||
"src/main/ssh/remote-install-lock-exited-owner.test.ts": 380,
|
||||
"src/main/ssh/remote-install-lock-termination.test.ts": 276,
|
||||
"src/main/ssh/remote-install-lock.test.ts": 157,
|
||||
"src/main/ssh/remote-install-noisy-sftp-wire.test.ts": 299,
|
||||
"src/main/ssh/remote-install-transfers-exec-fallback.test.ts": 101,
|
||||
"src/main/ssh/legacy-relay/ssh-relay-sentinel-copy-budget.test.ts": 114,
|
||||
"src/main/ssh/legacy-relay/ssh-relay-sentinel.test.ts": 400,
|
||||
"src/main/ssh/remote-versioned-install-termination.test.ts": 236,
|
||||
"src/main/ssh/ssh-remote-commands.test.ts": 8588,
|
||||
"src/main/ssh/ssh-remote-node-resolution.test.ts": 317,
|
||||
"src/main/ssh/ssh-remote-node-toolchain-probe.test.ts": 133,
|
||||
|
||||
@@ -186,7 +186,7 @@ function changesMobileWebApp(changedFiles) {
|
||||
const CROSS_VERSION_WIRE_PREFIXES = [
|
||||
'tests/e2e/cross-version-wire/',
|
||||
// COMPAT(legacy-relay-bridge): the bridge is proven against a real 1.4.224 relay here.
|
||||
'src/main/ssh/legacy-relay-bridge/',
|
||||
'src/main/ssh/legacy-relay/',
|
||||
'config/scripts/stable-release-tags',
|
||||
// The R1 daemon protocol crossing gate runs in this job.
|
||||
'config/scripts/daemon-protocol-facts',
|
||||
|
||||
@@ -132,7 +132,7 @@ export const PR_E2E_SOURCE_ROUTES = [
|
||||
file
|
||||
))
|
||||
},
|
||||
// COMPAT(legacy-relay-bridge): revisit 2027-01-15 with src/main/ssh/legacy-relay-bridge/.
|
||||
// COMPAT(legacy-relay-bridge): revisit 2027-01-15 with src/main/ssh/legacy-relay/.
|
||||
{
|
||||
id: 'ssh.orcad-legacy-relay-bridge',
|
||||
specs: ['tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts'],
|
||||
@@ -142,7 +142,7 @@ export const PR_E2E_SOURCE_ROUTES = [
|
||||
file
|
||||
) ||
|
||||
(isProductSource(file) &&
|
||||
/(?:legacy-relay-bridge|orcad-migration-terminal-gate|ssh-host-relay-terminals-on-connect)/.test(
|
||||
/(?:legacy-relay(?:-bridge|\/)|orcad-migration-terminal-gate|ssh-host-relay-terminals-on-connect)/.test(
|
||||
file
|
||||
))
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ export const NODE_RUNTIME_INCLUDE = [
|
||||
'config/scripts/vitest-sqlite-runtime-boundary.test.ts',
|
||||
'config/scripts/cloud-security-history-workflow.test.mjs',
|
||||
'config/scripts/skill-recipe-shell.test.mjs',
|
||||
'src/main/ssh/ssh-relay-endpoint-incumbent-shell.integration.test.ts',
|
||||
'src/main/ssh/legacy-relay/ssh-relay-endpoint-incumbent-shell.integration.test.ts',
|
||||
'src/main/ssh/ssh-remote-commands.test.ts',
|
||||
'src/packages/process-host/src/run-process.test.ts',
|
||||
'tests/e2e/cursor-quota-transport.unit.test.ts',
|
||||
|
||||
@@ -285,9 +285,9 @@ export const SQLITE_RUNTIME_INCLUDE = [
|
||||
'src/main/runtime/structured-foreground-command-strip.test.ts',
|
||||
'src/main/ssh-expired-lease-pane-readoption.test.ts',
|
||||
'src/main/ssh-reattach-pane-cardinality.test.ts',
|
||||
'src/main/ssh/legacy-relay-bridge/legacy-relay-cli-call-limits.test.ts',
|
||||
'src/main/ssh/legacy-relay-bridge/legacy-relay-cli-legacy-records.test.ts',
|
||||
'src/main/ssh/legacy-relay-bridge/legacy-relay-cli-server.test.ts',
|
||||
'src/main/ssh/legacy-relay/legacy-relay-cli-call-limits.test.ts',
|
||||
'src/main/ssh/legacy-relay/legacy-relay-cli-legacy-records.test.ts',
|
||||
'src/main/ssh/legacy-relay/legacy-relay-cli-server.test.ts',
|
||||
'src/main/ssh/orcad-migration-cutover-coordinator.test.ts',
|
||||
'src/main/ssh/orcad-migration-delta-move.test.ts',
|
||||
'src/main/ssh/orcad-migration-delta-snapshot.test.ts',
|
||||
|
||||
@@ -5,7 +5,7 @@ import { EventEmitter } from 'node:events'
|
||||
import type { ChildProcessWithoutNullStreams } from 'node:child_process'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../ssh/relay-protocol'
|
||||
import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../ssh/remote-frame-protocol'
|
||||
import {
|
||||
MAX_STARTUP_BUFFER_BYTES,
|
||||
waitForWslRelaySentinel,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// ChildProcess instead of a ClientChannel.
|
||||
import type { ChildProcessWithoutNullStreams } from 'node:child_process'
|
||||
|
||||
import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../ssh/relay-protocol'
|
||||
import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../ssh/remote-frame-protocol'
|
||||
import type { MultiplexerTransport } from '../ssh/ssh-channel-multiplexer'
|
||||
|
||||
export const MAX_STARTUP_BUFFER_BYTES = 64 * 1024
|
||||
|
||||
@@ -9,7 +9,7 @@ import { requireManagedOrcadInfrastructure } from '../ssh/orcad-managed-runtime-
|
||||
import { ensureOrcadManagedTunnel } from '../ssh/orcad-managed-tunnel'
|
||||
import { keepOrcadServerVersion, runOrcadDeltaMove } from '../ssh/orcad-migration-delta-move'
|
||||
import { planOrcadDeltaMove } from '../ssh/orcad-migration-delta-plan'
|
||||
import { censusHostRelayTerminalsFor } from '../ssh/ssh-host-relay-census-for-target'
|
||||
import { censusHostRelayTerminalsFor } from '../ssh/legacy-relay/ssh-host-relay-census-for-target'
|
||||
import { orcadMigrationDestinationFor } from '../ssh/orcad-runtime-conversion-wiring'
|
||||
import { requiredString } from './orcad-runtime-lifecycle-handlers'
|
||||
import { publishResolvedChangedHostStatus } from './runtime-environment-managed-tunnel'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { toAppSshPtyId } from '../../../../shared/ssh-pty-id'
|
||||
import type { SshRemotePtyLease } from '../../../../shared/ssh-types'
|
||||
import { installLegacyRelayBridge } from '../../../ssh/legacy-relay-bridge/legacy-relay-bridge-registry'
|
||||
import { installLegacyRelayBridge } from '../../../ssh/legacy-relay/legacy-relay-bridge-registry'
|
||||
import type { PtyRuntimeControllerDeps } from './controller-deps'
|
||||
import { killPtyFromRuntimeController } from './kill'
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import { errorMessage } from '../../../../shared/error-message'
|
||||
import {
|
||||
closeLegacyRelayPane,
|
||||
isLegacyRelayBridgedPty
|
||||
} from '../../../ssh/legacy-relay-bridge/legacy-relay-bridge-registry'
|
||||
} from '../../../ssh/legacy-relay/legacy-relay-bridge-registry'
|
||||
|
||||
// Bounds the wait for an observed exit to reach the runtime record when the caller set no deadline.
|
||||
const OBSERVED_EXIT_RECORD_WAIT_MS = 10_000
|
||||
|
||||
@@ -13,14 +13,11 @@ vi.mock('../ssh/ssh-connection-manager', () => mocks.sshConnectionManager)
|
||||
vi.mock('../ssh/ssh-channel-multiplexer', () => mocks.sshChannelMultiplexer)
|
||||
vi.mock('../ssh/ssh-port-forward', () => mocks.sshPortForward)
|
||||
vi.mock('../ssh/ssh-port-scanner', () => mocks.sshPortScanner)
|
||||
vi.mock(
|
||||
import('../ssh/legacy-relay-bridge/legacy-relay-bridge-registry'),
|
||||
async (importOriginal) => ({
|
||||
...(await importOriginal()),
|
||||
startLegacyRelayBridge: vi.fn(async () => {}),
|
||||
stopLegacyRelayBridge: vi.fn()
|
||||
})
|
||||
)
|
||||
vi.mock(import('../ssh/legacy-relay/legacy-relay-bridge-registry'), async (importOriginal) => ({
|
||||
...(await importOriginal()),
|
||||
startLegacyRelayBridge: vi.fn(async () => {}),
|
||||
stopLegacyRelayBridge: vi.fn()
|
||||
}))
|
||||
|
||||
import type { SshTarget } from '../../shared/ssh-types'
|
||||
import type { SshConnection } from '../ssh/ssh-connection'
|
||||
@@ -35,7 +32,7 @@ import {
|
||||
import {
|
||||
startLegacyRelayBridge,
|
||||
stopLegacyRelayBridge
|
||||
} from '../ssh/legacy-relay-bridge/legacy-relay-bridge-registry'
|
||||
} from '../ssh/legacy-relay/legacy-relay-bridge-registry'
|
||||
import { createSshIpcHarness } from './ssh-ipc-test-harness'
|
||||
|
||||
const { mockSshStore, mockConnectionManager } = mocks
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
import { connectionManager } from './ssh-ipc-context'
|
||||
import { abandonDecisionTransport } from './ssh-session-teardown'
|
||||
import { awaitTargetLifecycle } from './ssh-target-lifecycle-queue'
|
||||
import { startLegacyRelayBridge } from '../ssh/legacy-relay-bridge/legacy-relay-bridge-registry'
|
||||
import { startLegacyRelayBridge } from '../ssh/legacy-relay/legacy-relay-bridge-registry'
|
||||
import { clearSshCredentialDeclined } from '../ssh/ssh-credential-decline'
|
||||
import { createSshUserDisconnectedError, isSshUserDisconnected } from '../ssh/ssh-user-disconnect'
|
||||
import {
|
||||
|
||||
@@ -23,9 +23,9 @@ import type { HostServerOnConnectDeps } from '../ssh/ssh-host-server-on-connect'
|
||||
import {
|
||||
censusSshHostRelaysBeforeSession,
|
||||
relayTerminalsOnConnect
|
||||
} from '../ssh/ssh-host-relay-terminals-on-connect'
|
||||
} from '../ssh/legacy-relay/ssh-host-relay-terminals-on-connect'
|
||||
import { requireManagedOrcadInfrastructure } from '../ssh/orcad-managed-runtime-context'
|
||||
import { censusHostRelayTerminalsFor } from '../ssh/ssh-host-relay-census-for-target'
|
||||
import { censusHostRelayTerminalsFor } from '../ssh/legacy-relay/ssh-host-relay-census-for-target'
|
||||
import { setSshHostServerStatus } from '../ssh/ssh-host-server-status'
|
||||
import { trackSshHostServerEvent } from '../ssh/ssh-host-server-telemetry'
|
||||
import { knownSshHostPlatform } from '../ssh/ssh-host-platform-memo'
|
||||
@@ -35,7 +35,7 @@ import { releaseUnreachableOrcadSetup } from '../ssh/orcad-unreachable-setup-rel
|
||||
import { getCurrentMainWindow } from './ssh-ipc-context'
|
||||
import { broadcastSshState } from './ssh-renderer-broadcast'
|
||||
import { connectInFlight } from './ssh-connect-attempt-registry'
|
||||
import { startLegacyRelayBridge } from '../ssh/legacy-relay-bridge/legacy-relay-bridge-registry'
|
||||
import { startLegacyRelayBridge } from '../ssh/legacy-relay/legacy-relay-bridge-registry'
|
||||
|
||||
export function hostServerOnConnectDeps(userDataPath: string): HostServerOnConnectDeps {
|
||||
const registry = getSshTargetRegistryStore()!
|
||||
|
||||
@@ -13,7 +13,7 @@ import { errorMessage } from '../../shared/error-message'
|
||||
import {
|
||||
forgetLegacyRelayTarget,
|
||||
stopLegacyRelayBridge
|
||||
} from '../ssh/legacy-relay-bridge/legacy-relay-bridge-registry'
|
||||
} from '../ssh/legacy-relay/legacy-relay-bridge-registry'
|
||||
|
||||
export async function disconnectRegisteredSshTarget(targetId: string): Promise<void> {
|
||||
invalidateConnectAttempt(targetId)
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ import { disposeOrcadManagedTunnels } from '../ssh/orcad-managed-tunnel'
|
||||
import { reconcileManagedOrcadSshTargets } from '../ssh/orcad-retained-source'
|
||||
import { installOrcadMigrationScrollbackRetention } from '../ssh/orcad-migration-scrollback-retention-wiring'
|
||||
import { getAppEnvironment } from '../../shared/app-environment'
|
||||
import { registerLegacyRelayBridgeIpc } from '../ssh/legacy-relay-bridge/legacy-relay-bridge-ipc'
|
||||
import { registerLegacyRelayBridgeIpc } from '../ssh/legacy-relay/legacy-relay-bridge-ipc'
|
||||
import {
|
||||
disposeDesktopBrowserBridge,
|
||||
installDesktopBrowserBridge
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* are installed side by side as `~/.orca-remote/orcad-<version>/`, launched and stopped with
|
||||
* the client's own deploy commands, and share one data root.
|
||||
*/
|
||||
import type * as ExecCommandModule from '../ssh/ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from '../ssh/remote-exec-command'
|
||||
import { build } from 'esbuild'
|
||||
import {
|
||||
copyFileSync,
|
||||
@@ -46,7 +46,7 @@ import { gcOldOrcadVersions } from '../ssh/orcad-remote-gc'
|
||||
import { ORCAD_PID_FILENAME, ORCAD_READINESS_FILENAME } from '../ssh/orcad-remote-host-support'
|
||||
import { orcadLaunchCommand, parseOrcadReadinessOutput } from '../ssh/orcad-remote-launch'
|
||||
import { parseOrcadStopOutcome, stopOrcadCommand } from '../ssh/orcad-remote-process-control'
|
||||
import { RELAY_REMOTE_DIR } from '../ssh/relay-protocol'
|
||||
import { RELAY_REMOTE_DIR } from '../ssh/remote-frame-protocol'
|
||||
import { getRemoteHostPlatform } from '../ssh/ssh-remote-platform'
|
||||
import {
|
||||
skipForMissingInputs,
|
||||
@@ -56,7 +56,7 @@ import {
|
||||
|
||||
// GC runs its real commands, against this machine instead of an SSH host.
|
||||
const { execMock } = vi.hoisted(() => ({ execMock: vi.fn() }))
|
||||
vi.mock('../ssh/ssh-relay-exec-command', async (importOriginal) => ({
|
||||
vi.mock('../ssh/remote-exec-command', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand: execMock
|
||||
}))
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ import type {
|
||||
import { parseAppSshPtyId } from '../../../shared/ssh-pty-id'
|
||||
import type { SshRemotePtyLease } from '../../../shared/ssh-types'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import { waitForSentinel } from '../ssh-relay-sentinel'
|
||||
import { probeRelayEndpointIncumbent } from '../ssh-relay-endpoint-incumbent'
|
||||
import { waitForSentinel } from './ssh-relay-sentinel'
|
||||
import { probeRelayEndpointIncumbent } from './ssh-relay-endpoint-incumbent'
|
||||
import { isWindowsRemoteHost } from '../ssh-remote-platform'
|
||||
import type { OrcaRuntimeService } from '../../runtime/orca-runtime'
|
||||
import { LegacyRelayClient } from './legacy-relay-client'
|
||||
+7
-7
@@ -1,26 +1,26 @@
|
||||
import type * as ExecCommandModule from '../ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from '../remote-exec-command'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import { relaySocketNameForInstanceId } from '../ssh-relay-instance-id'
|
||||
import { windowsRelayPipePathsForSocketName } from '../ssh-relay-endpoints'
|
||||
import { relaySocketNameForInstanceId } from './ssh-relay-instance-id'
|
||||
import { windowsRelayPipePathsForSocketName } from './ssh-relay-endpoints'
|
||||
import { getRemoteHostPlatform, joinRemotePath } from '../ssh-remote-platform'
|
||||
|
||||
const { execCommand } = vi.hoisted(() => ({ execCommand: vi.fn() }))
|
||||
vi.mock('../ssh-relay-exec-command', async (importOriginal) => ({
|
||||
vi.mock('../remote-exec-command', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand
|
||||
}))
|
||||
vi.mock('../ssh-remote-platform-detection', () => ({
|
||||
detectRemoteHostPlatform: async () => getRemoteHostPlatform('win32-x64')
|
||||
}))
|
||||
vi.mock('../ssh-host-relay-windows-census', () => ({
|
||||
vi.mock('./ssh-host-relay-windows-census', () => ({
|
||||
windowsCensusNodePath: async () => 'C:\\node\\node.exe'
|
||||
}))
|
||||
vi.mock('../ssh-host-relay-windows-inventory', async (importOriginal) => ({
|
||||
vi.mock('./ssh-host-relay-windows-inventory', async (importOriginal) => ({
|
||||
...(await importOriginal<Record<string, unknown>>()),
|
||||
windowsRelayInventoryCommand: () => 'INVENTORY'
|
||||
}))
|
||||
vi.mock('../ssh-relay-windows-launch-command', () => ({
|
||||
vi.mock('./ssh-relay-windows-launch-command', () => ({
|
||||
windowsRelayConnectCommand: (_h: unknown, _n: string, _d: string, pipe: string) =>
|
||||
`BRIDGE ${pipe}`
|
||||
}))
|
||||
+7
-7
@@ -7,11 +7,11 @@
|
||||
*/
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import { shellEscape } from '../ssh-connection-utils'
|
||||
import { RELAY_REMOTE_DIR } from '../relay-protocol'
|
||||
import { RELAY_REMOTE_DIR } from '../remote-frame-protocol'
|
||||
import { SHORT_RELAY_SOCKET_DIR_PREFIX } from '../relay-socket-path-limit'
|
||||
import { execCommand } from '../ssh-relay-exec-command'
|
||||
import { readRelayDaemonRuntimes } from '../ssh-relay-endpoint-runtime'
|
||||
import { relaySocketNameForInstanceId } from '../ssh-relay-instance-id'
|
||||
import { execCommand } from '../remote-exec-command'
|
||||
import { readRelayDaemonRuntimes } from './ssh-relay-endpoint-runtime'
|
||||
import { relaySocketNameForInstanceId } from './ssh-relay-instance-id'
|
||||
import { readRemoteHomeCommand } from '../ssh-remote-commands'
|
||||
import { resolveRemoteNodePath } from '../ssh-remote-node-resolution'
|
||||
import { detectRemoteHostPlatform } from '../ssh-remote-platform-detection'
|
||||
@@ -24,9 +24,9 @@ import {
|
||||
import {
|
||||
parseWindowsRelayInventory,
|
||||
windowsRelayInventoryCommand
|
||||
} from '../ssh-host-relay-windows-inventory'
|
||||
import { windowsCensusNodePath } from '../ssh-host-relay-windows-census'
|
||||
import { windowsRelayConnectCommand } from '../ssh-relay-windows-launch-command'
|
||||
} from './ssh-host-relay-windows-inventory'
|
||||
import { windowsCensusNodePath } from './ssh-host-relay-windows-census'
|
||||
import { windowsRelayConnectCommand } from './ssh-relay-windows-launch-command'
|
||||
|
||||
const MAX_ENDPOINTS = 32
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { SshConnection } from './ssh-connection'
|
||||
import type { SshTarget } from '../../shared/ssh-types'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import type { SshTarget } from '../../../shared/ssh-types'
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
connect: vi.fn(),
|
||||
@@ -8,7 +8,7 @@ const mocks = vi.hoisted(() => ({
|
||||
disconnectConnection: vi.fn(async () => undefined),
|
||||
census: vi.fn()
|
||||
}))
|
||||
vi.mock('./orcad-managed-runtime-context', () => ({
|
||||
vi.mock('../orcad-managed-runtime-context', () => ({
|
||||
requireManagedOrcadInfrastructure: () => ({
|
||||
connectionManager: {
|
||||
connect: mocks.connect,
|
||||
@@ -23,7 +23,7 @@ vi.mock('./ssh-host-relay-terminals-on-connect', () => ({
|
||||
}))
|
||||
|
||||
const { censusHostRelayTerminalsFor } = await import('./ssh-host-relay-census-for-target')
|
||||
const attribution = await import('./ssh-connection-attribution')
|
||||
const attribution = await import('../ssh-connection-attribution')
|
||||
|
||||
const target: SshTarget = { id: 'ssh-1', label: 'Box', host: 'box', port: 22, username: 'me' }
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: attribution keys on identity only.
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
import type { SshTarget } from '../../shared/ssh-types'
|
||||
import type { CensusHostRelayTerminals } from './orcad-migration-terminal-gate'
|
||||
import { requireManagedOrcadInfrastructure } from './orcad-managed-runtime-context'
|
||||
import type { SshTarget } from '../../../shared/ssh-types'
|
||||
import type { CensusHostRelayTerminals } from '../orcad-migration-terminal-gate'
|
||||
import { requireManagedOrcadInfrastructure } from '../orcad-managed-runtime-context'
|
||||
import {
|
||||
beginSshHostCensus,
|
||||
currentSshOwner,
|
||||
isSshConnectionSolelyOwnedBy,
|
||||
runAttributedToSshOwner
|
||||
} from './ssh-connection-attribution'
|
||||
} from '../ssh-connection-attribution'
|
||||
import {
|
||||
censusSshHostRelaysBeforeSession,
|
||||
hostTerminalProofFromCensus
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from '../remote-exec-command'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { SshConnection } from './ssh-connection'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import {
|
||||
parseRelayEndpointIncumbentProbe,
|
||||
type RelayEndpointIncumbent
|
||||
} from './ssh-relay-endpoint-incumbent'
|
||||
import { getRemoteHostPlatform } from './ssh-remote-platform'
|
||||
import { getRemoteHostPlatform } from '../ssh-remote-platform'
|
||||
|
||||
const { execCommand, probeRelayEndpointIncumbent, countRelayEndpointPtys } = vi.hoisted(() => ({
|
||||
execCommand: vi.fn(),
|
||||
@@ -13,7 +13,7 @@ const { execCommand, probeRelayEndpointIncumbent, countRelayEndpointPtys } = vi.
|
||||
countRelayEndpointPtys: vi.fn()
|
||||
}))
|
||||
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({
|
||||
vi.mock('../remote-exec-command', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand
|
||||
}))
|
||||
+6
-6
@@ -6,11 +6,11 @@
|
||||
* Loss of contact is never evidence of exit (docs/reference/ssh-execution-boundary.md): a listing
|
||||
* that failed, ran out of room, or an endpoint the probe could not classify is `unverifiable`.
|
||||
*/
|
||||
import type { SshConnection } from './ssh-connection'
|
||||
import { shellEscape } from './ssh-connection-utils'
|
||||
import { RELAY_REMOTE_DIR } from './relay-protocol'
|
||||
import { SHORT_RELAY_SOCKET_DIR_PREFIX } from './relay-socket-path-limit'
|
||||
import { execCommand } from './ssh-relay-exec-command'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import { shellEscape } from '../ssh-connection-utils'
|
||||
import { RELAY_REMOTE_DIR } from '../remote-frame-protocol'
|
||||
import { SHORT_RELAY_SOCKET_DIR_PREFIX } from '../relay-socket-path-limit'
|
||||
import { execCommand } from '../remote-exec-command'
|
||||
import {
|
||||
isReapableRelayHusk,
|
||||
probeRelayEndpointIncumbent,
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
} from './ssh-relay-endpoint-incumbent'
|
||||
import { countRelayEndpointPtys } from './ssh-relay-endpoint-pty-count'
|
||||
import { readRelayDaemonRuntimes } from './ssh-relay-endpoint-runtime'
|
||||
import { isWindowsRemoteHost, type RemoteHostPlatform } from './ssh-remote-platform'
|
||||
import { isWindowsRemoteHost, type RemoteHostPlatform } from '../ssh-remote-platform'
|
||||
|
||||
/** `unenumerable`: Windows named pipes cannot be listed, so the caller keeps today's path. */
|
||||
export type HostRelayEndpointVerdict = 'none' | 'idle' | 'live' | 'unverifiable' | 'unenumerable'
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import type { SshRemotePtyLease } from '../../shared/ssh-types'
|
||||
import type { SshRemotePtyLease } from '../../../shared/ssh-types'
|
||||
import type { HostRelayEndpointCensus } from './ssh-host-relay-endpoint-census'
|
||||
import { relayTerminalsOnConnect } from './ssh-host-relay-terminals-on-connect'
|
||||
|
||||
+13
-9
@@ -2,24 +2,28 @@
|
||||
* The connect path's terminal verdict for a host that may convert to a managed server. The host's
|
||||
* own relay endpoints decide, so terminals another desktop opened there still block.
|
||||
*/
|
||||
import type { Store } from '../persistence'
|
||||
import type { HostServerTerminalVerdict } from './ssh-host-server-on-connect'
|
||||
import type { Store } from '../../persistence'
|
||||
import type { HostServerTerminalVerdict } from '../ssh-host-server-on-connect'
|
||||
import {
|
||||
censusHostRelayEndpoints,
|
||||
type HostRelayEndpointCensus
|
||||
} from './ssh-host-relay-endpoint-census'
|
||||
import type { SshConnection } from './ssh-connection'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import { censusWindowsHostRelays, windowsCensusNodePath } from './ssh-host-relay-windows-census'
|
||||
import { execCommand } from './ssh-relay-exec-command'
|
||||
import { readRemoteHomeCommand } from './ssh-remote-commands'
|
||||
import { resolveRemoteNodePath } from './ssh-remote-node-resolution'
|
||||
import { detectRemoteHostPlatform } from './ssh-remote-platform-detection'
|
||||
import { isWindowsRemoteHost, normalizeRemoteHome, validateRemoteHome } from './ssh-remote-platform'
|
||||
import { execCommand } from '../remote-exec-command'
|
||||
import { readRemoteHomeCommand } from '../ssh-remote-commands'
|
||||
import { resolveRemoteNodePath } from '../ssh-remote-node-resolution'
|
||||
import { detectRemoteHostPlatform } from '../ssh-remote-platform-detection'
|
||||
import {
|
||||
isWindowsRemoteHost,
|
||||
normalizeRemoteHome,
|
||||
validateRemoteHome
|
||||
} from '../ssh-remote-platform'
|
||||
import {
|
||||
assessOrcadMigrationTerminals,
|
||||
terminalsRunElsewhere,
|
||||
type HostRelayTerminalProof
|
||||
} from './orcad-migration-terminal-gate'
|
||||
} from '../orcad-migration-terminal-gate'
|
||||
|
||||
export async function relayTerminalsOnConnect(args: {
|
||||
store: Pick<Store, 'getSshRemotePtyLeases'>
|
||||
+5
-5
@@ -1,21 +1,21 @@
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from '../remote-exec-command'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { SshConnection } from './ssh-connection'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import { relaySocketNameForInstanceId } from './ssh-relay-instance-id'
|
||||
import { windowsRelayPipePathsForSocketName } from './ssh-relay-endpoints'
|
||||
import { getRemoteHostPlatform, joinRemotePath } from './ssh-remote-platform'
|
||||
import { getRemoteHostPlatform, joinRemotePath } from '../ssh-remote-platform'
|
||||
|
||||
const { execCommand, countRelayPtysOverBridge } = vi.hoisted(() => ({
|
||||
execCommand: vi.fn(),
|
||||
countRelayPtysOverBridge: vi.fn()
|
||||
}))
|
||||
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({
|
||||
vi.mock('../remote-exec-command', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand
|
||||
}))
|
||||
vi.mock('./ssh-relay-endpoint-pty-count', () => ({ countRelayPtysOverBridge }))
|
||||
vi.mock('./ssh-remote-commands', async (importOriginal) => ({
|
||||
vi.mock('../ssh-remote-commands', async (importOriginal) => ({
|
||||
...(await importOriginal<Record<string, unknown>>()),
|
||||
listRemoteInstallBaseDirsCommand: () => 'LIST'
|
||||
}))
|
||||
+11
-11
@@ -8,9 +8,9 @@
|
||||
* failed or a live pipe that cannot be asked: a shell no lease here knows must never let the host
|
||||
* convert under it.
|
||||
*/
|
||||
import type { SshConnection } from './ssh-connection'
|
||||
import { RELAY_REMOTE_DIR } from './relay-protocol'
|
||||
import { RELAY_INSTALL_MODEL } from './remote-install-model'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import { RELAY_REMOTE_DIR } from '../remote-frame-protocol'
|
||||
import { RELAY_INSTALL_MODEL } from '../remote-install-model'
|
||||
import type { HostRelayEndpointCensus } from './ssh-host-relay-endpoint-census'
|
||||
import {
|
||||
windowsPipesNotRunHere,
|
||||
@@ -19,16 +19,16 @@ import {
|
||||
windowsRelayInventoryCommand
|
||||
} from './ssh-host-relay-windows-inventory'
|
||||
import { countRelayPtysOverBridge } from './ssh-relay-endpoint-pty-count'
|
||||
import { execCommand } from './ssh-relay-exec-command'
|
||||
import { execCommand } from '../remote-exec-command'
|
||||
import { relaySocketNameForInstanceId } from './ssh-relay-instance-id'
|
||||
import { windowsRelayConnectCommand } from './ssh-relay-windows-launch-command'
|
||||
import { listRemoteInstallBaseDirsCommand } from './ssh-remote-commands'
|
||||
import { joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform'
|
||||
import { isNodeRuntimeTarget } from '../../shared/node-runtime-pin'
|
||||
import { orcadNodeRuntimeExecutable } from '../../shared/orcad-artifacts'
|
||||
import { nodeRuntimeStoreDir, remoteNodeRuntimePresentCommand } from './orcad-remote-node-runtime'
|
||||
import { REMOTE_NODE_RUNTIME_READY } from './orcad-remote-node-runtime-report'
|
||||
import { resolveRemoteNodePath } from './ssh-remote-node-resolution'
|
||||
import { listRemoteInstallBaseDirsCommand } from '../ssh-remote-commands'
|
||||
import { joinRemotePath, type RemoteHostPlatform } from '../ssh-remote-platform'
|
||||
import { isNodeRuntimeTarget } from '../../../shared/node-runtime-pin'
|
||||
import { orcadNodeRuntimeExecutable } from '../../../shared/orcad-artifacts'
|
||||
import { nodeRuntimeStoreDir, remoteNodeRuntimePresentCommand } from '../orcad-remote-node-runtime'
|
||||
import { REMOTE_NODE_RUNTIME_READY } from '../orcad-remote-node-runtime-report'
|
||||
import { resolveRemoteNodePath } from '../ssh-remote-node-resolution'
|
||||
|
||||
const MAX_CENSUS_PIPES = 32
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import {
|
||||
} from './ssh-host-relay-windows-inventory'
|
||||
import { relaySocketNameForInstanceId } from './ssh-relay-instance-id'
|
||||
import { windowsRelayPipePathsForSocketName } from './ssh-relay-endpoints'
|
||||
import { getRemoteHostPlatform, joinRemotePath } from './ssh-remote-platform'
|
||||
import { getRemoteHostPlatform, joinRemotePath } from '../ssh-remote-platform'
|
||||
|
||||
const host = getRemoteHostPlatform('win32-x64')
|
||||
const HOME = 'C:\\Users\\dev'
|
||||
+5
-5
@@ -7,15 +7,15 @@
|
||||
* names every relay pipe on the machine, and each instance leaves a credential file (and its pipe
|
||||
* marker) in its version directory, which maps a listed pipe back to the instance that serves it.
|
||||
*/
|
||||
import { RELAY_REMOTE_DIR } from './relay-protocol'
|
||||
import { commandWithNodePath } from './ssh-remote-commands'
|
||||
import { RELAY_REMOTE_DIR } from '../remote-frame-protocol'
|
||||
import { commandWithNodePath } from '../ssh-remote-commands'
|
||||
import {
|
||||
quotePowerShellLiteral as powerShellLiteral,
|
||||
quotePowerShellNativeArgument as powerShellNativeArg
|
||||
} from '../../shared/powershell-native-argument'
|
||||
} from '../../../shared/powershell-native-argument'
|
||||
import { windowsRelayPipePathsForSocketName } from './ssh-relay-endpoints'
|
||||
import { RELAY_INSTALL_MODEL, remoteInstallVersionDirRegex } from './remote-install-model'
|
||||
import { joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform'
|
||||
import { RELAY_INSTALL_MODEL, remoteInstallVersionDirRegex } from '../remote-install-model'
|
||||
import { joinRemotePath, type RemoteHostPlatform } from '../ssh-remote-platform'
|
||||
|
||||
/** The instance that serves a pipe: its version directory and the credential its bridge presents. */
|
||||
export type WindowsRelayPipeOwner = { dir: string; credentialFile: string }
|
||||
+1
-1
@@ -14,7 +14,7 @@ import {
|
||||
relayEndpointIncumbentProbeCommand,
|
||||
type RelayEndpointIncumbent
|
||||
} from './ssh-relay-endpoint-incumbent'
|
||||
import { RELAY_DAEMON_SERVICE_ENTRY_FILENAMES } from './relay-install-artifacts'
|
||||
import { RELAY_DAEMON_SERVICE_ENTRY_FILENAMES } from '../relay-install-artifacts'
|
||||
|
||||
const posixOnly = process.platform === 'win32' ? describe.skip : describe
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from '../remote-exec-command'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { RELAY_LSOF_PROBE_JS } from '@orca/process-host/posix-lsof-probe'
|
||||
|
||||
const execCommand = vi.fn()
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({
|
||||
vi.mock('../remote-exec-command', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand: (...args: unknown[]) => execCommand(...args),
|
||||
isUnconfirmedSshCommandTermination: (error: unknown) =>
|
||||
@@ -16,8 +16,8 @@ import {
|
||||
probeRelayEndpointIncumbent,
|
||||
relayEndpointIncumbentProbeCommand
|
||||
} from './ssh-relay-endpoint-incumbent'
|
||||
import type { SshConnection } from './ssh-connection'
|
||||
import { getRemoteHostPlatform } from './ssh-remote-platform'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import { getRemoteHostPlatform } from '../ssh-remote-platform'
|
||||
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: The mocked execCommand never dereferences the connection; the Windows path returns before using it.
|
||||
const connection = {} as SshConnection
|
||||
+6
-6
@@ -21,16 +21,16 @@
|
||||
* kernel may hold it, and this machine's connect and `lsof` cannot see that machine.
|
||||
*/
|
||||
import { RELAY_LSOF_PROBE_JS } from '@orca/process-host/posix-lsof-probe'
|
||||
import type { SshConnection } from './ssh-connection'
|
||||
import { shellEscape } from './ssh-connection-utils'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import { shellEscape } from '../ssh-connection-utils'
|
||||
import {
|
||||
RELAY_CHILD_COUNT_VAR,
|
||||
RELAY_UNRECOGNIZED_CHILD_COUNT_VAR,
|
||||
relayDaemonChildCensusShell
|
||||
} from './relay-daemon-service-children'
|
||||
import { execCommand, isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command'
|
||||
import { isWindowsRemoteHost, type RemoteHostPlatform } from './ssh-remote-platform'
|
||||
import { filesystemTypeIsLocalDisk } from '../orcad/orcad-data-root-locality'
|
||||
} from '../relay-daemon-service-children'
|
||||
import { execCommand, isUnconfirmedSshCommandTermination } from '../remote-exec-command'
|
||||
import { isWindowsRemoteHost, type RemoteHostPlatform } from '../ssh-remote-platform'
|
||||
import { filesystemTypeIsLocalDisk } from '../../orcad/orcad-data-root-locality'
|
||||
|
||||
type RelayEndpointVerdict = 'live' | 'unverifiable' | 'exited'
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { SshConnection } from './ssh-connection'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
|
||||
const { waitForSentinel, request, dispose } = vi.hoisted(() => ({
|
||||
waitForSentinel: vi.fn(),
|
||||
@@ -8,7 +8,7 @@ const { waitForSentinel, request, dispose } = vi.hoisted(() => ({
|
||||
}))
|
||||
|
||||
vi.mock('./ssh-relay-sentinel', () => ({ waitForSentinel }))
|
||||
vi.mock('./ssh-channel-multiplexer', () => ({
|
||||
vi.mock('../ssh-channel-multiplexer', () => ({
|
||||
SshChannelMultiplexer: class {
|
||||
request = request
|
||||
dispose = dispose
|
||||
+4
-4
@@ -6,10 +6,10 @@
|
||||
* itself knows: its own `relay.js --connect` presents its own build hash, so any client reaches it,
|
||||
* and `pty.listProcesses` needs no PTY owner role, so asking never takes over another desktop's.
|
||||
*/
|
||||
import type { SshConnection } from './ssh-connection'
|
||||
import { SshChannelMultiplexer } from './ssh-channel-multiplexer'
|
||||
import { shellEscape } from './ssh-connection-utils'
|
||||
import { SHORT_RELAY_SOCKET_DIR_PREFIX } from './relay-socket-path-limit'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import { SshChannelMultiplexer } from '../ssh-channel-multiplexer'
|
||||
import { shellEscape } from '../ssh-connection-utils'
|
||||
import { SHORT_RELAY_SOCKET_DIR_PREFIX } from '../relay-socket-path-limit'
|
||||
import { waitForSentinel } from './ssh-relay-sentinel'
|
||||
|
||||
const RELAY_PTY_COUNT_TIMEOUT_MS = 10_000
|
||||
+2
-2
@@ -6,8 +6,8 @@
|
||||
* relay resolved. Asking that relay, or probing its socket, with the same runtime is what keeps a
|
||||
* host with no PATH Node from reading every relay as unverifiable.
|
||||
*/
|
||||
import type { SshConnection } from './ssh-connection'
|
||||
import { execCommand } from './ssh-relay-exec-command'
|
||||
import type { SshConnection } from '../ssh-connection'
|
||||
import { execCommand } from '../remote-exec-command'
|
||||
|
||||
const RELAY_DAEMON_MARKER = ' relay.js --detached '
|
||||
|
||||
+5
-1
@@ -1,5 +1,9 @@
|
||||
import { createHash } from 'node:crypto'
|
||||
import { isWindowsRemoteHost, joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform'
|
||||
import {
|
||||
isWindowsRemoteHost,
|
||||
joinRemotePath,
|
||||
type RemoteHostPlatform
|
||||
} from '../ssh-remote-platform'
|
||||
|
||||
function relayEndpointForHost(
|
||||
hostPlatform: RemoteHostPlatform,
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from '../remote-exec-command'
|
||||
import { mkdtempSync, writeFileSync, rmSync, readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { createServer } from 'node:net'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { runProcess } from '@orca/process-host'
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({
|
||||
vi.mock('../remote-exec-command', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand: vi.fn()
|
||||
}))
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { EventEmitter } from 'node:events'
|
||||
import type { ClientChannel } from 'ssh2'
|
||||
import { expect, it, vi } from 'vitest'
|
||||
import { RELAY_SENTINEL } from './relay-protocol'
|
||||
import { RELAY_SENTINEL } from '../remote-frame-protocol'
|
||||
import { waitForSentinel } from './ssh-relay-sentinel'
|
||||
|
||||
it.each([1, 256])('copies each startup prefix once across %i chunks', async (chunks) => {
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { EventEmitter } from 'node:events'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import type { ClientChannel } from 'ssh2'
|
||||
import { waitForSentinel } from './ssh-relay-sentinel'
|
||||
import { RELAY_SENTINEL } from './relay-protocol'
|
||||
import { RELAY_SENTINEL } from '../remote-frame-protocol'
|
||||
import {
|
||||
RelayVersionMismatchError,
|
||||
RELAY_EXIT_CODE_VERSION_MISMATCH
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
import type { ClientChannel } from 'ssh2'
|
||||
import { createSshOperationAbortError } from './ssh-connection-utils'
|
||||
import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from './relay-protocol'
|
||||
import type { MultiplexerTransport } from './ssh-channel-multiplexer'
|
||||
import { createSshOperationAbortError } from '../ssh-connection-utils'
|
||||
import { RELAY_SENTINEL, RELAY_SENTINEL_TIMEOUT_MS } from '../remote-frame-protocol'
|
||||
import type { MultiplexerTransport } from '../ssh-channel-multiplexer'
|
||||
import { buildRelayHandshakeRefusalError } from './ssh-relay-handshake-mismatch'
|
||||
|
||||
const MAX_RELAY_STARTUP_BUFFER_BYTES = 64 * 1024
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
/** How the host census reaches a running Windows relay through its own bridge. */
|
||||
import { commandWithNodePath } from './ssh-remote-commands'
|
||||
import type { RemoteHostPlatform } from './ssh-remote-platform'
|
||||
import { quotePowerShellLiteral as powerShellLiteral } from '../../shared/powershell-native-argument'
|
||||
import { commandWithNodePath } from '../ssh-remote-commands'
|
||||
import type { RemoteHostPlatform } from '../ssh-remote-platform'
|
||||
import { quotePowerShellLiteral as powerShellLiteral } from '../../../shared/powershell-native-argument'
|
||||
|
||||
export function windowsRelayConnectCommand(
|
||||
hostPlatform: RemoteHostPlatform,
|
||||
@@ -1,7 +1,7 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from './remote-exec-command'
|
||||
import type * as RecordFile from './orcad-remote-record-file'
|
||||
import type * as InstallLock from './ssh-relay-install-lock'
|
||||
import type * as InstallLock from './remote-install-lock'
|
||||
import type * as VersionedInstall from './remote-versioned-install'
|
||||
import type * as Crypto from 'node:crypto'
|
||||
|
||||
@@ -11,14 +11,14 @@ vi.mock('node:crypto', async (importOriginal) => {
|
||||
return { ...actual, randomUUID: () => uuid.fixed ?? actual.randomUUID() }
|
||||
})
|
||||
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({
|
||||
vi.mock('./remote-exec-command', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand: vi.fn()
|
||||
}))
|
||||
vi.mock('./ssh-connection-utils', () => ({
|
||||
shellEscape: (s: string) => `'${s}'`
|
||||
}))
|
||||
vi.mock('./ssh-relay-install-lock', async (importOriginal) => ({
|
||||
vi.mock('./remote-install-lock', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof InstallLock>()),
|
||||
acquireInstallLock: vi.fn()
|
||||
}))
|
||||
@@ -38,8 +38,8 @@ vi.mock('./orcad-local-build-hash', () => ({
|
||||
computeLocalOrcadBuildHash: () => 'abc123def4567890'
|
||||
}))
|
||||
|
||||
import { execCommand } from './ssh-relay-exec-command'
|
||||
import { acquireInstallLock } from './ssh-relay-install-lock'
|
||||
import { execCommand } from './remote-exec-command'
|
||||
import { acquireInstallLock } from './remote-install-lock'
|
||||
import { writeAtomicOrcadRemoteRecord } from './orcad-remote-record-file'
|
||||
import { deployOrcad } from './orcad-remote-deploy'
|
||||
import { rollbackOrcad } from './orcad-remote-rollback'
|
||||
@@ -110,9 +110,8 @@ beforeEach(() => {
|
||||
vi.mocked(execCommand).mockImplementation(async (_conn, command) => host.exec(command))
|
||||
vi.mocked(acquireInstallLock).mockImplementation(async (_conn, dir, _host, options) => {
|
||||
if (!host.acquireFence(options)) {
|
||||
const { RemoteInstallLockBusyError } = await vi.importActual<typeof InstallLock>(
|
||||
'./ssh-relay-install-lock'
|
||||
)
|
||||
const { RemoteInstallLockBusyError } =
|
||||
await vi.importActual<typeof InstallLock>('./remote-install-lock')
|
||||
throw new RemoteInstallLockBusyError(dir, 0)
|
||||
}
|
||||
})
|
||||
@@ -364,9 +363,8 @@ describe('recovery refusals keep the fence', () => {
|
||||
host.crashAt = null
|
||||
const journal = host.journal
|
||||
expect(journal).not.toBeNull()
|
||||
const { RemoteInstallLockBusyError } = await vi.importActual<typeof InstallLock>(
|
||||
'./ssh-relay-install-lock'
|
||||
)
|
||||
const { RemoteInstallLockBusyError } =
|
||||
await vi.importActual<typeof InstallLock>('./remote-install-lock')
|
||||
vi.mocked(acquireInstallLock).mockRejectedValueOnce(new RemoteInstallLockBusyError('/l', 0))
|
||||
expect(await recoverInterruptedOrcadActivation({ ...slot })).toMatchObject({
|
||||
outcome: 'pending'
|
||||
|
||||
@@ -11,18 +11,18 @@ import {
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from './remote-exec-command'
|
||||
|
||||
// Every remote command runs in a real local shell, so the host-side checks are the real ones.
|
||||
const shell = vi.hoisted((): { env: NodeJS.ProcessEnv | undefined } => ({ env: undefined }))
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => {
|
||||
vi.mock('./remote-exec-command', async (importOriginal) => {
|
||||
const { runProcess } = await import('@orca/process-host')
|
||||
return {
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand: async (_conn: unknown, command: string) => {
|
||||
const result = await runProcess({ program: '/bin/sh', args: ['-c', command], env: shell.env })
|
||||
if (result.code !== 0) {
|
||||
const { sshCommandExitError } = await import('./ssh-relay-exec-command')
|
||||
const { sshCommandExitError } = await import('./remote-exec-command')
|
||||
throw sshCommandExitError(command, result.code ?? 1, result.stdout)
|
||||
}
|
||||
return result.stdout
|
||||
|
||||
@@ -6,7 +6,7 @@ const mocks = vi.hoisted(() => ({
|
||||
fence: vi.fn(),
|
||||
takeover: vi.fn()
|
||||
}))
|
||||
vi.mock('./ssh-relay-install-lock', () => ({
|
||||
vi.mock('./remote-install-lock', () => ({
|
||||
isRelayInstallLockStale: mocks.stale,
|
||||
RELAY_INSTALL_LOCK_NAME: '.install-lock'
|
||||
}))
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from './orcad-activation-lock'
|
||||
import { readOrcadActivationTransaction } from './orcad-activation-transaction-store'
|
||||
import { orcadActivationFenceLockDir } from './orcad-activation-transaction'
|
||||
import { isRelayInstallLockStale } from './ssh-relay-install-lock'
|
||||
import { isRelayInstallLockStale } from './remote-install-lock'
|
||||
import { findExitedOwnLockToken } from './orcad-exited-own-lock'
|
||||
import { orcadRemoteBaseDir } from './orcad-remote-windows-node'
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
import { AsyncLocalStorage } from 'node:async_hooks'
|
||||
import { shellEscape } from './ssh-connection-utils'
|
||||
import { isSshCommandExitError } from './ssh-relay-exec-command'
|
||||
import { isSshCommandExitError } from './remote-exec-command'
|
||||
|
||||
export const ORCAD_FENCE_OWNER_FILENAME = '.orca-fence-owner'
|
||||
export const ORCAD_FENCE_LOST_MARKER = '__ORCAD_FENCE_LOST__'
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
type OrcadActivationRecord
|
||||
} from './orcad-activation-record'
|
||||
import { isSnapshotCaptureCommand } from './orcad-snapshot-capture-command'
|
||||
import { sshCommandExitError } from './ssh-relay-exec-command'
|
||||
import { sshCommandExitError } from './remote-exec-command'
|
||||
|
||||
export const OLD = '0.1.0+aa01'
|
||||
export const NEW = '0.2.0+bb01'
|
||||
|
||||
@@ -12,12 +12,12 @@ import {
|
||||
withoutAbortSignal,
|
||||
type OrcadRemoteExecTarget
|
||||
} from './orcad-remote-runtime-control'
|
||||
import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command'
|
||||
import { acquireInstallLock, RemoteInstallLockBusyError } from './ssh-relay-install-lock'
|
||||
import { isUnconfirmedSshCommandTermination } from './remote-exec-command'
|
||||
import { acquireInstallLock, RemoteInstallLockBusyError } from './remote-install-lock'
|
||||
import {
|
||||
orphanInstallLockCommand,
|
||||
probeInstallLockExistsCommand
|
||||
} from './ssh-relay-install-lock-commands'
|
||||
} from './remote-install-lock-commands'
|
||||
import { shellEscape } from './ssh-connection-utils'
|
||||
import {
|
||||
ORCAD_FENCE_OWNER_FILENAME,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* activated" would deploy over a live install and lose its rollback target.
|
||||
*/
|
||||
import type { OrcadHostTransport } from './orcad-host-transport'
|
||||
import { RELAY_REMOTE_DIR } from './relay-protocol'
|
||||
import { RELAY_REMOTE_DIR } from './remote-frame-protocol'
|
||||
import {
|
||||
ORCAD_ACTIVATION_FILENAME,
|
||||
emptyOrcadActivationRecord,
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
orcadActivationFenceExists,
|
||||
withStaleOrcadActivationRecoveryLock
|
||||
} from './orcad-activation-lock'
|
||||
import { RemoteInstallLockBusyError } from './ssh-relay-install-lock'
|
||||
import { RemoteInstallLockBusyError } from './remote-install-lock'
|
||||
import { ensureOrcadSlotServing, resolveOrcadSlotIdentity } from './orcad-recovery-slot'
|
||||
import { reconcileOrcadDecommission } from './orcad-decommission-recovery'
|
||||
import {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as InstallLock from './ssh-relay-install-lock'
|
||||
import type * as ExecCommandModule from './remote-exec-command'
|
||||
import type * as InstallLock from './remote-install-lock'
|
||||
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({
|
||||
vi.mock('./remote-exec-command', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand: vi.fn().mockResolvedValue('')
|
||||
}))
|
||||
vi.mock('./ssh-relay-install-lock', async (importOriginal) => ({
|
||||
vi.mock('./remote-install-lock', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof InstallLock>()),
|
||||
acquireInstallLock: vi.fn().mockResolvedValue(undefined)
|
||||
}))
|
||||
|
||||
import { execCommand } from './ssh-relay-exec-command'
|
||||
import { acquireInstallLock, RemoteInstallLockBusyError } from './ssh-relay-install-lock'
|
||||
import { execCommand } from './remote-exec-command'
|
||||
import { acquireInstallLock, RemoteInstallLockBusyError } from './remote-install-lock'
|
||||
import {
|
||||
parseOrcadActivationTransaction,
|
||||
planOrcadTransactionRecovery,
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
} from './orcad-decommission-transaction'
|
||||
import { errorMessage } from '../../shared/error-message'
|
||||
import { RELAY_INSTALL_LOCK_NAME } from '../../shared/relay-install-lock-name'
|
||||
import { RELAY_REMOTE_DIR } from './relay-protocol'
|
||||
import { RELAY_REMOTE_DIR } from './remote-frame-protocol'
|
||||
import { joinRemotePath, type RemoteHostPlatform } from './ssh-remote-platform'
|
||||
|
||||
export const ORCAD_ACTIVATION_TRANSACTION_FILENAME = 'transaction.json'
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
launchOrcadAndAwaitReadiness,
|
||||
type OrcadRemoteExecTarget
|
||||
} from './orcad-remote-runtime-control'
|
||||
import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command'
|
||||
import { isUnconfirmedSshCommandTermination } from './remote-exec-command'
|
||||
|
||||
type CandidateLaunchTarget = Parameters<typeof launchOrcadAndAwaitReadiness>[0] &
|
||||
OrcadRemoteExecTarget & {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* lost answer is `unverifiable`, never exit; cancelling is how a stop that did not finish is
|
||||
* withdrawn, and only an orcad-confirmed cancellation lets the fence go.
|
||||
*/
|
||||
import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command'
|
||||
import { isUnconfirmedSshCommandTermination } from './remote-exec-command'
|
||||
import {
|
||||
cancelRemoteOrcadManagedStop,
|
||||
completeRemoteOrcadManagedStop
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from './remote-exec-command'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import {
|
||||
parseGlibcVersion,
|
||||
@@ -7,10 +7,10 @@ import {
|
||||
} from './orcad-deployment-target'
|
||||
import { SshConnection } from './ssh-connection'
|
||||
import { createCallbacks, createTarget } from './ssh-connection-test-fixtures'
|
||||
import { execCommand } from './ssh-relay-exec-command'
|
||||
import { execCommand } from './remote-exec-command'
|
||||
import { getRemoteHostPlatform } from './ssh-remote-platform'
|
||||
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({
|
||||
vi.mock('./remote-exec-command', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand: vi.fn()
|
||||
}))
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from '../../shared/node-runtime-pin'
|
||||
import { ORCAD_SERVER_TARGET_FILENAME } from '../../shared/orcad-artifacts'
|
||||
import type { RemoteInstallTransport } from './remote-install-transport'
|
||||
import { execCommand } from './ssh-relay-exec-command'
|
||||
import { execCommand } from './remote-exec-command'
|
||||
import type { RemoteHostPlatform } from './ssh-remote-platform'
|
||||
|
||||
/** The host answered the libc probe, but with nothing this client recognises. */
|
||||
|
||||
@@ -11,10 +11,10 @@ import { hostname, tmpdir, uptime } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { runProcess, spawnProcess } from '@orca/process-host'
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from './remote-exec-command'
|
||||
|
||||
// The proof's remote commands run in a real local shell.
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => {
|
||||
vi.mock('./remote-exec-command', async (importOriginal) => {
|
||||
const { runProcess: run } = await import('@orca/process-host')
|
||||
return {
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
@@ -26,7 +26,7 @@ vi.mock('./ssh-relay-exec-command', async (importOriginal) => {
|
||||
const { exitedOwnLockProof } = await import('./orcad-exited-own-lock')
|
||||
const { initOrcadHeldFenceTokenFile, ORCAD_HELD_FENCE_TOKENS_FILE_NAME } =
|
||||
await import('./orcad-held-fence-tokens')
|
||||
const { tryStealInstallLockCommand } = await import('./ssh-relay-install-lock-commands')
|
||||
const { tryStealInstallLockCommand } = await import('./remote-install-lock-commands')
|
||||
const { serializedStateMutationCommand } = await import('./orcad-state-snapshot')
|
||||
const { ORCAD_FENCE_LOST_EXIT, ORCAD_FENCE_LOST_MARKER } =
|
||||
await import('./orcad-activation-fence-scope')
|
||||
|
||||
@@ -11,13 +11,13 @@ import {
|
||||
import { hostname, tmpdir, uptime } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from './remote-exec-command'
|
||||
|
||||
// Every remote command runs in a real local shell, so the host-side checks are the real ones.
|
||||
const shell = vi.hoisted((): { env: NodeJS.ProcessEnv | undefined } => ({ env: undefined }))
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => {
|
||||
vi.mock('./remote-exec-command', async (importOriginal) => {
|
||||
const { runProcess } = await import('@orca/process-host')
|
||||
const { sshCommandExitError } = await import('./ssh-relay-exec-command')
|
||||
const { sshCommandExitError } = await import('./remote-exec-command')
|
||||
return {
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand: async (_conn: unknown, command: string) => {
|
||||
|
||||
@@ -11,12 +11,12 @@ import {
|
||||
import { hostname, tmpdir, uptime } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from './remote-exec-command'
|
||||
|
||||
// Every remote command runs in a real local shell, so the host-side checks are the real ones.
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => {
|
||||
vi.mock('./remote-exec-command', async (importOriginal) => {
|
||||
const { runProcess } = await import('@orca/process-host')
|
||||
const { sshCommandExitError } = await import('./ssh-relay-exec-command')
|
||||
const { sshCommandExitError } = await import('./remote-exec-command')
|
||||
return {
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand: async (_conn: unknown, command: string) => {
|
||||
@@ -29,7 +29,7 @@ vi.mock('./ssh-relay-exec-command', async (importOriginal) => {
|
||||
}
|
||||
})
|
||||
|
||||
const { acquireInstallLock, RemoteInstallLockBusyError } = await import('./ssh-relay-install-lock')
|
||||
const { acquireInstallLock, RemoteInstallLockBusyError } = await import('./remote-install-lock')
|
||||
const { exitedOwnLockProof } = await import('./orcad-exited-own-lock')
|
||||
const { initOrcadHeldFenceTokenFile, ORCAD_HELD_FENCE_TOKENS_FILE_NAME } =
|
||||
await import('./orcad-held-fence-tokens')
|
||||
|
||||
@@ -2,14 +2,14 @@ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
|
||||
import { hostname, tmpdir, uptime } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from './remote-exec-command'
|
||||
|
||||
// The host script's own checks are covered against the real script; here only the client's part.
|
||||
const remote = vi.hoisted((): { commands: string[]; reply: string } => ({
|
||||
commands: [],
|
||||
reply: ''
|
||||
}))
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => ({
|
||||
vi.mock('./remote-exec-command', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
execCommand: async (_conn: unknown, command: string) => {
|
||||
remote.commands.push(command)
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
} from './orcad-state-snapshot-members'
|
||||
import { CMD_EXE_COMMAND_LINE_MAX_CHARS } from '../providers/windows-shell-args'
|
||||
import { shellEscape } from './ssh-connection-utils'
|
||||
import type { InstallLockExitedOwnerProof } from './ssh-relay-install-lock'
|
||||
import type { InstallLockExitedOwnerProof } from './remote-install-lock'
|
||||
import { isWindowsRemoteHost, joinRemotePath } from './ssh-remote-platform'
|
||||
|
||||
// Keeps the Windows command line short; an older token left out only waits out the stale window.
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
posixOrcadFenceGuard,
|
||||
runWithOrcadFence
|
||||
} from './orcad-activation-fence-scope'
|
||||
import { isUnconfirmedSshCommandTermination, sshCommandExitError } from './ssh-relay-exec-command'
|
||||
import { isUnconfirmedSshCommandTermination, sshCommandExitError } from './remote-exec-command'
|
||||
import { getRemoteHostPlatform } from './ssh-remote-platform'
|
||||
import type { OrcadHostTransport } from './orcad-host-transport'
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { orcadInstallDirNames } from './orcad-activation-record'
|
||||
import type { OrcadActivationTransaction } from './orcad-activation-transaction'
|
||||
import { readOrcadActivationTransaction } from './orcad-activation-transaction-store'
|
||||
import { orcadActivationFenceExists } from './orcad-activation-lock'
|
||||
import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command'
|
||||
import { isUnconfirmedSshCommandTermination } from './remote-exec-command'
|
||||
import type { OrcadRemoteExecTarget } from './orcad-remote-runtime-control'
|
||||
|
||||
export type OrcadGcTransactionPins = { state: 'pinned'; dirNames: string[] } | { state: 'keep-all' }
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { execOrcadStateMutation } from './orcad-state-mutation-exec'
|
||||
import { orcadRemoteBaseDir } from './orcad-remote-windows-node'
|
||||
import type { ServeReadiness } from '../server/serve-readiness'
|
||||
import { RELAY_REMOTE_DIR } from './relay-protocol'
|
||||
import { RELAY_REMOTE_DIR } from './remote-frame-protocol'
|
||||
import { ORCAD_STATE_SNAPSHOT_DIR } from './orcad-activation-record'
|
||||
import type { OrcadSnapshotVerdict } from './orcad-activation-transaction'
|
||||
import {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import { orcadRemoteBaseDir } from './orcad-remote-windows-node'
|
||||
import { randomUUID } from 'node:crypto'
|
||||
import type { OrcadDeployOptions, OrcadDeployResult } from './orcad-remote-deploy'
|
||||
import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command'
|
||||
import { isUnconfirmedSshCommandTermination } from './remote-exec-command'
|
||||
import {
|
||||
withActivatedVersion,
|
||||
type OrcadActivationRecord,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { randomUUID } from 'node:crypto'
|
||||
import { shellEscape } from './ssh-connection-utils'
|
||||
import { RELAY_REMOTE_DIR } from './relay-protocol'
|
||||
import { RELAY_REMOTE_DIR } from './remote-frame-protocol'
|
||||
import {
|
||||
ORCAD_MACHINE_CLAIM_FILENAME,
|
||||
ORCAD_MACHINE_CLAIM_SCHEMA_VERSION
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as ExecCommandModule from './ssh-relay-exec-command'
|
||||
import type * as ExecCommandModule from './remote-exec-command'
|
||||
import type { OrcadMachineHomeProbe } from './orcad-machine-home'
|
||||
import type { OrcadHostTransport } from './orcad-host-transport'
|
||||
import type { RemoteHostPlatform } from './ssh-remote-platform'
|
||||
@@ -21,7 +21,7 @@ import type { RemoteHostPlatform } from './ssh-remote-platform'
|
||||
const shell = vi.hoisted((): { env: NodeJS.ProcessEnv | undefined } => ({
|
||||
env: undefined
|
||||
}))
|
||||
vi.mock('./ssh-relay-exec-command', async (importOriginal) => {
|
||||
vi.mock('./remote-exec-command', async (importOriginal) => {
|
||||
const { runProcess } = await import('@orca/process-host')
|
||||
return {
|
||||
...(await importOriginal<typeof ExecCommandModule>()),
|
||||
@@ -32,7 +32,7 @@ vi.mock('./ssh-relay-exec-command', async (importOriginal) => {
|
||||
env: conn.env ?? shell.env
|
||||
})
|
||||
if (result.code !== 0) {
|
||||
const { sshCommandExitError } = await import('./ssh-relay-exec-command')
|
||||
const { sshCommandExitError } = await import('./remote-exec-command')
|
||||
throw sshCommandExitError(command, result.code ?? 1, result.stdout)
|
||||
}
|
||||
return result.stdout
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
import { createHash } from 'node:crypto'
|
||||
import { shellEscape } from './ssh-connection-utils'
|
||||
import { RELAY_REMOTE_DIR } from './relay-protocol'
|
||||
import { RELAY_REMOTE_DIR } from './remote-frame-protocol'
|
||||
import { ORCAD_ACTIVATION_FILENAME } from './orcad-activation-record'
|
||||
import { parseDarwinPlatformUuid } from '../persistence/profile-state/profile-state-access-identity'
|
||||
import {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { execOrcadRemote } from './orcad-remote-runtime-control'
|
||||
import { readBoundedOrcadRemoteRecord } from './orcad-remote-record-file'
|
||||
import { orcadSlotDir, type OrcadSlotOptions } from './orcad-recovery-slot'
|
||||
import { isWindowsRemoteHost, joinRemotePath } from './ssh-remote-platform'
|
||||
import { isUnconfirmedSshCommandTermination } from './ssh-relay-exec-command'
|
||||
import { isUnconfirmedSshCommandTermination } from './remote-exec-command'
|
||||
import {
|
||||
orcadWindowsNodeCommandLine,
|
||||
orcadWindowsSlotOpCommand,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user