Skip to content

Add upload for a device or fleet - #32

Merged
siliconwitch merged 2 commits into
mainfrom
dev
Sep 19, 2026
Merged

siliconwitch merged 2 commits into
mainfrom
dev

Conversation

@siliconwitch

@siliconwitch siliconwitch commented Sep 17, 2026

Copy link
Copy Markdown
Member

Adds superstack upload <imei|fleet_id> <file> ... and shows one device state in device list.

  • A 15-digit first argument is a device. Any other positive number is a fleet.
  • A file argument uploads under its base name. A directory argument uploads its contents under paths relative to that directory, and skips hidden files and directories.
  • The same device path from two sources is refused before anything is sent.
  • The files go to PUT /devices/{imei}/files or PUT /fleets/{id}/files as {"files": {"<path>": "<base64>"}}. The output says how many files went to which device, or to how many devices in the fleet, and that they arrive at the next check-in.
  • The RUN STATE column is now STATE. It shows no space, rejected, failed, no code, updating, running, stopped, crashed, or -. --json passes run_state through unchanged.

Evidence: built with CGO_ENABLED=0. gofmt -l, go mod tidy -diff, go vet, and go test ./... pass. TestUpload checks the request body and the skipped hidden files, and TestDeviceList checks every state in the table and in JSON.

Needs the server change that adds the two routes and serves the states, 60a5c20 on dev.

A file argument lands at its base name. A directory argument uploads its contents with paths relative to it, skipping hidden entries.
The server now serves no_space, rejected, failed, no_code, and updating in
run_state alongside the run states, so the column is STATE and shows each
value with spaces.
@siliconwitch
siliconwitch merged commit b5547d0 into main Sep 19, 2026
2 checks passed
@siliconwitch
siliconwitch deleted the dev branch September 19, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant