release: MUA 2026.11.21.r039
WebGUI - New "Verbindung" section with both endpoints (/mcp/full, /mcp/lite), copy buttons and a selectable default profile for /mcp. - Notice for new, not yet enabled tools with a button to enable the new read-only tools; "Nur Lesen" and "Betrieb + Diagnose" presets extended. New tools (verified against the Unraid webgui source where possible) - VMs: list, inspect (disks, network, PCI/USB passthrough, snapshots, no passwords), start/shutdown/reboot/suspend/resume with state checks, autostart, force stop (critical). - Cache/pool analysis (which shares fill a pool, cache setting, files the mover will never move), mover state/schedule/log, start mover. - Parity status with schedule and history; start (non-correcting by default), pause, resume, cancel. - docker.img fill level and breakdown; send and archive Unraid notifications. - unraid_overview also reports a full docker.img, errors of the last parity check and crashed VMs. Fixes - Unread notifications in /tmp/notifications/unread were never read; the list and the overview now include them. Lite profile: new unraid_vm group; storage, docker and system groups extended with the new actions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
671e31b130
commit
a96b8f8534
20 files changed
+1104
-73
No files matched your search
+55
-4
@@ -57,7 +57,8 @@ $health_data = mua_health($config_port, $admin_token);
|
||||
$health_ok = is_array($health_data) && ($health_data['status'] ?? '') === 'ok';
|
||||
$running_version = $health_data['version'] ?? '';
|
||||
$scheme = ($health_data['scheme'] ?? '') === 'https' ? 'https' : 'http';
|
||||
$endpoint = $health_ok ? $scheme . '://' . (str_contains($host_ip, ':') ? '[' . $host_ip . ']' : $host_ip) . ':' . ($health_data['port'] ?? $port) . '/mcp' : 'Nicht verfügbar – Dienst/Logs prüfen';
|
||||
$base_url = $health_ok ? $scheme . '://' . (str_contains($host_ip, ':') ? '[' . $host_ip . ']' : $host_ip) . ':' . ($health_data['port'] ?? $port) : '';
|
||||
$endpoint = $health_ok ? $base_url . '/mcp' : 'Nicht verfügbar – Dienst/Logs prüfen';
|
||||
[$config_code, $config] = mua_api('GET', '/config', null, $admin_token, $config_port);
|
||||
$config_ok = $config_code === 200 && is_array($config);
|
||||
$flash_msg = '';
|
||||
@@ -73,13 +74,21 @@ $readonly = [
|
||||
'unraid_system_shell_readonly', 'unraid_docker_update_status',
|
||||
'unraid_system_health', 'unraid_storage_status', 'unraid_disk_health',
|
||||
'unraid_notifications_list', 'unraid_shares_list', 'unraid_share_inspect',
|
||||
'unraid_files_inventory',
|
||||
'unraid_files_inventory', 'unraid_overview', 'unraid_vm_list', 'unraid_vm_inspect',
|
||||
'unraid_cache_status', 'unraid_parity_status', 'unraid_docker_storage',
|
||||
];
|
||||
$operator = array_merge($readonly, [
|
||||
'unraid_network_audit_tcp', 'unraid_network_lan_probe',
|
||||
'unraid_ca_search', 'unraid_ca_install_preview',
|
||||
'unraid_docker_start', 'unraid_docker_stop', 'unraid_docker_restart',
|
||||
'unraid_vm_control', 'unraid_vm_autostart', 'unraid_mover_start', 'unraid_parity_control',
|
||||
'unraid_notify', 'unraid_notification_archive',
|
||||
]);
|
||||
$new_tools = is_array($config['newTools'] ?? null) ? $config['newTools'] : [];
|
||||
$new_read_tools = [];
|
||||
foreach ($new_tools as $tool) {
|
||||
if (is_array($tool) && ($tool['risk'] ?? '') === 'read' && is_string($tool['name'] ?? null)) $new_read_tools[] = $tool['name'];
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$posted_csrf = $_POST['mua_csrf'] ?? '';
|
||||
@@ -96,6 +105,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if ($action === 'preset_none') $payload = ['enabledTools' => [], 'allToolsEnabled' => false];
|
||||
if ($action === 'preset_all') $payload = ['enabledTools' => [], 'allToolsEnabled' => true];
|
||||
if ($action === 'save_toolbox') $payload = ['toolboxEnabled' => isset($_POST['toolbox_enabled'])];
|
||||
if ($action === 'save_profile') $payload = ['defaultProfile' => (($_POST['default_profile'] ?? '') === 'lite') ? 'lite' : 'full'];
|
||||
if ($action === 'enable_new_read' && !empty($new_read_tools)) {
|
||||
$current = is_array($config['enabledTools'] ?? null) ? $config['enabledTools'] : [];
|
||||
$payload = ['enabledTools' => array_values(array_unique(array_merge($current, $new_read_tools))), 'allToolsEnabled' => false];
|
||||
}
|
||||
if ($action === 'save_tls') $payload = ['tls' => [
|
||||
'enabled' => isset($_POST['tls_enabled']),
|
||||
'source' => $_POST['tls_source'] ?? 'manual',
|
||||
@@ -120,7 +134,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
[$code, $result] = mua_api('POST', '/config', $payload, $admin_token, $config_port);
|
||||
if ($code === 200 && is_array($result) && ($result['ok'] ?? false)) {
|
||||
$new_api_key = $result['generatedApiKey'] ?? '';
|
||||
$flash_msg = $action === 'save_tls' ? 'TLS-Einstellungen geprüft und gespeichert. Zum Anwenden Dienst ausdrücklich neu starten.' : ($new_api_key ? 'Neuer API-Key erzeugt. Jetzt kopieren – er wird nur dieses eine Mal angezeigt.' : 'Sicherheitseinstellungen gespeichert.');
|
||||
$flash_msg = $action === 'save_tls' ? 'TLS-Einstellungen geprüft und gespeichert. Zum Anwenden Dienst ausdrücklich neu starten.'
|
||||
: ($new_api_key ? 'Neuer API-Key erzeugt. Jetzt kopieren – er wird nur dieses eine Mal angezeigt.'
|
||||
: ($action === 'save_profile' ? 'Standardprofil gespeichert. Gilt sofort für neue Verbindungen auf /mcp.'
|
||||
: ($action === 'enable_new_read' ? 'Neue Lesewerkzeuge freigegeben.' : 'Sicherheitseinstellungen gespeichert.')));
|
||||
$flash_type = 'ok';
|
||||
[$config_code, $config] = mua_api('GET', '/config', null, $admin_token, $config_port);
|
||||
$config_ok = $config_code === 200 && is_array($config);
|
||||
@@ -132,6 +149,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
}
|
||||
}
|
||||
|
||||
$new_tools = is_array($config['newTools'] ?? null) ? $config['newTools'] : [];
|
||||
$new_read_tools = [];
|
||||
foreach ($new_tools as $tool) {
|
||||
if (is_array($tool) && ($tool['risk'] ?? '') === 'read' && is_string($tool['name'] ?? null)) $new_read_tools[] = $tool['name'];
|
||||
}
|
||||
$default_profile = ($config['defaultProfile'] ?? 'full') === 'lite' ? 'lite' : 'full';
|
||||
$profile_locked = !$config_ok || !empty($config['profileEnvOverride']);
|
||||
$transport = is_array($config['transport'] ?? null) ? $config['transport'] : [];
|
||||
$tls = is_array($transport['tls'] ?? null) ? $transport['tls'] : [];
|
||||
$tls_source = ($tls['source'] ?? 'unraid') === 'manual' ? 'manual' : 'unraid';
|
||||
@@ -177,7 +201,34 @@ $active_count = $all_tools_enabled ? count($all_tools) : count($enabled_tools);
|
||||
<div class="mua-card"><h3>Authentifizierung</h3><p class="mua-summary"><?= $config_ok ? '✅ Bearer-Key aktiv' : '❌ Verwaltung nicht erreichbar' ?></p><div class="mua-muted"><?= htmlspecialchars($config['apiKeyMasked'] ?? 'nicht verfügbar') ?></div></div>
|
||||
</div>
|
||||
|
||||
<div class="mua-card"><h3>MCP-Endpunkt</h3><code class="mua-endpoint"><?= htmlspecialchars($endpoint) ?></code><p class="mua-muted">Streamable HTTP · JSON-RPC 2.0 · Bearer-Authentifizierung erforderlich</p><?php if ($health_ok): ?><p class="mua-muted">Kompakt für kleine Modelle: <code><?= htmlspecialchars($endpoint . '/lite') ?></code></p><?php endif; ?></div>
|
||||
<div class="mua-section"><h2>Verbindung</h2><div class="mua-card">
|
||||
<?php if ($health_ok): ?>
|
||||
<table class="mua-details">
|
||||
<tr><td>Vollständig<br><small class="mua-muted">große Modelle (Claude, GPT)</small></td><td><code class="mua-endpoint" id="mua-ep-full"><?= htmlspecialchars($base_url . '/mcp/full') ?></code> <button type="button" class="mua-btn" onclick="navigator.clipboard.writeText(document.getElementById('mua-ep-full').textContent)">Kopieren</button></td></tr>
|
||||
<tr><td>Kompakt<br><small class="mua-muted">kleine/lokale Modelle (Qwen, Llama …)</small></td><td><code class="mua-endpoint" id="mua-ep-lite"><?= htmlspecialchars($base_url . '/mcp/lite') ?></code> <button type="button" class="mua-btn" onclick="navigator.clipboard.writeText(document.getElementById('mua-ep-lite').textContent)">Kopieren</button></td></tr>
|
||||
<tr><td>Standard</td><td><code class="mua-endpoint"><?= htmlspecialchars($endpoint) ?></code> → <strong><?= $default_profile === 'lite' ? 'Kompakt' : 'Vollständig' ?></strong></td></tr>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="mua-status err"><?= htmlspecialchars($endpoint) ?></div>
|
||||
<?php endif; ?>
|
||||
<p class="mua-muted">Streamable HTTP · JSON-RPC 2.0 · Bearer-Authentifizierung erforderlich. Beide Profile bieten dieselben Funktionen und Freigaben: „Kompakt“ bündelt sie in rund zehn Werkzeugen mit <code>action</code>-Feld und spart etwa die Hälfte der Tokens. Erster Aufruf in jeder Sitzung: <code>unraid_overview</code>.</p>
|
||||
<form method="post" class="mua-actions"><input type="hidden" name="csrf_token" value="<?= htmlspecialchars($unraid_csrf) ?>"><input type="hidden" name="mua_csrf" value="<?= htmlspecialchars($csrf) ?>"><input type="hidden" name="action" value="save_profile">
|
||||
<span>Standardprofil für <code>/mcp</code>:</span>
|
||||
<label><input type="radio" name="default_profile" value="full" <?= $default_profile === 'full' ? 'checked' : '' ?> <?= $profile_locked ? 'disabled' : '' ?>> Vollständig</label>
|
||||
<label><input type="radio" name="default_profile" value="lite" <?= $default_profile === 'lite' ? 'checked' : '' ?> <?= $profile_locked ? 'disabled' : '' ?>> Kompakt</label>
|
||||
<button type="submit" class="mua-btn" <?= $profile_locked ? 'disabled' : '' ?>>Speichern</button>
|
||||
<?php if (!empty($config['profileEnvOverride'])): ?><span class="mua-muted">Durch Umgebungsvariable MUA_PROFILE festgelegt.</span><?php endif; ?>
|
||||
</form>
|
||||
</div></div>
|
||||
|
||||
<?php if (!empty($new_tools)): ?>
|
||||
<div class="mua-section"><div class="mua-status warn"><strong>Neu in dieser Version – noch nicht freigegeben:</strong>
|
||||
<?php foreach ($new_tools as $tool): if (!is_array($tool)) continue; ?><code><?= htmlspecialchars((string)($tool['name'] ?? '')) ?></code><?= ($tool['risk'] ?? '') === 'read' ? '' : ' <small>(' . htmlspecialchars((string)($tool['risk'] ?? '')) . ')</small>' ?> <?php endforeach; ?>
|
||||
<?php if (!empty($new_read_tools)): ?>
|
||||
<form method="post" class="mua-actions"><input type="hidden" name="csrf_token" value="<?= htmlspecialchars($unraid_csrf) ?>"><input type="hidden" name="mua_csrf" value="<?= htmlspecialchars($csrf) ?>"><input type="hidden" name="action" value="enable_new_read"><button type="submit" class="mua-btn mua-btn-primary">Neue Lesewerkzeuge freigeben (<?= count($new_read_tools) ?>)</button><span class="mua-muted">Steuernde Werkzeuge (VMs, Mover, Parity, Benachrichtigungen) einzeln unten unter „Werkzeuge im Detail“ freigeben.</span></form>
|
||||
<?php endif; ?>
|
||||
</div></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="mua-section"><h2>HTTPS / TLS</h2><div class="mua-card">
|
||||
<p>Aktiver Transport: <strong><?= $health_ok ? strtoupper($scheme) : 'unbekannt' ?></strong>. TLS schützt denselben MCP-Port inklusive <code>/health</code>; Bearer-Key und Toolfreigaben bleiben unverändert.</p>
|
||||
|
||||
@@ -210,7 +210,15 @@ function notification_fields(string $contents): array {
|
||||
|
||||
function notification_list(int $limit, ?string $importance): array {
|
||||
$limit = max(1, min(50, $limit));
|
||||
$files = array_merge(glob('/tmp/notifications/*.notify') ?: [], glob('/tmp/notifications/archive/*.notify') ?: []);
|
||||
// Unraid (dynamix/scripts/notify): ungelesen in /tmp/notifications/unread,
|
||||
// gelesen in /tmp/notifications/archive. Die Wurzel wird für ältere
|
||||
// Versionen weiterhin mitgelesen.
|
||||
$base = getenv('MUA_NOTIFICATIONS_DIR') ?: '/tmp/notifications';
|
||||
$files = array_merge(
|
||||
glob("$base/unread/*.notify") ?: [],
|
||||
glob("$base/*.notify") ?: [],
|
||||
glob("$base/archive/*.notify") ?: []
|
||||
);
|
||||
usort($files, fn($a, $b) => filemtime($b) <=> filemtime($a));
|
||||
$items = [];
|
||||
foreach ($files as $file) {
|
||||
@@ -227,6 +235,7 @@ function notification_list(int $limit, ?string $importance): array {
|
||||
'subject' => clean_text(trim((string)($n['subject'] ?? ''), '"'), 180),
|
||||
'description' => clean_text(trim((string)($n['description'] ?? ''), '"'), 500),
|
||||
'archived' => str_contains($file, '/archive/'),
|
||||
'file' => basename($file),
|
||||
];
|
||||
if (count($items) >= $limit) break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user