feat(arm64): linux-arm64-musl target, plugin.json sidecar, v1.1.1
- Makefile: arm64 target probing aarch64-linux-musl-gcc then aarch64-linux-gnu-gcc (static aarch64 ELF for ARM64 servers) - release-dist.sh: arm64 build leg, manifest/SHA256SUMS/stage entries, --standalone escape hatch, version 1.1.1 (was 1.1.0 with five targets) - tests/run.sh: arm64 ELF + EM_AARCH64 assertion, macOS Mach-O slice checks, plugin.json contract check - plugin.json sidecar so the marketplace manifest carries the real title, summary, category, license and capabilities
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-12 00:05:09
Commit639cb1b1
Parents23251072
Changed files
.gitignore+5−2■■■■■
Makefile+15−4■■■■■
README.md+3−2■■■■■
plugin.json+10−0■■■■■
release-dist.sh+29−10■■■■■
tests/run.sh+49−2■■■■■
7 files+112−21
Diff
.gitignore+5−2■■■■■
index 791c966..4fcd53b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,12 @@
11 /plugin_docker
22 /plugin_docker.exe
3+/plugin_docker.arm64
4+/plugin_docker.musl
5+/plugin_docker.macos-*
36 *.o
47 *.obj
58 bin/
69 *.tmp
710 *.log
8-/plugin_docker.musl
9-/plugin_docker.macos-*
11+__pycache__/
12+*.pyc
Makefile+15−4■■■■■
index cc652e3..efe7034 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
11 # plugin_docker — ScorpioX Bot open-source container dashboard plugin
2-#
32 # Targets:
43 # make native build -> ./plugin_docker
54 # make musl static musl x86_64 -> ./plugin_docker (fully static)
5+# make arm64 static aarch64 -> ./plugin_docker.arm64 (Pi 5 / ARM64 servers)
66 # make win64 MinGW-w64 static -> ./plugin_docker.exe
77 # make macos Apple clang -> ./plugin_docker (run on macOS)
88 # make test build + run tests/run.sh
@@ -12,13 +12,17 @@ CC ?= cc
1212 CFLAGS ?= -O2 -std=c99 -Wall -Wextra -pedantic -Wno-overlength-strings
1313 MUSL_CC ?= musl-gcc
1414 MUSL_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
15+ARM64_CC ?= $(shell command -v aarch64-linux-musl-gcc 2>/dev/null || \
16+ command -v aarch64-linux-gnu-gcc 2>/dev/null || \
17+ echo aarch64-linux-musl-gcc)
18+ARM64_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
1519 WIN_CC ?= x86_64-w64-mingw32-gcc
1620 WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
1721 SRC := src/plugin_docker.c
1822 BIN := plugin_docker
1923 EXE := plugin_docker.exe
2024
21-.PHONY: all native musl win64 macos test clean distclean help
25+.PHONY: all native musl arm64 win64 macos test clean distclean help
2226
2327 all: native
2428
@@ -33,6 +37,13 @@ musl: $(SRC)
3337 @echo "==> static musl build ($(MUSL_CC))"
3438 $(MUSL_CC) $(MUSL_CFLAGS) -o $(BIN) $(SRC)
3539
40+# Static aarch64 build — Raspberry Pi 5 / ARM64 servers. Prefers the musl cross
41+# toolchain; the Debian aarch64-linux-gnu-gcc static link also yields a
42+# self-contained aarch64 ELF.
43+arm64: $(SRC)
44+ @echo "==> static arm64 build ($(ARM64_CC))"
45+ $(ARM64_CC) $(ARM64_CFLAGS) -o $(BIN).arm64 $(SRC)
46+
3647 # Native Win64 static PE — runs on any Windows 10/11 x64 node
3748 win64: $(SRC)
3849 @echo "==> MinGW-w64 build ($(WIN_CC))"
@@ -47,10 +58,10 @@ test: native
4758 @sh tests/run.sh
4859
4960 clean:
50- rm -f $(BIN) $(EXE)
61+ rm -f $(BIN) $(EXE) $(BIN).arm64 $(BIN).musl $(BIN).macos-arm64 $(BIN).macos-x86_64
5162 rm -rf bin
5263
5364 distclean: clean
5465
5566 help:
56- @echo "make | make musl | make win64 | make macos | make test | make clean"
67+ @echo "make | make musl | make arm64 | make win64 | make macos | make test | make clean"
README.md+3−2■■■■■
index 55daa4b..1189304 100644
--- a/README.md
+++ b/README.md
@@ -62,7 +62,7 @@ its quotes either.
6262 ```sh
6363 # Linux x86_64 — the static musl binary works on Alpine, Debian, Ubuntu, Arch, Omarchy
6464 mkdir -p ~/.scorpiox/plugins
65-curl -fsSL https://dist.scorpiox.net/bot-plugins/docker/1.1.0/linux-x86_64-musl/plugin_docker \
65+curl -fsSL https://dist.scorpiox.net/bot-plugins/docker/1.1.1/linux-x86_64-musl/plugin_docker \
6666 -o ~/.scorpiox/plugins/plugin_docker
6767 chmod +x ~/.scorpiox/plugins/plugin_docker
6868 ~/.scorpiox/plugins/plugin_docker --meta
@@ -79,7 +79,8 @@ No server restart is required — `scorpiox-server` resolves plugin routes live.
7979 git clone https://plugingit.scorpiox.net/scorpiox-bot-plugin-docker.git
8080 cd scorpiox-bot-plugin-docker
8181 make # native
82-make musl # fully static Linux — the universal artifact
82+make musl # fully static Linux x86_64 — the universal artifact
83+make arm64 # static aarch64 (ARM64 servers) -> plugin_docker.arm64
8384 make win64 # static Windows PE via MinGW-w64
8485 make test # 90+ offline assertions, no real runtime needed
8586 cp plugin_docker ~/.scorpiox/plugins/
plugin.json+10−0■■■■■
11new file mode 100644
index 0000000..8d9ec22
--- /dev/null
+++ b/plugin.json
@@ -0,0 +1,10 @@
1+{
2+ "slug": "docker",
3+ "id": "plugin_docker",
4+ "title": "Local Container Dashboard",
5+ "summary": "Zero-dependency local Docker and Podman dashboard: container list with live CPU and memory, 100-line log viewer, and safe start/stop/restart - all served from one C99 binary on your own node.",
6+ "category": "containers",
7+ "license": "MIT",
8+ "capabilities": ["proc_exec_docker", "container_list", "container_logs", "container_state_change"],
9+ "trust_notice": "Executes native C code on your node. Invokes the local docker or podman CLI to list containers, read logs and change container state; makes zero outbound network requests."
10+}
release-dist.sh+29−10■■■■■
index 593f6fc..0ef9a2d 100755
--- a/release-dist.sh
+++ b/release-dist.sh
@@ -28,7 +28,7 @@ set -euo pipefail
2828
2929 SLUG="docker"
3030 ID="plugin_docker"
31-VERSION="1.1.0"
31+VERSION="1.1.1"
3232 DIST_BASE_URL="https://dist.scorpiox.net/bot-plugins"
3333
3434 ROOT="$(cd "$(dirname "$0")" && pwd)"
@@ -37,12 +37,14 @@ cd "$ROOT"
3737 DRY_RUN=0
3838 DO_MACOS=1
3939 DO_MIRROR=1
40+STANDALONE=0
4041 for arg in "$@"; do
4142 case "$arg" in
42- --dry-run) DRY_RUN=1 ;;
43- --no-macos) DO_MACOS=0 ;;
44- --no-mirror) DO_MIRROR=0 ;;
45- -h|--help) sed -n '2,30p' "$0"; exit 0 ;;
43+ --dry-run) DRY_RUN=1 ;;
44+ --no-macos) DO_MACOS=0 ;;
45+ --no-mirror) DO_MIRROR=0 ;;
46+ --standalone) STANDALONE=1 ;;
47+ -h|--help) sed -n '2,30p' "$0"; exit 0 ;;
4648 *) echo "unknown argument: $arg" >&2; exit 2 ;;
4749 esac
4850 done
@@ -63,11 +65,11 @@ die() { printf '\033[31mERROR:\033[0m %s\n' "$1" >&2; exit 1; }
6365 # ---------------------------------------------------------------- 0. preflight
6466 say "0/7 preflight"
6567
66-if command -v scorpiox-cli-botplugin >/dev/null 2>&1; then
68+if [ "$STANDALONE" -eq 0 ] && command -v scorpiox-cli-botplugin >/dev/null 2>&1; then
6769 say "using scorpiox-cli-botplugin publish"
68- exec scorpiox-cli-botplugin publish "$ROOT"
70+ exec scorpiox-cli-botplugin publish "$ROOT" --version "$VERSION"
6971 fi
70-echo " scorpiox-cli-botplugin not installed — running standalone pipeline"
72+echo " running the standalone pipeline (dist + plugingit mirror)"
7173
7274 [ -n "$(git status --porcelain 2>/dev/null)" ] && \
7375 echo " note: working tree is dirty; source.tar.gz comes from the last commit"
@@ -138,6 +140,20 @@ else
138140 echo " skip linux-x86_64-musl (no musl-gcc)"
139141 fi
140142
143+# linux-arm64-musl (static aarch64 - Raspberry Pi 5 / ARM64 servers).
144+# Prefer musl; on a host that only has the Debian cross toolchain the static
145+# glibc link still yields a self-contained aarch64 ELF.
146+if command -v aarch64-linux-musl-gcc >/dev/null 2>&1; then
147+ aarch64-linux-musl-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.arm64" src/$ID.c \
148+ || die "arm64 musl build failed"
149+ echo " built linux-arm64-musl $(wc -c < "$STAGE/$ID.arm64" | tr -d ' ') bytes"
150+elif command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then
151+ aarch64-linux-gnu-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.arm64" src/$ID.c \
152+ || die "arm64 static build failed"
153+ echo " built linux-arm64-static $(wc -c < "$STAGE/$ID.arm64" | tr -d ' ') bytes"
154+else
155+ echo " skip linux-arm64-musl (no aarch64 cross compiler)"
156+fi
141157 # windows-x86_64 (static PE)
142158 if command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then
143159 x86_64-w64-mingw32-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.exe" src/$ID.c \
@@ -230,6 +246,7 @@ target_meta() { # target_meta <key> <file> <format> <relpath> <name>
230246 emit "linux-x86_64-musl" "$STAGE/$ID.musl" "elf-x86_64-static" "linux-x86_64-musl/$ID" "$ID"
231247 emit "macos-arm64" "$STAGE/$ID.macos-arm64" "macho-arm64" "macos-arm64/$ID" "$ID"
232248 emit "macos-x86_64" "$STAGE/$ID.macos-x86_64" "macho-x86_64" "macos-x86_64/$ID" "$ID"
249+ emit "linux-arm64-musl" "$STAGE/$ID.arm64" "elf-arm64-static" "linux-arm64-musl/$ID" "$ID"
233250 emit "windows-x86_64" "$STAGE/$ID.exe" "pe-x86_64" "windows-x86_64/$ID.exe" "$ID"
234251 printf '\n }\n}\n'
235252 } > "$STAGE/manifest.json"
@@ -243,6 +260,7 @@ echo " manifest.json ok"
243260 for f in source.tar.gz; do [ -f "$f" ] && sha256sum "$f"; done
244261 [ -f "$ID" ] && sha256sum "$ID" | sed "s| $ID\$| linux-x86_64/$ID|"
245262 [ -f "$ID.musl" ] && sha256sum "$ID.musl" | sed "s| $ID.musl\$| linux-x86_64-musl/$ID|"
263+ [ -f "$ID.arm64" ] && sha256sum "$ID.arm64" | sed "s| $ID.arm64\$| linux-arm64-musl/$ID|"
246264 [ -f "$ID.macos-arm64" ]&& sha256sum "$ID.macos-arm64"| sed "s| $ID.macos-arm64\$| macos-arm64/$ID|"
247265 [ -f "$ID.macos-x86_64" ]&& sha256sum "$ID.macos-x86_64"| sed "s| $ID.macos-x86_64\$| macos-x86_64/$ID|"
248266 [ -f "$ID.exe" ] && sha256sum "$ID.exe" | sed "s| $ID.exe\$| windows-x86_64/$ID.exe|"
@@ -252,9 +270,10 @@ echo " SHA256SUMS $(wc -l < "$STAGE/SHA256SUMS" | tr -d ' ') entries"
252270 # ---------------------------------------------------------------- 4. stage
253271 say "4/7 stage tree"
254272 PKG="$STAGE/pkg"
255-mkdir -p "$PKG/linux-x86_64" "$PKG/linux-x86_64-musl" "$PKG/macos-arm64" \
256- "$PKG/macos-x86_64" "$PKG/windows-x86_64"
273+mkdir -p "$PKG/linux-x86_64" "$PKG/linux-x86_64-musl" "$PKG/linux-arm64-musl" \
274+ "$PKG/macos-arm64" "$PKG/macos-x86_64" "$PKG/windows-x86_64"
257275 cp -f "$STAGE/$ID" "$PKG/linux-x86_64/$ID"
276+[ -f "$STAGE/$ID.arm64" ] && cp -f "$STAGE/$ID.arm64" "$PKG/linux-arm64-musl/$ID"
258277 [ -f "$STAGE/$ID.musl" ] && cp -f "$STAGE/$ID.musl" "$PKG/linux-x86_64-musl/$ID"
259278 [ -f "$STAGE/$ID.macos-arm64" ]&& cp -f "$STAGE/$ID.macos-arm64" "$PKG/macos-arm64/$ID"
260279 [ -f "$STAGE/$ID.macos-x86_64" ]&&cp -f "$STAGE/$ID.macos-x86_64" "$PKG/macos-x86_64/$ID"
src/plugin_docker.c+1−1■■
index 7436fba..85d6b58 100644
--- a/src/plugin_docker.c
+++ b/src/plugin_docker.c
@@ -52,7 +52,7 @@
5252
5353 #define PLUGIN_SLUG "docker"
5454 #define PLUGIN_ID "plugin_docker"
55-#define PLUGIN_VER "1.1.0"
55+#define PLUGIN_VER "1.1.1"
5656
5757 #define MAX_CONTAINERS 256
5858 #define LOG_TAIL 100
tests/run.sh+49−2■■■■■
index 1a02d6a..ebf7055 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -95,7 +95,7 @@ DESC=$(printf '%s' "$META" | sed 's/.*"desc":"\([^"]*\)".*/\1/')
9595 [ ${#DESC} -le 15 ] && pass "desc length ${#DESC} <= 15 chars" || fail "desc too long (${#DESC})"
9696 NAME=$(printf '%s' "$META" | sed 's/.*"name":"\([^"]*\)".*/\1/')
9797 [ "$(printf '%s' "$NAME" | wc -w | tr -d ' ')" -le 1 ] && pass "name is a single word" || fail "name has spaces"
98-check "--version prints version" '1.1.0' "$("$BIN" --version)"
98+check "--version prints version" '1.1.1' "$("$BIN" --version)"
9999 check "--help is available" 'usage:' "$("$BIN" --help)"
100100
101101 # ---------------------------------------------------------------- list mode
@@ -129,7 +129,7 @@ check_not "list header has no Content-Length" 'Content-Length' "$LIST"
129129 check "list ok:true" '"ok":true' "$LBODY"
130130 check "list plugin id" '"plugin":"plugin_docker"' "$LBODY"
131131 check "list slug docker" '"slug":"docker"' "$LBODY"
132-check "list version" '"version":"1.1.0"' "$LBODY"
132+check "list version" '"version":"1.1.1"' "$LBODY"
133133 check "list runtime available" '"available":true' "$LBODY"
134134 check "list daemon available" '"daemon_available":true' "$LBODY"
135135 check "list count 3" '"count":3' "$LBODY"
@@ -286,6 +286,41 @@ if [ -f plugin_docker.musl ]; then
286286 else
287287 echo " skip musl (not built)"
288288 fi
289+if [ -f plugin_docker.arm64 ]; then
290+ case $(head -c 4 plugin_docker.arm64 | od -An -tx1 | tr -d ' \n') in
291+ 7f454c46) pass "arm64 artifact is ELF" ;;
292+ *) fail "arm64 artifact is not ELF" ;;
293+ esac
294+ # e_machine sits at offset 18, little endian: b7 00 == EM_AARCH64
295+ EM=$(od -An -tx1 -j 18 -N 2 plugin_docker.arm64 | tr -d ' \n')
296+ [ "$EM" = "b700" ] && pass "arm64 artifact declares EM_AARCH64" \
297+ || fail "arm64 artifact e_machine is $EM, expected b700"
298+elif command -v aarch64-linux-musl-gcc >/dev/null 2>&1 || command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then
299+ A64=$(command -v aarch64-linux-musl-gcc 2>/dev/null || command -v aarch64-linux-gnu-gcc)
300+ if "$A64" -O2 -std=c99 -static -o /tmp/plugin_docker_arm64_test src/plugin_docker.c 2>/dev/null; then
301+ pass "aarch64 cross build succeeds"
302+ EM=$(od -An -tx1 -j 18 -N 2 /tmp/plugin_docker_arm64_test | tr -d ' \n')
303+ [ "$EM" = "b700" ] && pass "cross-built arm64 declares EM_AARCH64" \
304+ || fail "cross-built arm64 e_machine is $EM, expected b700"
305+ rm -f /tmp/plugin_docker_arm64_test
306+ else
307+ fail "aarch64 cross build failed"
308+ fi
309+else
310+ echo " skip arm64 (no aarch64 cross compiler)"
311+fi
312+for slice in arm64 x86_64; do
313+ f="plugin_docker.macos-$slice"
314+ if [ -f "$f" ]; then
315+ MF=$(head -c 4 "$f" | od -An -tx1 | tr -d ' \n')
316+ case "$MF" in
317+ cffaedfe|feedfacf|cefaedfe|feedface) pass "macos-$slice artifact is Mach-O" ;;
318+ *) fail "macos-$slice artifact is not Mach-O ($MF)" ;;
319+ esac
320+ else
321+ echo " skip macos-$slice (not built)"
322+ fi
323+done
289324 if [ -f plugin_docker.exe ]; then
290325 MAGIC=$(head -c 2 plugin_docker.exe)
291326 [ "$MAGIC" = "MZ" ] && pass "windows artifact has MZ header" || fail "windows artifact missing MZ"
@@ -293,6 +328,18 @@ else
293328 echo " skip windows PE (not built)"
294329 fi
295330
331+[ -f plugin.json ] && pass "file present: plugin.json" || fail "file missing: plugin.json"
332+if [ -f plugin.json ]; then
333+ python3 - <<'PY' >/dev/null 2>&1 && pass "plugin.json is valid JSON with the contract keys" || fail "plugin.json invalid or missing contract keys"
334+import json
335+d = json.load(open("plugin.json"))
336+for k in ("slug", "id", "title", "summary", "category", "license", "capabilities", "trust_notice"):
337+ assert k in d, k
338+assert d["slug"] == "docker" and d["id"] == "plugin_docker", d
339+assert isinstance(d["capabilities"], list) and d["capabilities"], d
340+PY
341+fi
342+
296343 # ---------------------------------------------------------------- history audit
297344 section "git history secret & LAN audit"
298345 if git rev-parse --git-dir >/dev/null 2>&1; then
299346
.gitignore+5−2■■■■■
index 791c966..4fcd53b 100644index 791c966..4fcd53b 100644
--- a/.gitignore--- a/.gitignore
+++ b/.gitignore+++ b/.gitignore
@@ -1,9 +1,12 @@@@ -1,9 +1,12 @@
1 /plugin_docker1 /plugin_docker
2 /plugin_docker.exe2 /plugin_docker.exe
3+/plugin_docker.arm64
4+/plugin_docker.musl
5+/plugin_docker.macos-*
3 *.o6 *.o
4 *.obj7 *.obj
5 bin/8 bin/
6 *.tmp9 *.tmp
7 *.log10 *.log
8-/plugin_docker.musl11+__pycache__/
9-/plugin_docker.macos-*12+*.pyc
Makefile+15−4■■■■■
index cc652e3..efe7034 100644index cc652e3..efe7034 100644
--- a/Makefile--- a/Makefile
+++ b/Makefile+++ b/Makefile
@@ -1,8 +1,8 @@@@ -1,8 +1,8 @@
1 # plugin_docker — ScorpioX Bot open-source container dashboard plugin1 # plugin_docker — ScorpioX Bot open-source container dashboard plugin
2-#
3 # Targets:2 # Targets:
4 # make native build -> ./plugin_docker3 # make native build -> ./plugin_docker
5 # make musl static musl x86_64 -> ./plugin_docker (fully static)4 # make musl static musl x86_64 -> ./plugin_docker (fully static)
5+# make arm64 static aarch64 -> ./plugin_docker.arm64 (Pi 5 / ARM64 servers)
6 # make win64 MinGW-w64 static -> ./plugin_docker.exe6 # make win64 MinGW-w64 static -> ./plugin_docker.exe
7 # make macos Apple clang -> ./plugin_docker (run on macOS)7 # make macos Apple clang -> ./plugin_docker (run on macOS)
8 # make test build + run tests/run.sh8 # make test build + run tests/run.sh
@@ -12,13 +12,17 @@ CC ?= cc@@ -12,13 +12,17 @@ CC ?= cc
12 CFLAGS ?= -O2 -std=c99 -Wall -Wextra -pedantic -Wno-overlength-strings12 CFLAGS ?= -O2 -std=c99 -Wall -Wextra -pedantic -Wno-overlength-strings
13 MUSL_CC ?= musl-gcc13 MUSL_CC ?= musl-gcc
14 MUSL_CFLAGS := -O2 -std=c99 -Wall -Wextra -static14 MUSL_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
15+ARM64_CC ?= $(shell command -v aarch64-linux-musl-gcc 2>/dev/null || \
16+ command -v aarch64-linux-gnu-gcc 2>/dev/null || \
17+ echo aarch64-linux-musl-gcc)
18+ARM64_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
15 WIN_CC ?= x86_64-w64-mingw32-gcc19 WIN_CC ?= x86_64-w64-mingw32-gcc
16 WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -static20 WIN_CFLAGS := -O2 -std=c99 -Wall -Wextra -static
17 SRC := src/plugin_docker.c21 SRC := src/plugin_docker.c
18 BIN := plugin_docker22 BIN := plugin_docker
19 EXE := plugin_docker.exe23 EXE := plugin_docker.exe
20 24
21-.PHONY: all native musl win64 macos test clean distclean help25+.PHONY: all native musl arm64 win64 macos test clean distclean help
22 26
23 all: native27 all: native
24 28
@@ -33,6 +37,13 @@ musl: $(SRC)@@ -33,6 +37,13 @@ musl: $(SRC)
33 @echo "==> static musl build ($(MUSL_CC))"37 @echo "==> static musl build ($(MUSL_CC))"
34 $(MUSL_CC) $(MUSL_CFLAGS) -o $(BIN) $(SRC)38 $(MUSL_CC) $(MUSL_CFLAGS) -o $(BIN) $(SRC)
35 39
40+# Static aarch64 build — Raspberry Pi 5 / ARM64 servers. Prefers the musl cross
41+# toolchain; the Debian aarch64-linux-gnu-gcc static link also yields a
42+# self-contained aarch64 ELF.
43+arm64: $(SRC)
44+ @echo "==> static arm64 build ($(ARM64_CC))"
45+ $(ARM64_CC) $(ARM64_CFLAGS) -o $(BIN).arm64 $(SRC)
46+
36 # Native Win64 static PE — runs on any Windows 10/11 x64 node47 # Native Win64 static PE — runs on any Windows 10/11 x64 node
37 win64: $(SRC)48 win64: $(SRC)
38 @echo "==> MinGW-w64 build ($(WIN_CC))"49 @echo "==> MinGW-w64 build ($(WIN_CC))"
@@ -47,10 +58,10 @@ test: native@@ -47,10 +58,10 @@ test: native
47 @sh tests/run.sh58 @sh tests/run.sh
48 59
49 clean:60 clean:
50- rm -f $(BIN) $(EXE)61+ rm -f $(BIN) $(EXE) $(BIN).arm64 $(BIN).musl $(BIN).macos-arm64 $(BIN).macos-x86_64
51 rm -rf bin62 rm -rf bin
52 63
53 distclean: clean64 distclean: clean
54 65
55 help:66 help:
56- @echo "make | make musl | make win64 | make macos | make test | make clean"67+ @echo "make | make musl | make arm64 | make win64 | make macos | make test | make clean"
README.md+3−2■■■■■
index 55daa4b..1189304 100644index 55daa4b..1189304 100644
--- a/README.md--- a/README.md
+++ b/README.md+++ b/README.md
@@ -62,7 +62,7 @@ its quotes either.@@ -62,7 +62,7 @@ its quotes either.
62 ```sh62 ```sh
63 # Linux x86_64 — the static musl binary works on Alpine, Debian, Ubuntu, Arch, Omarchy63 # Linux x86_64 — the static musl binary works on Alpine, Debian, Ubuntu, Arch, Omarchy
64 mkdir -p ~/.scorpiox/plugins64 mkdir -p ~/.scorpiox/plugins
65-curl -fsSL https://dist.scorpiox.net/bot-plugins/docker/1.1.0/linux-x86_64-musl/plugin_docker \65+curl -fsSL https://dist.scorpiox.net/bot-plugins/docker/1.1.1/linux-x86_64-musl/plugin_docker \
66 -o ~/.scorpiox/plugins/plugin_docker66 -o ~/.scorpiox/plugins/plugin_docker
67 chmod +x ~/.scorpiox/plugins/plugin_docker67 chmod +x ~/.scorpiox/plugins/plugin_docker
68 ~/.scorpiox/plugins/plugin_docker --meta68 ~/.scorpiox/plugins/plugin_docker --meta
@@ -79,7 +79,8 @@ No server restart is required — `scorpiox-server` resolves plugin routes live.@@ -79,7 +79,8 @@ No server restart is required — `scorpiox-server` resolves plugin routes live.
79 git clone https://plugingit.scorpiox.net/scorpiox-bot-plugin-docker.git79 git clone https://plugingit.scorpiox.net/scorpiox-bot-plugin-docker.git
80 cd scorpiox-bot-plugin-docker80 cd scorpiox-bot-plugin-docker
81 make # native81 make # native
82-make musl # fully static Linux — the universal artifact82+make musl # fully static Linux x86_64 — the universal artifact
83+make arm64 # static aarch64 (ARM64 servers) -> plugin_docker.arm64
83 make win64 # static Windows PE via MinGW-w6484 make win64 # static Windows PE via MinGW-w64
84 make test # 90+ offline assertions, no real runtime needed85 make test # 90+ offline assertions, no real runtime needed
85 cp plugin_docker ~/.scorpiox/plugins/86 cp plugin_docker ~/.scorpiox/plugins/
plugin.json+10−0■■■■■
1new file mode 1006441new file mode 100644
index 0000000..8d9ec22index 0000000..8d9ec22
--- /dev/null--- /dev/null
+++ b/plugin.json+++ b/plugin.json
@@ -0,0 +1,10 @@@@ -0,0 +1,10 @@
1+{
2+ "slug": "docker",
3+ "id": "plugin_docker",
4+ "title": "Local Container Dashboard",
5+ "summary": "Zero-dependency local Docker and Podman dashboard: container list with live CPU and memory, 100-line log viewer, and safe start/stop/restart - all served from one C99 binary on your own node.",
6+ "category": "containers",
7+ "license": "MIT",
8+ "capabilities": ["proc_exec_docker", "container_list", "container_logs", "container_state_change"],
9+ "trust_notice": "Executes native C code on your node. Invokes the local docker or podman CLI to list containers, read logs and change container state; makes zero outbound network requests."
10+}
release-dist.sh+29−10■■■■■
index 593f6fc..0ef9a2d 100755index 593f6fc..0ef9a2d 100755
--- a/release-dist.sh--- a/release-dist.sh
+++ b/release-dist.sh+++ b/release-dist.sh
@@ -28,7 +28,7 @@ set -euo pipefail@@ -28,7 +28,7 @@ set -euo pipefail
28 28
29 SLUG="docker"29 SLUG="docker"
30 ID="plugin_docker"30 ID="plugin_docker"
31-VERSION="1.1.0"31+VERSION="1.1.1"
32 DIST_BASE_URL="https://dist.scorpiox.net/bot-plugins"32 DIST_BASE_URL="https://dist.scorpiox.net/bot-plugins"
33 33
34 ROOT="$(cd "$(dirname "$0")" && pwd)"34 ROOT="$(cd "$(dirname "$0")" && pwd)"
@@ -37,12 +37,14 @@ cd "$ROOT"@@ -37,12 +37,14 @@ cd "$ROOT"
37 DRY_RUN=037 DRY_RUN=0
38 DO_MACOS=138 DO_MACOS=1
39 DO_MIRROR=139 DO_MIRROR=1
40+STANDALONE=0
40 for arg in "$@"; do41 for arg in "$@"; do
41 case "$arg" in42 case "$arg" in
42- --dry-run) DRY_RUN=1 ;;43+ --dry-run) DRY_RUN=1 ;;
43- --no-macos) DO_MACOS=0 ;;44+ --no-macos) DO_MACOS=0 ;;
44- --no-mirror) DO_MIRROR=0 ;;45+ --no-mirror) DO_MIRROR=0 ;;
45- -h|--help) sed -n '2,30p' "$0"; exit 0 ;;46+ --standalone) STANDALONE=1 ;;
47+ -h|--help) sed -n '2,30p' "$0"; exit 0 ;;
46 *) echo "unknown argument: $arg" >&2; exit 2 ;;48 *) echo "unknown argument: $arg" >&2; exit 2 ;;
47 esac49 esac
48 done50 done
@@ -63,11 +65,11 @@ die() { printf '\033[31mERROR:\033[0m %s\n' "$1" >&2; exit 1; }@@ -63,11 +65,11 @@ die() { printf '\033[31mERROR:\033[0m %s\n' "$1" >&2; exit 1; }
63 # ---------------------------------------------------------------- 0. preflight65 # ---------------------------------------------------------------- 0. preflight
64 say "0/7 preflight"66 say "0/7 preflight"
65 67
66-if command -v scorpiox-cli-botplugin >/dev/null 2>&1; then68+if [ "$STANDALONE" -eq 0 ] && command -v scorpiox-cli-botplugin >/dev/null 2>&1; then
67 say "using scorpiox-cli-botplugin publish"69 say "using scorpiox-cli-botplugin publish"
68- exec scorpiox-cli-botplugin publish "$ROOT"70+ exec scorpiox-cli-botplugin publish "$ROOT" --version "$VERSION"
69 fi71 fi
70-echo " scorpiox-cli-botplugin not installed — running standalone pipeline"72+echo " running the standalone pipeline (dist + plugingit mirror)"
71 73
72 [ -n "$(git status --porcelain 2>/dev/null)" ] && \74 [ -n "$(git status --porcelain 2>/dev/null)" ] && \
73 echo " note: working tree is dirty; source.tar.gz comes from the last commit"75 echo " note: working tree is dirty; source.tar.gz comes from the last commit"
@@ -138,6 +140,20 @@ else@@ -138,6 +140,20 @@ else
138 echo " skip linux-x86_64-musl (no musl-gcc)"140 echo " skip linux-x86_64-musl (no musl-gcc)"
139 fi141 fi
140 142
143+# linux-arm64-musl (static aarch64 - Raspberry Pi 5 / ARM64 servers).
144+# Prefer musl; on a host that only has the Debian cross toolchain the static
145+# glibc link still yields a self-contained aarch64 ELF.
146+if command -v aarch64-linux-musl-gcc >/dev/null 2>&1; then
147+ aarch64-linux-musl-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.arm64" src/$ID.c \
148+ || die "arm64 musl build failed"
149+ echo " built linux-arm64-musl $(wc -c < "$STAGE/$ID.arm64" | tr -d ' ') bytes"
150+elif command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then
151+ aarch64-linux-gnu-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.arm64" src/$ID.c \
152+ || die "arm64 static build failed"
153+ echo " built linux-arm64-static $(wc -c < "$STAGE/$ID.arm64" | tr -d ' ') bytes"
154+else
155+ echo " skip linux-arm64-musl (no aarch64 cross compiler)"
156+fi
141 # windows-x86_64 (static PE)157 # windows-x86_64 (static PE)
142 if command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then158 if command -v x86_64-w64-mingw32-gcc >/dev/null 2>&1; then
143 x86_64-w64-mingw32-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.exe" src/$ID.c \159 x86_64-w64-mingw32-gcc -O2 -std=c99 -Wall -Wextra -static -o "$STAGE/$ID.exe" src/$ID.c \
@@ -230,6 +246,7 @@ target_meta() { # target_meta <key> <file> <format> <relpath> <name>@@ -230,6 +246,7 @@ target_meta() { # target_meta <key> <file> <format> <relpath> <name>
230 emit "linux-x86_64-musl" "$STAGE/$ID.musl" "elf-x86_64-static" "linux-x86_64-musl/$ID" "$ID"246 emit "linux-x86_64-musl" "$STAGE/$ID.musl" "elf-x86_64-static" "linux-x86_64-musl/$ID" "$ID"
231 emit "macos-arm64" "$STAGE/$ID.macos-arm64" "macho-arm64" "macos-arm64/$ID" "$ID"247 emit "macos-arm64" "$STAGE/$ID.macos-arm64" "macho-arm64" "macos-arm64/$ID" "$ID"
232 emit "macos-x86_64" "$STAGE/$ID.macos-x86_64" "macho-x86_64" "macos-x86_64/$ID" "$ID"248 emit "macos-x86_64" "$STAGE/$ID.macos-x86_64" "macho-x86_64" "macos-x86_64/$ID" "$ID"
249+ emit "linux-arm64-musl" "$STAGE/$ID.arm64" "elf-arm64-static" "linux-arm64-musl/$ID" "$ID"
233 emit "windows-x86_64" "$STAGE/$ID.exe" "pe-x86_64" "windows-x86_64/$ID.exe" "$ID"250 emit "windows-x86_64" "$STAGE/$ID.exe" "pe-x86_64" "windows-x86_64/$ID.exe" "$ID"
234 printf '\n }\n}\n'251 printf '\n }\n}\n'
235 } > "$STAGE/manifest.json"252 } > "$STAGE/manifest.json"
@@ -243,6 +260,7 @@ echo " manifest.json ok"@@ -243,6 +260,7 @@ echo " manifest.json ok"
243 for f in source.tar.gz; do [ -f "$f" ] && sha256sum "$f"; done260 for f in source.tar.gz; do [ -f "$f" ] && sha256sum "$f"; done
244 [ -f "$ID" ] && sha256sum "$ID" | sed "s| $ID\$| linux-x86_64/$ID|"261 [ -f "$ID" ] && sha256sum "$ID" | sed "s| $ID\$| linux-x86_64/$ID|"
245 [ -f "$ID.musl" ] && sha256sum "$ID.musl" | sed "s| $ID.musl\$| linux-x86_64-musl/$ID|"262 [ -f "$ID.musl" ] && sha256sum "$ID.musl" | sed "s| $ID.musl\$| linux-x86_64-musl/$ID|"
263+ [ -f "$ID.arm64" ] && sha256sum "$ID.arm64" | sed "s| $ID.arm64\$| linux-arm64-musl/$ID|"
246 [ -f "$ID.macos-arm64" ]&& sha256sum "$ID.macos-arm64"| sed "s| $ID.macos-arm64\$| macos-arm64/$ID|"264 [ -f "$ID.macos-arm64" ]&& sha256sum "$ID.macos-arm64"| sed "s| $ID.macos-arm64\$| macos-arm64/$ID|"
247 [ -f "$ID.macos-x86_64" ]&& sha256sum "$ID.macos-x86_64"| sed "s| $ID.macos-x86_64\$| macos-x86_64/$ID|"265 [ -f "$ID.macos-x86_64" ]&& sha256sum "$ID.macos-x86_64"| sed "s| $ID.macos-x86_64\$| macos-x86_64/$ID|"
248 [ -f "$ID.exe" ] && sha256sum "$ID.exe" | sed "s| $ID.exe\$| windows-x86_64/$ID.exe|"266 [ -f "$ID.exe" ] && sha256sum "$ID.exe" | sed "s| $ID.exe\$| windows-x86_64/$ID.exe|"
@@ -252,9 +270,10 @@ echo " SHA256SUMS $(wc -l < "$STAGE/SHA256SUMS" | tr -d ' ') entries"@@ -252,9 +270,10 @@ echo " SHA256SUMS $(wc -l < "$STAGE/SHA256SUMS" | tr -d ' ') entries"
252 # ---------------------------------------------------------------- 4. stage270 # ---------------------------------------------------------------- 4. stage
253 say "4/7 stage tree"271 say "4/7 stage tree"
254 PKG="$STAGE/pkg"272 PKG="$STAGE/pkg"
255-mkdir -p "$PKG/linux-x86_64" "$PKG/linux-x86_64-musl" "$PKG/macos-arm64" \273+mkdir -p "$PKG/linux-x86_64" "$PKG/linux-x86_64-musl" "$PKG/linux-arm64-musl" \
256- "$PKG/macos-x86_64" "$PKG/windows-x86_64"274+ "$PKG/macos-arm64" "$PKG/macos-x86_64" "$PKG/windows-x86_64"
257 cp -f "$STAGE/$ID" "$PKG/linux-x86_64/$ID"275 cp -f "$STAGE/$ID" "$PKG/linux-x86_64/$ID"
276+[ -f "$STAGE/$ID.arm64" ] && cp -f "$STAGE/$ID.arm64" "$PKG/linux-arm64-musl/$ID"
258 [ -f "$STAGE/$ID.musl" ] && cp -f "$STAGE/$ID.musl" "$PKG/linux-x86_64-musl/$ID"277 [ -f "$STAGE/$ID.musl" ] && cp -f "$STAGE/$ID.musl" "$PKG/linux-x86_64-musl/$ID"
259 [ -f "$STAGE/$ID.macos-arm64" ]&& cp -f "$STAGE/$ID.macos-arm64" "$PKG/macos-arm64/$ID"278 [ -f "$STAGE/$ID.macos-arm64" ]&& cp -f "$STAGE/$ID.macos-arm64" "$PKG/macos-arm64/$ID"
260 [ -f "$STAGE/$ID.macos-x86_64" ]&&cp -f "$STAGE/$ID.macos-x86_64" "$PKG/macos-x86_64/$ID"279 [ -f "$STAGE/$ID.macos-x86_64" ]&&cp -f "$STAGE/$ID.macos-x86_64" "$PKG/macos-x86_64/$ID"
src/plugin_docker.c+1−1■■
index 7436fba..85d6b58 100644index 7436fba..85d6b58 100644
--- a/src/plugin_docker.c--- a/src/plugin_docker.c
+++ b/src/plugin_docker.c+++ b/src/plugin_docker.c
@@ -52,7 +52,7 @@@@ -52,7 +52,7 @@
52 52
53 #define PLUGIN_SLUG "docker"53 #define PLUGIN_SLUG "docker"
54 #define PLUGIN_ID "plugin_docker"54 #define PLUGIN_ID "plugin_docker"
55-#define PLUGIN_VER "1.1.0"55+#define PLUGIN_VER "1.1.1"
56 56
57 #define MAX_CONTAINERS 25657 #define MAX_CONTAINERS 256
58 #define LOG_TAIL 10058 #define LOG_TAIL 100
tests/run.sh+49−2■■■■■
index 1a02d6a..ebf7055 100755index 1a02d6a..ebf7055 100755
--- a/tests/run.sh--- a/tests/run.sh
+++ b/tests/run.sh+++ b/tests/run.sh
@@ -95,7 +95,7 @@ DESC=$(printf '%s' "$META" | sed 's/.*"desc":"\([^"]*\)".*/\1/')@@ -95,7 +95,7 @@ DESC=$(printf '%s' "$META" | sed 's/.*"desc":"\([^"]*\)".*/\1/')
95 [ ${#DESC} -le 15 ] && pass "desc length ${#DESC} <= 15 chars" || fail "desc too long (${#DESC})"95 [ ${#DESC} -le 15 ] && pass "desc length ${#DESC} <= 15 chars" || fail "desc too long (${#DESC})"
96 NAME=$(printf '%s' "$META" | sed 's/.*"name":"\([^"]*\)".*/\1/')96 NAME=$(printf '%s' "$META" | sed 's/.*"name":"\([^"]*\)".*/\1/')
97 [ "$(printf '%s' "$NAME" | wc -w | tr -d ' ')" -le 1 ] && pass "name is a single word" || fail "name has spaces"97 [ "$(printf '%s' "$NAME" | wc -w | tr -d ' ')" -le 1 ] && pass "name is a single word" || fail "name has spaces"
98-check "--version prints version" '1.1.0' "$("$BIN" --version)"98+check "--version prints version" '1.1.1' "$("$BIN" --version)"
99 check "--help is available" 'usage:' "$("$BIN" --help)"99 check "--help is available" 'usage:' "$("$BIN" --help)"
100 100
101 # ---------------------------------------------------------------- list mode101 # ---------------------------------------------------------------- list mode
@@ -129,7 +129,7 @@ check_not "list header has no Content-Length" 'Content-Length' "$LIST"@@ -129,7 +129,7 @@ check_not "list header has no Content-Length" 'Content-Length' "$LIST"
129 check "list ok:true" '"ok":true' "$LBODY"129 check "list ok:true" '"ok":true' "$LBODY"
130 check "list plugin id" '"plugin":"plugin_docker"' "$LBODY"130 check "list plugin id" '"plugin":"plugin_docker"' "$LBODY"
131 check "list slug docker" '"slug":"docker"' "$LBODY"131 check "list slug docker" '"slug":"docker"' "$LBODY"
132-check "list version" '"version":"1.1.0"' "$LBODY"132+check "list version" '"version":"1.1.1"' "$LBODY"
133 check "list runtime available" '"available":true' "$LBODY"133 check "list runtime available" '"available":true' "$LBODY"
134 check "list daemon available" '"daemon_available":true' "$LBODY"134 check "list daemon available" '"daemon_available":true' "$LBODY"
135 check "list count 3" '"count":3' "$LBODY"135 check "list count 3" '"count":3' "$LBODY"
@@ -286,6 +286,41 @@ if [ -f plugin_docker.musl ]; then@@ -286,6 +286,41 @@ if [ -f plugin_docker.musl ]; then
286 else286 else
287 echo " skip musl (not built)"287 echo " skip musl (not built)"
288 fi288 fi
289+if [ -f plugin_docker.arm64 ]; then
290+ case $(head -c 4 plugin_docker.arm64 | od -An -tx1 | tr -d ' \n') in
291+ 7f454c46) pass "arm64 artifact is ELF" ;;
292+ *) fail "arm64 artifact is not ELF" ;;
293+ esac
294+ # e_machine sits at offset 18, little endian: b7 00 == EM_AARCH64
295+ EM=$(od -An -tx1 -j 18 -N 2 plugin_docker.arm64 | tr -d ' \n')
296+ [ "$EM" = "b700" ] && pass "arm64 artifact declares EM_AARCH64" \
297+ || fail "arm64 artifact e_machine is $EM, expected b700"
298+elif command -v aarch64-linux-musl-gcc >/dev/null 2>&1 || command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then
299+ A64=$(command -v aarch64-linux-musl-gcc 2>/dev/null || command -v aarch64-linux-gnu-gcc)
300+ if "$A64" -O2 -std=c99 -static -o /tmp/plugin_docker_arm64_test src/plugin_docker.c 2>/dev/null; then
301+ pass "aarch64 cross build succeeds"
302+ EM=$(od -An -tx1 -j 18 -N 2 /tmp/plugin_docker_arm64_test | tr -d ' \n')
303+ [ "$EM" = "b700" ] && pass "cross-built arm64 declares EM_AARCH64" \
304+ || fail "cross-built arm64 e_machine is $EM, expected b700"
305+ rm -f /tmp/plugin_docker_arm64_test
306+ else
307+ fail "aarch64 cross build failed"
308+ fi
309+else
310+ echo " skip arm64 (no aarch64 cross compiler)"
311+fi
312+for slice in arm64 x86_64; do
313+ f="plugin_docker.macos-$slice"
314+ if [ -f "$f" ]; then
315+ MF=$(head -c 4 "$f" | od -An -tx1 | tr -d ' \n')
316+ case "$MF" in
317+ cffaedfe|feedfacf|cefaedfe|feedface) pass "macos-$slice artifact is Mach-O" ;;
318+ *) fail "macos-$slice artifact is not Mach-O ($MF)" ;;
319+ esac
320+ else
321+ echo " skip macos-$slice (not built)"
322+ fi
323+done
289 if [ -f plugin_docker.exe ]; then324 if [ -f plugin_docker.exe ]; then
290 MAGIC=$(head -c 2 plugin_docker.exe)325 MAGIC=$(head -c 2 plugin_docker.exe)
291 [ "$MAGIC" = "MZ" ] && pass "windows artifact has MZ header" || fail "windows artifact missing MZ"326 [ "$MAGIC" = "MZ" ] && pass "windows artifact has MZ header" || fail "windows artifact missing MZ"
@@ -293,6 +328,18 @@ else@@ -293,6 +328,18 @@ else
293 echo " skip windows PE (not built)"328 echo " skip windows PE (not built)"
294 fi329 fi
295 330
331+[ -f plugin.json ] && pass "file present: plugin.json" || fail "file missing: plugin.json"
332+if [ -f plugin.json ]; then
333+ python3 - <<'PY' >/dev/null 2>&1 && pass "plugin.json is valid JSON with the contract keys" || fail "plugin.json invalid or missing contract keys"
334+import json
335+d = json.load(open("plugin.json"))
336+for k in ("slug", "id", "title", "summary", "category", "license", "capabilities", "trust_notice"):
337+ assert k in d, k
338+assert d["slug"] == "docker" and d["id"] == "plugin_docker", d
339+assert isinstance(d["capabilities"], list) and d["capabilities"], d
340+PY
341+fi
342+
296 # ---------------------------------------------------------------- history audit343 # ---------------------------------------------------------------- history audit
297 section "git history secret & LAN audit"344 section "git history secret & LAN audit"
298 if git rev-parse --git-dir >/dev/null 2>&1; then345 if git rev-parse --git-dir >/dev/null 2>&1; then
299346