Refactor: PHP-Built-in-Server durch TypeScript-Binary (Bun Runtime) ersetzt
- src/*.ts: Port von mcp/*.php (helpers, tools, server) - Bun.serve() statt php -S — production-grade HTTP, POST funktioniert - dist/mua-1.0.0-x86_64-1.txz: Slackware-Paket (Binary + rc.mua + mua.page + PHP-Helper) - plugin/mua.plg: .txz-Installation via upgradepkg - scripts/rc.mua: Binary statt php -S - scripts/mua.page: Binary-Info statt PHP-Version - scripts/package.sh: .txz-Builder Fix: MCP-POST-Endpunkt lieferte leeren Body (php -S Limitation). Bun.serve() löst das Problem.
This commit is contained in:
+4
-2
@@ -14,6 +14,7 @@ Icon="cubes"
|
||||
$plugin_dir = '/usr/local/emhttp/plugins/mua';
|
||||
$port = 3002;
|
||||
$pidfile = '/var/run/mua.pid';
|
||||
$binary = '/usr/local/bin/mua';
|
||||
$endpoint = 'http://' . ($_SERVER['SERVER_ADDR'] ?? '127.0.0.1') . ':' . $port . '/mcp';
|
||||
|
||||
// Status bestimmen
|
||||
@@ -40,7 +41,7 @@ $health_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
$health_ok = ($health_code === 200);
|
||||
|
||||
$php_version = PHP_VERSION;
|
||||
$binary_exists = file_exists($binary);
|
||||
$tool_count = 21;
|
||||
$host_ip = $_SERVER['SERVER_ADDR'] ?? '127.0.0.1';
|
||||
?>
|
||||
@@ -74,7 +75,8 @@ $host_ip = $_SERVER['SERVER_ADDR'] ?? '127.0.0.1';
|
||||
<table>
|
||||
<tr><th>Plugin</th><td>MUA (Mikes Unraid Agent)</td></tr>
|
||||
<tr><th>Version</th><td>1.0.0</td></tr>
|
||||
<tr><th>PHP</th><td><?= $php_version ?></td></tr>
|
||||
<tr><th>Runtime</th><td>TypeScript (Bun Runtime, kompiliertes Binary)</td></tr>
|
||||
<tr><th>Binary</th><td><code><?= $binary ?></code> <?= $binary_exists ? '✅' : '❌ fehlt' ?></td></tr>
|
||||
<tr><th>Port</th><td><?= $port ?></td></tr>
|
||||
<tr><th>Host-IP</th><td><?= $host_ip ?></td></tr>
|
||||
<tr><th>Tools</th><td><?= $tool_count ?> (Docker: 14, Netzwerk: 6, System: 1)</td></tr>
|
||||
|
||||
Reference in New Issue
Block a user