Skip to content

fix(scripts): warn on spaced paths in the relay supervisor installer (#166) - #177

Merged
OBenner merged 1 commit into
mainfrom
fix/166-installer-hardening
Nov 28, 2026
Merged

OBenner merged 1 commit into
mainfrom
fix/166-installer-hardening

Conversation

@OBenner

@OBenner OBenner commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Follow-up к #166 (пост-ревью 803a52b)

Два усиления установщика, согласованные с dev как follow-up:

  1. Write-Warning при spaced-фолбэке: если 8.3 short names отключены на томе, фолбэк молча возвращал spaced-путь → та же миспарс-ловушка /tr, что чинил 803a52b. Теперь — громкое предупреждение.
  2. Write-Warning на spaced ProjectRoot/SynloqCli/SynloqHome (задокументировано как не поддерживается) — раньше молчали.

Намеренно НЕ сделано: обобщение %~sI на каталоги

Предложенное на пост-ревью обобщение short-name на ProjectRoot оказалось ловушкой, с evidence:

  • cmd /c for %I in (<dir>) возвращает мусор для каталогов (наблюдено: I:\git → I:\git\Synloq\git).
  • Node realpath на Windows НЕ резолвит 8.3 обратно в длинное имя (realpath("C:\PROGRA~1") → C:\PROGRA~1), а ключ проекта — sha256 канонического пути: короткий путь → ДРУГОЙ ключ → relay обслуживал бы чужой/пустой home. Доказательство: sha256("C:/Program Files/x") ≠ sha256("C:/PROGRA~1/x").

Quoting-safe регистрация spaced-путей — другой подход (doubled quotes в /tr), отдельной задачей, если понадобится.

Скрипт парсится (PSParser), verify не затронут (ps1 вне prettier/vitest контура).

…166)

Follow-up to the #166 post-review: when 8.3 short names are disabled on
the volume, the fallback silently reintroduces the spaced /tr misparse,
and spaced ProjectRoot/SynloqCli/SynloqHome (documented unsupported)
failed without a word. Both now warn loudly at install time.

Deliberately NOT done: generalizing the 8.3 trick to directories.
Evidence against it: cmd %~sI on a directory returns garbage, and Node's
realpath does not resolve 8.3 short names back to long ones — a short
projectRoot would hash to a different project key and the relay would
serve the wrong home. Quoting-safe registration needs a different
approach (doubled quotes in /tr), left for a future change.
@OBenner
OBenner merged commit f38a38b into main Nov 28, 2026
5 checks passed
@OBenner
OBenner deleted the fix/166-installer-hardening branch November 28, 2026 06:54
OBenner added a commit that referenced this pull request Nov 29, 2026
The code intentionally warns and still runs schtasks /create (the #177
warn-only precedent); the guide now says exactly that, with the verify
command.
OBenner added a commit that referenced this pull request Nov 29, 2026
…rom npm (#180) (#183)

* feat(cli): synloq relay-supervisor --install — register the Scheduled Task from npm (#180)

The ps1 installer never shipped in the npm package, so a clean install
had no supported way to register the supervisor task. The TypeScript
installer is the tested product path:

- idempotent: existing task with the same name is left untouched
- 8.3 short-name resolution for node.exe; spaced paths warn loudly
  instead of registering a broken task (#177 coverage)
- refuses non-Windows platforms explicitly; never touches locks or
  database state
- docs/guide/operator.md + CHANGELOG

* docs: supervisor install warns AND registers on spaced paths (#183)

The code intentionally warns and still runs schtasks /create (the #177
warn-only precedent); the guide now says exactly that, with the verify
command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant