@pylair/cli 0.1.0-rc.3 → 0.1.0-rc.31
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/README.md +3 -2
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +7 -0
- package/dist/bin.js.map +1 -0
- package/dist/build/artifacts.d.ts +14 -0
- package/dist/build/artifacts.d.ts.map +1 -0
- package/dist/build/artifacts.js +61 -0
- package/dist/build/artifacts.js.map +1 -0
- package/dist/build/bytecode.d.ts +29 -0
- package/dist/build/bytecode.d.ts.map +1 -0
- package/dist/build/bytecode.js +65 -0
- package/dist/build/bytecode.js.map +1 -0
- package/dist/build/download.d.ts +53 -0
- package/dist/build/download.d.ts.map +1 -0
- package/dist/build/download.js +327 -0
- package/dist/build/download.js.map +1 -0
- package/dist/build/notices.d.ts +10 -0
- package/dist/build/notices.d.ts.map +1 -0
- package/dist/build/notices.js +109 -0
- package/dist/build/notices.js.map +1 -0
- package/dist/build/pbs.d.ts +12 -0
- package/dist/build/pbs.d.ts.map +1 -0
- package/dist/build/pbs.js +36 -0
- package/dist/build/pbs.js.map +1 -0
- package/dist/build/python.d.ts +24 -0
- package/dist/build/python.d.ts.map +1 -0
- package/dist/build/python.js +106 -0
- package/dist/build/python.js.map +1 -0
- package/dist/build/sign.d.ts +18 -0
- package/dist/build/sign.d.ts.map +1 -0
- package/dist/build/sign.js +182 -0
- package/dist/build/sign.js.map +1 -0
- package/dist/build/source.d.ts +19 -0
- package/dist/build/source.d.ts.map +1 -0
- package/dist/build/source.js +91 -0
- package/dist/build/source.js.map +1 -0
- package/dist/build/util.d.ts +20 -0
- package/dist/build/util.d.ts.map +1 -0
- package/dist/build/util.js +62 -0
- package/dist/build/util.js.map +1 -0
- package/dist/build.d.ts +26 -12
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +240 -270
- package/dist/build.js.map +1 -1
- package/dist/capabilities.d.ts +51 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +232 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/cli.d.ts +38 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +266 -39
- package/dist/cli.js.map +1 -1
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +12 -1
- package/dist/codegen.js.map +1 -1
- package/dist/config.d.ts +25 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +31 -12
- package/dist/config.js.map +1 -1
- package/dist/dev.d.ts +7 -3
- package/dist/dev.d.ts.map +1 -1
- package/dist/dev.js +120 -16
- package/dist/dev.js.map +1 -1
- package/dist/doctor.d.ts +34 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +268 -19
- package/dist/doctor.js.map +1 -1
- package/dist/keys.d.ts +50 -0
- package/dist/keys.d.ts.map +1 -0
- package/dist/keys.js +192 -0
- package/dist/keys.js.map +1 -0
- package/dist/prune.d.ts.map +1 -1
- package/dist/prune.js +1 -0
- package/dist/prune.js.map +1 -1
- package/dist/ui/caps.d.ts +45 -0
- package/dist/ui/caps.d.ts.map +1 -0
- package/dist/ui/caps.js +81 -0
- package/dist/ui/caps.js.map +1 -0
- package/dist/ui/index.d.ts +106 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +264 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/prompts.d.ts +39 -0
- package/dist/ui/prompts.d.ts.map +1 -0
- package/dist/ui/prompts.js +209 -0
- package/dist/ui/prompts.js.map +1 -0
- package/dist/ui/style.d.ts +27 -0
- package/dist/ui/style.d.ts.map +1 -0
- package/dist/ui/style.js +71 -0
- package/dist/ui/style.js.map +1 -0
- package/dist/update.d.ts +64 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/update.js +266 -0
- package/dist/update.js.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +15 -0
- package/dist/version.js.map +1 -0
- package/dist/wrap.d.ts +69 -0
- package/dist/wrap.d.ts.map +1 -0
- package/dist/wrap.js +292 -0
- package/dist/wrap.js.map +1 -0
- package/dist/wrapbuild.d.ts +33 -0
- package/dist/wrapbuild.d.ts.map +1 -0
- package/dist/wrapbuild.js +83 -0
- package/dist/wrapbuild.js.map +1 -0
- package/dist/wrapconfig.d.ts +52 -0
- package/dist/wrapconfig.d.ts.map +1 -0
- package/dist/wrapconfig.js +117 -0
- package/dist/wrapconfig.js.map +1 -0
- package/package.json +4 -3
package/dist/doctor.js
CHANGED
|
@@ -1,52 +1,291 @@
|
|
|
1
|
-
/** `pylair doctor
|
|
1
|
+
/** `pylair doctor`: diagnose the dev/build environment. */
|
|
2
2
|
import { spawnSync } from "node:child_process";
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
4
|
-
import { join } from "node:path";
|
|
3
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
4
|
+
import { isAbsolute, join, relative } from "node:path";
|
|
5
5
|
import { platform, arch } from "node:os";
|
|
6
|
+
import { checkCapabilities, formatFinding, loadCapabilities } from "./capabilities.js";
|
|
6
7
|
import { loadConfig, loadTauriConfig } from "./config.js";
|
|
7
8
|
import { venvPython } from "./dev.js";
|
|
8
9
|
import { hostTriple } from "./build.js";
|
|
10
|
+
import { ui } from "./ui/index.js";
|
|
11
|
+
import { wrapWarnings } from "./wrapconfig.js";
|
|
12
|
+
import { STAGED_APP, runSmokeImports, smokeImports } from "./wrapbuild.js";
|
|
9
13
|
function probe(cmd, args) {
|
|
10
14
|
const r = spawnSync(cmd, args, { encoding: "utf-8" });
|
|
11
15
|
return r.status === 0 ? (r.stdout || r.stderr).trim() : null;
|
|
12
16
|
}
|
|
17
|
+
/** Numeric major.minor comparison — a string compare would pass "3.9"
|
|
18
|
+
* for a "3.12" floor. Anything unparseable is false. */
|
|
19
|
+
export function meetsMinPython(version, min) {
|
|
20
|
+
const v = /^(\d+)\.(\d+)/.exec(version.trim());
|
|
21
|
+
const m = /^(\d+)\.(\d+)/.exec(min.trim());
|
|
22
|
+
if (!v || !m)
|
|
23
|
+
return false;
|
|
24
|
+
const [maj, mi] = [Number(v[1]), Number(v[2])];
|
|
25
|
+
const [fmaj, fmi] = [Number(m[1]), Number(m[2])];
|
|
26
|
+
return maj > fmaj || (maj === fmaj && mi >= fmi);
|
|
27
|
+
}
|
|
28
|
+
const MSVC_FIX = 'install "Desktop development with C++" via Visual Studio Installer, or repair it if an update is pending';
|
|
29
|
+
/** The C/C++ toolchain `pylair build` needs on this OS, past cargo itself:
|
|
30
|
+
* MSVC build tools on Windows (OK only when vswhere at the standard
|
|
31
|
+
* Installer path reports an instance with the VC tools component: rustc
|
|
32
|
+
* locates MSVC via the setup instance registry vswhere reads, so files on
|
|
33
|
+
* disk without a registered instance do not link; those get a repair hint),
|
|
34
|
+
* Xcode Command Line Tools on macOS, a C compiler and the webkit2gtk-4.1 dev
|
|
35
|
+
* files Tauri links against on Linux. */
|
|
36
|
+
export function nativeToolchain(e) {
|
|
37
|
+
if (e.platform === "win32") {
|
|
38
|
+
const pf86 = e.env["ProgramFiles(x86)"] ?? "C:\\Program Files (x86)";
|
|
39
|
+
const pf = e.env.ProgramFiles ?? "C:\\Program Files";
|
|
40
|
+
const vswhere = join(pf86, "Microsoft Visual Studio", "Installer", "vswhere.exe");
|
|
41
|
+
if (e.exists(vswhere)) {
|
|
42
|
+
const found = e.run(vswhere, [
|
|
43
|
+
"-utf8",
|
|
44
|
+
"-latest",
|
|
45
|
+
"-products",
|
|
46
|
+
"*",
|
|
47
|
+
"-requires",
|
|
48
|
+
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
|
|
49
|
+
"-property",
|
|
50
|
+
"installationPath",
|
|
51
|
+
]);
|
|
52
|
+
const dir = found?.split(/\r?\n/).find((l) => l.trim());
|
|
53
|
+
if (dir)
|
|
54
|
+
return { ok: true, detail: `MSVC build tools at ${dir}` };
|
|
55
|
+
}
|
|
56
|
+
// A link.exe on disk that vswhere does not see is a broken or
|
|
57
|
+
// half-registered install: rustc will not find it either.
|
|
58
|
+
for (const root of [join(pf, "Microsoft Visual Studio", "2022"), join(pf86, "Microsoft Visual Studio", "2019"), join(pf86, "Microsoft Visual Studio", "2017")]) {
|
|
59
|
+
for (const ed of ["Enterprise", "Professional", "Community", "BuildTools", "Preview"]) {
|
|
60
|
+
const msvc = join(root, ed, "VC", "Tools", "MSVC");
|
|
61
|
+
if (e.list(msvc).some((v) => e.exists(join(msvc, v, "bin", "Hostx64", "x64", "link.exe"))))
|
|
62
|
+
return {
|
|
63
|
+
ok: false,
|
|
64
|
+
detail: `MSVC tools found at ${join(root, ed)} but Visual Studio does not list the install`,
|
|
65
|
+
fix: "repair it from Visual Studio Installer (More > Repair)",
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
ok: false,
|
|
71
|
+
detail: "no MSVC C++ build tools found (link.exe missing)",
|
|
72
|
+
fix: MSVC_FIX,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (e.platform === "darwin") {
|
|
76
|
+
const p = e.run("xcode-select", ["-p"]);
|
|
77
|
+
return p
|
|
78
|
+
? { ok: true, detail: `Xcode command line tools at ${p}` }
|
|
79
|
+
: { ok: false, detail: "Xcode command line tools not found", fix: "run `xcode-select --install`" };
|
|
80
|
+
}
|
|
81
|
+
if (e.platform !== "linux")
|
|
82
|
+
return { ok: true, detail: `${e.platform}: no toolchain requirements known` };
|
|
83
|
+
const cc = e.run("cc", ["--version"]) ?? e.run("gcc", ["--version"]) ?? e.run("clang", ["--version"]);
|
|
84
|
+
const hasPkgConfig = e.run("pkg-config", ["--version"]) !== null;
|
|
85
|
+
const gtk = hasPkgConfig && e.run("pkg-config", ["--exists", "webkit2gtk-4.1"]) !== null;
|
|
86
|
+
const missing = [];
|
|
87
|
+
const pkgs = [];
|
|
88
|
+
if (!cc) {
|
|
89
|
+
missing.push("a C compiler (cc/gcc/clang)");
|
|
90
|
+
pkgs.push("build-essential");
|
|
91
|
+
}
|
|
92
|
+
if (!hasPkgConfig) {
|
|
93
|
+
missing.push("pkg-config");
|
|
94
|
+
pkgs.push("pkg-config", "libwebkit2gtk-4.1-dev");
|
|
95
|
+
}
|
|
96
|
+
else if (!gtk) {
|
|
97
|
+
missing.push("webkit2gtk-4.1 dev files");
|
|
98
|
+
pkgs.push("libwebkit2gtk-4.1-dev");
|
|
99
|
+
}
|
|
100
|
+
if (missing.length)
|
|
101
|
+
return { ok: false, detail: `missing: ${missing.join(", ")}`, fix: `sudo apt-get install -y ${pkgs.join(" ")}` };
|
|
102
|
+
const gtkVer = e.run("pkg-config", ["--modversion", "webkit2gtk-4.1"]);
|
|
103
|
+
return { ok: true, detail: `${cc?.split("\n")[0]} + webkit2gtk-4.1 ${gtkVer ?? "found"}` };
|
|
104
|
+
}
|
|
105
|
+
/** Wrap-mode checks. `add` records one line each. Exported for tests. */
|
|
106
|
+
export function wrapChecks(appDir, cfg, add) {
|
|
107
|
+
const w = cfg.wrap;
|
|
108
|
+
add("[tool.pylair] config", true, `mode=wrap framework=${w.framework} source=${cfg.source}`);
|
|
109
|
+
const warns = wrapWarnings(w);
|
|
110
|
+
add("wrap command", warns.length === 0, warns.length ? warns.join("\n ") : w.cmd ? w.cmd.join(" ") : `entry ${w.entry}`, {
|
|
111
|
+
file: "pyproject.toml",
|
|
112
|
+
fix: "edit [tool.pylair.wrap] (see docs/wrap.md)",
|
|
113
|
+
});
|
|
114
|
+
// Dependencies come from a manifest, never from guessing imports.
|
|
115
|
+
const hasLock = existsSync(join(appDir, "uv.lock"));
|
|
116
|
+
const hasReqs = existsSync(join(appDir, cfg.requirements));
|
|
117
|
+
add("dependency manifest", hasLock || hasReqs, hasLock
|
|
118
|
+
? "pyproject.toml + uv.lock"
|
|
119
|
+
: hasReqs
|
|
120
|
+
? `${cfg.requirements} only (no uv.lock): the bundled env can drift from \`pylair dev\`'s; prefer \`uv add\``
|
|
121
|
+
: "none: run `uv init` and `uv add <packages>` (Pylair does not infer dependencies from imports)", { file: "pyproject.toml", fix: "run `uv init`, then `uv add <packages>`" });
|
|
122
|
+
const src = join(appDir, cfg.source);
|
|
123
|
+
add("source dir", existsSync(src), src, {
|
|
124
|
+
file: "pyproject.toml",
|
|
125
|
+
fix: "create the directory, or point [tool.pylair] source at the right one",
|
|
126
|
+
});
|
|
127
|
+
if (w.entry)
|
|
128
|
+
add("entry file", existsSync(join(src, w.entry)), join(src, w.entry), {
|
|
129
|
+
file: "pyproject.toml",
|
|
130
|
+
fix: "set [tool.pylair.wrap] entry to a file under the source dir",
|
|
131
|
+
});
|
|
132
|
+
// The framework must import in the env `pylair dev` uses.
|
|
133
|
+
const mods = smokeImports(w);
|
|
134
|
+
if (mods.length) {
|
|
135
|
+
const py = venvPython(appDir);
|
|
136
|
+
if (!existsSync(py))
|
|
137
|
+
add("framework importable", false, `no venv at ${py}: run \`uv sync\``, { file: py, fix: "run `uv sync`" });
|
|
138
|
+
else {
|
|
139
|
+
const bad = runSmokeImports(py, mods, { PYTHONPATH: src }, appDir);
|
|
140
|
+
add("framework importable", !bad, bad ?? `import ${mods.join(", ")} ok in the project venv`, {
|
|
141
|
+
file: "pyproject.toml",
|
|
142
|
+
fix: "add the framework to your dependencies (`uv add`), then run `uv sync`",
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
add("framework importable", true, "nothing to import for this cmd (not `python -m <module>`)");
|
|
148
|
+
}
|
|
149
|
+
// The window shell the plugin drives, and the no-IPC guarantee for the
|
|
150
|
+
// wrapped page: capabilities must not grant any remote url.
|
|
151
|
+
for (const f of ["ui/index.html", "ui/restarting.html"])
|
|
152
|
+
add(f, existsSync(join(appDir, f)), join(appDir, f), {
|
|
153
|
+
file: join(appDir, f),
|
|
154
|
+
fix: "restore it from the wrap template (`pylair wrap` writes the missing files)",
|
|
155
|
+
});
|
|
156
|
+
try {
|
|
157
|
+
const conf = JSON.parse(readFileSync(join(appDir, "src-tauri", "tauri.conf.json"), "utf-8"));
|
|
158
|
+
const main = (conf.app?.windows ?? []).find((x) => x.label === "main");
|
|
159
|
+
add('window "main" has create: false', main?.create === false, main?.create === false ? "the plugin builds it with the download and new-window hooks" : "set \"create\": false on the main window in tauri.conf.json", { file: "src-tauri/tauri.conf.json", fix: 'set "create": false on the window labelled "main"' });
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
/* tauri.conf.json problems are reported by its own check */
|
|
163
|
+
}
|
|
164
|
+
const capDir = join(appDir, "src-tauri", "capabilities");
|
|
165
|
+
const remote = [];
|
|
166
|
+
if (existsSync(capDir))
|
|
167
|
+
for (const f of readdirSync(capDir).filter((n) => n.endsWith(".json"))) {
|
|
168
|
+
try {
|
|
169
|
+
if (JSON.parse(readFileSync(join(capDir, f), "utf-8")).remote)
|
|
170
|
+
remote.push(f);
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
/* unparseable capability files are tauri's to report */
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
add("wrapped page gets no IPC", remote.length === 0, remote.length ? `capability ${remote.join(", ")} grants a remote url: the wrapped page would get Tauri IPC` : "no capability grants a remote url", {
|
|
177
|
+
file: remote.map((r) => join("src-tauri", "capabilities", r)).join(", "),
|
|
178
|
+
fix: "remove the \"remote\" block from that capability (docs/security.md)",
|
|
179
|
+
});
|
|
180
|
+
// After a build: the bundled interpreter must still import the framework
|
|
181
|
+
// (the post-prune smoke test `pylair build` runs).
|
|
182
|
+
const res = join(appDir, "src-tauri", "resources");
|
|
183
|
+
const bundled = join(res, "python", process.platform === "win32" ? "python.exe" : "bin/python3");
|
|
184
|
+
if (mods.length && existsSync(bundled) && existsSync(join(res, STAGED_APP))) {
|
|
185
|
+
const sep = process.platform === "win32" ? ";" : ":";
|
|
186
|
+
const bad = runSmokeImports(bundled, mods, { PYTHONPATH: `${join(res, STAGED_APP)}${sep}${join(res, "site-packages")}`, PYTHONNOUSERSITE: "1", PYTHONDONTWRITEBYTECODE: "1" }, appDir);
|
|
187
|
+
add("bundled env imports framework", !bad, bad ?? "ok with the bundled interpreter (last build)", {
|
|
188
|
+
file: "pyproject.toml",
|
|
189
|
+
fix: "check [tool.pylair] prune, then run `pylair build` again",
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/** A path as the user would type it: relative to the app when inside it. */
|
|
194
|
+
function shown(appDir, p) {
|
|
195
|
+
return p
|
|
196
|
+
.split(", ")
|
|
197
|
+
.map((x) => {
|
|
198
|
+
if (!isAbsolute(x))
|
|
199
|
+
return x;
|
|
200
|
+
const r = relative(appDir, x);
|
|
201
|
+
return r && !r.startsWith("..") && !isAbsolute(r) ? r : x;
|
|
202
|
+
})
|
|
203
|
+
.join(", ");
|
|
204
|
+
}
|
|
13
205
|
export async function doctor(appDir) {
|
|
14
206
|
const checks = [];
|
|
15
|
-
const add = (name, ok, detail) => checks.push({ name, ok, detail });
|
|
207
|
+
const add = (name, ok, detail, hint) => checks.push({ name, ok, detail, hint });
|
|
16
208
|
const pyVer = probe("python3", ["-c", "import sys;print('%d.%d'%sys.version_info[:2])"]);
|
|
17
209
|
const py = pyVer ? "python3" : "python";
|
|
18
210
|
const pyV = pyVer ?? probe("python", ["-c", "import sys;print('%d.%d'%sys.version_info[:2])"]);
|
|
19
|
-
add("python >= 3.12", !!pyV && pyV
|
|
20
|
-
|
|
211
|
+
add("python >= 3.12", !!pyV && meetsMinPython(pyV, "3.12"), pyV ? `found ${py} ${pyV}` : "not found", { fix: "install Python 3.12 or newer (`uv python install 3.12`)" });
|
|
212
|
+
const uvVer = probe("uv", ["--version"]);
|
|
213
|
+
add("uv", !!uvVer, uvVer ?? "not found", { fix: "install uv: https://docs.astral.sh/uv/" });
|
|
21
214
|
add("node", true, process.version);
|
|
22
|
-
|
|
215
|
+
const cargoVer = probe("cargo", ["--version"]);
|
|
216
|
+
add("rust/cargo", !!cargoVer, cargoVer ?? "not found", { fix: "install Rust: https://rustup.rs" });
|
|
217
|
+
const tc = nativeToolchain({
|
|
218
|
+
platform: platform(),
|
|
219
|
+
run: probe,
|
|
220
|
+
exists: existsSync,
|
|
221
|
+
list: (d) => {
|
|
222
|
+
try {
|
|
223
|
+
return readdirSync(d);
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
return [];
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
env: process.env,
|
|
230
|
+
});
|
|
231
|
+
add("native toolchain", tc.ok, tc.detail, tc.fix ? { fix: tc.fix } : undefined);
|
|
23
232
|
let triple = "unsupported";
|
|
24
233
|
try {
|
|
25
234
|
triple = hostTriple();
|
|
26
235
|
}
|
|
27
236
|
catch { /* stays unsupported */ }
|
|
28
|
-
add("host triple", triple !== "unsupported", `${platform()}/${arch()}
|
|
237
|
+
add("host triple", triple !== "unsupported", `${platform()}/${arch()} (${triple})`, {
|
|
238
|
+
fix: "pylair builds on Windows, macOS and Linux (x64 and arm64) only",
|
|
239
|
+
});
|
|
29
240
|
if (existsSync(join(appDir, "pyproject.toml"))) {
|
|
30
241
|
try {
|
|
31
242
|
const cfg = loadConfig(appDir);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
243
|
+
if (cfg.mode === "wrap") {
|
|
244
|
+
wrapChecks(appDir, cfg, add);
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
add("[tool.pylair] config", true, `app-module=${cfg.appModule} source=${cfg.source}`);
|
|
248
|
+
add("source dir", existsSync(join(appDir, cfg.source)), join(appDir, cfg.source), {
|
|
249
|
+
file: "pyproject.toml",
|
|
250
|
+
fix: "create the directory, or point [tool.pylair] source at the right one",
|
|
251
|
+
});
|
|
252
|
+
add("requirements", existsSync(join(appDir, cfg.requirements)), cfg.requirements, {
|
|
253
|
+
file: "pyproject.toml",
|
|
254
|
+
fix: "create the file, or set [tool.pylair] requirements (uv.lock is used when present)",
|
|
255
|
+
});
|
|
256
|
+
}
|
|
35
257
|
}
|
|
36
258
|
catch (e) {
|
|
37
|
-
add("[tool.pylair] config", false, e.message
|
|
259
|
+
add("[tool.pylair] config", false, e.message, {
|
|
260
|
+
file: "pyproject.toml",
|
|
261
|
+
fix: "fix the [tool.pylair] table (see docs/build.md)",
|
|
262
|
+
});
|
|
38
263
|
}
|
|
39
264
|
try {
|
|
40
265
|
const t = loadTauriConfig(appDir);
|
|
41
266
|
add("tauri.conf.json", true, `${t.productName} (${t.identifier})`);
|
|
42
267
|
}
|
|
43
268
|
catch (e) {
|
|
44
|
-
add("tauri.conf.json", false, e.message
|
|
269
|
+
add("tauri.conf.json", false, e.message, {
|
|
270
|
+
file: "src-tauri/tauri.conf.json",
|
|
271
|
+
fix: "run this inside a pylair app; the file needs productName and identifier",
|
|
272
|
+
});
|
|
45
273
|
}
|
|
46
|
-
add("venv", existsSync(venvPython(appDir)), venvPython(appDir));
|
|
274
|
+
add("venv", existsSync(venvPython(appDir)), venvPython(appDir), { file: venvPython(appDir), fix: "run `uv sync`" });
|
|
275
|
+
// Per-function permission scopes (static; exposed names are not loaded
|
|
276
|
+
// here, so unmatched-pattern warnings are left to `pylair build`).
|
|
277
|
+
const loaded = loadCapabilities(appDir);
|
|
278
|
+
const found = [...loaded.findings, ...checkCapabilities(loaded.capabilities)];
|
|
279
|
+
const bad = found.filter((f) => f.level === "error");
|
|
280
|
+
add("capability scopes", bad.length === 0, found.length === 0
|
|
281
|
+
? `${loaded.capabilities.length} capability file(s) ok`
|
|
282
|
+
: found.map(formatFinding).join("\n "), { file: "src-tauri/capabilities", fix: "fix the listed scopes (docs/security.md)" });
|
|
47
283
|
}
|
|
48
284
|
else {
|
|
49
|
-
add("app dir", false, `${appDir} has no pyproject.toml
|
|
285
|
+
add("app dir", false, `${appDir} has no pyproject.toml`, {
|
|
286
|
+
file: join(appDir, "pyproject.toml"),
|
|
287
|
+
fix: "run this inside a pylair app, or pass --dir <path>",
|
|
288
|
+
});
|
|
50
289
|
}
|
|
51
290
|
// Optional integration: report Ollama when present; absence is a note,
|
|
52
291
|
// not a failure — it's opt-in.
|
|
@@ -61,15 +300,25 @@ export async function doctor(appDir) {
|
|
|
61
300
|
return { ok: true, detail: `${j.models?.length ?? 0} model(s) available` };
|
|
62
301
|
}
|
|
63
302
|
catch {
|
|
64
|
-
return { ok: true, detail: "not running (optional
|
|
303
|
+
return { ok: true, detail: "not running (optional, pylair-ollama)" };
|
|
65
304
|
}
|
|
66
305
|
})();
|
|
67
|
-
checks.push({
|
|
306
|
+
checks.push({
|
|
307
|
+
name: "ollama (optional)",
|
|
308
|
+
ok: ollama.ok,
|
|
309
|
+
detail: ollama.detail,
|
|
310
|
+
hint: { fix: "restart Ollama, or ignore it: it is optional" },
|
|
311
|
+
});
|
|
312
|
+
// Plain output keeps the exact legacy lines (` ok `/`FAIL`, padded name, two
|
|
313
|
+
// spaces, detail): scripts and tests read them. Fancy aligns a symbol, the
|
|
314
|
+
// name and the detail; a failure shows its file and fix underneath in both.
|
|
315
|
+
ui.header("pylair doctor", [["app", appDir]], []);
|
|
68
316
|
const w = Math.max(...checks.map((c) => c.name.length));
|
|
69
317
|
for (const c of checks)
|
|
70
|
-
|
|
318
|
+
ui.check(c.ok, c.name, w, c.detail, c.hint && { fix: c.hint.fix, file: c.hint.file && shown(appDir, c.hint.file) });
|
|
71
319
|
const fails = checks.filter((c) => !c.ok).length;
|
|
72
|
-
|
|
320
|
+
ui.line();
|
|
321
|
+
ui.summary(fails ? "fail" : "ok", fails ? `${fails} problem(s) found` : "all checks passed");
|
|
73
322
|
return fails ? 1 : 0;
|
|
74
323
|
}
|
|
75
324
|
//# sourceMappingURL=doctor.js.map
|
package/dist/doctor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAA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K,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC/E,CAAC;IACJ,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC;IACjD,EAAE,CAAC,IAAI,EAAE,CAAC;IACV,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC;IAC7F,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC"}
|
package/dist/keys.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** `pylair keys init` - wrap `tauri signer generate` (minisign, the update
|
|
2
|
+
* trust anchor of decision 0011 sec. 6): the private key goes to a path the user
|
|
3
|
+
* picks OUTSIDE the project, the pubkey lands in tauri.conf.json's
|
|
4
|
+
* plugins.updater.pubkey, and the user gets the storage instructions the key
|
|
5
|
+
* deserves - losing it means existing installs can never update again.
|
|
6
|
+
*/
|
|
7
|
+
import { type PromptIo } from "./ui/prompts.js";
|
|
8
|
+
/** The pubkey value `create-pylair --with-updater` writes, standing in for a
|
|
9
|
+
* real key until `pylair keys init` runs. Keep in step with scaffold.ts. */
|
|
10
|
+
export declare const PUBKEY_PLACEHOLDER = "<generated by pylair keys init>";
|
|
11
|
+
/** The pieces of `keys init` a test stubs (process boundary only - every
|
|
12
|
+
* decision above it runs in-process). */
|
|
13
|
+
export interface KeysOps {
|
|
14
|
+
/** `node <tauri-cli> signer generate ...`. `inherit` stdio lets the tauri
|
|
15
|
+
* CLI prompt for the password itself on a TTY; `capture` is for the
|
|
16
|
+
* non-interactive `-p` path and returns combined output. */
|
|
17
|
+
generate: (args: string[], mode: "inherit" | "capture", stdin?: string) => number;
|
|
18
|
+
/** The git work-tree root containing `cwd`, or undefined outside a repo
|
|
19
|
+
* (`git -C cwd rev-parse --show-toplevel`). */
|
|
20
|
+
repoTop: (cwd: string) => string | undefined;
|
|
21
|
+
/** Is `path` ignored under the git repo containing `cwd`? - "ignored" only
|
|
22
|
+
* when `git check-ignore` exits 0; "untracked" on 1; "unknown" when there
|
|
23
|
+
* is no repo or no git binary (a path we can't verify counts as tracked). */
|
|
24
|
+
checkIgnored: (path: string, cwd: string) => "ignored" | "untracked" | "unknown";
|
|
25
|
+
}
|
|
26
|
+
export interface KeysInitOptions {
|
|
27
|
+
appDir: string;
|
|
28
|
+
/** `--key-path`: where the private key is written. Must be outside the
|
|
29
|
+
* repository containing the app - or git-ignored inside it, verified via
|
|
30
|
+
* `git check-ignore`. */
|
|
31
|
+
keyPath?: string;
|
|
32
|
+
/** `--password`: private-key password; otherwise the env var, a TTY prompt
|
|
33
|
+
* from the tauri CLI itself, or --no-password for a deliberately
|
|
34
|
+
* unprotected key. */
|
|
35
|
+
password?: string;
|
|
36
|
+
/** `--no-password`: explicit opt-in to an UNPROTECTED private key (a
|
|
37
|
+
* warning is printed). Never implied - a failed generate is never
|
|
38
|
+
* silently retried with an empty password. */
|
|
39
|
+
noPassword?: boolean;
|
|
40
|
+
/** Overwrite an existing pubkey in tauri.conf.json and/or an existing key
|
|
41
|
+
* file. Off by default: a new key needs the OLD one to reach installed
|
|
42
|
+
* copies (the signed rollover update of 0011 sec. 6). */
|
|
43
|
+
force?: boolean;
|
|
44
|
+
env?: NodeJS.ProcessEnv;
|
|
45
|
+
ops?: KeysOps;
|
|
46
|
+
/** Prompt streams for the interactive path/password questions. */
|
|
47
|
+
prompt?: PromptIo;
|
|
48
|
+
}
|
|
49
|
+
export declare function keysInit(opts: KeysInitOptions): Promise<number>;
|
|
50
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzD;4EAC4E;AAC5E,eAAO,MAAM,kBAAkB,oCAAoC,CAAC;AAEpE;yCACyC;AACzC,MAAM,WAAW,OAAO;IACtB;;gEAE4D;IAC5D,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAClF;mDAC+C;IAC/C,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC7C;;iFAE6E;IAC7E,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;CAClF;AAyBD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf;;6BAEyB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;0BAEsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;kDAE8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;6DAEyD;IACzD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,kEAAkE;IAClE,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AA2HD,wBAAsB,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CA2ErE"}
|
package/dist/keys.js
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/** `pylair keys init` - wrap `tauri signer generate` (minisign, the update
|
|
2
|
+
* trust anchor of decision 0011 sec. 6): the private key goes to a path the user
|
|
3
|
+
* picks OUTSIDE the project, the pubkey lands in tauri.conf.json's
|
|
4
|
+
* plugins.updater.pubkey, and the user gets the storage instructions the key
|
|
5
|
+
* deserves - losing it means existing installs can never update again.
|
|
6
|
+
*/
|
|
7
|
+
import { spawnSync } from "node:child_process";
|
|
8
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { homedir } from "node:os";
|
|
10
|
+
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
11
|
+
import { tauriCliEntry } from "./config.js";
|
|
12
|
+
import { ui } from "./ui/index.js";
|
|
13
|
+
import { askText } from "./ui/prompts.js";
|
|
14
|
+
/** The pubkey value `create-pylair --with-updater` writes, standing in for a
|
|
15
|
+
* real key until `pylair keys init` runs. Keep in step with scaffold.ts. */
|
|
16
|
+
export const PUBKEY_PLACEHOLDER = "<generated by pylair keys init>";
|
|
17
|
+
const keysRealOps = {
|
|
18
|
+
generate: (args, mode, stdin) => {
|
|
19
|
+
const r = spawnSync(process.execPath, args, {
|
|
20
|
+
stdio: mode === "inherit" ? "inherit" : ["pipe", "pipe", "pipe"],
|
|
21
|
+
input: stdin,
|
|
22
|
+
});
|
|
23
|
+
return r.status ?? 1;
|
|
24
|
+
},
|
|
25
|
+
repoTop: (cwd) => {
|
|
26
|
+
const r = spawnSync("git", ["-C", cwd, "rev-parse", "--show-toplevel"], {
|
|
27
|
+
encoding: "utf-8",
|
|
28
|
+
});
|
|
29
|
+
const top = r.status === 0 ? r.stdout.trim() : "";
|
|
30
|
+
return top ? resolve(top) : undefined;
|
|
31
|
+
},
|
|
32
|
+
checkIgnored: (path, cwd) => {
|
|
33
|
+
const r = spawnSync("git", ["-C", cwd, "check-ignore", "-q", "--", path]);
|
|
34
|
+
if (r.status === 0)
|
|
35
|
+
return "ignored";
|
|
36
|
+
if (r.status === 1)
|
|
37
|
+
return "untracked";
|
|
38
|
+
return "unknown";
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
const CONF_ERR_PREFIX = "pylair keys init";
|
|
42
|
+
function confPath(appDir) {
|
|
43
|
+
return join(appDir, "src-tauri", "tauri.conf.json");
|
|
44
|
+
}
|
|
45
|
+
function loadConf(appDir) {
|
|
46
|
+
const path = confPath(appDir);
|
|
47
|
+
if (!existsSync(path))
|
|
48
|
+
throw new Error(`${CONF_ERR_PREFIX}: no src-tauri/tauri.conf.json - run inside a pylair app`);
|
|
49
|
+
try {
|
|
50
|
+
return { path, conf: JSON.parse(readFileSync(path, "utf-8")) };
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
throw new Error(`${CONF_ERR_PREFIX}: could not parse ${path}: ${e.message}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function defaultKeyPath(appDir, product) {
|
|
57
|
+
const safe = product.replace(/[^a-zA-Z0-9._-]+/g, "-") || "app";
|
|
58
|
+
return join(homedir(), ".pylair-keys", `${safe}-updater.key`);
|
|
59
|
+
}
|
|
60
|
+
/** `abs` inside `scope`? Returns the scope-relative path (display case), or
|
|
61
|
+
* undefined outside. Case-folded on win32 so an oddly-cased absolute path
|
|
62
|
+
* can't slip past the boundary check. */
|
|
63
|
+
function relInside(scope, abs) {
|
|
64
|
+
const fold = (s) => (process.platform === "win32" ? s.toLowerCase() : s);
|
|
65
|
+
const rel = relative(fold(scope), fold(abs));
|
|
66
|
+
return rel === "" || rel.startsWith("..") || isAbsolute(rel)
|
|
67
|
+
? undefined
|
|
68
|
+
: relative(scope, abs);
|
|
69
|
+
}
|
|
70
|
+
/** Refuse a private-key path the user could later commit: inside the git
|
|
71
|
+
* repository containing the app it must be git-ignored (verified, not
|
|
72
|
+
* assumed) - in a monorepo that boundary is the repo root, not the app
|
|
73
|
+
* dir, so a key at the root or in a sibling package is inside git just the
|
|
74
|
+
* same. Outside the repo is always fine; with no repo at all, the app dir
|
|
75
|
+
* is the boundary as before. Also refuses to clobber an existing key file
|
|
76
|
+
* without --force. */
|
|
77
|
+
function assertSafeKeyPath(keyPath, appDir, force, ops) {
|
|
78
|
+
const abs = resolve(appDir, keyPath);
|
|
79
|
+
const repo = ops.repoTop(appDir);
|
|
80
|
+
const scope = resolve(repo ?? appDir);
|
|
81
|
+
const rel = relInside(scope, abs);
|
|
82
|
+
if (rel !== undefined) {
|
|
83
|
+
const ignored = ops.checkIgnored(abs, appDir);
|
|
84
|
+
if (ignored !== "ignored") {
|
|
85
|
+
const where = repo ? "the repository" : "the project";
|
|
86
|
+
throw new Error(`${CONF_ERR_PREFIX}: refusing to write the private key inside ${where} ` +
|
|
87
|
+
`(${rel}) - it would end up in git. ` +
|
|
88
|
+
(ignored === "unknown"
|
|
89
|
+
? repo
|
|
90
|
+
? "git could not verify it as untracked. "
|
|
91
|
+
: "This directory isn't a git repo, so nothing proves the path is untracked. "
|
|
92
|
+
: "It's not covered by .gitignore. ") +
|
|
93
|
+
`Pick a path outside ${where} (e.g. the suggested default).`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (existsSync(abs) && !force)
|
|
97
|
+
throw new Error(`${CONF_ERR_PREFIX}: ${abs} already exists - a fresh key does not reach ` +
|
|
98
|
+
"existing installs (rotation needs the old key, 0011 sec. 6). Pass --force " +
|
|
99
|
+
"to overwrite it anyway.");
|
|
100
|
+
}
|
|
101
|
+
/** `signer generate` writes `<key>` and `<key>.pub`; the pubkey goes into
|
|
102
|
+
* tauri.conf.json. Password order: --password / env var, then --no-password
|
|
103
|
+
* (explicit opt-in, warned), then the tauri CLI's own TTY prompt with
|
|
104
|
+
* inherited stdio. Non-interactive with none of those is a usage error,
|
|
105
|
+
* and a FAILED generate is never silently retried with a weaker password -
|
|
106
|
+
* a mistyped confirmation must not quietly produce an unprotected key.
|
|
107
|
+
* (The only documented scripted delivery is `-p` on argv - tauri signer
|
|
108
|
+
* generate has no env/stdin password support; caveat in docs/updates.md.) */
|
|
109
|
+
function runGenerate(entry, keyPath, password, noPassword, interactive, ops) {
|
|
110
|
+
const failed = () => {
|
|
111
|
+
throw new Error(`${CONF_ERR_PREFIX}: tauri signer generate failed - no key was written. ` +
|
|
112
|
+
"Fix the cause (see output above) and run `pylair keys init` again.");
|
|
113
|
+
};
|
|
114
|
+
mkdirSync(dirname(keyPath), { recursive: true });
|
|
115
|
+
const args = [entry, "signer", "generate", "-w", keyPath];
|
|
116
|
+
if (password !== undefined) {
|
|
117
|
+
if (ops.generate([...args, "-p", password], "capture") !== 0)
|
|
118
|
+
failed();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (noPassword) {
|
|
122
|
+
ui.note("WARNING: --no-password generates an UNPROTECTED private key - anyone " +
|
|
123
|
+
"who copies the file can sign updates as you.");
|
|
124
|
+
// Piped stdin: the spike proved some CLI builds read stdin instead of
|
|
125
|
+
// honouring `-p ""`, so answer a possible prompt with an empty line.
|
|
126
|
+
if (ops.generate([...args, "-p", ""], "capture", "\n") !== 0)
|
|
127
|
+
failed();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (!interactive)
|
|
131
|
+
throw new Error(`${CONF_ERR_PREFIX}: no password source in a non-interactive shell - ` +
|
|
132
|
+
"pass --password, set TAURI_SIGNING_PRIVATE_KEY_PASSWORD, or " +
|
|
133
|
+
"--no-password for a deliberately unprotected key");
|
|
134
|
+
if (ops.generate(args, "inherit") !== 0)
|
|
135
|
+
failed();
|
|
136
|
+
}
|
|
137
|
+
export async function keysInit(opts) {
|
|
138
|
+
const ops = opts.ops ?? keysRealOps;
|
|
139
|
+
const env = opts.env ?? process.env;
|
|
140
|
+
const { path: confFile, conf } = loadConf(opts.appDir);
|
|
141
|
+
const updater = conf.plugins?.updater;
|
|
142
|
+
if (!updater || typeof updater !== "object")
|
|
143
|
+
throw new Error(`${CONF_ERR_PREFIX}: ${confFile} has no plugins.updater block - ` +
|
|
144
|
+
"scaffold with `create-pylair --with-updater` or add it first (docs/updates.md)");
|
|
145
|
+
const existing = updater.pubkey;
|
|
146
|
+
const hasKey = typeof existing === "string" && existing !== "" && existing !== PUBKEY_PLACEHOLDER;
|
|
147
|
+
if (hasKey && !opts.force)
|
|
148
|
+
throw new Error(`${CONF_ERR_PREFIX}: plugins.updater.pubkey is already set - replacing it ` +
|
|
149
|
+
"strands installed apps (rotation = an update signed by the OLD key, " +
|
|
150
|
+
"0011 sec. 6). Pass --force to overwrite it anyway.");
|
|
151
|
+
const product = typeof conf.productName === "string" ? conf.productName : "app";
|
|
152
|
+
const suggested = defaultKeyPath(opts.appDir, product);
|
|
153
|
+
let keyPath;
|
|
154
|
+
if (opts.keyPath) {
|
|
155
|
+
keyPath = resolve(opts.appDir, opts.keyPath);
|
|
156
|
+
}
|
|
157
|
+
else if (opts.prompt) {
|
|
158
|
+
const answer = await askText(opts.prompt, `private key path (e.g. ${suggested})`);
|
|
159
|
+
keyPath = resolve(opts.appDir, answer);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
throw new Error(`${CONF_ERR_PREFIX}: pass --key-path <file> for the private key ` +
|
|
163
|
+
"(a path outside the project; the key must never be committed)");
|
|
164
|
+
}
|
|
165
|
+
assertSafeKeyPath(keyPath, opts.appDir, opts.force, ops);
|
|
166
|
+
if (opts.password !== undefined && opts.noPassword)
|
|
167
|
+
throw new Error(`${CONF_ERR_PREFIX}: pass --password or --no-password, not both`);
|
|
168
|
+
const password = opts.password ?? env.TAURI_SIGNING_PRIVATE_KEY_PASSWORD;
|
|
169
|
+
runGenerate(tauriCliEntry(opts.appDir), keyPath, password, opts.noPassword, opts.prompt !== undefined, ops);
|
|
170
|
+
const pubFile = `${keyPath}.pub`;
|
|
171
|
+
if (!existsSync(pubFile))
|
|
172
|
+
throw new Error(`${CONF_ERR_PREFIX}: signer generate produced no ${pubFile}`);
|
|
173
|
+
const pubkey = readFileSync(pubFile, "utf-8").trim();
|
|
174
|
+
if (!pubkey)
|
|
175
|
+
throw new Error(`${CONF_ERR_PREFIX}: ${pubFile} is empty`);
|
|
176
|
+
conf.plugins.updater.pubkey = pubkey;
|
|
177
|
+
writeFileSync(confFile, JSON.stringify(conf, null, 2) + "\n");
|
|
178
|
+
ui.ok("pylair keys init: updater key generated");
|
|
179
|
+
ui.line(` pubkey -> src-tauri/tauri.conf.json (plugins.updater.pubkey)`);
|
|
180
|
+
ui.line(` private -> ${keyPath}`);
|
|
181
|
+
ui.line();
|
|
182
|
+
ui.note([
|
|
183
|
+
"The private key is the update trust anchor - losing it means existing",
|
|
184
|
+
"installs can never update again (reinstall only, 0011 sec. 6):",
|
|
185
|
+
` - CI secrets: TAURI_SIGNING_PRIVATE_KEY = the file's contents`,
|
|
186
|
+
` TAURI_SIGNING_PRIVATE_KEY_PASSWORD = the password`,
|
|
187
|
+
" - keep an offline backup; never commit the key or leave it only on CI",
|
|
188
|
+
" - rotation ships a new pubkey inside an update signed by the OLD key",
|
|
189
|
+
].join("\n"));
|
|
190
|
+
return 0;
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=keys.js.map
|
package/dist/keys.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACnC,OAAO,EAAE,OAAO,EAAiB,MAAM,iBAAiB,CAAC;AAEzD;4EAC4E;AAC5E,MAAM,CAAC,MAAM,kBAAkB,GAAG,iCAAiC,CAAC;AAkBpE,MAAM,WAAW,GAAY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