Your gaming PC and your Discord bot, from anywhere. A tiny web panel running on a Raspberry Pi Zero 2 W that wakes the PC with Wake on LAN, monitors it, runs your scripts on it over SSH and turns it off again β and manages the RGL Discord BOT that lives on the same Pi. All from your phone, through Tailscale. π
The Pi is always on and sips power; the PC only runs when there is something to do. From the panel you see CPU, RAM, disk and GPU at a glance, power the PC on/off/restart/sleep, lock it, keep it from locking, restart, update and configure the Discord bot, and even top up a prepaid wallet that needs a real browser β which the Pi (415 MB of RAM) could never run itself, so it borrows the PC for 30 seconds. β‘
| Area | Technology |
|---|---|
| Panel backend | Python 3.15 (via uv) Β· Flask 3 Β· waitress |
| Panel frontend | Vanilla HTML + CSS + JS β inline SVG icons and charts, zero dependencies Β· Bento theme, dark by default with a light mode (Inter + JetBrains Mono) |
| Telemetry | SQLite (telemetria.db), 30 days of history, bucketed on the fly per range |
| PC control | OpenSSH Server on Windows (key auth only) + PowerShell 5.1 scripts |
| Power on | Wake on LAN magic packet (UDP broadcast from the Pi) |
| Desktop actions | Windows Task Scheduler tasks that run inside the user session |
| Browser automation | Playwright + headless Chromium (wallet top-up) |
| Alerts | Telegram Bot API |
| Services | systemd (recarga-web) β starts with the Pi, restarts itself; also drives the bot's discordbot service |
| Remote access | Tailscale (WireGuard VPN, no ports opened) |
| Hardware | Raspberry Pi Zero 2 W Β· Windows 11 PC (AtlasOS) |
| CI/CD | GitHub Actions β automatic versioning, tag and release on every push |
A Bento grid of rounded cards β dark by default, with a sun button for light mode (remembered per browser). Figures in a monospace so they line up, one teal accent for what you can touch. On a phone the cards stack and the navigation becomes a bar at the bottom, under your thumb.
β ZD ZeroDesk ββββββββββββββββββββββββββββββ β Todo operativo Β· 13:27 β β₯ β
β [Inicio] Bot Terminal GrΓ‘ficas Sistema β
β β PC de juegos βββββββββββββββββββββββββββββββββββββββββββ [β» Apagar PC] ββ
β β RNXPC β En lΓnea Β· encendido hace 3 h 20 min ββ
β β [CPU 18%] [RAM 41%] [Disco 56%] [GPU 9%] [47 Β°C] ββ
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Control del PC ββ β RGL Bot ββ Activo β β Scripts ββββββββββββββββββ β
β β 6 buttons β β v2.0.0 Β· 2 d Β· 61MBβ β Monedero Casa Ortega β β
β β Anti-bloqueo β β β Chat de IA β β β [Simular] [Recargar 10β¬] β β
β βββββββββββββββββββ ββββββββββββββββββββββ ββββββββββββββββββββββββββββ β
β β Terminal ββββββββββββββββββββββββββββββ β Raspberry Pi ββββββββββββββ β
β Rendimiento Β· Herramientas del bot (logs, .env, memoria IA) Β· Sistema β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- π₯οΈ Summary β the PC's name, state and uptime, one main button (Power on when it is off, Shut down when it is on) and a one-line diagnosis: all good, disk C: at 92 %, GPU at 82 Β°C, waiting at the login screenβ¦
- π Command path β browser β Raspberry Pi β PC, each with its own status dot, so you see at a glance which link is down.
- π Live metrics β CPU, RAM, disk C:, GPU load and GPU temperature; the bar turns amber and then red past its threshold.
- π Performance β one large chart; pick the metric (PC CPU / RAM / GPU temp, Pi CPU / RAM / temp) in cells that already show its latest value and its peak, with 1 h Β· 6 h Β· 24 h Β· 7 d Β· 30 d ranges, a real scale and hover tooltips. Gaps (PC off, Pi rebooting) break the line instead of lying.
- π§Ύ System β Windows edition, CPU, GPU, public IP and session; casaortega.com, Redsys and the Telegram API with their latency; the Pi's CPU, RAM, temperature and uptime.
| Button | How it works |
|---|---|
| β‘ Power on | Wake on LAN from the Pi, then waits until SSH answers |
| β» Shut down | shutdown /s over SSH, waits until the PC is really gone |
| π Restart | shutdown /r, tracks it going down and coming back |
| π Sleep | SetSuspendState β wakes up again with Power on |
| π Lock / πͺ Sign out | Scheduled tasks that run inside the desktop session |
| π±οΈ Anti-lock | Nudges the mouse 1 px every 5 min so Windows never locks (off by default) |
| π Reboot Pi | systemctl reboot through an exact-command sudoers rule; the page reconnects by itself |
The RGL Discord BOT runs on the same Pi. It used to have its own web panel (another Flask app, another service, more RAM); everything it did now lives here:
- π’ Status β running / stopped / crashed, version, uptime and memory of the
discordbotservice. - π Restart / stop / start, and Update: runs the bot's
startup.sh(apt,git resetto the latestmain, Python patch, dependencies) as a job, streamed into the terminal, and checks the version that actually came up. - π¬ AI chat switch β on/off instantly (
data/ai_state.json). - π Logs β the last lines of its journal, errors in red.
- βοΈ Config β its
.envand.env.avisosas a form, comments and order kept; tokens and keys are never sent to the browser (empty = unchanged). After saving it offers to restart the bot. - π§ AI memory β edit the manual context and the learned memory as JSON (validated before saving), or wipe the learned memory in one click.
- π³ Wallet top-up β logs into casaortega.com, fills the Redsys gateway with the Pluxee card and waits for the bank. If the PC was off, it is woken up for the job and shut down afterwards; if it was on, it is left alone.
Every operation shows its steps ([ OK ], [FAIL], timings) and the PC's output live; when idle, the terminal shows the operation log.
flowchart LR
phone["π± Phone / browser"] -- Tailscale --> pi["π Raspberry Pi Zero 2 W<br/>Flask panel :6678"]
pi -- "Wake on LAN" --> pc["π₯οΈ Windows PC"]
pi -- "SSH (key)" --> pc
pc -- "scheduled tasks" --> desk["π€ User session<br/>jiggler Β· lock"]
pc -- "Playwright" --> shop["π casaortega.com β Redsys"]
pi -- "systemd" --> bot["π€ Discord bot<br/>discordbot.service"]
pi -- alerts --> tg["βοΈ Telegram"]
pc -- alerts --> tg
ZeroDesk/
βββ panel/ # π runs on the Raspberry Pi
β βββ app.py # Flask app: monitor thread, jobs, API
β βββ templates/ static/ # dashboard UI (panel, login) and its single stylesheet
β βββ instalar.sh # one-shot installer (venv, SSH key, sudoers, systemd)
β βββ cambiar_password.py # set / change the panel password
β βββ recarga-web.sudoers # the exact commands the panel may run with sudo
β βββ recarga-web.service
βββ pc/ # π₯οΈ runs on the Windows PC (called by the Pi over SSH)
β βββ preparar_pc.ps1 # one-shot setup: OpenSSH, firewall, WoL, scheduled tasks
β βββ estado_pc.ps1 # CPU / RAM / disk / GPU / session β JSON
β βββ jiggler.ps1 Β· mantener_despierto.ps1 Β· lanzar_jiggler.vbs
β βββ sesion.ps1 # lock / sign out
βββ recarga.py # π³ wallet top-up (Playwright)
βββ notificar.py Β· saldo.py Β· sacar_chat_id.py Β· recargar.bat
βββ .github/workflows/release.yml
- Clone the repo (the panel expects it at the path set in
PC_DIR). - Wallet top-up (optional):
pip install -r requirements.txt python -m playwright install chromium-headless-shell copy .env.example .env # card, Casa Ortega login, Telegram bot python sacar_chat_id.py # prints your TG_CHAT_ID
- From an elevated PowerShell, with the key printed by the Pi installer:
It installs OpenSSH Server from Microsoft's MSI (works on AtlasOS, where Windows Update is off), allows only the Pi's key, opens port 22 only to the Pi, arms Wake on LAN and registers the scheduled tasks.
powershell -ExecutionPolicy Bypass -File .\pc\preparar_pc.ps1 -ClavePi "ssh-ed25519 AAAA... pi-recarga"
- In the BIOS/UEFI: enable Wake on LAN / Power On By PCI-E and disable ErP / Deep Sleep. The PC must be on Ethernet.
git clone https://github.com/Ren0X1/ZeroDesk.git
sudo bash ZeroDesk/panel/instalar.shThe panel runs straight from the cloned repo (~/ZeroDesk/panel). The installer creates the venv, generates the SSH key for the PC, asks for the panel password, installs the sudo rule and enables the recarga-web service so it starts on every boot. Then check ~/ZeroDesk/panel/.env (PC_IP, PC_MAC, PC_DIR, TG_TOKEN, TG_CHAT_ID).
http://<pi-tailscale-ip>:6678 from any device on your tailnet. π±
bash ~/ZeroDesk/panel/actualizar.sh # π update: git pull + restart (config and history are kept)
# the stylesheet URL carries VERSION, so browsers pick up the new look at once
systemctl status recarga-web # is the panel up?
journalctl -u recarga-web -n 50 --no-pager # what happened
cd ~/ZeroDesk/panel && venv/bin/python cambiar_password.py && sudo systemctl restart recarga-webOn the PC nothing needs restarting: the Pi calls the scripts in pc/ and recarga.py from the repo folder on every run, so a git pull there is enough.
- π SSH into the PC with one key only; password login is disabled; port 22 is open only to the Pi.
- π The panel is meant to be reached only through Tailscale β nothing is exposed to the internet.
- π§ Panel password stored as a salted hash; 5 wrong attempts β 15 min lockout + Telegram alert.
- π‘οΈ Session cookie
HttpOnly+SameSite=Strict, and a CSRF token on every action. - π§― The Pi's sudo rights are limited to exact commands (
panel/recarga-web.sudoers): reboot, restart the panel, and start / stop / restart / update the bot. - π³ Card data lives only in the PC's
.env(git-ignored). The top-up is once a day max and never retries by itself: a blind retry could charge twice.
- Power on does nothing β Wake on LAN is off in the BIOS, ErP is on, or the PC is on Wi-Fi. The link LED on the NIC should stay lit while the PC is off.
- Lock / anti-lock greyed out β they need someone signed in on the PC; after a Wake on LAN boot the PC sits at the login screen.
- No GPU temperature β it comes from
nvidia-smi; Windows' ACPI thermal zone reports a fixed value and is ignored on purpose. - Top-up timed out β the bank may have charged anyway: check the wallet before trying again.
π οΈ ZeroDesk by Ren0X1.