# Bootstrap Restore order for `ballbox-first` style Pi control-plane setup. Goal: - restore control plane from git - restore host integrations from scripts/docs - restore durable data from backup - verify the system without relying on memory ## Assumptions - target user: `sebas` - canonical control repo: `/home/sebas/pi-config` - canonical machine style: home-first - durable data may be restored separately from git ## Step 0: base OS prerequisites Install/confirm: - git - curl - Node.js - tmux - python3 - systemd user session support - nginx if using local web exposure If local web/file exposure matters, also confirm: - copyparty or equivalent file server - tailscale if tailnet access is required ## Step 1: clone control plane ```bash git clone https://github.com/sebasfavaron/pi-config.git /home/sebas/pi-config cd /home/sebas/pi-config ``` ## Step 2: install runtimes and repo-local tooling ### Bun `pi-config` now uses Bun for local TypeScript validation and task-phase tools. If missing: ```bash curl -fsSL https://bun.sh/install | bash ln -sf /home/sebas/.bun/bin/bun /home/sebas/.local/bin/bun ln -sf /home/sebas/.bun/bin/bunx /home/sebas/.local/bin/bunx ``` ### Repo deps ```bash cd /home/sebas/pi-config bun install ``` ### Validation ```bash cd /home/sebas/pi-config bun run typecheck ``` ## Step 3: ensure canonical directories exist Required roots: - `/home/sebas/agents-database` - `/home/sebas/runtime` - `/home/sebas/work` - `/home/sebas/outputs` - `/home/sebas/archive` - `/home/sebas/notes` Create if missing. ## Step 4: install Pi-side control files Ensure Pi points at this repo as the live config directory. Important repo-controlled files: - `settings.json` - `AGENTS.md` - `extensions/` - `bin/` - `docs/` Also verify local PATH includes: - `/home/sebas/pi-config/bin` - `/home/sebas/.local/bin` ## Step 5: install sidecar services From `pi-config`: - session memory dispatcher service - session memory sweeper timer - pi job status writer timer - telegram service if desired Current repo install helpers: - `scripts/install-session-memory-dispatcher.service` - `scripts/install-tmp-cleanup-cron.sh` - `scripts/install-pi-telegram-service.sh` - `scripts/install-wifi-tracker-api-service.sh` - `scripts/install-shell-tmux-helpers.sh` - `scripts/install-nginx-kiosk.sh` (root/sudo) Also inspect and restore any user services not fully installer-covered yet: - any other Pi-control sidecars you rely on daily ## Step 6: restore host integration ### nginx Restore site config and any portal routes. Current live notes point to: - `/etc/nginx/sites-available/kiosk` - `/var/www/portal/index.html` ### shell / tmux helpers Restore dotfile or shell integration for: - `pitmux` - `piresume` - PATH additions Repo capture now exists: - `scripts/tmux.conf` - `scripts/pi-shell-helpers.sh` - `scripts/install-shell-tmux-helpers.sh` `SERVICES-ARCHITECTURE.md` is source of truth for tmux / Pi persistence behavior. ## Step 7: restore durable data from backup Git is not enough for this step. Restore as needed: - `/home/sebas/agents-database` - `/home/sebas/work` - `/home/sebas/outputs` - selected archives - any important app/service state outside repo ## Step 8: verify health Minimum checks: ```bash pi --version bun --version cd /home/sebas/pi-config && bun run typecheck ``` Service/API checks: - `http://100.116.176.16:8091/api/status` for `agents-database` Workflow checks: - `bin/task-init --help` - `bin/task-phase-init --help` - `bin/task-phase-run --help` - `bin/task-phase-loop --help` - `bin/tool-usage-report` ## Step 9: remote-review proof check Because this setup is reviewed remotely often, confirm that: - `/files/` exposure works - generated evidence links are clickable - task-phase artifacts can be opened remotely ## Bootstrap scripts Current script layer: - `scripts/bootstrap-prereqs.sh` - `scripts/bootstrap-pi-config.sh` - `scripts/bootstrap-services.sh` - `scripts/bootstrap-validate.sh` Suggested order: ```bash cd /home/sebas/pi-config ./scripts/bootstrap-prereqs.sh ./scripts/bootstrap-pi-config.sh ./scripts/bootstrap-services.sh ./scripts/bootstrap-validate.sh ``` Current gap - bootstrap exists, but still not fully complete for all host-specific pieces - nginx config still depends on root install/reload, even though the repo-owned config and installer now exist