SIMON Master Console Rebuild
True command center for SIMON + WEB360
This rebuild gives you a cleaner production spine: interactive tree, live viewer, guarded editor, dynamic graphics, architecture map, and note storage. It is designed to sit beside your existing
console.php
and become the stronger replacement path.
Dashboard
Tree
Viewer
System Map
File Registry
Notes
Files
15,555
Folders
422
Scanned Size
3.85 GB
PHP Files
920
Editable Text Files
12,816
File viewer
guarded to /htdocs
/live/webhook_inbox.php
<?php declare(strict_types=1); require __DIR__ . '/bootstrap.php'; $stream = preg_replace('/[^a-zA-Z0-9_\-]/', '', (string)($_GET['stream'] ?? 'default')) ?: 'default'; $path = SIMON_DATA_DIR . '/webhook_' . $stream . '.ndjson'; $secrets = simon_secrets(); $secret = (string)($secrets['SIMON_WEBHOOK_SECRET'] ?? ''); function simon_check_webhook_secret(string $secret): bool { if ($secret === '') return true; $key = (string)($_GET['key'] ?? ''); if ($key !== '' && hash_equals($secret, $key)) return true; $body = file_get_contents('php://input') ?: ''; $sig = $_SERVER['HTTP_X_SIGNATURE'] ?? $_SERVER['HTTP_X_SIMON_SIGNATURE'] ?? ''; if ($sig !== '') { $expected = hash_hmac('sha256', $body, $secret); $sig = preg_replace('/^sha256=/', '', (string)$sig); if (hash_equals($expected, $sig)) return true; } return false; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!simon_check_webhook_secret($secret)) simon_json_response(['ok'=>false,'error'=>'Unauthorized webhook'], 401); $raw = file_get_contents('php://input') ?: ''; $payload = json_decode($raw, true); if (!is_array($payload)) $payload = ['title'=>'Webhook Text Event','message'=>$raw]; $row = [ 'id' => sha1($stream . '|' . microtime(true) . '|' . $raw), 'stream' => $stream, 'at' => gmdate('c'), 'ip' => $_SERVER['REMOTE_ADDR'] ?? '', 'payload' => $payload, ]; @file_put_contents($path, json_encode($row, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . "\n", FILE_APPEND | LOCK_EX); simon_json_response(['ok'=>true,'stored'=>1,'stream'=>$stream,'id'=>$row['id']]); } $limit = max(1, min(500, (int)($_GET['limit'] ?? 100))); $lines = is_file($path) ? (file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: []) : []; $rows = []; foreach (array_slice($lines, -$limit) as $line) { $row = json_decode($line, true); if (is_array($row)) $rows[] = $row; } simon_json_response(['ok'=>true,'stream'=>$stream,'count'=>count($rows),'items'=>array_reverse($rows)]);
Save file
Quick jump
open a path
Open