querysub 0.661.0 → 0.662.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/package.json
CHANGED
|
@@ -403,10 +403,10 @@ async function main() {
|
|
|
403
403
|
|
|
404
404
|
console.log("Setting up machine:", sshRemote);
|
|
405
405
|
|
|
406
|
-
// 0. Update apt
|
|
406
|
+
// 0. Update apt. nothrow, as apt update exits non-zero when ANY configured repo fails (ex, a stale third-party repo whose vendor rotated its GPG key), and setup only needs the main repos - if those are actually broken, the installs below fail loudly anyway.
|
|
407
407
|
console.log("Updating apt...");
|
|
408
|
-
await runPromise(`ssh ${sshRemote} "sudo apt update"
|
|
409
|
-
console.log("✅ Apt updated");
|
|
408
|
+
await runPromise(`ssh ${sshRemote} "sudo apt update"`, { nothrow: true });
|
|
409
|
+
console.log("✅ Apt updated (any repo errors above are only fatal if the installs below fail)");
|
|
410
410
|
|
|
411
411
|
// 1. Copy backblaze file to remote server (~/backblaze.json)
|
|
412
412
|
console.log("Copying backblaze credentials...");
|
|
@@ -424,7 +424,7 @@ async function main() {
|
|
|
424
424
|
console.log("✅ Git already installed");
|
|
425
425
|
} catch {
|
|
426
426
|
console.log("Installing git...");
|
|
427
|
-
await runPromise(`ssh ${sshRemote} "sudo apt update
|
|
427
|
+
await runPromise(`ssh ${sshRemote} "sudo apt update; sudo apt install -y git"`);
|
|
428
428
|
console.log("✅ Git installed");
|
|
429
429
|
}
|
|
430
430
|
|
|
@@ -509,7 +509,8 @@ async function main() {
|
|
|
509
509
|
}
|
|
510
510
|
|
|
511
511
|
// Get the public key from remote machine
|
|
512
|
-
|
|
512
|
+
// Falls back to deriving from the private key, as the .pub file can be missing while the key itself is fine
|
|
513
|
+
const sshPublicKey = await sshValue(sshRemote, "cat ~/.ssh/id_rsa.pub 2>/dev/null || ssh-keygen -y -f ~/.ssh/id_rsa");
|
|
513
514
|
const keyTitle = `Machine Setup - ${sshRemote} - ${new Date().toISOString()}`;
|
|
514
515
|
|
|
515
516
|
// Add the deploy key to GitHub repository
|