# Recovery Guide Recovery is now Tailscale-first. Bare-metal NixOS nodes are rebuilt from their host-specific configs in `4-Infrastructure/deploy//` and the secrets in `secrets/` (gitignored). ## Critical Files (committed to repo) - `4-Infrastructure/deploy//configuration.nix` — Host-specific NixOS configs - `5-Applications/AppFlowy-Cloud/docker-compose.minimal.yml` — Custom AppFlowy Cloud compose - `4-Infrastructure/infra/nixos-setup-cred-server.sh` — Credential server bootstrap - `4-Infrastructure/infra/credential_provider.py` — Credential resolution chain - `4-Infrastructure/infra/credential_server.py` — Webhook handler - `5-Applications/AppFlowy-Cloud/.env.example` — Sanitized AppFlowy Cloud env template ## Critical Files (NOT committed — in `secrets/` dir, gitignored) - `credentials.json` — All API provider keys - `appflowy.env` — AppFlowy Cloud env (PostgreSQL host, JWT, encryption key) - `tailscale-auth.key` — Tailscale auth key ## Recovery Flow 1. Install NixOS on replacement bare-metal host and join Tailscale. 2. Copy the host-specific `configuration.nix` to `/etc/nixos/`. 3. Restore secrets from gitignored backup. 4. `nixos-rebuild switch` — brings up Caddy, credential server, Forgejo, Heimdall. 5. Deploy AppFlowy: copy compose + `.env` to `/var/lib/AppFlowy-Cloud/`, start stack. 6. Reconnect AppFlowy to the PostgreSQL instance defined in `appflowy.env`. 7. Forgejo repos lost unless backed up separately. 8. Heimdall tiles lost unless backed up separately.