Skip to content

fix: start a fresh clone on a clean host with ./quickstart.sh, keeping production values in LKAL (ADR-001070) - #445

Merged
Kaikei-e merged 22 commits into
mainfrom
fix/quickstart-clean-host
Dec 4, 2026
Merged

Kaikei-e merged 22 commits into
mainfrom
fix/quickstart-clean-host

Conversation

@Kaikei-e

@Kaikei-e Kaikei-e commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

A fresh clone on a clean host now starts with one command: ./quickstart.sh --gpu cuda|vulkan (ADR-001070).

  • Entry point: new quickstart.sh. It builds altctl in a pinned Go container, so the host needs neither Go nor sudo. The one exception is a single AppArmor step on hosts where AppArmor is enabled.
  • altctl:
    • --timeout now bounds only the Ready-wait, so image pull and build are never killed mid-run.
    • The status table after a failure shows each container's real state.
    • init generates the VAPID key pair, creates .alt-data/ with the owner each container expects, records --gpu, and gains --open-registration.
    • ALT_INFERENCE_GPU=vulkan adds the Vulkan overlay.
  • Compose defaults:
    • Bind sources default to repo-relative paths, and the Plecto signed artifact and its public key are committed.
    • Kratos URLs default to localhost.
    • The VAPID_SUBJECT default now passes the notifier's validation.
    • The Plecto admin port is configurable.
  • Production values: declared in deploy/desired-env.lkal under the new host_paths section.
  • Kratos registration fails closed: the defaults remain registration disabled and the show_verification_ui hook. The quickstart opens registration explicitly with altctl init --open-registration, and the entrypoint logs the registration mode at startup.
  • kisage / deploy check:
    • A compose default may differ from its declaration only for host_paths; every other section still fails verify with compose-default-mismatch.
    • The new required_env_overrides rule makes check-env-overrides.py reject a production .env that lacks any host_paths key.
    • deploy-local.sh now runs that check too.
  • Bugs that appeared only on a clean host:
    • db/init now creates the tag_generator role.
    • The PKI bootstrap writes the provisioner password with mode 0644, inside a 0750 directory.
    • The quickstart creates the search-indexer consumer group.
    • pre-processor-sidecar and auth-token-manager start with INOREADER_SYNC=disabled; an unset value now fails at startup.
    • The Kratos entrypoint removes duplicate CORS origins.
    • news-creator keeps the reranker model in a named volume, and its mTLS /health/deep returns 503 until startup completes.
  • Also fixed: auth-token-manager JSON log lines carried ANSI color codes.

Before merging

The production .env must contain the five host_paths keys (*_HOST_PATH). Apply them with kisage, following docs/runbooks/kisage-env.md with /host_paths in scope. Then check the result: python3 scripts/kisage-env.py preflight --env-file <prod .env> and python3 scripts/check-env-overrides.py --env-file <prod .env> must both pass. Without these keys, every deploy stops at the host env check.

On the first deploy after merging, news-creator downloads the reranker model again into the new volume. This took about 6 minutes when measured.

Test plan

  • altctl, pre-processor-sidecar and auth-token-manager tests and lint (./scripts/lint/run.sh <target>)
  • news-creator pytest and lint
  • ./scripts/lint/run.sh repo, scripts, compose
  • python3 scripts/kisage-env.py verify, test-kisage-env.py, test-check-env-overrides.py, test-group1-security.py, test-quickstart-entry.py, test-compose-prod-env-wiring.py, test-compose-file-bind-audit.py, role-parity, PKI, seed-reranker
  • shellcheck on the new and changed shell scripts
  • Re-run ./quickstart.sh on a host reset to a clean state

🤖 Generated with Claude Code

Kaikei-e and others added 21 commits December 4, 2026 18:42
…clone with quickstart defaults in the repo and production values declared in LKAL

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d by both the production init script and the CI fixture, and new PKI provisioner passwords to be 0644 inside a 0750 secrets directory (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the non-role db_owner from the CI fixture, write new PKI provisioner passwords 0644 in a 0750 directory, and run the role parity test in the compose audit (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…espan initialization completes, the image to own the Hugging Face cache directory, and a reranker seed script for the cache volume (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ization completes, create the Hugging Face cache directory for appuser in the image, and add a script that seeds the reranker into the cache volume (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dle without Inoreader credentials when INOREADER_SYNC=disabled, and to fail fast on an unset or unknown INOREADER_SYNC (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th an inoreader_sync_disabled log when INOREADER_SYNC=disabled, wire no Inoreader code in that mode, and require INOREADER_SYNC to be set explicitly (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and bound only the readiness wait, report real container states after a failed start, generate a VAPID pair in init, record --gpu and add the Vulkan overlay, and create the quickstart data directories (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reate phases with --timeout only on readiness, classify failed services from State, Health and ExitCode, generate VAPID keys and the .alt-data directories in init, and add the Vulkan overlay when .env sets ALT_INFERENCE_GPU=vulkan (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… runs PKI, streams, model seeding and the stacks in order with a side-effect-free dry run, builds altctl in a digest-pinned Go image, and a README quick start without a host Go toolchain (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… builds altctl in a container, runs init, bootstraps PKI, creates the search-indexer consumer group, seeds the models and starts the stacks, and point the README quick start at it (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… ANSI color codes, which the log pipeline cannot parse (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… so every stdout line is plain JSON (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n values declared in LKAL and enforced by kisage preflight, the tracked Plecto key and signed artifact, Kratos localhost defaults with a registration hook allowlist and deduplicated origins, the Vulkan overlay, the news-creator Hugging Face cache volume, and INOREADER_SYNC for auth-token-manager (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fering production values in deploy/desired-env.lkal, track the Plecto public key and signed artifact, default Kratos to localhost with an allowlisted registration hook, add the Vulkan llama-server overlay and the news-creator Hugging Face cache volume, and pass INOREADER_SYNC to auth-token-manager (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ompose executor instead of a second os/exec runner, drop suppressions gosec does not need, and name file modes in the new tests (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ion when .env does not set it, log the registration mode at startup, and let altctl init --open-registration open it for the quickstart (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ration mode at startup, and have the quickstart open registration through altctl init --open-registration instead of a compose default (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…for host_paths keys, and require the deploy env check to reject a production .env that omits a host_paths key (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aults must still equal the declaration, add required_env_overrides to the deploy env check, and run that check in the local deploy path (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ths-only override class, the required_env_overrides deploy check, and the measured reranker re-download

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kaikei-e Kaikei-e changed the title fix/quickstart clean host fix: start a fresh clone on a clean host with ./quickstart.sh, keeping production values in LKAL (ADR-001070) Dec 4, 2026
…s, 0644 host files inside a 0750 secrets directory and 0400 inside step-ca, instead of the 0600 that nonroot containers could not read (ADR-001070)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kaikei-e
Kaikei-e merged commit 48c37b6 into main Dec 4, 2026
54 checks passed
@Kaikei-e
Kaikei-e deleted the fix/quickstart-clean-host branch December 4, 2026 12:05
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