@letitbexai_root/lexxit-automation-framework 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letitbexai_root/lexxit-automation-framework",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Playwright test execution framework with Express API for test execution and reporting.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -57,7 +57,7 @@ param(
57
57
  [string] $RunnerUsername = "lexxit-runner",
58
58
  [string] $RunnerPassword = "", # generated below if blank
59
59
  [string] $Resolution = "1920x1080",
60
- [string] $AgentPackage = "lexxit-automation-framework",
60
+ [string] $AgentPackage = "@letitbexai_root/lexxit-automation-framework",
61
61
  # "latest" is a placeholder, not a recommendation - pin a real version
62
62
  # once one has been published including healthProbes.ts's
63
63
  # os/browsers/vnc_ready/session_state fields (the plan's section 1.6
@@ -243,8 +243,36 @@ $msiArgs = @(
243
243
  "SERVER_REGISTER_AS_SERVICE=1",
244
244
  "SERVER_ADD_FIREWALL_EXCEPTION=1",
245
245
  "SET_USEVNCAUTHENTICATION=1", "VALUE_OF_USEVNCAUTHENTICATION=1",
246
+ # VALUE_OF_PASSWORD on an msiexec command line is readable in plaintext
247
+ # by any other local user/process on this VM for the few seconds this
248
+ # install runs (Task Manager's "Command line" column, Get-CimInstance
249
+ # Win32_Process, etc.) - TightVNC's MSI has no encrypted/file-based way
250
+ # to set this property, only this one. Accepted deliberately: the
251
+ # password is random and single-use per VM (generated fresh per install
252
+ # token, encrypted at rest in Mongo), the exposure window is brief, and
253
+ # exploiting it needs local access to this exact VM during that window -
254
+ # not a remote or persistent risk. A real fix exists (write TightVNC's
255
+ # registry password directly using its fixed-key DES obfuscation,
256
+ # bypassing this property entirely) but was deliberately not done here:
257
+ # hand-rolling that obfuscation wrong fails silently into the exact same
258
+ # "VNC authentication failed" this script already had to debug once.
246
259
  "SET_PASSWORD=1", "VALUE_OF_PASSWORD=$VncPassword",
247
- "SET_ALLOWLOOPBACK=1", "VALUE_OF_ALLOWLOOPBACK=1"
260
+ "SET_ALLOWLOOPBACK=1", "VALUE_OF_ALLOWLOOPBACK=1",
261
+ # Without these, `msiexec /i` on a TightVNC that is ALREADY installed at
262
+ # the same product version silently no-ops instead of reapplying
263
+ # properties - VALUE_OF_PASSWORD included. That left a real VM with
264
+ # TightVNC still on an old password after this script re-ran (e.g. after
265
+ # someone changed it by hand via TightVNC's own config UI in between),
266
+ # while the backend had already stored the new one from this run's
267
+ # install token, causing the live-view proxy's VNC auth to fail with no
268
+ # indication why. REINSTALL=ALL + REINSTALLMODE=vomus forces msiexec to
269
+ # treat this as a genuine reinstall - v: run from source, o: reinstall
270
+ # if older/missing, m/u: rewrite machine+user registry (where TightVNC's
271
+ # password actually lives), s: rewrite shortcuts - so the password (and
272
+ # every other property above) is guaranteed to re-apply every single
273
+ # time this script runs, install or reinstall alike. Confirmed the hard
274
+ # way: a real VM's live view broke from exactly this gap.
275
+ "REINSTALL=ALL", "REINSTALLMODE=vomus"
248
276
  )
249
277
  Start-Process msiexec.exe -ArgumentList $msiArgs -Wait -NoNewWindow
250
278
  # TightVNC's "service mode" specifically captures the active CONSOLE
@@ -272,6 +300,19 @@ if (-not $node) {
272
300
  [System.Environment]::GetEnvironmentVariable("Path", "User")
273
301
  }
274
302
 
303
+ # Playwright's default browser cache is per-Windows-user (%LOCALAPPDATA%\
304
+ # ms-playwright), but whoever runs THIS install (an Administrator, or SYSTEM
305
+ # over SSM) is never the same Windows account that later runs the agent
306
+ # (lexxit-runner, via the Scheduled Task below) - so a browser downloaded
307
+ # under the installer's own profile is invisible to the running agent,
308
+ # which reports it as missing (/api/health's browsers.chromium: false) even
309
+ # though it is genuinely installed, just under the wrong profile. Pointing
310
+ # both the install-time download and the launcher's runtime env (below) at
311
+ # the same fixed, non-per-user path makes this independent of who installs.
312
+ # Confirmed the hard way on a real Windows EC2 AMI.
313
+ $browsersPath = Join-Path $AgentInstallDir ".playwright-browsers"
314
+ $env:PLAYWRIGHT_BROWSERS_PATH = $browsersPath
315
+
275
316
  Write-Host "[lexxit] Installing $AgentPackage@$AgentVersion into $AgentInstallDir..."
276
317
  if (-not (Test-Path $AgentInstallDir)) { New-Item -ItemType Directory -Path $AgentInstallDir -Force | Out-Null }
277
318
  Push-Location $AgentInstallDir
@@ -299,6 +340,7 @@ $launcherContent = @"
299
340
  `$env:PORT = '$AgentPort'
300
341
  `$env:VNC_READY_MARKER = '$vncReadyMarker'
301
342
  `$env:SESSION_PROBE_SCRIPT = '$probeScript'
343
+ `$env:PLAYWRIGHT_BROWSERS_PATH = '$browsersPath'
302
344
  New-Item -ItemType File -Path `$env:VNC_READY_MARKER -Force | Out-Null
303
345
  node "$agentEntry"
304
346
  "@