Files
warkanumandClaude Sonnet 5 2590e404f5
CI / rust (push) Successful in 3m6s
CI / go (push) Successful in 33s
CI / js (push) Successful in 34s
feat: initial Go/JS/Rust Origin check-in client SDKs
Standalone clients that resolve a machine unique ID (OS machine ID first,
falling back to a generated UUID persisted to disk), detect hostname/IP/
container/orchestrator, and register+re-ping origin.warky.dev's public
service-checkin endpoint on a daily interval. Ported from icy2's internal
origincheckin package but extended to the full check-in contract and made
dependency-light for external reuse.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-01 15:25:30 +02:00

45 lines
1.6 KiB
Markdown

# origin_client
Client SDKs that register a running service with
[Origin](https://origin.warky.dev)'s public check-in endpoint and re-ping it
on an interval. One package per language, same wire contract, same behavior.
## Packages
| Language | Path | Module/package |
|---|---|---|
| Go | [`go/`](go/) | `git.warky.dev/wdevs/origin_client/go` |
| JavaScript/TypeScript | [`js/`](js/) | `@warkanum/origin-client` |
| Rust | [`rust/`](rust/) | `origin-client` |
## What it does
- Resolves a machine unique ID: real OS ID first (`/etc/machine-id` on
Linux, `IOPlatformUUID` on macOS, `MachineGuid` on Windows), falling back
to a generated UUID persisted to disk.
- Detects hostname, outbound IP, container ID (Docker/cgroup), and
orchestrator (Kubernetes/Docker) best-effort.
- POSTs a check-in payload to Origin immediately, then again every
`interval_hours` (default 24), until stopped. Network/server failures are
logged and swallowed — check-in never crashes or blocks the host app.
## Wire contract
`POST {base_url}` (default `https://origin.warky.dev/api/public/service-checkin`)
with header `X-Origin-Service-Key: <your key>`.
Required: `type`, `version`, `name`, `unique_install_id`.
Optional: `site`, `environment`, `database_type`, `database_name`,
`app_type`, `hostname`, `port`, `base_url`, `internal_url`, `container_id`,
`orchestrator`, `description`.
Response: `success`, `service_instance_id`, `unique_install_id`, `status`,
`pinged_at`.
Full contract: see `origin/doc/service-checkin.md` in the Origin repo.
## Status
Structured for independent versioning/publishing per package. Not yet
published to any registry.