@synopackageland/cli 0.48.23 → 0.49.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.
- package/CHANGELOG.md +17 -0
- package/dist/build-spk/dsm-icons.d.ts +2 -0
- package/dist/build-spk/dsm-icons.js +5 -0
- package/dist/build-spk/reproducible-archive.d.ts +2 -0
- package/dist/build-spk/reproducible-archive.js +27 -2
- package/dist/ctl/registry.d.ts +1 -1
- package/dist/error-registry.js +11 -0
- package/dist/init.js +27 -0
- package/dist/secret-files.d.ts +19 -0
- package/dist/secret-files.js +173 -0
- package/dist/skill.js +1 -0
- package/dist/standalone/build.js +2 -0
- package/dist/standalone/dsm-window.js +29 -2
- package/dist/standalone/i18n.d.ts +1 -0
- package/dist/standalone/i18n.js +2 -2
- package/dist/standalone/inspect-spk.js +30 -3
- package/dist/standalone/manifest.d.ts +4 -0
- package/dist/standalone/manifest.js +28 -0
- package/dist/standalone/mobile.d.ts +50 -0
- package/dist/standalone/mobile.js +154 -0
- package/dist/standalone/native-layout.d.ts +2 -0
- package/dist/standalone/native-layout.js +8 -4
- package/dist/standalone/sdk-check.js +12 -1
- package/dist/standalone/spk.js +9 -2
- package/dist/validate.js +16 -8
- package/package.json +5 -4
- package/schema/dsm-api-contract.json +6 -6
- package/schema/dsm-package.schema.json +11 -1
- package/schema/mobile.v1.schema.json +34 -0
- package/skills/SKILL.md +13 -0
- package/skills/reference/create.md +18 -0
- package/skills/reference/mobile.md +64 -0
- package/skills/reference/upstream-fork.md +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.49.0
|
|
4
|
+
|
|
5
|
+
- Add the `mobile` declaration for native and gateway Apps, with localized registration, generated icons, intake rules and build-consistency checks during inspection
|
|
6
|
+
- Bundle the installed SDK entry runtime and generate entry pages that share the DSM window session, language and privileged adapters
|
|
7
|
+
- Require the matching templates minor so fresh installations use the updated SDK/App scaffolds
|
|
8
|
+
- Resolve frontend SDK tilde ranges through the installed package or matching lockfile, retaining exact backend/frontend version checks
|
|
9
|
+
- Add `synopkgland skill show mobile` with registration, entry-page and mobile-shell guidance
|
|
10
|
+
- Include `lang` and `locale` in generated Go `app.status` responses, using trusted DSM language hints and browser-locale fallback
|
|
11
|
+
|
|
12
|
+
## 0.48.24
|
|
13
|
+
|
|
14
|
+
- Check tracked secret files only inside the App project directory, and warn about untracked local secrets across the repository without clone-safe ignore rules
|
|
15
|
+
- Preserve tracked upstream fixtures, environment templates and public certificates; detect private-key PEM content and binary PKCS#12 instead of rejecting certificate filenames
|
|
16
|
+
- Enforce the project check during builds and CLI release/publish preflight; reject non-template environment files, npm auth tokens and private-key PEM blocks during SPK packing
|
|
17
|
+
- Protect local secrets in generated ignore files and document secret placement for own Apps and upstream forks
|
|
18
|
+
- Allow explicit `allow_secret_files` payload paths with build warnings and check notices; reject patterns and missing files without relaxing repository or metadata checks
|
|
19
|
+
|
|
3
20
|
## 0.48.23
|
|
4
21
|
|
|
5
22
|
- Show paths that bypass DSM sign-in in inspect and check, including upstream-auth paths, permanent and optional passthrough, and public gateway/upstream access; JSON includes the declared paths and nonblocking review notices
|
|
@@ -38,3 +38,5 @@ export declare function windowIconFile(icons: PackageIcons, size: number): strin
|
|
|
38
38
|
export declare function readDsmWindowIcons(uiDir: string): PackageIcons;
|
|
39
39
|
export declare function writeDsmWindowIcons(uiDir: string, icons: PackageIcons): void;
|
|
40
40
|
export declare function writePackageCenterIcons(spkRoot: string, icons: PackageIcons): void;
|
|
41
|
+
/** Reuse the package PNG pipeline for the mobile launcher sizes. */
|
|
42
|
+
export declare function mobileIcons(path: string | undefined): Map<number, Buffer>;
|
|
@@ -188,3 +188,8 @@ export function writePackageCenterIcons(spkRoot, icons) {
|
|
|
188
188
|
writeIcon(join(spkRoot, "PACKAGE_ICON.PNG"), icons.packageIcon);
|
|
189
189
|
writeIcon(join(spkRoot, "PACKAGE_ICON_256.PNG"), icons.packageIcon256);
|
|
190
190
|
}
|
|
191
|
+
/** Reuse the package PNG pipeline for the mobile launcher sizes. */
|
|
192
|
+
export function mobileIcons(path) {
|
|
193
|
+
const image = decodePng(packageIcons(path).packageIcon256);
|
|
194
|
+
return new Map([192, 512].map(size => [size, encodePng(size, size, scale(image, size).rgba)]));
|
|
195
|
+
}
|
|
@@ -5,4 +5,6 @@ export declare function collectArchiveEntries(root: string): string[];
|
|
|
5
5
|
/** Writes `sourceDir` to `outputPath` as a tar whose bytes depend only on the file contents. */
|
|
6
6
|
export declare function createReproducibleTar(sourceDir: string, outputPath: string, options?: {
|
|
7
7
|
gzip?: boolean;
|
|
8
|
+
rejectSecrets?: boolean;
|
|
9
|
+
allowSecretFiles?: string[];
|
|
8
10
|
}): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { readdirSync, statSync } from "node:fs";
|
|
1
|
+
import { lstatSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import * as tar from "tar";
|
|
4
|
+
import { allowedSecretFileWarnings, readAllowedSecretFiles, secretFile } from "../secret-files.js";
|
|
4
5
|
/** Every archive this CLI writes uses the same timestamp so builds are byte-identical. */
|
|
5
6
|
export const FIXED_MTIME = new Date(0);
|
|
6
7
|
/** Relative paths of every file under `root`, depth-first and sorted for a stable archive order. */
|
|
@@ -24,11 +25,35 @@ export function collectArchiveEntries(root) {
|
|
|
24
25
|
}
|
|
25
26
|
/** Writes `sourceDir` to `outputPath` as a tar whose bytes depend only on the file contents. */
|
|
26
27
|
export async function createReproducibleTar(sourceDir, outputPath, options = {}) {
|
|
28
|
+
const entries = collectArchiveEntries(sourceDir);
|
|
29
|
+
if (options.rejectSecrets) {
|
|
30
|
+
const allowed = new Set(readAllowedSecretFiles(options.allowSecretFiles));
|
|
31
|
+
const files = new Set(entries);
|
|
32
|
+
for (const path of allowed) {
|
|
33
|
+
if (!files.has(path) || !lstatSync(join(sourceDir, path)).isFile()) {
|
|
34
|
+
throw Object.assign(new Error(`allow_secret_files entry must match an existing regular payload file exactly: ${JSON.stringify(path)}`), {
|
|
35
|
+
code: "SECRET_FILE_ALLOWLIST_MISSING",
|
|
36
|
+
hint: "Use an exact path relative to package.tgz; generate the file before packing or remove the entry.",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
for (const warning of allowedSecretFileWarnings([...allowed])) {
|
|
41
|
+
console.warn(`[${warning.code}] ${warning.message}\n${warning.suggestion}`);
|
|
42
|
+
}
|
|
43
|
+
for (const path of entries) {
|
|
44
|
+
if (!allowed.has(path) && secretFile(path, () => readFileSync(join(sourceDir, path)))) {
|
|
45
|
+
throw Object.assign(new Error(`Secret file cannot be packed: ${JSON.stringify(path)}`), {
|
|
46
|
+
code: "SECRET_FILE_PACKED",
|
|
47
|
+
hint: "Remove the secret from packaged UI, payload and metadata inputs; provide it at runtime.",
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
27
52
|
await tar.c({
|
|
28
53
|
file: outputPath,
|
|
29
54
|
cwd: sourceDir,
|
|
30
55
|
gzip: options.gzip ?? false,
|
|
31
56
|
portable: true,
|
|
32
57
|
mtime: FIXED_MTIME,
|
|
33
|
-
},
|
|
58
|
+
}, entries);
|
|
34
59
|
}
|
package/dist/ctl/registry.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export declare function registrySessionRetry(registry: OperationRegistry, routes
|
|
|
52
52
|
}[]): {
|
|
53
53
|
[k: string]: {
|
|
54
54
|
effect: "read" | "write" | "destructive";
|
|
55
|
-
kind: "
|
|
55
|
+
kind: "unknown" | "rpc" | "ai" | "stream";
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
export declare function registryArtifacts(root: string, registry: OperationRegistry, check: boolean, routes?: readonly {
|
package/dist/error-registry.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { COMPOSE_ERRORS } from "./standalone/compose-errors.js";
|
|
2
|
+
import { SECRET_FILE_FIX } from "./secret-files.js";
|
|
2
3
|
export const ERROR_REGISTRY = {
|
|
3
4
|
...COMPOSE_ERRORS,
|
|
5
|
+
STANDALONE_MOBILE_INVALID: { code: 'STANDALONE_MOBILE_INVALID', description: 'The mobile declaration or its UI/gateway dependency is invalid', suggestion: 'Check mobile against the manifest schema and read the mobile skill' },
|
|
6
|
+
MOBILE_SDK_ENTRY_MISSING: { code: 'MOBILE_SDK_ENTRY_MISSING', description: 'The installed frontend SDK has no entry export', suggestion: 'Install an SDK with /entry in the UI build directory or project root' },
|
|
7
|
+
MOBILE_INVALID: { code: 'MOBILE_INVALID', description: 'Packaged mobile assets differ from their build declaration', suggestion: 'Rebuild the SPK and inspect it again' },
|
|
8
|
+
SECRET_FILE_TRACKED: { code: "SECRET_FILE_TRACKED", description: "Git tracks a local secret file.", suggestion: SECRET_FILE_FIX },
|
|
9
|
+
SECRET_FILE_UNIGNORED: { code: "SECRET_FILE_UNIGNORED", description: "A local secret file lacks a repository ignore rule.", suggestion: SECRET_FILE_FIX },
|
|
10
|
+
SECRET_FILE_PACKED: { code: "SECRET_FILE_PACKED", description: "An SPK input contains a local secret file.", suggestion: "Remove the secret from packaged UI, payload and metadata inputs; provide it at runtime." },
|
|
11
|
+
SECRET_FILE_ALLOWLIST_INVALID: { code: "SECRET_FILE_ALLOWLIST_INVALID", description: "allow_secret_files is not a list of unique exact payload paths.", suggestion: "Use payload-relative file paths without globs, absolute paths, dot segments or duplicates." },
|
|
12
|
+
SECRET_FILE_ALLOWLIST_MISSING: { code: "SECRET_FILE_ALLOWLIST_MISSING", description: "An allowed secret path does not match a regular payload file.", suggestion: "Generate the file before packing or remove the entry from allow_secret_files; directories are not allowed." },
|
|
13
|
+
SECRET_FILE_ALLOWED: { code: "SECRET_FILE_ALLOWED", description: "A payload file is explicitly exempted from the SPK secret guard.", suggestion: "Do not use this for credentials; prefer generating keys at install/runtime. Tracked secrets still fail repository checks." },
|
|
14
|
+
SECRET_FILES_CHECK_FAILED: { code: "SECRET_FILES_CHECK_FAILED", description: "The repository secret-file check could not finish.", suggestion: "Restore Git repository and file access and retry." },
|
|
4
15
|
HOST_CERT_CHANGED: { "code": "HOST_CERT_CHANGED", "description": "Strict TLS: the NAS certificate differs from the recorded SHA-256", "suggestion": "Verify old/new fingerprints, then run synopkgland host trust <name>" },
|
|
5
16
|
HOST_TLS_UNTRUSTED: { "code": "HOST_TLS_UNTRUSTED", "description": "Strict TLS: the NAS certificate failed CA, hostname or validity verification", "suggestion": "Check the CA file, NAS hostname and certificate validity, or omit strict TLS" },
|
|
6
17
|
HOST_DNS_FAILED: { "code": "HOST_DNS_FAILED", "description": "The NAS hostname could not be resolved", "suggestion": "Check the registered hostname and DNS" },
|
package/dist/init.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { validateForkRecipe, writeForkScaffold } from "./init-upstream.js";
|
|
2
|
+
import { ENV_TEMPLATE_NAMES } from "./secret-files.js";
|
|
2
3
|
import { goChildEnv } from "./runtime/go-env.js";
|
|
3
4
|
import { spawnSync } from "node:child_process";
|
|
4
5
|
import { parse, parseDocument } from "yaml";
|
|
@@ -246,6 +247,27 @@ export function initFromTemplate(template, targetDir, options = {}) {
|
|
|
246
247
|
}
|
|
247
248
|
for (const file of capability.removed)
|
|
248
249
|
rmSync(join(targetDir, file));
|
|
250
|
+
// Older templates omit the entry language hints. Empty hints deliberately
|
|
251
|
+
// select the SDK's browser-locale fallback until the App reads DSM preferences.
|
|
252
|
+
if (template === 'native-go') {
|
|
253
|
+
const routes = join(targetDir, 'backend/internal/app/routes.go');
|
|
254
|
+
if (existsSync(routes)) {
|
|
255
|
+
const source = readFileSync(routes, 'utf8');
|
|
256
|
+
if (!source.includes('"locale"') && source.includes('"admin": caller.Admin(),'))
|
|
257
|
+
writeFileSync(routes, source.replace('"admin": caller.Admin(),', '"admin": caller.Admin(),\n\t\t"lang": "",\n\t\t"locale": "",'));
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
const bridgeStatus = {
|
|
261
|
+
'native-python': { file: 'backend/app/routes.py', from: '"admin": ctx.admin,', to: '"admin": ctx.admin,\n "lang": "",\n "locale": ctx.locale,' },
|
|
262
|
+
'native-node': { file: 'backend/src/routes.ts', from: 'admin: ctx.admin,', to: 'admin: ctx.admin,\n lang: \'\',\n locale: ctx.locale,' },
|
|
263
|
+
'native-rust': { file: 'backend/src/routes.rs', from: '"admin": ctx.admin,', to: '"admin": ctx.admin,\n "lang": "",\n "locale": ctx.locale,' },
|
|
264
|
+
}[template];
|
|
265
|
+
if (bridgeStatus) {
|
|
266
|
+
const path = join(targetDir, bridgeStatus.file);
|
|
267
|
+
const source = readFileSync(path, 'utf8');
|
|
268
|
+
if (!source.includes('locale'))
|
|
269
|
+
writeFileSync(path, source.replace(bridgeStatus.from, bridgeStatus.to));
|
|
270
|
+
}
|
|
249
271
|
if (isNativeTemplate(template)) {
|
|
250
272
|
const path = join(targetDir, PERMISSIONS_FILE[template]);
|
|
251
273
|
const policy = JSON.parse(readFileSync(path, "utf8"));
|
|
@@ -276,6 +298,11 @@ export function initFromTemplate(template, targetDir, options = {}) {
|
|
|
276
298
|
renameSync(join(targetDir, from), join(targetDir, to));
|
|
277
299
|
}
|
|
278
300
|
}
|
|
301
|
+
const ignoreFile = join(targetDir, ".gitignore");
|
|
302
|
+
const ignore = existsSync(ignoreFile) ? readFileSync(ignoreFile, "utf8") : "";
|
|
303
|
+
// Applies inside synology/ for a fork; never change upstream ignore files.
|
|
304
|
+
const secretRules = [".env", ".env.*", ...ENV_TEMPLATE_NAMES.map(name => `!${name}`)];
|
|
305
|
+
writeFileSync(ignoreFile, `${ignore.trimEnd()}\n\n# Local secrets\n${secretRules.join("\n")}\n`);
|
|
279
306
|
for (const file of files.map(targetName))
|
|
280
307
|
substitute(join(targetDir, file), substitutions);
|
|
281
308
|
if (localSdk && isNativeTemplate(template))
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ValidationError } from "./types.js";
|
|
2
|
+
export declare const SECRET_FILE_FIX = "Move it under synology/ (forks) or add it to the repo .gitignore; remove tracked secrets from the index and rotate exposed credentials.";
|
|
3
|
+
export declare const ENV_TEMPLATE_NAMES: string[];
|
|
4
|
+
/** Exact, canonical POSIX payload paths only; never interpret patterns. */
|
|
5
|
+
export declare function readAllowedSecretFiles(value: unknown): string[] | undefined;
|
|
6
|
+
export declare function allowedSecretFileWarnings(paths?: string[]): ValidationError[];
|
|
7
|
+
/** Environment templates are allowed by name; other environment files are local. */
|
|
8
|
+
export declare function secretFileName(path: string): boolean;
|
|
9
|
+
/** Payload checks inspect content regardless of filename, including extensionless keys. */
|
|
10
|
+
export declare function secretFile(path: string, read: () => string | Buffer): boolean;
|
|
11
|
+
/** Recognize a DER PKCS#12 PFX envelope, rather than treating every binary as a key. */
|
|
12
|
+
export declare function binaryPkcs12(content: Buffer): boolean;
|
|
13
|
+
/** Tracked errors belong to the App directory; local untracked warnings span the repo. */
|
|
14
|
+
export declare function repositorySecretFiles(cwd: string): ValidationError[];
|
|
15
|
+
/** Build/release entry points must refuse tracked secrets, even without `check`. */
|
|
16
|
+
export declare function enforceRepositorySecrets(cwd: string, warn?: {
|
|
17
|
+
(...data: any[]): void;
|
|
18
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
19
|
+
}): void;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
3
|
+
import { basename, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
4
|
+
export const SECRET_FILE_FIX = "Move it under synology/ (forks) or add it to the repo .gitignore; remove tracked secrets from the index and rotate exposed credentials.";
|
|
5
|
+
export const ENV_TEMPLATE_NAMES = [
|
|
6
|
+
".env.example", ".env.sample", ".env.template", ".env.dist", ".env.defaults",
|
|
7
|
+
];
|
|
8
|
+
/** Exact, canonical POSIX payload paths only; never interpret patterns. */
|
|
9
|
+
export function readAllowedSecretFiles(value) {
|
|
10
|
+
if (value === undefined)
|
|
11
|
+
return undefined;
|
|
12
|
+
if (!Array.isArray(value) || value.some(path => typeof path !== "string" ||
|
|
13
|
+
/[\\*?\[\]{}:\x00-\x1f\x7f]/.test(path) ||
|
|
14
|
+
path.split("/").some(part => part === "" || part === "." || part === "..")) || new Set(value).size !== value.length) {
|
|
15
|
+
throw Object.assign(new Error("allow_secret_files must be a list of unique, exact payload-relative file paths; no globs, directories, absolute paths or dot segments."), { code: "SECRET_FILE_ALLOWLIST_INVALID" });
|
|
16
|
+
}
|
|
17
|
+
return [...value];
|
|
18
|
+
}
|
|
19
|
+
export function allowedSecretFileWarnings(paths = []) {
|
|
20
|
+
return paths.map(path => ({
|
|
21
|
+
code: "SECRET_FILE_ALLOWED",
|
|
22
|
+
severity: "warning",
|
|
23
|
+
span: { file: "dsm-package.yaml", line: 1, column: 1 },
|
|
24
|
+
message: `SPK secret guard explicitly allows payload file: ${JSON.stringify(path)}`,
|
|
25
|
+
suggestion: "Do not use this for credentials; prefer generating keys at install/runtime. Tracked secrets still fail repository checks.",
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
/** Environment templates are allowed by name; other environment files are local. */
|
|
29
|
+
export function secretFileName(path) {
|
|
30
|
+
const name = basename(path);
|
|
31
|
+
return (name === ".env" || name.startsWith(".env.")) && !ENV_TEMPLATE_NAMES.includes(name);
|
|
32
|
+
}
|
|
33
|
+
/** Payload checks inspect content regardless of filename, including extensionless keys. */
|
|
34
|
+
export function secretFile(path, read) {
|
|
35
|
+
if (secretFileName(path))
|
|
36
|
+
return true;
|
|
37
|
+
const bytes = read();
|
|
38
|
+
const content = Buffer.isBuffer(bytes) ? bytes.toString("latin1") : bytes;
|
|
39
|
+
return (basename(path) === ".npmrc" && /_authToken/.test(content)) ||
|
|
40
|
+
/-----BEGIN [A-Z ]*PRIVATE KEY-----/.test(content);
|
|
41
|
+
}
|
|
42
|
+
/** Recognize a DER PKCS#12 PFX envelope, rather than treating every binary as a key. */
|
|
43
|
+
export function binaryPkcs12(content) {
|
|
44
|
+
const tlv = (offset) => {
|
|
45
|
+
if (offset + 2 > content.length)
|
|
46
|
+
return;
|
|
47
|
+
const tag = content[offset++];
|
|
48
|
+
let length = content[offset++];
|
|
49
|
+
if (length & 0x80) {
|
|
50
|
+
const count = length & 0x7f;
|
|
51
|
+
if (!count || count > 4 || offset + count > content.length)
|
|
52
|
+
return;
|
|
53
|
+
length = 0;
|
|
54
|
+
for (let i = 0; i < count; i++)
|
|
55
|
+
length = length * 256 + content[offset++];
|
|
56
|
+
}
|
|
57
|
+
const end = offset + length;
|
|
58
|
+
if (end > content.length)
|
|
59
|
+
return;
|
|
60
|
+
return { tag, start: offset, end };
|
|
61
|
+
};
|
|
62
|
+
const pfx = tlv(0);
|
|
63
|
+
if (!pfx || pfx.tag !== 0x30 || pfx.end !== content.length)
|
|
64
|
+
return false;
|
|
65
|
+
const version = tlv(pfx.start);
|
|
66
|
+
if (!version || version.tag !== 2 || version.end - version.start !== 1 || content[version.start] !== 3)
|
|
67
|
+
return false;
|
|
68
|
+
const authSafe = tlv(version.end);
|
|
69
|
+
if (!authSafe || authSafe.tag !== 0x30 || authSafe.end > pfx.end)
|
|
70
|
+
return false;
|
|
71
|
+
const oid = tlv(authSafe.start);
|
|
72
|
+
if (!oid || oid.tag !== 6 || oid.end > authSafe.end)
|
|
73
|
+
return false;
|
|
74
|
+
// authSafe is PKCS#7 data or signedData (1.2.840.113549.1.7.1 / .2).
|
|
75
|
+
const type = content.subarray(oid.start, oid.end).toString("hex");
|
|
76
|
+
if (type !== "2a864886f70d010701" && type !== "2a864886f70d010702")
|
|
77
|
+
return false;
|
|
78
|
+
const value = tlv(oid.end);
|
|
79
|
+
return Boolean(value && value.tag === 0xa0 && value.end === authSafe.end);
|
|
80
|
+
}
|
|
81
|
+
function problem(code, path, severity) {
|
|
82
|
+
return {
|
|
83
|
+
code, severity, span: { file: path, line: 1, column: 1 },
|
|
84
|
+
message: `${severity === "error" ? "Git tracks a secret file" : "Secret file lacks a repository .gitignore rule"}: ${JSON.stringify(path)}`,
|
|
85
|
+
suggestion: SECRET_FILE_FIX,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** Tracked errors belong to the App directory; local untracked warnings span the repo. */
|
|
89
|
+
export function repositorySecretFiles(cwd) {
|
|
90
|
+
const projectRoot = realpathSync(cwd);
|
|
91
|
+
const gitBytes = (args, input, allowNoMatch = false) => {
|
|
92
|
+
const result = spawnSync("git", args, {
|
|
93
|
+
cwd, input, maxBuffer: 64 * 1024 * 1024,
|
|
94
|
+
env: { ...process.env, LC_ALL: "C" },
|
|
95
|
+
});
|
|
96
|
+
if (result.status !== 0 && !(allowNoMatch && result.status === 1)) {
|
|
97
|
+
throw Object.assign(new Error("Cannot check repository secret files."), {
|
|
98
|
+
code: "SECRET_FILES_CHECK_FAILED",
|
|
99
|
+
hint: "Restore Git repository access and retry.",
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return result.stdout;
|
|
103
|
+
};
|
|
104
|
+
const git = (args, input, allowNoMatch = false) => gitBytes(args, input, allowNoMatch).toString("utf8");
|
|
105
|
+
const location = spawnSync("git", ["rev-parse", "--show-toplevel"], {
|
|
106
|
+
cwd, encoding: "utf8", env: { ...process.env, LC_ALL: "C" },
|
|
107
|
+
});
|
|
108
|
+
if (location.status !== 0) {
|
|
109
|
+
if (location.status === 128 && location.stderr?.includes("not a git repository"))
|
|
110
|
+
return [];
|
|
111
|
+
throw Object.assign(new Error("Cannot check repository secret files."), { code: "SECRET_FILES_CHECK_FAILED" });
|
|
112
|
+
}
|
|
113
|
+
cwd = location.stdout.replace(/\r?\n$/, "");
|
|
114
|
+
const tracked = new Set(git(["ls-files", "--cached", "-z"]).split("\0").filter(Boolean));
|
|
115
|
+
// No exclude-standard: local-only excludes and ignored files must remain visible.
|
|
116
|
+
const files = new Set([...tracked, ...git(["ls-files", "--others", "-z"]).split("\0").filter(Boolean)]);
|
|
117
|
+
const candidates = [...files].sort().filter(path => {
|
|
118
|
+
if (tracked.has(path)) {
|
|
119
|
+
const within = relative(projectRoot, resolve(cwd, path));
|
|
120
|
+
if (isAbsolute(within) || within === ".." || within.startsWith(`..${sep}`))
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
const name = basename(path);
|
|
124
|
+
return secretFileName(path) || name === ".npmrc" ||
|
|
125
|
+
/\.(?:pem|key|p12)$/.test(name) || name.startsWith("id_rsa");
|
|
126
|
+
});
|
|
127
|
+
if (!candidates.length)
|
|
128
|
+
return [];
|
|
129
|
+
// Verbose NUL output identifies the winning rule. Global rules and info/exclude
|
|
130
|
+
// cannot protect a fresh clone; a negated rule is not an ignore rule.
|
|
131
|
+
const ignored = git(["-c", "core.excludesFile=", "check-ignore", "--no-index", "-v", "-z", "--stdin"], candidates.join("\0") + "\0", true).split("\0");
|
|
132
|
+
const protectedFiles = new Set();
|
|
133
|
+
for (let i = 0; i + 3 < ignored.length; i += 4) {
|
|
134
|
+
const [source, , pattern, path] = ignored.slice(i, i + 4);
|
|
135
|
+
if ((source === ".gitignore" || source.endsWith("/.gitignore")) && !pattern.startsWith("!"))
|
|
136
|
+
protectedFiles.add(path);
|
|
137
|
+
}
|
|
138
|
+
return candidates.flatMap(path => {
|
|
139
|
+
if (!tracked.has(path) && protectedFiles.has(path))
|
|
140
|
+
return [];
|
|
141
|
+
const sensitive = (read) => {
|
|
142
|
+
if (secretFileName(path))
|
|
143
|
+
return true;
|
|
144
|
+
const content = read();
|
|
145
|
+
return secretFile(path, () => content) ||
|
|
146
|
+
(/\.(?:pem|key|p12)$/.test(path) && binaryPkcs12(content));
|
|
147
|
+
};
|
|
148
|
+
let found = false;
|
|
149
|
+
try {
|
|
150
|
+
// Inspect both index and working copy: unstaged cleanup cannot hide a staged key.
|
|
151
|
+
if (tracked.has(path))
|
|
152
|
+
found = sensitive(() => gitBytes(["show", `:${path}`]));
|
|
153
|
+
const local = join(cwd, path);
|
|
154
|
+
if (!found && existsSync(local)) {
|
|
155
|
+
found = sensitive(() => readFileSync(local));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
throw Object.assign(new Error(`Cannot check secret file: ${JSON.stringify(path)}`), { code: "SECRET_FILES_CHECK_FAILED" });
|
|
160
|
+
}
|
|
161
|
+
return found ? [problem(tracked.has(path) ? "SECRET_FILE_TRACKED" : "SECRET_FILE_UNIGNORED", path, tracked.has(path) ? "error" : "warning")] : [];
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/** Build/release entry points must refuse tracked secrets, even without `check`. */
|
|
165
|
+
export function enforceRepositorySecrets(cwd, warn = console.warn) {
|
|
166
|
+
const findings = repositorySecretFiles(cwd);
|
|
167
|
+
for (const finding of findings.filter(item => item.severity === "warning")) {
|
|
168
|
+
warn(`[${finding.code}] ${finding.message}\n${finding.suggestion}`);
|
|
169
|
+
}
|
|
170
|
+
const errors = findings.filter(item => item.severity === "error");
|
|
171
|
+
if (errors.length)
|
|
172
|
+
throw Object.assign(new Error(errors.map(item => `[${item.code}] ${item.message}`).join("\n")), { code: "SECRET_FILE_TRACKED", hint: SECRET_FILE_FIX });
|
|
173
|
+
}
|
package/dist/skill.js
CHANGED
|
@@ -32,6 +32,7 @@ const SKILL_CATALOG = [
|
|
|
32
32
|
file: "reference/identity.md",
|
|
33
33
|
when: "Needs a DSM sign-in",
|
|
34
34
|
},
|
|
35
|
+
{ id: "mobile", file: "reference/mobile.md", when: "Register an App for the mobile shell and generate its SDK entry page" },
|
|
35
36
|
{ id: "files", file: "reference/files.md", when: "Needs NAS files" },
|
|
36
37
|
{
|
|
37
38
|
id: "portal",
|
package/dist/standalone/build.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildInstallSettings } from './install-settings.js';
|
|
2
|
+
import { enforceRepositorySecrets } from "../secret-files.js";
|
|
2
3
|
import { buildAppBackup } from './hyper-backup.js';
|
|
3
4
|
import { auditGoRoutes, httpRoutesDigest } from './route-audit.js';
|
|
4
5
|
import { PORTAL_REQUIRES_EXECUTOR } from "../portal/alias.js";
|
|
@@ -102,6 +103,7 @@ export function runnerFor(run, jobs, arch) {
|
|
|
102
103
|
}
|
|
103
104
|
/** `build` for a Standalone Package: build the UI, compile the CGI, pack one SPK per arch. */
|
|
104
105
|
export async function buildStandalone(options) {
|
|
106
|
+
enforceRepositorySecrets(options.root);
|
|
105
107
|
const loaded = loadStandaloneManifest(options.root);
|
|
106
108
|
if (!loaded.ok) {
|
|
107
109
|
const [first] = loaded.errors;
|
|
@@ -404,7 +404,34 @@ ${root ? root.definitions : ""}${manifest.portal ? renderPortalDefinition(ns, po
|
|
|
404
404
|
// registered. Reuse it only when this build loaded it; an older loader records
|
|
405
405
|
// no build, so its app is replaced as well.
|
|
406
406
|
${ns}.loadApp = function (done) {
|
|
407
|
-
var
|
|
407
|
+
${manifest.mobile?.entry === 'app' ? ` var deliver = done;
|
|
408
|
+
done = function (app, error) {
|
|
409
|
+
if (!app || error) { deliver(app, error); return; }
|
|
410
|
+
import(new URL("webman/3rdparty/${pkg}/app/entry-context.js?v=${assetVersion}", document.baseURI).href).then(function (entry) {
|
|
411
|
+
deliver({mount: function (root, ctx) {
|
|
412
|
+
var options = Ext.apply({}, ctx);
|
|
413
|
+
options.packageId = ${p};
|
|
414
|
+
options.build = "${assetVersion}";
|
|
415
|
+
options.session = ${ns}.session;
|
|
416
|
+
options.token = SYNO.SDS.Session && SYNO.SDS.Session.SynoToken;
|
|
417
|
+
options.portalAccess = ctx.portal;
|
|
418
|
+
delete options.portal;
|
|
419
|
+
delete options.uiUpdate;
|
|
420
|
+
var shared = entry.createAppContext(options);
|
|
421
|
+
try {
|
|
422
|
+
var mounted = app.mount(root, shared) || {};
|
|
423
|
+
var wrapped = Ext.apply({}, mounted);
|
|
424
|
+
wrapped.unmount = function () {
|
|
425
|
+
try { if (mounted.unmount) mounted.unmount(); }
|
|
426
|
+
finally { shared.host.dispose(); }
|
|
427
|
+
};
|
|
428
|
+
return wrapped;
|
|
429
|
+
}
|
|
430
|
+
catch (error) { shared.host.dispose(); throw error; }
|
|
431
|
+
}}, null);
|
|
432
|
+
}, function (error) { deliver(null, error); });
|
|
433
|
+
};
|
|
434
|
+
` : ""} var apps = window.DsmPackageApps || {};
|
|
408
435
|
var versions = window.DsmPackageAppVersions = window.DsmPackageAppVersions || {};
|
|
409
436
|
if (apps[${p}] && versions[${p}] === "${assetVersion}") {
|
|
410
437
|
done(apps[${p}]);
|
|
@@ -418,7 +445,7 @@ ${moduleVersion ? ` var loads = window.DsmPackageAppLoads = window.DsmPackageAp
|
|
|
418
445
|
css.rel = "stylesheet";
|
|
419
446
|
css.href = base + "app.css?v=${assetVersion}";
|
|
420
447
|
document.head.appendChild(css);
|
|
421
|
-
${moduleVersion ? ` loads[key] = import(new URL(base + "app.module.js", document.baseURI).href).then(function (app) {
|
|
448
|
+
${moduleVersion ? ` loads[key] = import(new URL(base + "app.module.js${manifest.mobile ? `?v=${assetVersion}` : ""}", document.baseURI).href).then(function (app) {
|
|
422
449
|
if (typeof app.mount !== "function") throw new Error("The UI module must export mount(root, ctx)");
|
|
423
450
|
window.DsmPackageApps = window.DsmPackageApps || {};
|
|
424
451
|
window.DsmPackageApps[${p}] = app;
|
package/dist/standalone/i18n.js
CHANGED
|
@@ -17,7 +17,7 @@ export const DSM_LANGS = {
|
|
|
17
17
|
es: "spn",
|
|
18
18
|
it: "ita",
|
|
19
19
|
};
|
|
20
|
-
const INFO_TEXT_FIELDS = new Set(["displayname", "description"]);
|
|
20
|
+
const INFO_TEXT_FIELDS = new Set(["displayname", "description", "mobile_name"]);
|
|
21
21
|
export function readInfoTranslations(value, check) {
|
|
22
22
|
if (value === undefined) {
|
|
23
23
|
return {};
|
|
@@ -31,7 +31,7 @@ export function readInfoTranslations(value, check) {
|
|
|
31
31
|
return check.invalid(`"${locale}" is not a supported translation language; English goes in the top-level displayname / description.`);
|
|
32
32
|
}
|
|
33
33
|
if (!isRecord(text) || Object.keys(text).some((key) => !INFO_TEXT_FIELDS.has(key))) {
|
|
34
|
-
return check.invalid(`.${locale} accepts only displayname and
|
|
34
|
+
return check.invalid(`.${locale} accepts only displayname, description and mobile_name.`);
|
|
35
35
|
}
|
|
36
36
|
const entry = {};
|
|
37
37
|
for (const field of INFO_TEXT_FIELDS) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { inspectMobileFiles, mobileRecordProblem } from './mobile.js';
|
|
1
2
|
import { DAEMON_NOFILE_UNSUPPORTED, DAEMON_NOFILE_ACTIVATION_PROBLEM, readNoFile, daemonSystemUnitName, renderDaemonSystemUnit, daemonNoFileSdkProblem, daemonNoFileIdentityProblem, DAEMON_NOFILE_MIN_DSM } from "./daemon-nofile.js";
|
|
2
3
|
import { gatewayIngressPathProblem, gatewayIngressOwnershipSupported } from './gateway-ingress.js';
|
|
3
4
|
import { renderGatewayIngressCheck } from './native-gateway.js';
|
|
@@ -166,7 +167,7 @@ export async function inspectSpk(spkPath, expectedKind) {
|
|
|
166
167
|
if (metadata.daemon_nofile !== undefined && (!paths.has("daemon/control") || metadata.compose !== undefined))
|
|
167
168
|
findings.push("daemon.nofile requires a native daemon controller");
|
|
168
169
|
const daemonRestart = recoverDaemonRestart(metadata.daemon_restart, metadata.daemon_restart === undefined && daemonNoFile !== undefined ? undefined : metadata.daemon_sdk, findings);
|
|
169
|
-
await inspectModuleUi(dir, paths, metadata.ui_module, findings);
|
|
170
|
+
await inspectModuleUi(dir, paths, metadata.ui_module, findings, metadata.mobile);
|
|
170
171
|
if (metadata.daemon_restart !== undefined && (metadata.compose !== undefined || !paths.has("daemon/control")))
|
|
171
172
|
findings.push("DAEMON_RESTART_INVALID daemon restart requires a native daemon controller, without Compose supervision");
|
|
172
173
|
const { identityGateway, gateway } = await inspectGatewayAdmission(dir, paths, metadata.provider_only_oidc, findings);
|
|
@@ -218,6 +219,7 @@ export async function inspectSpk(spkPath, expectedKind) {
|
|
|
218
219
|
: await recoverCompose(dir, metadata.compose, findings);
|
|
219
220
|
const daemonNode = recoverDaemonNode(metadata.daemon_node, findings);
|
|
220
221
|
const info = readInfo(join(dir, "INFO"), findings, kind, Boolean(combined), daemonNode, dependencies);
|
|
222
|
+
await inspectMobile(dir, paths, metadata.mobile, info, findings);
|
|
221
223
|
if (combined &&
|
|
222
224
|
(!info.os_min_ver || !isDsmAtLeast(info.os_min_ver, CONTAINER_MIN_DSM)))
|
|
223
225
|
findings.push("compose identity_gateway requires DSM >= 7.2.1");
|
|
@@ -402,7 +404,7 @@ export async function inspectSpk(spkPath, expectedKind) {
|
|
|
402
404
|
rmSync(dir, { recursive: true, force: true });
|
|
403
405
|
}
|
|
404
406
|
}
|
|
405
|
-
async function inspectModuleUi(dir, paths, version, findings) {
|
|
407
|
+
async function inspectModuleUi(dir, paths, version, findings, mobile) {
|
|
406
408
|
if (version === undefined) {
|
|
407
409
|
if ([...paths].some(path => /^ui\/app\/[a-f0-9]{64}\/app\.module\.js$/.test(path)))
|
|
408
410
|
findings.push("UI_MODULE_INVALID module UI requires its build record");
|
|
@@ -415,7 +417,7 @@ async function inspectModuleUi(dir, paths, version, findings) {
|
|
|
415
417
|
for (const entry of [MODULE_UI_ENTRY, "app.css"])
|
|
416
418
|
if (!paths.has(prefix + entry))
|
|
417
419
|
throw new Error(`missing ${entry}`);
|
|
418
|
-
if ([...paths].some(path => path.startsWith("ui/app/") && path !== `ui/app/${version}` && !path.startsWith(prefix)))
|
|
420
|
+
if ([...paths].some(path => path.startsWith("ui/app/") && path !== `ui/app/${version}` && !path.startsWith(prefix) && !(mobile && !mobileRecordProblem(mobile) && Object.hasOwn(mobile.files, path.slice("ui/app/".length)))))
|
|
419
421
|
throw new Error("module UI assets must all belong to the recorded tree");
|
|
420
422
|
const root = join(dir, "module-ui-inspection");
|
|
421
423
|
mkdirSync(root);
|
|
@@ -1824,3 +1826,28 @@ function matchesGatewayConfig(actual, manifest) {
|
|
|
1824
1826
|
delete expected[key];
|
|
1825
1827
|
return actual === JSON.stringify(expected) + '\n';
|
|
1826
1828
|
}
|
|
1829
|
+
async function inspectMobile(dir, paths, record, info, findings) {
|
|
1830
|
+
const MOBILE_INVALID = 'MOBILE_INVALID';
|
|
1831
|
+
const hasRegistration = paths.has('ui/app/mobile.json');
|
|
1832
|
+
if (!record) {
|
|
1833
|
+
if (hasRegistration)
|
|
1834
|
+
findings.push(`${MOBILE_INVALID} mobile.json has no build declaration`);
|
|
1835
|
+
return;
|
|
1836
|
+
}
|
|
1837
|
+
try {
|
|
1838
|
+
const invalid = mobileRecordProblem(record);
|
|
1839
|
+
if (invalid)
|
|
1840
|
+
throw new Error(invalid);
|
|
1841
|
+
if (record.package !== info.package || record.version !== info.version)
|
|
1842
|
+
throw new Error('registration package or version differs from INFO');
|
|
1843
|
+
const target = join(dir, 'mobile-inspection');
|
|
1844
|
+
mkdirSync(target);
|
|
1845
|
+
await tar.x({ file: join(dir, 'package.tgz'), cwd: target, filter: path => path.replace(/^\.\//, '').startsWith('ui/app/') });
|
|
1846
|
+
const problem = inspectMobileFiles(join(target, 'ui/app'), record);
|
|
1847
|
+
if (problem)
|
|
1848
|
+
throw new Error(problem);
|
|
1849
|
+
}
|
|
1850
|
+
catch (error) {
|
|
1851
|
+
findings.push(`${MOBILE_INVALID} ${error.message}`);
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type MobileDeclaration } from './mobile.js';
|
|
1
2
|
import { type PackageDependencies } from "./package-dependencies.js";
|
|
2
3
|
import { type InstallSettings } from './install-settings.js';
|
|
3
4
|
import { type WebLaunchMode } from "../contract/web-launch.js";
|
|
@@ -45,6 +46,8 @@ export interface StandaloneI18n {
|
|
|
45
46
|
info: InfoTranslations;
|
|
46
47
|
}
|
|
47
48
|
export interface StandaloneManifest {
|
|
49
|
+
/** Exact payload paths exempted from the SPK secret guard, never repository checks. */
|
|
50
|
+
allowSecretFiles?: string[];
|
|
48
51
|
ctl?: {
|
|
49
52
|
enabled: boolean;
|
|
50
53
|
registry?: string;
|
|
@@ -118,6 +121,7 @@ export interface StandaloneManifest {
|
|
|
118
121
|
integrations?: string[];
|
|
119
122
|
/** `portal`: registers the DSM Application Portal entry; an administrator activates it. */
|
|
120
123
|
portal?: PortalDeclaration;
|
|
124
|
+
mobile?: MobileDeclaration;
|
|
121
125
|
/**
|
|
122
126
|
* `ui: false`: a native identity_gateway App with no SDK window. Its one
|
|
123
127
|
* main-menu icon and Package Center's Open both go to the gateway's web UI,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { readMobile, mobileIconPath } from './mobile.js';
|
|
1
2
|
import { daemonNoFileSdkProblem, daemonNoFileIdentityProblem, DAEMON_NOFILE_MIN_DSM, DAEMON_NOFILE_UNSUPPORTED, DAEMON_NOFILE_ACTIVATION_PROBLEM } from './daemon-nofile.js';
|
|
3
|
+
import { readAllowedSecretFiles } from "../secret-files.js";
|
|
2
4
|
import { readRegistry, registryFile } from '../ctl/registry.js';
|
|
3
5
|
import { gatewayIngressPathProblem, gatewayIngressOwnershipSupported } from './gateway-ingress.js';
|
|
4
6
|
import { nativeGatewaySdk } from "./native-gateway.js";
|
|
@@ -46,6 +48,7 @@ import { BRIDGE_RUNTIMES, isBridgeBackend, overlaps, readBridgeBackend, } from "
|
|
|
46
48
|
*/
|
|
47
49
|
export const STANDALONE_MANIFEST = "dsm-package.yaml";
|
|
48
50
|
export const KNOWN_FIELDS = new Set([
|
|
51
|
+
"allow_secret_files",
|
|
49
52
|
"ctl",
|
|
50
53
|
"schema",
|
|
51
54
|
"package",
|
|
@@ -71,6 +74,7 @@ export const KNOWN_FIELDS = new Set([
|
|
|
71
74
|
"entry",
|
|
72
75
|
"integrations",
|
|
73
76
|
"portal",
|
|
77
|
+
"mobile",
|
|
74
78
|
"console",
|
|
75
79
|
"icon",
|
|
76
80
|
"reproducible",
|
|
@@ -154,6 +158,13 @@ export function loadStandaloneManifest(root) {
|
|
|
154
158
|
: { ok: false, errors: c.errors };
|
|
155
159
|
}
|
|
156
160
|
function readManifest(raw, c) {
|
|
161
|
+
let allowSecretFiles;
|
|
162
|
+
try {
|
|
163
|
+
allowSecretFiles = readAllowedSecretFiles(raw.allow_secret_files);
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
c.fail("SECRET_FILE_ALLOWLIST_INVALID", error.message);
|
|
167
|
+
}
|
|
157
168
|
for (const key of Object.keys(raw)) {
|
|
158
169
|
if (!KNOWN_FIELDS.has(key)) {
|
|
159
170
|
c.fail("STANDALONE_FIELD_UNKNOWN", `Unsupported field "${key}". A Standalone Package does not accept DSM conf; put lifecycle scripts in dsm-scripts/<DSM script name>.`);
|
|
@@ -489,6 +500,21 @@ function readManifest(raw, c) {
|
|
|
489
500
|
}
|
|
490
501
|
const i18n = raw.i18n === undefined ? undefined : readI18n(raw.i18n, c);
|
|
491
502
|
const icon = raw.icon === undefined ? undefined : readIcon(raw.icon, c);
|
|
503
|
+
let mobile;
|
|
504
|
+
if (raw.mobile !== undefined) {
|
|
505
|
+
try {
|
|
506
|
+
mobile = readMobile(raw.mobile);
|
|
507
|
+
if (mobile.entry === 'app' && (!ui || noWindow || raw.compose !== undefined))
|
|
508
|
+
c.fail('STANDALONE_MOBILE_INVALID', 'mobile.entry: app needs a UI');
|
|
509
|
+
if (mobile.entry === 'gateway' && !identityGateway)
|
|
510
|
+
c.fail('STANDALONE_MOBILE_INVALID', 'mobile.entry: gateway needs identity_gateway');
|
|
511
|
+
if (mobile.icon)
|
|
512
|
+
renderPackageIcons(mobileIconPath(c.root, mobile.icon));
|
|
513
|
+
}
|
|
514
|
+
catch (error) {
|
|
515
|
+
c.fail('STANDALONE_MOBILE_INVALID', error.message);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
492
518
|
if (capabilities.webapi && backend) {
|
|
493
519
|
const sdk = sdkVersionOrUndefined(backend);
|
|
494
520
|
if (!sdk ||
|
|
@@ -582,6 +608,7 @@ function readManifest(raw, c) {
|
|
|
582
608
|
}
|
|
583
609
|
return {
|
|
584
610
|
...(raw.ctl ? { ctl: raw.ctl } : {}),
|
|
611
|
+
...(allowSecretFiles ? { allowSecretFiles } : {}),
|
|
585
612
|
root: c.root,
|
|
586
613
|
package: packageId,
|
|
587
614
|
version,
|
|
@@ -621,6 +648,7 @@ function readManifest(raw, c) {
|
|
|
621
648
|
...(entry ? { entry } : {}),
|
|
622
649
|
...(integrations?.length ? { integrations } : {}),
|
|
623
650
|
...(portal ? { portal } : {}),
|
|
651
|
+
...(mobile ? { mobile } : {}),
|
|
624
652
|
...(dsmConsole ? { console: dsmConsole } : {}),
|
|
625
653
|
...(noWindow ? { sdkWindow: false } : {}),
|
|
626
654
|
...(icon ? { icon } : {}),
|