@synopackageland/cli 0.54.11 → 0.54.12
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.
- package/CHANGELOG.md +5 -0
- package/dist/error-registry.js +10 -0
- package/dist/native-http-schema/source.json +1 -1
- package/dist/runtime/sdk-source.d.ts +1 -1
- package/dist/runtime/sdk-source.js +1 -1
- package/dist/standalone/daemon-log.d.ts +10 -0
- package/dist/standalone/daemon-log.js +48 -0
- package/dist/standalone/daemon.js +3 -0
- package/dist/standalone/inspect-spk.js +21 -2
- package/dist/standalone/manifest.d.ts +2 -0
- package/dist/standalone/manifest.js +27 -6
- package/dist/standalone/spk.js +1 -0
- package/docs/daemon.md +25 -0
- package/package.json +1 -1
- package/schema/dsm-package.schema.json +14 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.54.12 (2026-11-23)
|
|
4
|
+
|
|
5
|
+
- Configure SDK-managed daemon logs with `daemon.log_max_mb` and `daemon.log_keep_files` in `dsm-package.yaml`. Native daemons and Compose web gateways support both settings.
|
|
6
|
+
- Use SDK 0.53.58 for CLI-owned daemon controllers and Compose planning by default.
|
|
7
|
+
|
|
3
8
|
## 0.54.11 (2026-11-22)
|
|
4
9
|
|
|
5
10
|
- `ctl generate` (and `--check`) no longer needs store text: it does not read the project `.env`, ignores `--catalog`/`SYNOPKGLAND_CATALOG`, and accepts a manifest without `description`. It previously failed when the catalog had no release notes for the current version, or when no `.env` supplied the catalog. `check`, `build` and `inspect` still require the catalog text as before.
|
package/dist/error-registry.js
CHANGED
|
@@ -424,6 +424,16 @@ export const ERROR_REGISTRY = {
|
|
|
424
424
|
description: "The daemon file-descriptor limit or package account is invalid.",
|
|
425
425
|
suggestion: "Use an integer daemon.nofile from 1024 to 1048576 and a valid non-root package ID; new builds currently require omitting daemon.nofile because activation is unsupported.",
|
|
426
426
|
},
|
|
427
|
+
STANDALONE_DAEMON_LOG_INVALID: {
|
|
428
|
+
code: "STANDALONE_DAEMON_LOG_INVALID",
|
|
429
|
+
description: "The daemon log settings are invalid or the package has no SDK-managed daemon.",
|
|
430
|
+
suggestion: "Use integer daemon.log_max_mb from 1 to 2048 MiB and daemon.log_keep_files from 1 to 20 with a native daemon or Compose web gateway.",
|
|
431
|
+
},
|
|
432
|
+
STANDALONE_DAEMON_LOG_SDK_REQUIRED: {
|
|
433
|
+
code: "STANDALONE_DAEMON_LOG_SDK_REQUIRED",
|
|
434
|
+
description: "The selected controller SDK does not support configurable daemon log retention.",
|
|
435
|
+
suggestion: "Upgrade the App or gateway SDK pin, or upgrade the CLI if it supplies the default controller SDK. Use matching SDK sources.",
|
|
436
|
+
},
|
|
427
437
|
STANDALONE_DAEMON_NOFILE_DSM_REQUIRED: {
|
|
428
438
|
code: "STANDALONE_DAEMON_NOFILE_DSM_REQUIRED",
|
|
429
439
|
description: "The declared DSM minimum does not support the daemon file-descriptor limit contract.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"module":"github.com/synopackageland/syno-pkg-land-sdk","version":"0.53.
|
|
1
|
+
{"module":"github.com/synopackageland/syno-pkg-land-sdk","version":"0.53.58","local":false}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { goPrivateCovers } from './go-env.js';
|
|
2
2
|
import { type ExecutorManifest } from './sdk-executor-manifest.js';
|
|
3
3
|
/** Pinned SDK for CLI-owned controllers and Compose planning; App pins take precedence. */
|
|
4
|
-
export declare const DEFAULT_SDK_VERSION = "0.53.
|
|
4
|
+
export declare const DEFAULT_SDK_VERSION = "0.53.58";
|
|
5
5
|
export declare const SDK_PACKAGE = "@synopackageland/sdk";
|
|
6
6
|
export declare const SDK_MODULE = "github.com/synopackageland/syno-pkg-land-sdk";
|
|
7
7
|
export declare const EXECUTOR_MODULE = "github.com/synopackageland/syno-pkg-land-sdk/executor";
|
|
@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os';
|
|
|
5
5
|
import { join } from 'node:path';
|
|
6
6
|
import { readExecutorManifest, predatesExecutorManifest } from './sdk-executor-manifest.js';
|
|
7
7
|
/** Pinned SDK for CLI-owned controllers and Compose planning; App pins take precedence. */
|
|
8
|
-
export const DEFAULT_SDK_VERSION = '0.53.
|
|
8
|
+
export const DEFAULT_SDK_VERSION = '0.53.58';
|
|
9
9
|
export const SDK_PACKAGE = '@synopackageland/sdk';
|
|
10
10
|
export const SDK_MODULE = 'github.com/synopackageland/syno-pkg-land-sdk';
|
|
11
11
|
export const EXECUTOR_MODULE = `${SDK_MODULE}/executor`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StandaloneError } from "./manifest.js";
|
|
2
|
+
declare const bounds: {
|
|
3
|
+
readonly log_max_mb: 2048;
|
|
4
|
+
readonly log_keep_files: 20;
|
|
5
|
+
};
|
|
6
|
+
export type DaemonLog = Partial<Record<keyof typeof bounds, number>>;
|
|
7
|
+
export declare function readDaemonLog(value: unknown, fail: (error: StandaloneError) => void): DaemonLog | undefined;
|
|
8
|
+
export declare function daemonLogSdkProblem(sdk: string): string | undefined;
|
|
9
|
+
export declare function requireDaemonLogSource(source: string, sdk: string, settings?: DaemonLog): void;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { gte, valid } from "semver";
|
|
4
|
+
import { StandaloneBuildError } from "./spk.js";
|
|
5
|
+
const minSdk = "0.53.58";
|
|
6
|
+
const bounds = { log_max_mb: 2048, log_keep_files: 20 };
|
|
7
|
+
export function readDaemonLog(value, fail) {
|
|
8
|
+
if (value === undefined)
|
|
9
|
+
return;
|
|
10
|
+
if (value === null || typeof value !== "object" || Array.isArray(value) ||
|
|
11
|
+
Object.keys(value).some(key => !Object.hasOwn(bounds, key))) {
|
|
12
|
+
fail({ code: "STANDALONE_DAEMON_LOG_INVALID", message: "Daemon log settings accept only log_max_mb and log_keep_files." });
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const settings = {};
|
|
16
|
+
for (const key of Object.keys(bounds)) {
|
|
17
|
+
const number = value[key];
|
|
18
|
+
if (number === undefined)
|
|
19
|
+
continue;
|
|
20
|
+
if (typeof number !== "number" || !Number.isInteger(number) || number < 1 || number > bounds[key]) {
|
|
21
|
+
fail({
|
|
22
|
+
code: "STANDALONE_DAEMON_LOG_INVALID",
|
|
23
|
+
message: `daemon.${key} must be an integer from 1 to ${bounds[key]}${key === "log_max_mb" ? " MiB" : ""}.`,
|
|
24
|
+
});
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
settings[key] = number;
|
|
28
|
+
}
|
|
29
|
+
return Object.keys(settings).length ? settings : undefined;
|
|
30
|
+
}
|
|
31
|
+
export function daemonLogSdkProblem(sdk) {
|
|
32
|
+
if (!valid(sdk) || !gte(sdk, minSdk))
|
|
33
|
+
return `daemon.log_max_mb and daemon.log_keep_files require SDK ${minSdk} or later; selected SDK ${sdk}.`;
|
|
34
|
+
}
|
|
35
|
+
export function requireDaemonLogSource(source, sdk, settings) {
|
|
36
|
+
if (!settings)
|
|
37
|
+
return;
|
|
38
|
+
const problem = daemonLogSdkProblem(sdk);
|
|
39
|
+
if (problem)
|
|
40
|
+
throw new StandaloneBuildError("STANDALONE_DAEMON_LOG_SDK_REQUIRED", problem);
|
|
41
|
+
let main = "";
|
|
42
|
+
try {
|
|
43
|
+
main = readFileSync(join(source, "daemonctl/main.go"), "utf8");
|
|
44
|
+
}
|
|
45
|
+
catch { /* Report the missing controller support below. */ }
|
|
46
|
+
if (Object.keys(settings).some(key => !main.includes(`json:"${key},omitempty"`)))
|
|
47
|
+
throw new StandaloneBuildError("STANDALONE_DAEMON_LOG_SDK_REQUIRED", "The selected SDK source does not support the declared daemon log settings. Use matching SDK sources.");
|
|
48
|
+
}
|
|
@@ -11,6 +11,7 @@ import { checkCgiBinary } from "./binary.js";
|
|
|
11
11
|
import { NODE_PACKAGES } from "./bridge-backend.js";
|
|
12
12
|
import { readDaemonIngress, ingressEnv } from "./daemon-ingress.js";
|
|
13
13
|
import { readDaemonRestart, requireDaemonRestartSource } from "./daemon-restart.js";
|
|
14
|
+
import { requireDaemonLogSource } from "./daemon-log.js";
|
|
14
15
|
import { composeDaemon, composeNetwork } from "./compose.js";
|
|
15
16
|
import { gatewayDaemon } from "./identity-gateway.js";
|
|
16
17
|
import { StandaloneBuildError } from "./spk.js";
|
|
@@ -189,6 +190,7 @@ export function daemonConfig(manifest) {
|
|
|
189
190
|
return (JSON.stringify({
|
|
190
191
|
package: manifest.package,
|
|
191
192
|
...(manifest.daemon?.nofile !== undefined ? { nofile: manifest.daemon.nofile } : {}),
|
|
193
|
+
...manifest.daemonLog,
|
|
192
194
|
...(!manifest.compose && manifest.daemon?.backend ? { backend: true } : { exec }),
|
|
193
195
|
args,
|
|
194
196
|
...(uninstall_args ? { uninstall_args } : {}),
|
|
@@ -238,6 +240,7 @@ export async function buildDaemonControl(manifest, arch, work, run) {
|
|
|
238
240
|
const out = join(work, `daemon-control-${arch}`);
|
|
239
241
|
const sdk = daemonSdkVersion(manifest);
|
|
240
242
|
const source = runtimeBudgetSource(sdkSource(sdk).goDir, manifest);
|
|
243
|
+
requireDaemonLogSource(source, sdk, manifest.daemonLog);
|
|
241
244
|
requireDaemonRestartSource(source, sdk, manifest.daemon?.restart);
|
|
242
245
|
requireBackendDaemonSource(source, manifest.daemon);
|
|
243
246
|
const result = await run("go", [
|
|
@@ -8,6 +8,7 @@ import { inspectStablePages } from './stable-pages.js';
|
|
|
8
8
|
import { LIFECYCLE_SCRIPTS } from '../spk/dsm-spec.js';
|
|
9
9
|
import { SHORT_PATHS_CONFIG, renderShortPathsCheck, renderShortPathsConfig, shortPathIngressProblem, shortPathsMinDsmProblem, shortPathsProblem, withoutShortPathsCheck } from './short-paths.js';
|
|
10
10
|
import { DAEMON_NOFILE_UNSUPPORTED, DAEMON_NOFILE_ACTIVATION_PROBLEM, readNoFile, daemonSystemUnitName, renderDaemonSystemUnit, daemonNoFileSdkProblem, daemonNoFileIdentityProblem, DAEMON_NOFILE_MIN_DSM } from "./daemon-nofile.js";
|
|
11
|
+
import { daemonLogSdkProblem, readDaemonLog } from "./daemon-log.js";
|
|
11
12
|
import { gatewayIngressPathProblem, gatewayIngressOwnershipSupported } from './gateway-ingress.js';
|
|
12
13
|
import { renderGatewayIngressCheck } from './native-gateway.js';
|
|
13
14
|
import { portDefaults, portInstallSteps } from "./install-ports.js";
|
|
@@ -188,6 +189,9 @@ export async function inspectSpk(spkPath, expectedKind, options = {}) {
|
|
|
188
189
|
}
|
|
189
190
|
const dependencies = inspectPackageDependencies(metadata.dependencies, findings);
|
|
190
191
|
const daemonNoFile = readNoFile(metadata.daemon_nofile, e => findings.push(e.message));
|
|
192
|
+
const daemonLog = readDaemonLog(metadata.daemon_log, e => findings.push(`${e.code} ${e.message}`));
|
|
193
|
+
if (metadata.daemon_log !== undefined && (!daemonLog || !paths.has("daemon/control")))
|
|
194
|
+
findings.push("STANDALONE_DAEMON_LOG_INVALID daemon_log requires valid settings and daemon/control.");
|
|
191
195
|
if (metadata.daemon_nofile !== undefined)
|
|
192
196
|
findings.push(`[${DAEMON_NOFILE_UNSUPPORTED}] ${DAEMON_NOFILE_ACTIVATION_PROBLEM}`);
|
|
193
197
|
if (daemonNoFile !== undefined) {
|
|
@@ -219,7 +223,7 @@ export async function inspectSpk(spkPath, expectedKind, options = {}) {
|
|
|
219
223
|
const integrations = metadata.integrations ?? [];
|
|
220
224
|
await inspectCtlArtifacts(dir, paths, metadata.ctl, metadata.entry, findings);
|
|
221
225
|
if (metadata.compose !== undefined) {
|
|
222
|
-
const result = await inspectUnifiedCompose(dir, payload, { ...metadata, installSettings, minMemoryMb, memoryAdvice }, findings, options.baseline);
|
|
226
|
+
const result = await inspectUnifiedCompose(dir, payload, { ...metadata, installSettings, minMemoryMb, memoryAdvice, daemonLog }, findings, options.baseline);
|
|
223
227
|
if (dependencies) {
|
|
224
228
|
result.dependencies = dependencies;
|
|
225
229
|
}
|
|
@@ -304,7 +308,7 @@ export async function inspectSpk(spkPath, expectedKind, options = {}) {
|
|
|
304
308
|
if (standalone && portal)
|
|
305
309
|
findings.push(...inspectPortalInfo(info, hasExecutor));
|
|
306
310
|
const daemon = standalone
|
|
307
|
-
? await checkDaemon(dir, info, paths, payload, findings, hasExecutor, background, combined, nativeGateway, uninstallHook?.uninstall, { ingress: daemonIngress, node: daemonNode, restart: daemonRestart, nofile: daemonNoFile, installPorts: Boolean(metadata.installPorts) })
|
|
311
|
+
? await checkDaemon(dir, info, paths, payload, findings, hasExecutor, background, combined, nativeGateway, uninstallHook?.uninstall, { ingress: daemonIngress, node: daemonNode, restart: daemonRestart, nofile: daemonNoFile, log: daemonLog, installPorts: Boolean(metadata.installPorts) })
|
|
308
312
|
: undefined;
|
|
309
313
|
if (background)
|
|
310
314
|
checkBackground(dir, info, payload, findings, hasExecutor, daemon, kind !== "native-go", metadata.lifecycleTimeouts, nativeGateway, Boolean(metadata.installPorts));
|
|
@@ -887,6 +891,7 @@ async function inspectUnifiedCompose(dir, payload, metadata, findings, baseline
|
|
|
887
891
|
build: Number(info.version?.split("-").pop()),
|
|
888
892
|
arches: [arch],
|
|
889
893
|
backend: { kind: "binary", files: {}, ...(metadata.operationSeconds ? { timeoutSeconds: metadata.operationSeconds } : {}) },
|
|
894
|
+
daemonLog: metadata.daemonLog,
|
|
890
895
|
lifecycleTimeouts: metadata.lifecycleTimeouts,
|
|
891
896
|
ui: { dir: root, launch: metadata.launch },
|
|
892
897
|
capabilities: {
|
|
@@ -902,6 +907,13 @@ async function inspectUnifiedCompose(dir, payload, metadata, findings, baseline
|
|
|
902
907
|
};
|
|
903
908
|
if (Boolean(c.web) !== Boolean(g))
|
|
904
909
|
throw new Error("Web ingress must have a complete identity gateway");
|
|
910
|
+
if (metadata.daemonLog && !g)
|
|
911
|
+
throw new Error("daemon log settings require a Compose web gateway");
|
|
912
|
+
if (metadata.daemonLog && g) {
|
|
913
|
+
const problem = daemonLogSdkProblem(g.sdk);
|
|
914
|
+
if (problem)
|
|
915
|
+
throw new Error(problem);
|
|
916
|
+
}
|
|
905
917
|
if (gateway && !matchesGatewayConfig(gateway, manifest))
|
|
906
918
|
throw new Error("gateway configuration differs from the declared package contract");
|
|
907
919
|
if (readOptional(join(dir, "conf/privilege")) !== renderNativePrivilege())
|
|
@@ -1090,11 +1102,17 @@ async function checkDaemon(dir, info, paths, payload, findings, executor, backgr
|
|
|
1090
1102
|
"uninstall_args",
|
|
1091
1103
|
"restart",
|
|
1092
1104
|
"nofile",
|
|
1105
|
+
"log_max_mb",
|
|
1106
|
+
"log_keep_files",
|
|
1093
1107
|
...(combined ? ["network"] : []),
|
|
1094
1108
|
].includes(key)))
|
|
1095
1109
|
throw new Error("package/config mismatch");
|
|
1096
1110
|
if (config.nofile !== extras.nofile)
|
|
1097
1111
|
throw new Error("daemon nofile differs from its build declaration");
|
|
1112
|
+
if (config.log_max_mb !== extras.log?.log_max_mb || config.log_keep_files !== extras.log?.log_keep_files) {
|
|
1113
|
+
findings.push("STANDALONE_DAEMON_LOG_INVALID daemon log settings differ from their build declaration.");
|
|
1114
|
+
return undefined;
|
|
1115
|
+
}
|
|
1098
1116
|
if (!isDeepStrictEqual(config.restart, extras.restart))
|
|
1099
1117
|
throw new Error("daemon restart differs from its build declaration");
|
|
1100
1118
|
const backend = config.backend === true;
|
|
@@ -1144,6 +1162,7 @@ async function checkDaemon(dir, info, paths, payload, findings, executor, backgr
|
|
|
1144
1162
|
root: dir,
|
|
1145
1163
|
...(combined ? { lifecycleTimeouts: daemon.timeouts } : {}),
|
|
1146
1164
|
daemon,
|
|
1165
|
+
daemonLog: extras.log,
|
|
1147
1166
|
uninstall,
|
|
1148
1167
|
...combined,
|
|
1149
1168
|
capabilities: {
|
|
@@ -17,6 +17,7 @@ import { type RootOp } from "./root-ops.js";
|
|
|
17
17
|
import type { RootSettings } from "../runtime/root-programs.js";
|
|
18
18
|
import { type ComposeApp } from "./compose.js";
|
|
19
19
|
import { type Daemon } from "./daemon.js";
|
|
20
|
+
import { type DaemonLog } from "./daemon-log.js";
|
|
20
21
|
import { type IdentityGateway } from "./identity-gateway.js";
|
|
21
22
|
import { type Uninstall } from "./uninstall.js";
|
|
22
23
|
import { type HyperBackup } from "./hyper-backup.js";
|
|
@@ -113,6 +114,7 @@ export interface StandaloneManifest {
|
|
|
113
114
|
tasks: ExecutorTask[];
|
|
114
115
|
};
|
|
115
116
|
daemon?: Daemon;
|
|
117
|
+
daemonLog?: DaemonLog;
|
|
116
118
|
lifecycleTimeouts?: Daemon["timeouts"];
|
|
117
119
|
/** Author-supplied overrides, before daemon supervision defaults are filled. */
|
|
118
120
|
declaredLifecycleTimeouts?: Partial<Daemon["timeouts"]>;
|
|
@@ -31,6 +31,7 @@ import { loadRootOps, readRootSettings, rootBinaryProblem, ROOT_OPS_DIR, } from
|
|
|
31
31
|
import { composeManifestContext, readComposeApp } from "./compose.js";
|
|
32
32
|
import { daemonSdkVersion, readDaemon, readLifecycleTimeouts } from "./daemon.js";
|
|
33
33
|
import { daemonRestartSdkProblem } from "./daemon-restart.js";
|
|
34
|
+
import { daemonLogSdkProblem, readDaemonLog } from "./daemon-log.js";
|
|
34
35
|
import { daemonIngressMinDsmProblem } from "./daemon-ingress.js";
|
|
35
36
|
import { readIdentityGateway, } from "./identity-gateway.js";
|
|
36
37
|
import { gatewayIngressOnly, unixUpstreamSocket } from "./gateway-ingress-only.js";
|
|
@@ -290,10 +291,19 @@ function readManifest(raw, c, storeText) {
|
|
|
290
291
|
c.fail("STANDALONE_API_PERMISSIONS_INVALID", `backend/${API_PERMISSIONS_FILE[backend.kind]} must define the centralized API policy: ${String(error)}`);
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
|
-
const
|
|
294
|
-
const
|
|
294
|
+
const { log_max_mb, log_keep_files, ...daemonBody } = isRecord(raw.daemon) ? raw.daemon : {};
|
|
295
|
+
const hasLogSettings = log_max_mb !== undefined || log_keep_files !== undefined;
|
|
296
|
+
const daemonLog = hasLogSettings
|
|
297
|
+
? readDaemonLog({ log_max_mb, log_keep_files }, e => c.fail(e.code, e.message))
|
|
298
|
+
: undefined;
|
|
299
|
+
const daemonSettingsOnly = isRecord(raw.daemon) &&
|
|
300
|
+
(hasLogSettings || "timeouts" in daemonBody) &&
|
|
301
|
+
Object.keys(daemonBody).every(key => key === "timeouts");
|
|
302
|
+
const lifecycleTimeouts = daemonSettingsOnly && "timeouts" in daemonBody
|
|
303
|
+
? readLifecycleTimeouts(daemonBody.timeouts, e => c.fail(e.code, e.message))
|
|
304
|
+
: undefined;
|
|
295
305
|
const daemon = arches &&
|
|
296
|
-
readDaemon(
|
|
306
|
+
readDaemon(daemonSettingsOnly ? undefined : isRecord(raw.daemon) ? daemonBody : raw.daemon, c.root, arches, (e) => c.fail(e.code, e.message), packageId);
|
|
297
307
|
let dependencies;
|
|
298
308
|
try {
|
|
299
309
|
const explicit = readPackageDependencies(raw.dependencies);
|
|
@@ -341,7 +351,7 @@ function readManifest(raw, c, storeText) {
|
|
|
341
351
|
installPorts,
|
|
342
352
|
}));
|
|
343
353
|
if (raw.compose !== undefined &&
|
|
344
|
-
((raw.daemon !== undefined && !
|
|
354
|
+
((raw.daemon !== undefined && !daemonSettingsOnly) ||
|
|
345
355
|
Object.keys(capabilities).some((k) => k !== "composeMounts") ||
|
|
346
356
|
!osMinVer ||
|
|
347
357
|
!isDsmAtLeast(osMinVer, "7.2.1-69057")))
|
|
@@ -414,6 +424,16 @@ function readManifest(raw, c, storeText) {
|
|
|
414
424
|
if (problem)
|
|
415
425
|
c.fail("STANDALONE_DAEMON_RESTART_SDK_REQUIRED", problem);
|
|
416
426
|
}
|
|
427
|
+
if (daemonLog) {
|
|
428
|
+
if (!daemon && !(compose && identityGateway)) {
|
|
429
|
+
c.fail("STANDALONE_DAEMON_LOG_INVALID", "Daemon log settings require a native daemon or a Compose web gateway managed by the SDK.");
|
|
430
|
+
}
|
|
431
|
+
else if (backend) {
|
|
432
|
+
const problem = daemonLogSdkProblem(daemonSdkVersion({ backend, identityGateway }));
|
|
433
|
+
if (problem)
|
|
434
|
+
c.fail("STANDALONE_DAEMON_LOG_SDK_REQUIRED", problem);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
417
437
|
if ((daemon?.ingress || daemon?.node || daemon?.backend) && raw.identity_gateway !== undefined)
|
|
418
438
|
c.fail("STANDALONE_DAEMON_INVALID", "daemon.backend, daemon.node and daemon.ingress run the App's own daemon; identity_gateway runs its gateway as the daemon. Use one or the other.");
|
|
419
439
|
if (compose && identityGateway && compose.sdk !== identityGateway.sdk)
|
|
@@ -432,7 +452,7 @@ function readManifest(raw, c, storeText) {
|
|
|
432
452
|
s.port === identityGateway.oidc?.issuer_port))))
|
|
433
453
|
c.fail("STANDALONE_IDENTITY_GATEWAY_INVALID", "compose service ports must contain upstream and not overlap gateway or issuer ports.");
|
|
434
454
|
if (capabilities.jobs &&
|
|
435
|
-
raw.daemon !== undefined && !
|
|
455
|
+
raw.daemon !== undefined && !daemonSettingsOnly &&
|
|
436
456
|
capabilities.delegate?.lifetime !== "until-revoked") {
|
|
437
457
|
c.fail("CAPABILITY_COMBINATION_INVALID", "daemon can only coexist with an explicit until-revoked delegate fixed worker; plain capabilities.jobs stays mutually exclusive.");
|
|
438
458
|
}
|
|
@@ -451,7 +471,7 @@ function readManifest(raw, c, storeText) {
|
|
|
451
471
|
delegate.destinations?.length)) {
|
|
452
472
|
c.fail("CAPABILITY_UNSUPPORTED", `For backend.runtime: ${backend.kind}, capabilities.delegate supports only operations: [files.moveFromStaging], destinations and lifetime: until-revoked.`);
|
|
453
473
|
}
|
|
454
|
-
if (raw.daemon !== undefined && !
|
|
474
|
+
if (raw.daemon !== undefined && !daemonSettingsOnly)
|
|
455
475
|
c.fail("CAPABILITY_UNSUPPORTED", `backend.runtime: ${backend.kind} does not support daemon; a v1 App runs once per request (exec mode).`);
|
|
456
476
|
if (permissions)
|
|
457
477
|
checkBridgeMethods(backend, permissions, c);
|
|
@@ -720,6 +740,7 @@ function readManifest(raw, c, storeText) {
|
|
|
720
740
|
...(rootOps ? { rootOps } : {}),
|
|
721
741
|
...(rootPrograms ? { rootPrograms } : {}),
|
|
722
742
|
...(daemon ? { daemon } : {}),
|
|
743
|
+
...(daemonLog ? { daemonLog } : {}),
|
|
723
744
|
...(dependencies ? { dependencies } : {}),
|
|
724
745
|
...(lifecycleTimeouts ? { lifecycleTimeouts } : {}),
|
|
725
746
|
declaredLifecycleTimeouts: isRecord(raw.daemon) && isRecord(raw.daemon.timeouts)
|
package/dist/standalone/spk.js
CHANGED
|
@@ -350,6 +350,7 @@ export async function assembleStandaloneSpk(options) {
|
|
|
350
350
|
...(manifest.daemon?.ingress ? { daemon_ingress: manifest.daemon.ingress } : {}),
|
|
351
351
|
...(manifest.daemon?.node ? { daemon_node: manifest.daemon.node } : {}),
|
|
352
352
|
...(manifest.daemon?.nofile !== undefined ? { daemon_nofile: manifest.daemon.nofile } : {}),
|
|
353
|
+
...(manifest.daemonLog ? { daemon_log: manifest.daemonLog } : {}),
|
|
353
354
|
...(manifest.daemon?.restart ? { daemon_restart: manifest.daemon.restart } : {}),
|
|
354
355
|
...(manifest.daemon?.restart || manifest.daemon?.nofile !== undefined ? { daemon_sdk: daemonSdkVersion(manifest) } : {}),
|
|
355
356
|
launch: resolvedSdkLaunch(manifest),
|
package/docs/daemon.md
CHANGED
|
@@ -48,6 +48,31 @@ inspection digests are separate. Replacing an upstream binary through its own
|
|
|
48
48
|
updater is therefore not detected by this supervisor digest. Follow
|
|
49
49
|
[self-updating upstream guidance](../skills/reference/upstream-fork.md#self-updating-upstreams).
|
|
50
50
|
|
|
51
|
+
## Daemon log retention
|
|
52
|
+
|
|
53
|
+
Configure either limit in `dsm-package.yaml` and rebuild with a CLI and SDK
|
|
54
|
+
that support these settings.
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
daemon:
|
|
58
|
+
log_max_mb: 100
|
|
59
|
+
log_keep_files: 7
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`log_max_mb` is the uncompressed active `daemon/daemon.log` limit in MiB.
|
|
63
|
+
It accepts integers from 1 to 2048 and defaults to 100. `log_keep_files`
|
|
64
|
+
counts rotated files in addition to the active log. It accepts integers from
|
|
65
|
+
1 to 20 and defaults to 7. Add the settings to the existing native `daemon`
|
|
66
|
+
block, or use them with optional `daemon.timeouts` for a Compose web gateway.
|
|
67
|
+
The CLI rejects invalid limits before compiling.
|
|
68
|
+
|
|
69
|
+
`daemon/control status-json` reports `log` and the configured `log_archives`
|
|
70
|
+
paths. The default archives run from `daemon/daemon.log.1.gz` (newest) through
|
|
71
|
+
`daemon/daemon.log.7.gz` (oldest). Use `zcat` or `zgrep` to read them. An
|
|
72
|
+
archive waiting for background compression or a retry has the same path
|
|
73
|
+
without `.gz`. The supervisor also migrates an existing `daemon/daemon.log.1`
|
|
74
|
+
on start.
|
|
75
|
+
|
|
51
76
|
## `daemon.restart`: bounded native crash recovery
|
|
52
77
|
|
|
53
78
|
`daemon.restart` is optional. Use `mode: off` to disable crash recovery.
|
package/package.json
CHANGED
|
@@ -2,11 +2,24 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "dsm-package.schema.json",
|
|
4
4
|
"title": "DSM package manifest",
|
|
5
|
-
"description": "Editor schema for schema 2
|
|
5
|
+
"description": "Editor schema for selected schema 2 package settings; CLI check validates the complete package manifest",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"required": ["schema"],
|
|
8
8
|
"properties": {
|
|
9
9
|
"schema": {"type": "integer", "const": 2},
|
|
10
|
+
"daemon": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"log_max_mb": {
|
|
14
|
+
"type": "integer", "minimum": 1, "maximum": 2048, "default": 100,
|
|
15
|
+
"description": "Uncompressed active daemon.log limit in MiB."
|
|
16
|
+
},
|
|
17
|
+
"log_keep_files": {
|
|
18
|
+
"type": "integer", "minimum": 1, "maximum": 20, "default": 7,
|
|
19
|
+
"description": "Rotated gzip archives to retain, in addition to daemon.log."
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
10
23
|
"install": {
|
|
11
24
|
"type": "object",
|
|
12
25
|
"properties": {
|