fix(gui): per-target credentials for install and restore (#46, #51)
source / check (pull_request) Skipped
verify / verify (pull_request) Failing after 31m29s
source / check (pull_request) Skipped
verify / verify (pull_request) Failing after 31m29s
"Install failed due to credentials" was the #46 change pulling one generic saved SSH login for both directions. Install targets a stock board and restore targets an alkane board, which need different logins. Add the alkane control-board login to the shipped defaults ("Alkane" root/alkane) and a `cred_for(firmware)` helper (saved per-firmware override, else shipped default). Install now uses the selected stock board's firmware login (e.g. AntMiner root/root); restore and the on-board-backup probe use the alkane login (root/alkane). No password field; both overridable per-firmware in Settings. Confirmed on the bench S17 at 10.255.1.111: its alkane login is root/alkane. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
This commit is contained in:
+18
-12
@@ -3070,10 +3070,14 @@ impl App {
|
||||
)
|
||||
};
|
||||
let allow_unsigned = self.install_unsigned_check.is_checked();
|
||||
// Board login from Settings; empty -> the firmware's shipped default
|
||||
// applies inside the engine (issue #46).
|
||||
let password = credentials::load_ssh_credentials()
|
||||
.map(|(_, p)| p)
|
||||
// The STOCK board's shipped login (overridable per-firmware in Settings),
|
||||
// so install authenticates with no password field (issues #46, #51). The
|
||||
// target is on stock, so its firmware's default (e.g. AntMiner root/root)
|
||||
// is correct -- not a saved alkane login.
|
||||
let password = self
|
||||
.selected_rows()
|
||||
.first()
|
||||
.map(|r| credentials::cred_for(&r.firmware).1)
|
||||
.filter(|p| !p.is_empty());
|
||||
let ips = std::mem::take(&mut self.install_ips);
|
||||
if ips.is_empty() {
|
||||
@@ -3138,9 +3142,10 @@ impl App {
|
||||
// Credentials come from Settings (the alkane root login), not this dialog
|
||||
// (issue #46). Probe each selected board for a restorable on-board stock
|
||||
// backup so the on-board option can be offered or greyed out (#48).
|
||||
let cred = credentials::load_ssh_credentials()
|
||||
.map(|(_, p)| p)
|
||||
.filter(|p| !p.is_empty());
|
||||
let cred = {
|
||||
let p = credentials::cred_for(crate::alkane_detect::FIRMWARE).1;
|
||||
(!p.is_empty()).then_some(p)
|
||||
};
|
||||
let onboard_ok = ips
|
||||
.iter()
|
||||
.all(|ip| stock_ops::onboard_backup_present(ip, cred.as_deref()));
|
||||
@@ -3255,11 +3260,12 @@ impl App {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Alkane root credential comes from Settings; empty -> the method's
|
||||
// shipped default applies (issue #46, #51).
|
||||
let password = credentials::load_ssh_credentials()
|
||||
.map(|(_, p)| p)
|
||||
.filter(|p| !p.is_empty());
|
||||
// The ALKANE board's shipped login (overridable per-firmware in
|
||||
// Settings), so restore authenticates with no password field (#46, #51).
|
||||
let password = {
|
||||
let p = credentials::cred_for(crate::alkane_detect::FIRMWARE).1;
|
||||
(!p.is_empty()).then_some(p)
|
||||
};
|
||||
let ips = std::mem::take(&mut self.uninstall_ips);
|
||||
if ips.is_empty() {
|
||||
self.uninstall_dialog.close(0);
|
||||
|
||||
Reference in New Issue
Block a user