Skip to content

feat(cli): smooth self-hosted setup and recovery - #4142

Merged
yannickmonney merged 3 commits into
mainfrom
feat/self-hosted-onboarding
Oct 3, 2026
Merged

yannickmonney merged 3 commits into
mainfrom
feat/self-hosted-onboarding

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

First-time self-hosted users could follow stale setup instructions, receive a ready message while the API was unhealthy, or get stuck when installation and PATH handling disagreed. This change makes the existing tale init → tale dev path easier to diagnose, start, and resume.

  • Add read-only tale doctor checks for Docker, Compose readiness support, the container platform, and local ports, with actionable recovery and structured JSON output.
  • Wait for services before reporting a detached launch ready; keep custom HTTPS origins consistent across auth, API and object-store URLs; add tale dev --stop that stops only the project's local containers and preserves its data.
  • Verify the installed executable at its actual location, handle custom directories and Windows PATH correctly, fail closed on invalid checksums, and make Linux Docker installation and socket-permission recovery reliable.
  • Rewrite the self-hosted entry path, quickstart, installation reference and first-owner instructions in English, German and French, including the handoff to provider settings and a first chat.

Validation:

  • CLI CI passes on Linux x64/ARM64, macOS x64/ARM64, and native Windows, including unit tests and compiled-binary smoke tests. All 31 installer cases also pass locally with PowerShell supplied by the official Microsoft container.
  • Core checks, including formatting, lint, types, unit/UI/browser tests, builds and Knip, pass. Security scanning and all platform/docs/web end-to-end tests pass; the E2E run retained no retry/failure diagnostics. Documentation structure, locale parity, links and prerender checks pass.
  • Observed a fresh release-style CLI launch on Docker, first-owner and workspace creation in a real browser, the provider-settings handoff, and stop/restart preserving the account, workspace, draft and .env. Verified documentation at desktop/mobile widths and installer-tab keyboard interaction.
  • Container builds, image validation and smoke tests pass. All 55 non-skipped checks are green on commit 11f7705c4. No host Docker installer was executed, and no model response was tested because no provider credential was supplied.

The live test used published 0.5.70 runtime images. This host's existing Docker networks exhausted its default address pools, so the disposable test project received an explicitly reserved unused subnet; existing networks and volumes were preserved.

@yannickmonney
yannickmonney marked this pull request as ready for review October 3, 2026 14:36
@yannickmonney
yannickmonney merged commit c97fed0 into main Oct 3, 2026
@yannickmonney
yannickmonney deleted the feat/self-hosted-onboarding branch October 3, 2026 15:23
@yannickmonney

Copy link
Copy Markdown
Contributor Author

Post-merge independent review of #4142 at c97fed0b1: root merged it at 15:23Z with no review on record. Tale agent #2 3f9fdcee, TALE-359 run a721a46a-c362-49ac-8936-9fa055181d29. This is a source review by one read-only reviewer, with its key claims spot-checked by me. Nothing was executed.

Verdict: source accepted with follow-ups. tale dev --stop deletes nothing, the installers fail closed on checksum problems, the Docker install script is downloaded completely before it runs, and host and port are validated before compose generation.

LOW

  1. The docs now call .env "a private .env" (docs/{en,de,fr}/self-hosted/install/quickstart.md:57).
    • The problem: tools/cli/src/lib/config/ensure-env.ts:632 writes it with no file mode, so the umask decides (typically 0644). On a multi-user Linux host, other local users can then read the auth secret, the encryption key, the SOPS age key and the database password.
    • The code is older than this PR; the new claim isn't.
    • Fix: write it with mode: 0o600 and chmod existing files.
  2. Foreground tale dev now requires Compose with --wait-timeout (tools/cli/src/lib/actions/dev.ts:244 → setup-checks.ts:37), though only the detached path uses --wait. A host with an older Compose v2 that ran tale dev before now fails a precondition.
  3. The Windows installer rewrites the user PATH on most upgrades (scripts/install-cli.ps1:328-335). It reads the expanded value and writes it back as a plain string, so %VAR% entries become frozen paths. This is a hypothesis about .NET registry behaviour; the tests cover only the pure function.
    • Fix: read with DoNotExpandEnvironmentNames and write ExpandString, or skip the write when the directory is already present.

INFO

  • tale doctor's port check warns "EACCES" to every non-root Linux user.
  • --stop doesn't stop sandbox session containers, and takes no lock against a concurrent --detach.
  • The dev origin now comes only from flags, and there is no upgrade note.

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