@cosmicdrift/kumiko-server-runtime 0.345.0 → 0.346.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
export declare const APP_VERSION_ENV = "KUMIKO_APP_VERSION";
|
|
3
3
|
export declare const GIT_COMMIT_ENV = "KUMIKO_GIT_COMMIT";
|
|
4
|
-
export declare const INSTANCE_ID_ENV = "
|
|
4
|
+
export declare const INSTANCE_ID_ENV = "KUMIKO_INSTANCE_ID";
|
|
5
|
+
export declare const HOSTNAME_ENV = "HOSTNAME";
|
|
5
6
|
export declare const UNKNOWN_APP_VERSION = "unknown";
|
|
6
7
|
type EnvSource = Readonly<Record<string, string | undefined>>;
|
|
7
8
|
export type AppStartedPayload = {
|
|
@@ -5,7 +5,8 @@ import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
|
5
5
|
import { SYSTEM_TENANT_ID, SYSTEM_USER_ID } from "@cosmicdrift/kumiko-types/identifiers";
|
|
6
6
|
export const APP_VERSION_ENV = "KUMIKO_APP_VERSION";
|
|
7
7
|
export const GIT_COMMIT_ENV = "KUMIKO_GIT_COMMIT";
|
|
8
|
-
export const INSTANCE_ID_ENV = "
|
|
8
|
+
export const INSTANCE_ID_ENV = "KUMIKO_INSTANCE_ID";
|
|
9
|
+
export const HOSTNAME_ENV = "HOSTNAME";
|
|
9
10
|
export const UNKNOWN_APP_VERSION = "unknown";
|
|
10
11
|
function nonEmpty(value) {
|
|
11
12
|
return value === undefined || value === "" ? undefined : value;
|
|
@@ -15,7 +16,7 @@ export function resolveAppStartedPayload(envSource, fallbackHostname, startedAt)
|
|
|
15
16
|
return {
|
|
16
17
|
version: nonEmpty(envSource[APP_VERSION_ENV]) ?? UNKNOWN_APP_VERSION,
|
|
17
18
|
...(commit !== undefined ? { commit } : {}),
|
|
18
|
-
instanceId: nonEmpty(envSource[INSTANCE_ID_ENV]) ?? fallbackHostname,
|
|
19
|
+
instanceId: nonEmpty(envSource[INSTANCE_ID_ENV]) ?? nonEmpty(envSource[HOSTNAME_ENV]) ?? fallbackHostname,
|
|
19
20
|
startedAt,
|
|
20
21
|
};
|
|
21
22
|
}
|
package/dist/run-worker-app.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
// Container/Coolify sets the same env vars as runProdApp:
|
|
16
16
|
// DATABASE_URL, REDIS_URL, JWT_SECRET — PORT is not needed.
|
|
17
17
|
import { startPiiEventBackfillOnBoot } from "./boot/pii-event-backfill-on-boot.js";
|
|
18
|
+
import { recordAppStartedOnBoot } from "./boot/record-app-started-on-boot.js";
|
|
18
19
|
import { bootWorkerProcess, resolveWorkerEnvSource } from "./boot/worker-boot-core.js";
|
|
19
20
|
import { startWorkerMetricsServer, } from "./boot/worker-metrics-server.js";
|
|
20
21
|
import { makeDispatchSystemWrite } from "./extra-routes-deps.js";
|
|
@@ -55,6 +56,7 @@ export async function runWorkerApp(options) {
|
|
|
55
56
|
stop: boot.close,
|
|
56
57
|
...(metricsServer && { metricsServer }),
|
|
57
58
|
};
|
|
59
|
+
await recordAppStartedOnBoot({ db, envSource });
|
|
58
60
|
startPiiEventBackfillOnBoot({
|
|
59
61
|
db,
|
|
60
62
|
registry,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-server-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.346.0",
|
|
4
4
|
"description": "Production server-boot runtime for Kumiko apps: connections, schema-drift-gate, seeds, lifecycle, graceful shutdown. Symmetric to kumiko-dev-server's runDevApp, without dev/scaffold/codegen tooling.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@cosmicdrift/kumiko-bundled-features": "0.
|
|
84
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
85
|
-
"@cosmicdrift/kumiko-headless": "0.
|
|
86
|
-
"@cosmicdrift/kumiko-renderer-web": "0.
|
|
83
|
+
"@cosmicdrift/kumiko-bundled-features": "0.346.0",
|
|
84
|
+
"@cosmicdrift/kumiko-framework": "0.346.0",
|
|
85
|
+
"@cosmicdrift/kumiko-headless": "0.346.0",
|
|
86
|
+
"@cosmicdrift/kumiko-renderer-web": "0.346.0",
|
|
87
87
|
"bun-types": "^1.3.13",
|
|
88
88
|
"ioredis": "^5.10.1",
|
|
89
89
|
"temporal-polyfill": "^0.3.2"
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.346.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "runWorkerApp records app.started; instance id prefers KUMIKO_INSTANCE_ID over HOSTNAME",
|
|
6
|
+
"detail": "runWorkerApp records app.started too\nThe worker now appends the same `kumiko:system:app.started` event as `runProdApp`. The instance id prefers `KUMIKO_INSTANCE_ID` and falls back to `HOSTNAME`, then the OS hostname."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.345.0",
|
|
4
10
|
"type": "improvement",
|