Files
recipe-maintainer/.claude/commands/test-setup.md
autonomic-bot f283a371bb recipe-maintainer: public snapshot (secrets + deployment plans removed, single commit)
Sanitized single-commit public mirror of recipe-maintainer.
- Removed test-ssh/.testenv (live creds); added test-ssh/.testenv.example placeholders.
- Removed plans/ and planned-updates/ (deployment-planning docs) so no client/
  deployment domains appear in the public repo.
- All other secret stores were already gitignored.
- docs.coopcloud.tech retained as a submodule (public upstream).
2026-06-16 20:18:24 +00:00

154 lines
4.6 KiB
Markdown

---
description: Verify the test environment is configured correctly
allowed-tools: [Read, Glob, Bash]
---
# Test Setup — Environment Check
Check the project's current setup state and guide the user through anything that's missing.
## Step 1: Check `settings.toml`
Read `settings.toml` if it exists. If it does not exist, tell the user they need to create one. Explain the format:
```toml
default_instance = "<instance-name>"
[instances.<instance-name>]
server = "<hostname>"
domain_suffix = "<hostname>"
protected_recipes = ["traefik", "backup-bot-two"]
```
- `default_instance` — which instance the skills use by default
- `server` — the SSH hostname of the test server
- `domain_suffix` — the domain suffix for app URLs (e.g. `myserver.example.com` means apps get deployed as `<app>.myserver.example.com`)
- `protected_recipes` — apps that `/test-context-reset` will never undeploy
You can define multiple instances and switch between them with `/switch-default-instance`.
## Step 2: Check `test-ssh/`
Check if `test-ssh/` exists and contains an `ssh-config` file and a key directory. If it does not exist, tell the user they need to create it:
```
test-ssh/
├── ssh-config # SSH config with Host entries for each server
└── test-ssh-keys/
└── <keyname> # Private key(s) for the test server(s)
```
The `ssh-config` should have a `Host` entry for each server defined in `settings.toml`. Example:
```
Host myserver.example.com
User root
IdentityFile test-ssh-keys/mykey
Port 22
```
The `IdentityFile` path is relative to `test-ssh/`.
## Step 3: Check `maintained-recipes`
Read `maintained-recipes` if it exists (also accept `maintained-recipes.md` as an alternative name). If neither exists, tell the user they can create one to list the recipes they maintain. It's a plain list of recipe names, one per line (markdown list format also accepted):
```
cryptpad
lasuite-drive
matrix-synapse
```
This file is used by `/recipe-overview` and `/recipe-test-all` to know which recipes to check.
## Step 4: Check SSH connectivity
If `settings.toml` and `test-ssh/` both exist, test SSH connectivity to the default instance's server:
```bash
ssh -F test-ssh/ssh-config -o ConnectTimeout=5 <server> "echo ok" 2>&1
```
Report whether the connection succeeded or failed.
## Step 5: Check abra
Run `abra version` to confirm abra is installed and report the version.
## Step 6: Summary
Print a summary of the project state:
| Component | Status |
|-----------|--------|
| `settings.toml` | Found / Missing |
| `test-ssh/` | Found / Missing |
| `maintained-recipes` | Found (N recipes) / Missing |
| SSH connectivity | OK / Failed / Not tested |
| `abra` CLI | vX.Y.Z / Not found |
If everything is set up, suggest the user start with `/recipe-overview` to see the current state of their recipes.
If anything is missing, show the setup guide below.
## Setting up a new environment from scratch
If the environment is not yet configured, walk the user through these steps:
### 1. Generate SSH keys
Create the `test-ssh/` directory and generate a new keypair:
```bash
mkdir -p test-ssh/test-ssh-keys
ssh-keygen -t ed25519 -f test-ssh/test-ssh-keys/testkey -N "" -C "coopcloud-recipe-toolkit"
```
### 2. Create a server
The user needs a server (VPS, VM, etc.) running a supported Linux distribution. Once the server exists:
- Upload the public key (`test-ssh/test-ssh-keys/testkey.pub`) to the server's `~/.ssh/authorized_keys` for the user they'll SSH in as (typically `root`)
- Note the server's hostname, SSH port, and username
### 3. Create `test-ssh/ssh-config`
Create `test-ssh/ssh-config` with a Host entry matching the server. Use absolute paths for the IdentityFile:
```
Host myserver.example.com
User root
IdentityFile /workspace/test-ssh/test-ssh-keys/testkey
Port 22
```
### 4. Create `settings.toml`
```toml
default_instance = "myinstance"
[instances.myinstance]
server = "myserver.example.com"
domain_suffix = "myserver.example.com"
protected_recipes = ["traefik", "backup-bot-two"]
```
The `domain_suffix` is used to construct app URLs — apps get deployed as `<app>.<domain_suffix>`.
### 5. Create `maintained-recipes`
List the recipes you want to maintain, one per line:
```
recipe-one
recipe-two
```
### 6. Verify and initialize
Re-run `/test-setup` to confirm everything is working. If SSH connects successfully, ask Claude to make sure the server is properly initialized for Co-op Cloud (Docker Swarm enabled, `abra` server added, Traefik deployed).
Then either:
- **`/init-instance`** — Deploy all maintained recipes to the server at once
- **`/recipe-deploy <name>`** — Deploy one recipe at a time