Commit graph

22 commits

Author SHA1 Message Date
18816a7712 Fix stale TESTING.md banner and embedding bake-through in .env seed (Sam & Claude)
- TESTING.md: expected output banner now matches updated integration-test.sh
- shell-env.sh: EMBED_BASE_URL defaults to empty when no OpenRouter key exists, letting config.ts resolve dynamically at runtime instead of baking localhost:8080 into .env
2026-06-04 20:04:23 +02:00
f81f487560 Align ISO config docs with post-install setup 2026-06-04 20:04:23 +02:00
1a4d98acf8 Add remote-safe setup access slice (Sam & Codex)
Collect optional SSH public key and Tailscale auth key in the live installer, keep the controlplane loopback-bound by default, allow SSH over tailscale0, and rotate the post-install setup token into /var/db/clawdie-installer/setup-token with MOTD guidance for SSH tunnel access.

This slice is install-mode only; upgrade runs do not mint a new setup token.

Build: pass
Tests: pass — sh -n + QML build + config-format + mocked setup-token writer dry-run
Real-disk / bhyve install: NOT YET TESTED
2026-06-04 20:04:22 +02:00
b04222fa81 Bump FreeBSD 14→15 docs, add CLAWDIE_PROFILE to firstboot
- REQUIREMENTS.md: remove 14.2 minimum floor (15.0+ only)
- firstboot/shell-env.sh: set CLAWDIE_PROFILE=core in fresh install and upgrade append
- AGENTS.md: document mac_do adoption plan reference

---
Build: n/a | Tests: n/a (shell scripts, Linux agent)
2026-06-04 20:04:22 +02:00
23f4f1aaec feat(firstboot): unify setup import across USB and VPS 2026-06-04 20:04:22 +02:00
127d8d560f feat(firstboot): add controlplane auth + git jail env vars to .env seed
Generate CONTROLPLANE_SHARED_SECRET and BETTER_AUTH_SECRET at install
time via openssl rand. Add CONTROLPLANE_HOST_IP, CONTROLPLANE_AUTH_MODE,
CONTROLPLANE_PORT, BETTER_AUTH_URL, GIT_LOCAL_URL to both install heredoc
and upgrade append path. Default to bare git repo (CODE_HOSTING_MODE=git)
instead of Forgejo.

---
Build: pass | Tests: not run (Linux) — shell script, bash -n validated
2026-06-04 20:04:22 +02:00
4c60ed81e3 fix(installer): Phase A — stable ZFS, safe upgrades, module matrix
Four critical fixes before v1.0.0 VM test, informed by PC-BSD failure
modes and GhostBSD's improvements:

1. shell-zfs.sh: zpool labelclear on fresh install
   Clear ZFS labels from every device that was in the old pool before
   bsdinstall writes new ones. Prevents the "can't find pool by GUID"
   boot failure that made PC-BSD reinstalls unreliable.

2. shell-zfs.sh: pre-upgrade snapshot
   When operator selects Upgrade, take zfs snapshot -r
   pool@pre-upgrade-{timestamp} before any changes. One reboot to
   roll back if the upgrade goes wrong. UPGRADE_SNAPSHOT exported for
   downstream modules to reference.

3. shell-env.sh: never overwrite secrets on upgrade
   clawdie_shell_env_generate() now checks CLAWDIE_BOOT_MODE. In
   upgrade mode it calls clawdie_shell_env_append_new_keys() instead
   of regenerating — reads existing .env and appends only keys that
   are absent. Existing DB passwords, JWT secrets, API keys are never
   touched. This fixes the root cause of the orphaned-database bug:
   new passwords that don't match the existing pool's data.

4. firstboot.sh: module execution matrix via run_step_if
   New run_step_if "<modes>" wrapper marks steps as done without
   running them when not applicable to the current boot mode.
   Upgrade skips: gpu, nvidia, ssh, system, desktop, pf, tailscale
   Upgrade runs: pkg, env (append-only), npm-globals, deploy
   Prevents SSH key resets, rc.conf overwrites, and firewall rewrites
   during upgrade — all of which undid operator customisations.

Also adds INSTALLER-PLAN.md: full architecture plan for unified
GUI/TUI installer with Fresh / Upgrade / Repair modes, boot
environment support, and a clear phase roadmap to v1.1.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 20:04:22 +02:00
68f1c1fad7 fix(firstboot): run installer as root so rc.d service is installed
shell-deploy.sh was dropping to the clawdie user before running
just install. setup/service.ts checks isRoot() to decide whether
to install the rc.d service or generate start/stop wrappers — so
running as clawdie meant the agent was never registered with
FreeBSD's service manager and never started at boot.

Fix: run the installer as root. setup/service.ts already handles
privilege separation correctly when invoked as root: it writes
/usr/local/etc/rc.d/{agent}, adds -u {agent} to daemon args so
the running process is never root, and chowns data/logs/groups to
the agent user to prevent EACCES on first write.

Also adds DB_RUNTIME to the generated .env seed so operators can
see the jail vs host postgres option without reading the docs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 20:04:22 +02:00
c0bd59cf0b Set locale/keymap defaults and move npm globals to /opt 2026-06-04 20:04:22 +02:00
c687b90034 Add Aider prerequisites to ISO 2026-06-04 20:04:22 +02:00
8ca0544d2a feat: bundle Aider and Forgejo packages, add ZAI_API_BASE to .env seed (Sam & Claude)
Add py311-aider_chat to host baseline for the controlplane harness
(Aider + Pi multi-agent orchestrator). Add forgejo package to jail
list for the code service. Bake ZAI_API_BASE into firstboot .env
to fix litellm endpoint mismatch discovered during Aider testing.

---
Build: pass | Tests: not run (Linux)
2026-06-04 20:04:22 +02:00
18afbae2cd feat: add Claude auth fields to firstboot wizard (Sam & Claude)
Add ANTHROPIC_API_KEY and CLAUDE_CODE_OAUTH_TOKEN as optional password
fields to both shell wizard and GUI installer. Fields flow through to
.env via shell-env.sh. Document /tmp exemption in AGENTS.md.
2026-06-04 20:04:22 +02:00
0aee135c43 Add EMBED_API_KEY and EMBED_DIMENSIONS to .env pipeline
The .env template was missing two vars that src/config.ts reads at
runtime.  Without them embeddings silently fall back to wrong defaults
(768 dims vs the 1024 the pgvector schema expects).

- shell-env.sh: add EMBED_API_KEY + EMBED_DIMENSIONS to template
- build.cfg: add matching defaults (1024 dims)
- firstboot.sh: export the new vars
- cloud-path-test.sh: add EMBED var checks (now 19 total)

Build: not tested | Tests: PASS (cloud-path 19/19, integration 7/7)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-04 20:04:22 +02:00
81107cd977 Simplify wizard: all jails default, fewer questions
Baremetal wizard reduced from 11 interactions to 5:
  1. Disclaimer
  2. Assistant name
  3. Domain + DNS note
  4. Timezone
  5. SSH key + Tailscale (optional)

Removed questions (now always-on defaults):
  - Agent gender → defaults to "f"
  - Forgejo toggle → always YES (FEATURE_GITEA=YES)
  - Local LLM provider → defaults to "none" (enable post-install)
  - Ollama HPP → NO
  - CODE_HOSTING_MODE → always "gitea"

All jails (db, git/forgejo, cms) provision out of the box.
shell-env.sh defaults aligned: FEATURE_GITEA=YES, CODE_HOSTING_MODE=gitea.

Integration test: PASS | Cloud path test: PASS (17/17)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-04 20:04:22 +02:00
74e7b583d0 Clarify Tailscale auth key prompt (Sam & Codex)
Explain reusable key for host + jails and seed auth key into .env.

---

Build: FAIL — not run

Tests: FAIL — not run
2026-06-04 20:04:22 +02:00
d65ef7c33f Add Tailscale firstboot module (Sam & Codex) 2026-06-04 20:04:21 +02:00
16252fb67c iso: sync clawdie-ai v1.0.2 + codex baseline (Sam & Codex) 2026-06-04 20:04:21 +02:00
28f2100a47 feat: add local LLM choice and model seeding 2026-06-04 20:04:21 +02:00
93a690db85 feat: enable forgejo by default in firstboot 2026-06-04 20:04:21 +02:00
e46d955527 feat: make firstboot agent-name-agnostic for multi-agent deployments
Derive AGENT_NAME from ASSISTANT_NAME instead of hardcoding "clawdie".
Database names, users, and identity vars now follow the agent name.

Add configurable fields to build.cfg and shell-env.sh:
- AGENT_GENDER, PI_TUI_PROVIDER, PI_TUI_MODEL
- ZAI_API_KEY, OPENROUTER_API_KEY, EMBED_BASE_URL, EMBED_MODEL
- TELEGRAM_BOT_TOKEN, FEATURE_TELEGRAM (pre-bakeable for cloud)

Add gender selection to baremetal wizard (bsddialog radiolist).
Update bhyve-test.sh with --name flag, tap0/bridge auto-setup,
sparse disk reuse, and reduced default disk size (25G).

Tested: dry-run env generation produces correct Mevy config
(agent_name=mevy, db=mevy, provider=zai, model=glm-5).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00
d28d38b49f impl: Complete all 5 shell modules for v0.9.0 installer
Implements critical firstboot orchestration:
- shell-gpu.sh: GPU detection (Intel i915kms, AMD amdgpu, NVIDIA, VMware vmwgfx)
- shell-nvidia.sh: NVIDIA driver version selection (590/470/390 per GPU)
- shell-pkg.sh: Package repository config + Bastille cache seeding
- shell-env.sh: .env generation with secrets and jail IP allocation
- shell-deploy.sh: Clawdie-AI tarball extraction + npm run install-all

All modules:
- POSIX-compliant (no bash-isms)
- Proper error handling and validation
- Comprehensive logging to /var/log/clawdie-firstboot.log
- Progress tracking to /var/log/clawdie-firstboot.progress
- Environment variable overrides for testing

Unblocks firstboot.sh which was calling undefined functions.
Ready for end-to-end installation testing on bhyve VM.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00
954dcebee2 refactor: Rename clawdie-shell-*.sh to shell-*.sh (remove redundant prefix)
- Rename all modules: clawdie-shell-{func}.sh → shell-{func}.sh
- Update references in firstboot.sh and installerconfig
- Update self-detection case statements in each module
- Reduces naming redundancy and improves clarity

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-04 20:04:21 +02:00
Renamed from firstboot/test-clawdie-shell-env.sh (Browse further)