Files
luna 17bd6622eb
ci / smoke (push) Successful in 55s
improve shx upload error handling
2026-06-04 22:10:55 +00:00

58 lines
1.4 KiB
Markdown

# shx-helper
tiny helper repo for uploads to the SHX Zipline instance.
## what it includes
- `bin/shx-upload` - upload one or more files to Zipline
- `.gitea/workflows/ci.yml` - basic CI for syntax + smoke tests
- `.gitea/workflows/release.yml` - tag build artifact packaging
- `tests/smoke.sh` - local smoke tests covering success, failures, and request formation with mocked network calls
## requirements
- `bash`
- `curl`
- `jq` for normal output mode
## env
loaded from `/root/.openclaw/.env` by default:
- `SHX_URL=https://shx.reversed.dev`
- `SHX_TOKEN=...` ← required for uploads
optional fallback:
- `ZIPLINE_TOKEN=...`
## usage
```bash
/root/projects/shx-helper/bin/shx-upload ./file.gif
/root/projects/shx-helper/bin/shx-upload ./a.png ./b.mp4
/root/projects/shx-helper/bin/shx-upload --json ./file.gif
/root/projects/shx-helper/bin/shx-upload --help
```
## local checks
```bash
make lint
make test
```
## release flow
push a tag like `v0.1.0` to trigger the release packaging workflow.
## notes
- username/password are for dashboard login only
- actual uploads use a Zipline API token
- failed uploads now print the Zipline response body when one is returned
- successful uploads are validated to ensure the response includes a non-empty `.files` array
- docs: https://zipline.diced.sh/docs
- upload endpoint ref: https://v3.zipline.diced.sh/docs/api/upload
- shell uploader guide: https://zipline.diced.sh/docs/guides/uploaders/shell-script