@inceptionstack/roundhouse 0.3.4 → 0.3.6
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/package.json +1 -1
- package/src/cli/cli.ts +18 -7
- package/src/cli/setup.ts +7 -1
package/package.json
CHANGED
package/src/cli/cli.ts
CHANGED
|
@@ -609,12 +609,23 @@ const commands: Record<string, () => void | Promise<void>> = {
|
|
|
609
609
|
agent: cmdAgent,
|
|
610
610
|
};
|
|
611
611
|
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
612
|
+
if (command === "--version" || command === "-v") {
|
|
613
|
+
try {
|
|
614
|
+
const pkg = JSON.parse(
|
|
615
|
+
await readFile(resolve(__dirname, "..", "..", "package.json"), "utf8")
|
|
616
|
+
);
|
|
617
|
+
console.log(pkg.version);
|
|
618
|
+
} catch {
|
|
619
|
+
console.log("unknown");
|
|
620
|
+
}
|
|
618
621
|
} else {
|
|
619
|
-
|
|
622
|
+
const fn = command ? commands[command] : undefined;
|
|
623
|
+
if (fn) {
|
|
624
|
+
Promise.resolve(fn()).catch((err) => {
|
|
625
|
+
console.error(`[roundhouse] ${command} failed:`, err);
|
|
626
|
+
process.exit(1);
|
|
627
|
+
});
|
|
628
|
+
} else {
|
|
629
|
+
printHelp();
|
|
630
|
+
}
|
|
620
631
|
}
|
package/src/cli/setup.ts
CHANGED
|
@@ -407,6 +407,9 @@ async function stepInstallPackages(opts: SetupOptions): Promise<void> {
|
|
|
407
407
|
ok("psst vault initialized");
|
|
408
408
|
} catch (err: any) {
|
|
409
409
|
warn(`psst vault init failed: ${err.stderr?.trim() || err.message}`);
|
|
410
|
+
// Clean up orphan password file
|
|
411
|
+
try { await unlink(resolve(ROUNDHOUSE_DIR, ".psst-password")); } catch {}
|
|
412
|
+
delete process.env.PSST_PASSWORD;
|
|
410
413
|
opts.psst = false;
|
|
411
414
|
}
|
|
412
415
|
}
|
|
@@ -568,7 +571,10 @@ async function stepConfigure(
|
|
|
568
571
|
envLines.push(`ALLOWED_USERS=${envQuote(opts.users.join(","))}`);
|
|
569
572
|
}
|
|
570
573
|
|
|
571
|
-
// If psst uses a generated password (headless), include it in env for systemd
|
|
574
|
+
// If psst uses a generated password (headless), include it in env for systemd.
|
|
575
|
+
// Threat model tradeoff: the vault key is plaintext in a 0600 file, but this is
|
|
576
|
+
// unavoidable on headless servers with no keychain. The benefit is that individual
|
|
577
|
+
// secrets are still managed centrally via psst and injected at runtime.
|
|
572
578
|
if (opts.psst) {
|
|
573
579
|
const pwFile = resolve(ROUNDHOUSE_DIR, ".psst-password");
|
|
574
580
|
if (await fileExists(pwFile)) {
|