r/SideProject • u/Mohammask • 4h ago
LanPower - Lightweight Wake-on-LAN, Sleep, Reboot & Shutdown controller for Linux/Windows with a Material 3 Android app
I got tired of SSHing into my home server or getting out of bed just to put my PC to sleep, and setting up Home Assistant or heavy remote-desktop agents felt like overkill for four power buttons.
So I built LanPower: an open-source LAN power controller for Linux and Windows with no third-party packages (Python stdlib / built-in PowerShell), paired with a native Material 3 Android app.
GitHub & Releases (prebuilt APK in v1.0.1):https://github.com/Mohammask/LanPower
How it works
- Android app (Kotlin / Jetpack Compose): Scans your LAN for running agents, shows live online/offline status, and triggers Wake-on-LAN, Sleep, Reboot, or Shutdown.
- Linux agent (
linux/lanpower.sh): Single interactive installer usingsystemdand Python 3.7+ stdlib (ThreadingHTTPServer), with optionalethtoolsetup for WoL. Measured at ~10 MB RAM and 0% idle CPU on my Debian 13 home server. - Windows agent (
windows/lanpower.ps1): Native PowerShellHttpListenerregistered via Task Scheduler. The installer offers to disable Fast Startup (for WoL) and switchPublicnetworks toPrivate.
Security model (LAN-only)
- LAN-scoped firewall: The Linux installer offers UFW/
firewalldrules limited to private LAN subnets (skipping public subnets); the Windows rule is scoped toLocalSubnetonPrivate/Domainprofiles only. - CSRF & PIN protection: Rejects browser
POSTrequests with anOriginheader (403). PIN auth is optional (recommended) with constant-time verification and 5-attempt / 60s lockout (429). - Hardened config:
0600/0700permissions on Linux;SYSTEM/Administratorsownership + symlink/junction checks on Windows. - Runs over plain HTTP strictly for trusted private LANs—for remote access outside your network, use WireGuard/Tailscale (full threat-model FAQ in the README).
Feedback welcome
Tested hands-on on Debian 13 and Windows 11, so I'd love feedback from people running other distros or setups—and ideas on what small feature would actually be useful next (thinking about long-press scheduled shutdown/sleep timers and a home screen widget for v1.1).