You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test RouterOS protocol peers from inside the container on a RouterOS host #7
Follow-up to #5. Research left one vector unproven: which RouterOS protocols an agent in this container can actually observe, act as a client for, or serve as a peer for, when the container runs on RouterOS. Mapping and candidate packages: routeros-protocol-map.md.
Depends on #5 shipping the groups (all selected), so the packages exist to test.
Proposed lab
quickchr CHR with a paid license (faster than the free 1 Mbps cap), running app-t3code with T3APP_TOOL_GROUPS=all.
A T3 Code instance on orca or the Mac drives that remote T3 to run the tests against a second CHR, which acts as the RouterOS peer.
Repeat on one physical ARM/ARM64 device.
Measure first (decides the vpn group)
Capability set, ping_group_range, /dev/net/tun, /dev/ppp, /dev/kvm, kernel modules (wireguard, l2tp, gre, vxlan, xfrm, tun). Run each in three configurations: unprivileged, privileged=yes (RouterOS 7.24+ changelog), and devices= passthrough. Also check whether /app/set devices= keeps volumes like environment= does (lab results). Probe commands are in the protocol map.
Then per protocol tier
User space: centrs btest, SNMP, RADIUS/CoA, DNS/DoH, BGP active session (exabgp via uvx), NetFlow via nfcapd, syslog, MQTT.
Raw sockets: ping/arping, LLDP/CDP via lldpd, OSPF via bird2, PPPoE discovery, live tcpdump. Also check whether live TZSP works through tshark's udpdump extcap without capture privileges.
Unknown: which user and environment /container/shell uses
From the PR #14 review: operators and agents may run t3code-tools from the router, e.g. /container/shell <app-container> cmd="t3code-tools status". Two points are unverified on RouterOS 7.25+:
The uid. The image is USER node. If /container/shell runs as root, the shell gets root's capability set, not the app process's. Any capability evidence gathered through it would then overstate what T3's agents can do. Final tooling slice: five-group default, retire browser/agents-extra, drop bundled Muse, add uv/uvx and sqlite3 (#5) #14 makes t3code-tools install/prune/init re-execute as the payload owner (via setpriv) when run as root, so payloads stay node-owned either way.
The environment. If HOME or T3CODE_TOOL_GROUPS differ from the app's, status reads the wrong payload root or selection.
Proposed check on a twin: cmd="id", cmd="env" and cmd="cat /proc/self/status" (CapEff), compared with the same values read from a T3 terminal. Do this before citing any /container/shell output as capability evidence.
Explicit transfer from #5's closeout (labs matrix). These items need a RouterOS host and now belong here:
A nested CHR guest (x86, and ARM64 under TCG) booted by quickchr inside app-t3code on a RouterOS host. On Morpheus's CHR (1 CPU, 1 GiB, no /dev/kvm) only QEMU, firmware discovery and quickchr doctor were checked; no guest was booted.
quickchr file transfer, snapshots and machine cleanup on that host.
Triage 2026-11-07, added scope from the owner's notes:
Privileged vs unprivileged is not a CAP_NET_ADMIN toggle. In each configuration, record the full CapEff/CapBnd, the cgroup version, the controllers and whether they can be written, the seccomp mode, and the devices present. Compare that with Docker's default and --privileged sets, so the README's privilege table is based on observation rather than mapped from Docker. The Morpheus baseline (unprivileged): CapEff 0, CapBnd 3fffffffff, Seccomp 2, /dev/net/tun present, no /dev/kvm.
Two test CHRs ready for this lab, and the arm64 first-install path (2026-11-08)
From the #3 re-run (write-up in #26, docs/research/2026-11-07/chr-0.1.7-upgrade.md; recipe in .claude/skills/chr-app-lab/SKILL.md):
x86 test CHR (RouterOS 7.25, p-unlimited, bridged LAN): upgraded to 0.1.7 by /app/update, with all five groups ready.
arm64 test CHR (RouterOS 7.25.1, TCG on an x86_64 host, 2 vCPU / 2 GiB, p-unlimited, same LAN): a fresh 0.1.7 install from app/t3code.tikapp.yaml. The pull and extract took about 8 minutes, and the web UI answered 200 about 11.5 minutes after the /app PUT. All five groups reached ready in the background:
Group
Payload
Time
capture
arm64-trixie-c149fa9e83498601
389 s (after one interrupted attempt, see below)
labs
arm64-trixie-b470b946f9fa8cc5
137 s (pruned 256 MiB of AAVMF secure-boot images)
vpn
arm64-trixie-3c91e98e858d15b4
65 s
routing
arm64-trixie-e490a90fc8e3b234
54 s
dev
arm64-abi137-ab2895431a557d74
118 s
/data uses 4.5G of 24G afterwards. As expected on a fresh home, claude is missing; that's the installer bug on #13.
For this issue:
/container/shell runs as uid 1000 (node), the image user, in both CHRs.
Every RouterOS stop is a SIGKILL, because PID 1 tini doesn't catch SIGTERM (RouterOS SIGKILLs the app on every stop: PID 1 (tini) doesn't catch SIGTERM #25). The first capture install was killed by an app restart that /app/settings router-ip triggered, and the next attempt cleaned up the staging directory. The cleanup path works on arm64.
Under TCG, /container/shell commands that start Bun (t3code-tools status) took over 110 s while groups installed. Plain shell commands return in seconds. Size harness timeouts for that.
Sizing signal from the arm64 TCG CHR (owner, 2026-11-08)
On the arm64 test CHR (2 vCPU, 2 GiB, TCG on an x86_64 Mac, which may also be throttling under heat):
The owner changed T3CODE_TOOL_GROUPS to labs vpn dev in WinBox's app environment and pressed Apply. That restarted the container, with a SIGKILL as usual (RouterOS SIGKILLs the app on every stop: PID 1 (tini) doesn't catch SIGTERM #25). The UI came back a few minutes later, with /data unchanged (4.9 GB used before and after).
Right after the restart, T3 showed "Claude provider status: timed out after 25s while checking Claude account status" and "Some requests are slow: 1 request waiting longer than 15s". The background group installs were probably running at the same time. After about 5 minutes, Claude was logged in and the terminal worked.
WinBox showed about 62 % CPU and 1096.6 / 951.4 / 2048.0 MiB of memory during that window.
So 2 vCPU and 2 GiB under TCG works, but only just: it's the slowness a too-small router would show. For real hardware this is a data point for a minimum-size note. The first minutes after a start (T3 startup, provider probes, group installs) are the peak. Worth measuring separately on a real arm64 RouterBOARD. Also: both test CHRs now have distinct identities (t3code, t3code-arm64) instead of CHR, so T3 and WinBox can tell them apart once the containers restart.
Visible again after the Amm0Bot suspension (2026-11-08 to 2026-11-10). Updates from that gap, which the roadmap (#30) carried:
The /container/shell uid is answered: 1000 (node), or root with user=root; HOME is /data either way, and the umask is 0000 (measured on 7.25 x86 and 7.25.1 arm64, AGENTS.md "Users"). As root, t3app tools switches back to the payload owner (t3app: app-owned command, settings and source layout #45).
privileged in /app YAML: verified on CHR (2026-11-24)
Context: while adding dns and privileged to the restraml /app schemas (tikoci/restraml#125, #126), I tested the YAML form on CHR. These are the first observations of the "Measure first" privileged vs unprivileged comparison. It isn't the full lab.
The YAML key
A service-level privileged: works from 7.25. Checked on 7.25.2 and 7.26beta7 by enabling each app and reading the resulting /container entry:
YAML
/container privileged=
privileged: true or privileged: 'true'
true
privileged: false, or no key
false
privileged: yes or privileged: maybe
false, with no error
yes doesn't work. Only true does, even though yes is how RouterOS writes booleans everywhere else.
7.24.7 ignores the key./container has a privileged= property there, but privileged: true in the YAML still produces privileged=false. So the YAML route starts at 7.25, which matches the 7.25beta4 changelog entry "allow the privileged mode to be enabled per service in the container app YAML". The body's "RouterOS 7.24+" applies to the /container privileged= setting, not to the YAML.
No validation at /app/add. RouterOS accepts any key there, including an unknown zzz_unknown, so being accepted proves nothing. Check /container instead.
What changes inside the container (7.25.2 x86 CHR)
Measured with alpine:latest running as root, read through /container/shell:
privileged: true
unprivileged
uid
0
0
CapEff / CapPrm / CapBnd
3fffffffff
3fffffffff
CapEff after su nobody
0
0
Seccomp / NoNewPrivs
2 / 0
2 / 0
/sys/fs/cgroup
read-only; controllers cpuset cpu io memory pids
same
net.ipv4.ping_group_range
1 0 (unprivileged ICMP sockets off)
65534 65534
/dev entries
405
18
/dev/net/tun, /dev/fuse
present
present
/dev/ppp, /dev/kvm
absent
absent
ip link add … type dummy / type wireguard
RTNETLINK answers: Not supported
same
What this suggests (one CHR, one image):
Privileged mode doesn't change the capability set here. A root process already gets the full set without it, and a non-root user gets none either way. So for node (uid 1000), privileged mode alone won't grant CAP_NET_RAW or CAP_NET_ADMIN, which fits the Morpheus baseline of CapEff 0. Running as root (user=root) is the lever for capabilities, not privileged.
What it does change is the device list./dev goes from 18 entries to 405, and ping_group_range changes. Without privileged mode the setting is 65534 65534, which allows unprivileged ICMP sockets only for gid 65534. With it, the setting is 1 0, which turns them off entirely. So a non-root ping could get worse in privileged mode.
/dev/net/tun is present even unprivileged./dev/ppp isn't present in either mode.
Caveats
This was an x86 CHR on macOS HVF, so /dev/kvm being absent says nothing about a host that has KVM.
ip here is BusyBox's. "Not supported" is the kernel's answer for dummy and wireguard, but it should be re-checked with iproute2 from the app-t3code image before ruling either out.
devices= passthrough, the T3 image's node user, and arm64 hardware weren't tested. Those still need the lab.
The restraml /app schemas now accept privileged only as true/false/'true'/'false', so editors flag yes. Per-version schemas for 7.24.x leave the key out.
Activity
Amm0Bot commentedon Nov 7, 2026
Unknown: which user and environment
/container/shellusesFrom the PR #14 review: operators and agents may run
t3code-toolsfrom the router, e.g./container/shell <app-container> cmd="t3code-tools status". Two points are unverified on RouterOS 7.25+:USER node. If/container/shellruns as root, the shell gets root's capability set, not the app process's. Any capability evidence gathered through it would then overstate what T3's agents can do. Final tooling slice: five-group default, retire browser/agents-extra, drop bundled Muse, add uv/uvx and sqlite3 (#5) #14 makest3code-tools install/prune/initre-execute as the payload owner (viasetpriv) when run as root, so payloads stay node-owned either way.HOMEorT3CODE_TOOL_GROUPSdiffer from the app's,statusreads the wrong payload root or selection.Proposed check on a twin:
cmd="id",cmd="env"andcmd="cat /proc/self/status"(CapEff), compared with the same values read from a T3 terminal. Do this before citing any/container/shelloutput as capability evidence.Amm0Bot commentedon Nov 8, 2026
Explicit transfer from #5's closeout (labs matrix). These items need a RouterOS host and now belong here:
/dev/kvm) only QEMU, firmware discovery andquickchr doctorwere checked; no guest was booted.Amm0Bot commentedon Nov 8, 2026
Triage 2026-11-07, added scope from the owner's notes:
CapEff/CapBnd, the cgroup version, the controllers and whether they can be written, the seccomp mode, and the devices present. Compare that with Docker's default and--privilegedsets, so the README's privilege table is based on observation rather than mapped from Docker. The Morpheus baseline (unprivileged): CapEff 0, CapBnd3fffffffff, Seccomp 2,/dev/net/tunpresent, no/dev/kvm.upstream).research-home-manifest: git by argv without index writes; no echoed e…
#3 re-run on 0.1.7: upgrade comparison, on-CHR Claude review, CHR lab…
Amm0Bot commentedon Nov 8, 2026
Two test CHRs ready for this lab, and the arm64 first-install path (2026-11-08)
From the #3 re-run (write-up in #26,
docs/research/2026-11-07/chr-0.1.7-upgrade.md; recipe in.claude/skills/chr-app-lab/SKILL.md):/app/update, with all five groupsready.app/t3code.tikapp.yaml. The pull and extract took about 8 minutes, and the web UI answered 200 about 11.5 minutes after the/appPUT. All five groups reachedreadyin the background:arm64-trixie-c149fa9e83498601arm64-trixie-b470b946f9fa8cc5arm64-trixie-3c91e98e858d15b4arm64-trixie-e490a90fc8e3b234arm64-abi137-ab2895431a557d74/datauses 4.5G of 24G afterwards. As expected on a fresh home,claudeis missing; that's the installer bug on #13.For this issue:
/container/shellruns as uid 1000 (node), the image user, in both CHRs.tinidoesn't catch SIGTERM (RouterOS SIGKILLs the app on every stop: PID 1 (tini) doesn't catch SIGTERM #25). The firstcaptureinstall was killed by an app restart that/app/settings router-iptriggered, and the next attempt cleaned up the staging directory. The cleanup path works on arm64./container/shellcommands that start Bun (t3code-tools status) took over 110 s while groups installed. Plain shell commands return in seconds. Size harness timeouts for that.Amm0Bot commentedon Nov 8, 2026
Sizing signal from the arm64 TCG CHR (owner, 2026-11-08)
On the arm64 test CHR (2 vCPU, 2 GiB, TCG on an x86_64 Mac, which may also be throttling under heat):
T3CODE_TOOL_GROUPStolabs vpn devin WinBox's app environment and pressed Apply. That restarted the container, with a SIGKILL as usual (RouterOS SIGKILLs the app on every stop: PID 1 (tini) doesn't catch SIGTERM #25). The UI came back a few minutes later, with/dataunchanged (4.9 GB used before and after).So 2 vCPU and 2 GiB under TCG works, but only just: it's the slowness a too-small router would show. For real hardware this is a data point for a minimum-size note. The first minutes after a start (T3 startup, provider probes, group installs) are the peak. Worth measuring separately on a real arm64 RouterBOARD. Also: both test CHRs now have distinct identities (
t3code,t3code-arm64) instead ofCHR, so T3 and WinBox can tell them apart once the containers restart.mobileskyfi commentedon Nov 10, 2026
Visible again after the Amm0Bot suspension (2026-11-08 to 2026-11-10). Updates from that gap, which the roadmap (#30) carried:
/container/shelluid is answered: 1000 (node), or root withuser=root; HOME is/dataeither way, and the umask is 0000 (measured on 7.25 x86 and 7.25.1 arm64,AGENTS.md"Users"). As root,t3app toolsswitches back to the payload owner (t3app: app-owned command, settings and source layout #45).t3code-toolsis nowt3app tools, and the setting isT3APP_TOOL_GROUPS(t3app: app-owned command, settings and source layout #45). The body's research links point at the moved paths..agents/skills/chr-app-lab.mobileskyfi commentedon Nov 24, 2026
privilegedin /app YAML: verified on CHR (2026-11-24)Context: while adding
dnsandprivilegedto the restraml /app schemas (tikoci/restraml#125, #126), I tested the YAML form on CHR. These are the first observations of the "Measure first" privileged vs unprivileged comparison. It isn't the full lab.The YAML key
A service-level
privileged:works from 7.25. Checked on 7.25.2 and 7.26beta7 by enabling each app and reading the resulting/containerentry:/container privileged=privileged: trueorprivileged: 'true'trueprivileged: false, or no keyfalseprivileged: yesorprivileged: maybefalse, with no erroryesdoesn't work. Onlytruedoes, even thoughyesis how RouterOS writes booleans everywhere else./containerhas aprivileged=property there, butprivileged: truein the YAML still producesprivileged=false. So the YAML route starts at 7.25, which matches the 7.25beta4 changelog entry "allow the privileged mode to be enabled per service in the container app YAML". The body's "RouterOS 7.24+" applies to the/container privileged=setting, not to the YAML./app/add. RouterOS accepts any key there, including an unknownzzz_unknown, so being accepted proves nothing. Check/containerinstead.What changes inside the container (7.25.2 x86 CHR)
Measured with
alpine:latestrunning as root, read through/container/shell:privileged: true3fffffffff3fffffffffsu nobody/sys/fs/cgroupcpuset cpu io memory pidsnet.ipv4.ping_group_range1 0(unprivileged ICMP sockets off)65534 65534/deventries/dev/net/tun,/dev/fuse/dev/ppp,/dev/kvmip link add … type dummy/type wireguardRTNETLINK answers: Not supportedWhat this suggests (one CHR, one image):
node(uid 1000), privileged mode alone won't grant CAP_NET_RAW or CAP_NET_ADMIN, which fits the Morpheus baseline of CapEff 0. Running as root (user=root) is the lever for capabilities, notprivileged./devgoes from 18 entries to 405, andping_group_rangechanges. Without privileged mode the setting is65534 65534, which allows unprivileged ICMP sockets only for gid 65534. With it, the setting is1 0, which turns them off entirely. So a non-rootpingcould get worse in privileged mode./dev/net/tunis present even unprivileged./dev/pppisn't present in either mode.Caveats
/dev/kvmbeing absent says nothing about a host that has KVM.iphere is BusyBox's. "Not supported" is the kernel's answer fordummyandwireguard, but it should be re-checked with iproute2 from the app-t3code image before ruling either out.devices=passthrough, the T3 image'snodeuser, and arm64 hardware weren't tested. Those still need the lab.The restraml /app schemas now accept
privilegedonly astrue/false/'true'/'false', so editors flagyes. Per-version schemas for 7.24.x leave the key out.Docs: /app YAML privileged verified on CHR (#65)