KtulhuServer is a home server management suite built in C# for Windows. It integrates real-time hardware telemetry, automatic thermal alert dispatching via Telegram, ngrok tunnel coordination, and dynamic Telegram bot webhook synchronization.
Warning
Developed between November 2019 and January 2020 for Windows 10 and .NET Framework 4.7.2. Archived for historical and architectural reference; not tested or updated for Windows 11.
Operating a self-hosted Windows home server (playfully nicknamed "Ktulhu") behind residential NAT and dynamic ISP IP addresses presented two constant challenges:
- Telegram Webhook Drift: Self-hosted Telegram bots communicating via webhooks require public HTTPS endpoints. When using ngrok tunnels on free tiers, public URLs rotate on reconnects. Manually re-configuring webhook endpoints for multiple bots was tedious and caused service downtime.
- Thermal Safety: Dedicated compact server chassis under continuous load (media encoding, bot processing) required constant thermal vigilance.
KtulhuServer was created to automate both tasks:
- Monitoring the ngrok daemon API, capturing new public URLs, and immediately updating all registered bot webhooks via the Telegram Bot API.
- Polling hardware thermal sensors via
OpenHardwareMonitorLiband dispatching instant Telegram alert notifications if temperatures exceeded 80°C or reached critical thresholds (100°C).
- Fluent Acrylic Interface: Implements Windows 10 Acrylic blur behind the WPF window using
SetWindowCompositionAttributeP/Invoke (API/Acryl.cs). - Hardware Telemetry & Thermal Alerts:
- Uses
OpenHardwareMonitorLib.dlland WMI performance counters to monitor CPU clock frequencies, core temperatures, and available system RAM. - Automatically sends warning messages to server administrators via Telegram if temperatures cross
alert_temp = 80°Corcritical_temp = 100°C.
- Uses
- Tunnel Management & Webhook Sync (
Ngrok.cs,TelegramBots.cs):- Interrogates the local ngrok client API (
http://localhost:4040/api/tunnels). - Reads bot token mappings (
token|path) and executessetWebhook?url=https://<ngrok-host><path>.
- Interrogates the local ngrok client API (
- Live Logging: Performance and connection history logger (
PerfLog.cs).
- Compact console background worker for headless environments.
- Continuously polls ngrok tunnel states and maintains Telegram webhook validity with minimal memory footprint.
- Experimental Universal Windows Platform (UWP) dashboard designed with Segoe MDL2 iconography and CPU performance meters.
ktulhu-server/
├── desktop-tool/ # Primary WPF server dashboard
│ ├── KtulhuServerTool.sln # Visual Studio solution
│ └── KtulhuServerTool/
│ ├── MainWindow.xaml # Acrylic dashboard view
│ ├── MainWindow.xaml.cs # Telemetry loop & thermal alert triggers
│ ├── Ngrok.cs # ngrok local REST API client
│ ├── TelegramBots.cs # Multi-bot webhook updater
│ ├── OpenHardwareMonitorLib.dll # Hardware sensor library
│ └── API/ # Windows Acrylic & sensor interop
├── daemon/ # Headless console daemon
│ ├── KtulhuServer.sln # Console solution
│ └── KtulhuServer/ # Tunnel sync service
├── experiments/ # Historical experiments
│ └── uwp-dashboard/ # UWP server monitor prototype
└── logo.png # Project branding

