Public-facing build server for the Perry ecosystem. Receives build uploads from the perry publish CLI, manages licenses, and dispatches build jobs to workers via WebSocket.
perry publish ──► Perry Hub ──► Worker (macOS/iOS/Android)
(CLI) (this server) │
▲ │
└──────────────┘
artifacts + status
- A developer runs
perry publishwhich uploads a tarball to Perry Hub - Perry Hub validates the license, rate-limits, and enqueues a build job
- A connected worker picks up the job, downloads the tarball, and builds it
- The worker uploads artifacts back to Perry Hub
- The CLI downloads the finished artifacts
- TypeScript compiled to a native binary by the Perry compiler (not Node.js)
- Fastify for HTTP
- ws for WebSocket
- MySQL for license and build persistence
src/main.ts # Entire server (single file)
perry.toml # Perry compiler project config
perry-hub # Compiled binary (gitignored)
Requires the Perry compiler:
perry compile src/main.ts -o perry-hub# Set required environment variables (see Configuration below)
export PERRY_DB_PASSWORD=...
export PERRY_HUB_WORKER_SECRET=...
./perry-hubAll configuration is via environment variables:
| Variable | Default | Description |
|---|---|---|
PERRY_HUB_HTTP_PORT |
3456 |
HTTP server port |
PERRY_HUB_WS_PORT |
3457 |
WebSocket server port |
PERRY_HUB_WORKER_SECRET |
(empty) | Shared secret for worker authentication |
PERRY_HUB_ADMIN_SECRET |
(empty) | Secret for admin endpoints |
PERRY_HUB_PUBLIC_URL |
https://hub.perryts.com |
Public URL for artifact download links |
PERRY_HUB_SELF_HOSTED |
false |
Set to true to disable rate limiting |
PERRY_HUB_ARTIFACT_TTL_SECS |
600 |
Seconds before artifacts expire |
PERRY_DB_HOST |
localhost |
MySQL host |
PERRY_DB_PORT |
3306 |
MySQL port |
PERRY_DB_USER |
perry |
MySQL user |
PERRY_DB_PASSWORD |
(empty) | MySQL password |
PERRY_DB_NAME |
perry_hub |
MySQL database name |
| Method | Path | Description |
|---|---|---|
GET |
/api/v1/status |
Server status, queue length, connected workers |
POST |
/api/v1/build |
Submit a build (multipart: license_key, manifest, tarball_b64) |
POST |
/api/v1/license/register |
Register a new license (admin) |
POST |
/api/v1/license/verify |
Verify a license key |
GET |
/api/v1/dl/:token |
Download a build artifact |
Workers connect and send worker_hello with capabilities. CLI clients connect and send subscribe with a job_id to receive real-time build updates.
- perry — The Perry compiler and CLI
- builder-macos — macOS/iOS/Android build worker
MIT