Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KtulhuServer Logo

KtulhuServer

Language Framework UI Telemetry Integration Status

Buy Me A Coffee

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.

Ktulhu Server WPF Acrylic Dashboard


Warning

Disclaimer & Legacy Notice

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.


💡 Origin & Background

Operating a self-hosted Windows home server (playfully nicknamed "Ktulhu") behind residential NAT and dynamic ISP IP addresses presented two constant challenges:

  1. 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.
  2. 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 OpenHardwareMonitorLib and dispatching instant Telegram alert notifications if temperatures exceeded 80°C or reached critical thresholds (100°C).

🛠️ Architecture & Suite Components

1. desktop-tool/ (KtulhuServerTool) — Primary Desktop Dashboard

  • Fluent Acrylic Interface: Implements Windows 10 Acrylic blur behind the WPF window using SetWindowCompositionAttribute P/Invoke (API/Acryl.cs).
  • Hardware Telemetry & Thermal Alerts:
    • Uses OpenHardwareMonitorLib.dll and 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°C or critical_temp = 100°C.
  • 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 executes setWebhook?url=https://<ngrok-host><path>.
  • Live Logging: Performance and connection history logger (PerfLog.cs).

2. daemon/ (KtulhuServer) — Headless Console Daemon

  • Compact console background worker for headless environments.
  • Continuously polls ngrok tunnel states and maintains Telegram webhook validity with minimal memory footprint.

3. experiments/uwp-dashboard/ — UWP Interface Prototype

  • Experimental Universal Windows Platform (UWP) dashboard designed with Segoe MDL2 iconography and CPU performance meters.

📦 Project Structure

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

About

Home server monitoring dashboard, ngrok tunnel coordinator, and Telegram webhook manager built with WPF & C# (2019–2020 archive)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages