@inceptionstack/roundhouse 0.3.3 → 0.3.4
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/setup.ts +30 -2
package/package.json
CHANGED
package/src/cli/setup.ts
CHANGED
|
@@ -388,8 +388,27 @@ async function stepInstallPackages(opts: SetupOptions): Promise<void> {
|
|
|
388
388
|
ok("psst vault exists");
|
|
389
389
|
} else {
|
|
390
390
|
log(" Initializing psst vault...");
|
|
391
|
-
|
|
392
|
-
|
|
391
|
+
// On headless servers, no keychain is available — use PSST_PASSWORD
|
|
392
|
+
const psstEnv = { ...process.env };
|
|
393
|
+
if (!psstEnv.PSST_PASSWORD) {
|
|
394
|
+
// Generate a random password and store it for future use
|
|
395
|
+
const psstPw = randomBytes(32).toString("base64");
|
|
396
|
+
const pwFile = resolve(ROUNDHOUSE_DIR, ".psst-password");
|
|
397
|
+
await atomicWriteText(pwFile, psstPw + "\n", 0o600);
|
|
398
|
+
psstEnv.PSST_PASSWORD = psstPw;
|
|
399
|
+
// Also set for subsequent psst calls in this process
|
|
400
|
+
process.env.PSST_PASSWORD = psstPw;
|
|
401
|
+
}
|
|
402
|
+
try {
|
|
403
|
+
execFileSync("psst", ["init"], {
|
|
404
|
+
encoding: "utf8", stdio: "pipe", timeout: 30_000,
|
|
405
|
+
env: psstEnv,
|
|
406
|
+
});
|
|
407
|
+
ok("psst vault initialized");
|
|
408
|
+
} catch (err: any) {
|
|
409
|
+
warn(`psst vault init failed: ${err.stderr?.trim() || err.message}`);
|
|
410
|
+
opts.psst = false;
|
|
411
|
+
}
|
|
393
412
|
}
|
|
394
413
|
|
|
395
414
|
// Install pi-psst extension
|
|
@@ -549,6 +568,15 @@ async function stepConfigure(
|
|
|
549
568
|
envLines.push(`ALLOWED_USERS=${envQuote(opts.users.join(","))}`);
|
|
550
569
|
}
|
|
551
570
|
|
|
571
|
+
// If psst uses a generated password (headless), include it in env for systemd
|
|
572
|
+
if (opts.psst) {
|
|
573
|
+
const pwFile = resolve(ROUNDHOUSE_DIR, ".psst-password");
|
|
574
|
+
if (await fileExists(pwFile)) {
|
|
575
|
+
const pw = (await readFile(pwFile, "utf8")).trim();
|
|
576
|
+
envLines.push(`PSST_PASSWORD=${envQuote(pw)}`);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
552
580
|
if (opts.provider === "amazon-bedrock") {
|
|
553
581
|
// Preserve existing AWS config
|
|
554
582
|
let existingEnv: Record<string, string> = {};
|