Files
shard-memory/runbooks/prime-nextcloud-setup.md
T

81 lines
2.3 KiB
Markdown

# Prime ↔ Nextcloud Talk Setup Runbook
## Goal
Set up Prime as a Nextcloud Talk bot in the shared room, with stable secrets in Kubernetes and a human-readable bot name.
## Source of truth
- Kubernetes namespace: `shard`
- Secrets:
- `cred-nextcloud-prime`
- `cred-nextcloud-shard`
- ConfigMap:
- `server-roles`
## Required secret keys
From `cred-nextcloud-prime`:
- `NEXTCLOUD_BASE_URL`
- `NEXTCLOUD_USERNAME`
- `NEXTCLOUD_APP_PASSWORD`
- `NEXTCLOUD_TALK_BOT_SECRET`
- `NEXTCLOUD_TALK_WEBHOOK_PUBLIC_URL`
## Verify Nextcloud auth (Prime account)
```bash
curl -u "$NEXTCLOUD_USERNAME:$NEXTCLOUD_APP_PASSWORD" \
-H "OCS-APIRequest: true" \
"$NEXTCLOUD_BASE_URL/ocs/v1.php/cloud/user"
```
Expected: OCS status `ok` and user info for `Prime`.
## Inspect Talk bots on server
```bash
php occ talk:bot:list --output json_pretty
```
## Inspect bots in a room
```bash
php occ talk:bot:list <ROOM_TOKEN> --output json_pretty
```
## Rename behavior caveat
Nextcloud Talk bot names are not edited in place via `occ`.
If a bot was created as `OpenClaw Prime`, rename requires:
1. remove bot from room
2. uninstall bot
3. reinstall bot with desired name (same webhook + secret)
4. set up bot in room again
## Rename + rebind procedure (example room token `gnrm73b4`)
```bash
# Find old ID
php occ talk:bot:list --output json | jq -r '.[] | select(.name=="OpenClaw Prime") | .id'
# Remove from room
php occ talk:bot:remove <OLD_ID> gnrm73b4
# Uninstall old bot
php occ talk:bot:uninstall <OLD_ID>
# Install new bot with desired name
php occ talk:bot:install "Prime" "$NEXTCLOUD_TALK_BOT_SECRET" "$NEXTCLOUD_TALK_WEBHOOK_PUBLIC_URL" \
-f webhook -f response -f reaction
# Find new ID and add to room
php occ talk:bot:list --output json | jq -r '.[] | select(.name=="Prime") | .id'
php occ talk:bot:setup <NEW_ID> gnrm73b4
# Verify
php occ talk:bot:list gnrm73b4 --output json_pretty
```
## Current known room
- `https://cloud.aeternalisgames.com/call/gnrm73b4`
## Current known state (2026-03-13)
- Room `gnrm73b4` has bot name `Prime` attached (webhook/response/reaction).
- Prime user account also exists in Nextcloud with display name `Prime`.
## Ops notes
- `cred-nextcloud-shard` credential set may not be valid for OCS API auth; use `cred-nextcloud-prime` for Prime Talk integration checks.
- Keep all credential values in k8s secrets only; do not copy raw secrets to git or chat.