mirror of
https://github.com/saltbo/zpan.git
synced 2026-08-29 00:01:42 +08:00
53ca110218
Flatten the instance `runtime` object into two fields: `runtime` (the JS engine,
node | workerd) and `platform` (the deployment host). The About page shows each
as its own row with friendly labels (e.g. "workerd" + "Cloudflare Workers",
"Node.js" + "Docker").
- Detect the platform from the entry file (entry === target): each serverless
entry declares it; entry-node sniffs Cloud Run (K_SERVICE) / Docker
(ZPAN_RUNTIME, set in the Dockerfile) / bare node. Cloudflare is detected from
the D1 binding.
- Decouple the cloud payload: zpan-cloud-sdk fixes runtime { provider, target },
so CloudInstanceInfo keeps that shape and buildCloudInstanceInfo maps to it;
buildInstanceInfo serves the richer flat shape to the About API.
- Migrate PostHog instance telemetry to the runtime/platform shape and merge the
duplicate runtimeInfo in licensing-admin into the shared one.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
// Instance metadata reported to ZPan Cloud and shown on the admin About page.
|
|
export interface InstanceInfo {
|
|
id: string
|
|
name: string
|
|
url: string
|
|
version: string
|
|
commit?: string | null
|
|
// JS runtime engine.
|
|
runtime?: 'node' | 'workerd' | null
|
|
// Deployment platform / host.
|
|
platform?:
|
|
| 'cloudflare-workers'
|
|
| 'aws-lambda'
|
|
| 'vercel'
|
|
| 'netlify'
|
|
| 'azure-functions'
|
|
| 'cloud-run'
|
|
| 'docker'
|
|
| 'node'
|
|
| null
|
|
server?: {
|
|
os?: {
|
|
platform?: string | null
|
|
arch?: string | null
|
|
release?: string | null
|
|
} | null
|
|
} | null
|
|
node?: {
|
|
version?: string | null
|
|
} | null
|
|
}
|
|
|
|
// Changelog feed shown on the About page, sourced from CHANGELOG.md on GitHub.
|
|
export interface ChangelogInfo {
|
|
// The version this instance is running, from the build-time version global.
|
|
currentVersion: string
|
|
// Newest released version parsed from the changelog, or null if undetectable.
|
|
latestVersion: string | null
|
|
// True when latestVersion is strictly newer than currentVersion.
|
|
updateAvailable: boolean
|
|
// Raw CHANGELOG.md markdown for rendering in the drawer.
|
|
markdown: string
|
|
}
|