@dudko.dev/baton-worker
v0.2.2
Published
Baton Worker: scheduled runs, remote execution, git bridge, and web-build proxy.
Downloads
442
Maintainers
Readme
baton-worker
The self-hosted companion service for Baton, the git-native API client. It pulls the same workspace repository the app uses and:
- runs schedules — cron entries declared in the workspace's
schedules.yaml, each in its own timezone, with run history and a failure webhook; - runs requests on demand — for requests that must originate from inside a network;
- bridges git and proxies requests for the web build, which cannot clone a repository or send cross-origin requests from the browser.
The worker is yours: your server, your network, your credentials. There is no Baton cloud.
Run it
Docker is the usual way:
docker run -d --name baton-worker \
-p 8787:8787 \
-e BATON_WORKER_TOKEN=<long-random-token> \
-e BATON_GIT_URL=https://github.com/acme/my-apis.git \
-e BATON_GIT_TOKEN=<read-only-deploy-token> \
-e BATON_SECRET_APITOKEN=<value> \
-e TZ=UTC \
-v baton-data:/data \
ghcr.io/dudko-dev/baton-worker:latestOr straight from npm, on a host with Node.js 24+ and git installed:
BATON_WORKER_TOKEN=<long-random-token> \
BATON_DATA_DIR=./baton-data \
npx -y @dudko.dev/baton-worker| Env var | Purpose |
|---|---|
| BATON_WORKER_TOKEN | Bearer token the app must present. Required. |
| BATON_GIT_URL | Workspace repository to clone and pull. |
| BATON_GIT_TOKEN / BATON_GIT_USERNAME | Credentials for that repository. Passed to git through a credential helper, so they never reach the command line or a log. |
| BATON_SECRET_<NAME> | Values for the secret references a request uses. |
| BATON_DATA_DIR | Defaults to /data — run history and the workspace checkout. |
| BATON_HISTORY_RETENTION_DAYS | Defaults to 90. 0 keeps everything. |
| BATON_PORT | Defaults to 8787. |
TLS is the reverse proxy's job; the worker speaks plain HTTP.
Full documentation, including the REST API and the event stream, ships inside the app and lives at https://baton.dudko.dev.
License
Proprietary — see LICENSE.
Free for personal, non-commercial use. Commercial use is free for small entities: your group must have raised less than USD 250,000 in total, be valued at less than USD 250,000, and have annual gross revenue under USD 1,000,000. Above any of the three, commercial use needs a license — write to [email protected].
Redistribution is not permitted. Installing from npm, caching in your own registry proxy, and building your own deployment images are (see Section 4 of the license); republishing, forking, or bundling these packages into something you ship are not.
