fix(setup): make local platform setup repeatable #466

Closed
caution-bot wants to merge 0 commits from fix/bootstrap-first-install into main
caution-bot commented 2026-10-04 05:26:07 +00:00 (Migrated from codeberg.org)

Summary

Narrowed to platform-local setup, configuration, and migration fixes. AWS resource provisioning and the legacy infra-bootstrap/ changes are no longer part of this PR.

  • Add make setup to seed missing .env, prices.json, and config.json files with mode 0600, preserve existing configuration and permissions, refresh the supplied systemd user units, and reload the user manager without enabling or starting services.
  • Document local prerequisites, review of service secrets/database settings, and the shared container data directory; use /var/cache/caution in the environment example.
  • Make migrations fall back to POSTGRES_USER, POSTGRES_DB, and POSTGRES_PASSWORD, preserving explicit nonempty migration/PGPASSWORD overrides.
  • Keep four behavioral setup/migration tests as make test-setup, also included in make test. Remove AWS/OpenTofu/Docker-bootstrap harness cases and their credential/plan fixtures.
  • Apply only the retained changes onto current main, preserving its canonical-repository notice, secrets runbook link, additional Make targets, and dependency pins.

Fixes #452.

Scope boundary

infra-bootstrap/ is unchanged from main: no provider/lockfile upgrade, native AWS-login handling, cloud plan/apply changes, or private-output changes remain. This PR no longer addresses #451. Moving/retiring the legacy bootstrap and changing the platform's AWS-bootstrap documentation belong to the infrastructure cutover, once the replacement is verified.

Verification

  • The original PR's 10-test suite passed before narrowing.
  • RED: the four retained behavioral tests failed on unmodified current main (missing setup script and missing PostgreSQL credential fallback).
  • GREEN: make test-setup — all four tests passed.
  • make test-cli-install — passed, including Makefile target/dry-run checks.
  • bash -n scripts/setup-platform.sh and sh -n utils/makefile-run-migrations.sh — passed.
  • ShellCheck passed for the setup script (Bash) and migration helper (POSIX sh).
  • make -n setup and make -n test — passed; setup and test wiring verified.
  • git diff --cached --check — passed before commit.
  • Checked the six-file patch boundary, unchanged infra-bootstrap/ tree, and byte-identical retained production scripts versus the original PR.
  • Independent scope/correctness review and separate security/logic review passed with no blocking findings.

The behavioral tests run the real scripts in temporary directories with stubbed Docker, systemctl, and psql commands. They do not prove a live installation, execute SQL against PostgreSQL, or start services. Full Rust/workspace and live platform/AWS E2E tests were not run for this shell/documentation-only narrowing.

## Summary Narrowed to platform-local setup, configuration, and migration fixes. AWS resource provisioning and the legacy `infra-bootstrap/` changes are no longer part of this PR. - Add `make setup` to seed missing `.env`, `prices.json`, and `config.json` files with mode `0600`, preserve existing configuration and permissions, refresh the supplied systemd user units, and reload the user manager without enabling or starting services. - Document local prerequisites, review of service secrets/database settings, and the shared container data directory; use `/var/cache/caution` in the environment example. - Make migrations fall back to `POSTGRES_USER`, `POSTGRES_DB`, and `POSTGRES_PASSWORD`, preserving explicit nonempty migration/PGPASSWORD overrides. - Keep four behavioral setup/migration tests as `make test-setup`, also included in `make test`. Remove AWS/OpenTofu/Docker-bootstrap harness cases and their credential/plan fixtures. - Apply only the retained changes onto current main, preserving its canonical-repository notice, secrets runbook link, additional Make targets, and dependency pins. Fixes #452. ## Scope boundary `infra-bootstrap/` is unchanged from main: no provider/lockfile upgrade, native AWS-login handling, cloud plan/apply changes, or private-output changes remain. This PR no longer addresses #451. Moving/retiring the legacy bootstrap and changing the platform's AWS-bootstrap documentation belong to the infrastructure cutover, once the replacement is verified. ## Verification - The original PR's 10-test suite passed before narrowing. - RED: the four retained behavioral tests failed on unmodified current main (missing setup script and missing PostgreSQL credential fallback). - GREEN: `make test-setup` — all four tests passed. - `make test-cli-install` — passed, including Makefile target/dry-run checks. - `bash -n scripts/setup-platform.sh` and `sh -n utils/makefile-run-migrations.sh` — passed. - ShellCheck passed for the setup script (Bash) and migration helper (POSIX sh). - `make -n setup` and `make -n test` — passed; setup and test wiring verified. - `git diff --cached --check` — passed before commit. - Checked the six-file patch boundary, unchanged `infra-bootstrap/` tree, and byte-identical retained production scripts versus the original PR. - Independent scope/correctness review and separate security/logic review passed with no blocking findings. The behavioral tests run the real scripts in temporary directories with stubbed Docker, systemctl, and psql commands. They do not prove a live installation, execute SQL against PostgreSQL, or start services. Full Rust/workspace and live platform/AWS E2E tests were not run for this shell/documentation-only narrowing.
anton changed title from Fix bootstrap execution and first-time platform setup to fix(setup): make local platform setup repeatable 2026-10-15 20:10:24 +00:00
anton force-pushed fix/bootstrap-first-install from 6e87dee51d to 9a84b0a84f 2026-10-15 20:10:25 +00:00 Compare
anton force-pushed fix/bootstrap-first-install from 9a84b0a84f to 5ae9711ffe 2026-10-15 20:12:48 +00:00 Compare
Owner

Merged via CLI

Merged via CLI
anton closed this pull request 2026-10-15 20:15:14 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
public/platform!466
No description provided.