bazel start + mcp start
This commit is contained in:
1 parent
a90653260a
commit
4c082aca7c
33 files changed
+1728
-79
No files matched your search
+21
-20
@@ -27,24 +27,25 @@ nix build git+https://gitea.skyg.ca/ari/slacker-bot.git#agent -o /var/lib/slacke
|
||||
nix build .#agent -o /var/lib/slackerbot/agent-system
|
||||
```
|
||||
|
||||
Rebuild the same way after changing `nix/container.nix`. Each container picks up the new build on its next start. `nix/container.nix` runs `goose serve`, which needs a recent goose. If nixpkgs' `goose-cli` is too old, override it there.
|
||||
Rebuild the same way after changing `nix/container.nix`, and after upgrading the bot: the container includes `slackerbot-tools` (the agent's `send_file` tool) from the same checkout. Each container picks up the new build on its next start. `nix/container.nix` runs `goose serve`, which needs a recent goose. If nixpkgs' `goose-cli` is too old, override it there.
|
||||
|
||||
## 3. Config
|
||||
|
||||
Copy `config.example.toml` and edit it. The important parts:
|
||||
|
||||
| Setting | What |
|
||||
|---|---|
|
||||
| `system` | The build from step 2, e.g. `/var/lib/slackerbot/agent-system` |
|
||||
| `state_dir` | Where `state.json`, env files and cluster certificates live |
|
||||
| `[agent_env]` | Environment for goose (provider, model, API key). `$VARS` are expanded from the bot's environment |
|
||||
| `[container]`, `[max_container]` | Default and largest container size |
|
||||
| `[host_reserve]` | RAM/CPU kept free for the host |
|
||||
| `idle_timeout`, `max_idle_timeout`, `allow_indefinite` | Idle shutdown rules |
|
||||
| `[storage]` | Default guaranteed (`min`) and cap (`max`) home size, and the largest cap anyone may set (`limit`) |
|
||||
| `[[drives]]` | btrfs folders for home folders, each with a `reserve` kept free |
|
||||
| `[permissions]` | Starting permissions, copied in on first start only (see USERGUIDE.md) |
|
||||
| `[cluster]` | Only for more than one node (see step 6) |
|
||||
| Setting | What |
|
||||
| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
|
||||
| `system` | The build from step 2, e.g. `/var/lib/slackerbot/agent-system` |
|
||||
| `state_dir` | Where `state.json`, env files and cluster certificates live |
|
||||
| `[agent_env]` | Environment for goose (provider, model, API key). `$VARS` are expanded from the bot's environment |
|
||||
| `[container]`, `[max_container]` | Default and largest container size |
|
||||
| `[host_reserve]` | RAM/CPU kept free for the host |
|
||||
| `idle_timeout`, `max_idle_timeout`, `allow_indefinite` | Idle shutdown rules |
|
||||
| `max_send_file_mb` | Largest file the agent may send, and the largest attachment copied in (default 100, at most 1024) |
|
||||
| `[storage]` | Default guaranteed (`min`) and cap (`max`) home size, and the largest cap anyone may set (`limit`) |
|
||||
| `[[drives]]` | btrfs folders for home folders, each with a `reserve` kept free |
|
||||
| `[permissions]` | Starting permissions, copied in on first start only (see USERGUIDE.md) |
|
||||
| `[cluster]` | Only for more than one node (see step 6) |
|
||||
|
||||
## 4. Secrets
|
||||
|
||||
@@ -65,14 +66,14 @@ CLUSTER_SECRET=…
|
||||
|
||||
One `NAME=value` per line, with no quotes needed and no comments after a value (systemd would read the comment as part of the value). `CLUSTER_SECRET` is only needed with more than one node.
|
||||
|
||||
| Variable | Overrides | Needed on |
|
||||
|---|---|---|
|
||||
| `SLACK_APP_TOKEN` | `[slack] app_token` | master |
|
||||
| `SLACK_BOT_TOKEN` | `[slack] bot_token` | master |
|
||||
| `CLUSTER_SECRET` | `[cluster] secret` | every node, if clustered |
|
||||
| anything named in `[agent_env]` (e.g. `$ANTHROPIC_API_KEY`) | expanded into the container's env | master |
|
||||
| Variable | Overrides | Needed on |
|
||||
| ----------------------------------------------------------- | --------------------------------- | ------------------------ |
|
||||
| `SLACK_APP_TOKEN` | `[slack] app_token` | master |
|
||||
| `SLACK_BOT_TOKEN` | `[slack] bot_token` | master |
|
||||
| `CLUSTER_SECRET` | `[cluster] secret` | every node, if clustered |
|
||||
| anything named in `[agent_env]` (e.g. `$ANTHROPIC_API_KEY`) | expanded into the container's env | master |
|
||||
|
||||
The master refuses to start without both Slack tokens. You *can* write them into `[slack]` in the config instead, but then the config holds secrets. With NixOS, the config file is copied into the world-readable Nix store, so use the env file there.
|
||||
The master refuses to start without both Slack tokens. You _can_ write them into `[slack]` in the config instead, but then the config holds secrets. With NixOS, the config file is copied into the world-readable Nix store, so use the env file there.
|
||||
|
||||
The bot writes the `[agent_env]` values, with `$VARS` expanded, to a root-only file under `state_dir/env/`, and bind-mounts it read-only into the container at `/var/lib/slackerbot/agent.env`, where goose reads it at start. To give goose another key, add it to the secrets file and reference it in `[agent_env]`:
|
||||
|
||||
|
||||
Reference in new issue
Block a user