feat(satellite): ssh.exec — ARIA fuehrt Kommandos per SSH auf Geraeten aus
Neuer Credential-Typ 'ssh' (Benutzer + Passwort ODER privater Key, Port) und Aktion ssh.exec (params: ip, cmd). paramiko-Client; grosse Ausgaben werden wie bei http.get gefenstert (contains/offset/max_chars gemeinsam via _window_text), Antwort mit exit_code + stdout + stderr. Auth kommt aus dem Credential-Store, ARIA muss keine Passwoerter mitgeben. - satellite: _do_ssh + _ssh_load_key (RSA/Ed25519/ECDSA/DSS aus String), ssh.exec in _control + Allowlist, 'ssh' in beide Cred-Typ-Listen; paramiko in requirements; .env.example ergaenzt. - diagnostic: SSH-Sektion im Credentials-Modal (User/Port/Passwort/Key) + Save-Logik (User + Passwort|Key). - brain: satellite_command-Tool um ssh.exec erweitert. Laeuft ueber den bestehenden sat_command/sat_result-Pfad — keine RVS-Aenderung. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+23
-2
@@ -248,6 +248,16 @@
|
||||
<input id="dc-fb-pass" type="password" placeholder="FritzBox-Passwort" style="width:100%;">
|
||||
</div>
|
||||
|
||||
<div style="border:1px solid #1E1E2E;border-radius:6px;padding:10px;">
|
||||
<div style="color:#E0E0F0;font-weight:600;margin-bottom:6px;">SSH</div>
|
||||
<div style="display:flex;gap:4px;margin-bottom:4px;">
|
||||
<input id="dc-ssh-user" placeholder="Benutzer" style="flex:2;">
|
||||
<input id="dc-ssh-port" placeholder="Port 22" style="flex:1;">
|
||||
</div>
|
||||
<input id="dc-ssh-pass" type="password" placeholder="Passwort (oder Key unten)" style="width:100%;margin-bottom:4px;">
|
||||
<textarea id="dc-ssh-key" placeholder="Privater SSH-Key (optional, PEM/OpenSSH)" style="width:100%;height:60px;font-family:monospace;font-size:10px;"></textarea>
|
||||
</div>
|
||||
|
||||
<div style="display:flex;gap:8px;justify-content:flex-end;">
|
||||
<button class="btn secondary" onclick="deleteDeviceCreds()" style="color:#FF6E6E;">Alle loeschen</button>
|
||||
<button class="btn" onclick="saveDeviceCreds()">Speichern</button>
|
||||
@@ -4624,7 +4634,7 @@
|
||||
credsModalSat = satId; credsModalIp = ip;
|
||||
document.getElementById('dev-creds-title').textContent = (name || ip) + ' (' + ip + ')';
|
||||
// Felder leeren — Secrets werden NIE zurueckgeliefert, nur neu gesetzt.
|
||||
['dc-snmp-community','dc-v3-user','dc-v3-authkey','dc-v3-privkey','dc-http-user','dc-http-pass','dc-fb-user','dc-fb-pass'].forEach(id => document.getElementById(id).value = '');
|
||||
['dc-snmp-community','dc-v3-user','dc-v3-authkey','dc-v3-privkey','dc-http-user','dc-http-pass','dc-fb-user','dc-fb-pass','dc-ssh-user','dc-ssh-port','dc-ssh-pass','dc-ssh-key'].forEach(id => document.getElementById(id).value = '');
|
||||
document.getElementById('dc-snmp-version').value = '';
|
||||
dcToggleV3();
|
||||
const set = ((satCreds[satId] || {})[ip]) || [];
|
||||
@@ -4656,7 +4666,18 @@
|
||||
const fu = document.getElementById('dc-fb-user').value.trim();
|
||||
const fp = document.getElementById('dc-fb-pass').value;
|
||||
if (fu || fp) creds.fritzbox = { user: fu, pass: fp };
|
||||
if (!Object.keys(creds).length) { document.getElementById('dc-status').textContent = 'Nichts zu speichern — mindestens einen Typ ausfuellen.'; return; }
|
||||
// SSH: Benutzer + (Passwort ODER Key). Port optional.
|
||||
const su = document.getElementById('dc-ssh-user').value.trim();
|
||||
const sp = document.getElementById('dc-ssh-pass').value;
|
||||
const sk = document.getElementById('dc-ssh-key').value.trim();
|
||||
if (su && (sp || sk)) {
|
||||
creds.ssh = { user: su };
|
||||
if (sp) creds.ssh.pass = sp;
|
||||
if (sk) creds.ssh.key = sk;
|
||||
const sport = document.getElementById('dc-ssh-port').value.trim();
|
||||
if (sport) creds.ssh.port = sport;
|
||||
}
|
||||
if (!Object.keys(creds).length) { document.getElementById('dc-status').textContent = 'Nichts zu speichern — mindestens einen Typ ausfuellen (SSH braucht Benutzer + Passwort/Key).'; return; }
|
||||
send({ action: 'sat_creds_set', satellite: credsModalSat, ip: credsModalIp, creds });
|
||||
document.getElementById('dc-status').textContent = 'Speichere …';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user