Adds a right-click "View log (API)..." action that fetches a miner's log through
its firmware API and regex-scans it -- the "logs through API" path for PIC
detection and other metrics without SSH.
Per firmware (crates/alkane-gui/src/log_scan.rs, curl-based like the access
probe, stdout drained on a thread so a large log never deadlocks the pipe):
- VNish: POST /api/v1/unlock -> bearer -> GET /api/v1/logs/miner (the full miner
log: PSU init, per-chain chip detection, tuning, errors).
- Stock Antminer: GET /cgi-bin/log.cgi (digest); older models (Z15) that do not
serve it are reported as "no log over its web API".
- WhatsMiner: get_error_code on :4028 (unauthenticated) formatted as the log.
The summary regex reports PIC status ("not present (no-PIC miner)" / "present --
<version line>"), the latest per-chain chip-detection line, and recent errors
from the log history. Creds reuse the round 12 #13 per-firmware defaults (VNish
password, else "admin"; Antminer web login from the saved global creds).
Verified live: VNish S19j Pro (10.7.1.25) log -> "PIC: not present (log reports a
no-PIC miner)" + chains + recent errors; WhatsMiner (10.8.1.45) -> its active
error codes; Z15 (10.5.1.196) -> honest "no log over its web API". Unit tests for
the summary + a headless ALKANE_LOG_SCAN diagnostic; self-test passes.
Note: WhatsMiner fault codes already surface in the Errors column via asic-rs's
get_error_code -> messages; this adds the raw-log view and the PIC scan on top.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
WhatsMiners were shown "locked/unauthenticated" even with their default login.
Two causes, both fixed:
- The access probe hit an Antminer-only endpoint (/cgi-bin/get_miner_conf.cgi via
curl --digest) for EVERY make; WhatsMiners answer 307 there, so the check was
always indeterminate. Added a real WhatsMiner check over its :4028 token API:
get_token (unauthenticated) -> derive the AES key from the password (md5crypt +
SHA256, the same scheme the vendored asic-rs whatsminer backend uses) -> send a
NON-mutating encrypted `summary`. An encrypted reply means the password was
accepted (unlocked); a plaintext "enc json load err" means rejected (locked).
probe_access now branches on the miner brand. Candidate passwords: a per-firmware
override (round 12 #13) if set, else the factory defaults admin (V1/V2) and super
(V3); all attempts are non-mutating so trying both is safe.
- The scan-time lock guess (!caps.any_control()) falsely marked older WhatsMiners
locked because they route to the asic-rs V1 backend, which declares no control
commands even though the miner is controllable via the token API. WhatsMiner
lock state is now left unknown at scan time and decided by the real probe.
Live-verified on the fleet: older 20220422.18.REL units (10.8.1.176, 10.7.1.196)
and newer M30S+ (10.8.1.45) all report UNLOCKED with the default admin login;
the Antminer digest path is unchanged (Z15 -> 200 with root/root -> unlocked).
Added a headless `ALKANE_ACCESS_PROBE="<ip> <make>"` diagnostic and a
deterministic AES unit test. Self-test passes.
Note: this is the access/lock half of #8b. Implementing the full reverse-
engineered WhatsMiner command set (control + monitoring over the token API) is
tracked separately.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
asic-rs has no lock-state signal (a wrong-password miner just silently returns
fewer fields, because the collector drops the 401). This builds the real check
ON TOP of asic-rs:
- access_probe.rs: a NON-mutating, digest-authenticated GET to a privileged
endpoint (Antminer get_miner_conf.cgi, read-only). The HTTP status is decisive
-- 200 = credentials authenticate (writable -> unlocked), 401/403 = rejected
(view-only -> locked); anything else -> indeterminate. Pure classifier +
unit tests; shells out to curl --digest (no HTTP crate) so the offline build
is unaffected.
- Right-click "Check access (auth)" on the selected miners runs start_access_probe
on a background thread using the saved scan (web) credentials (default root/root),
updating write_locked in the rows as results arrive. Fake-scan mode returns
deterministic demo results. Guarded against a flash / concurrent probe.
Replaces the previous capability-based inference for the miners the user
explicitly checks. cargo check --release --tests clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh