Web app to send Wake-on-LAN (WoL) packets
Find a file
2025-12-29 23:26:19 -08:00
templates Add url prefix support 2025-12-29 23:22:19 -08:00
.dockerignore Initial import 2025-12-29 23:03:17 -08:00
.gitignore Initial import 2025-12-29 23:03:17 -08:00
app.py Fix url prefix 2025-12-29 23:26:19 -08:00
docker-compose.yml Add url prefix support 2025-12-29 23:22:19 -08:00
Dockerfile Add url prefix support 2025-12-29 23:22:19 -08:00
README.md Fix url prefix 2025-12-29 23:26:19 -08:00
requirements.txt Initial import 2025-12-29 23:03:17 -08:00

Wake-on-LAN Web Manager

A Flask-based web application to manage and wake machines on your local network using Wake-on-LAN (WoL) packets.

Features

  • 📋 Machine List: View all registered machines with their current status (online/offline)
  • Wake Machines: Send WoL packets to offline machines with a single click
  • Add/Edit Machines: Manage machine configurations (name, IP, MAC address)
  • 🔍 Status Monitoring: Automatic ping-based status checking every 10 seconds
  • 🎨 Modern UI: Clean, responsive interface with modal dialogs
  • 🐳 Docker Support: Easy containerized deployment

Prerequisites

For running locally:

  • Python 3.8 or higher
  • Network access to the machines you want to wake

For Docker:

  • Docker installed on your system

Installation

Option 1: Running Locally

  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python app.py
  1. Open your browser and navigate to:
http://localhost:5100

Option 2: Using Docker

  1. Build the Docker image:
docker build -t wol-manager .
  1. Run the container:
docker run -d \
  --name wol-manager \
  --network host \
  -v wol-data:/app/data \
  wol-manager

Note: The --network host flag is important for WoL packets to work correctly on your local network.

  1. Open your browser and navigate to:
http://localhost:5100

Option 3: Using Docker Compose

  1. Start the application:
docker-compose up -d
  1. Open your browser and navigate to:
http://localhost:5100

Usage

Adding a Machine

  1. Click the "+ New Machine" button
  2. Enter the machine details:
    • Machine Name: A friendly name (e.g., "Living Room PC")
    • IP Address: The machine's IP address (e.g., "192.168.1.100")
    • MAC Address: The machine's MAC address (e.g., "AA:BB:CC:DD:EE:FF")
  3. Click "Save"

Waking a Machine

  1. Wait for the status indicator to update (or refresh the page)
  2. Machines that are offline will show a red indicator
  3. Click the "Wake" button next to the offline machine
  4. The WoL packet will be sent to the machine

Editing a Machine

  1. Click the "Edit" button next to any machine
  2. Update the details as needed
  3. Click "Save"

Deleting a Machine

  1. Click the "Delete" button next to any machine
  2. Confirm the deletion

How It Works

  • Status Checking: The app pings each machine every 10 seconds to determine if it's online
  • Wake-on-LAN: When you click "Wake", a magic packet is sent to the machine's MAC address
  • Data Storage: Machine configurations are stored in a JSON file (machines.json)

Network Requirements

For Wake-on-LAN to work:

  1. Target machines must have WoL enabled in BIOS/UEFI
  2. Network adapters must support WoL
  3. Machines should be connected via Ethernet (WiFi WoL is less reliable)
  4. The app must be running on the same local network as the target machines

Data Persistence

When using Docker, machine data is stored in a Docker volume named wol-data. This ensures your machine configurations persist across container restarts.

Reverse Proxy Support

If you're running the app behind a reverse proxy (like nginx) with a URL prefix, you need to:

  1. Configure nginx to strip the prefix when proxying to the backend:
location /c/ {
    proxy_pass http://localhost:5100/;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}
  1. Set the URL_PREFIX environment variable so the frontend knows what base path to use:

With Docker:

docker run -d \
  --name wol-manager \
  --network host \
  -e URL_PREFIX=/c \
  -v wol-data:/app/data \
  wol-manager

With Docker Compose: Edit docker-compose.yml and set:

environment:
  - URL_PREFIX=/c

Running locally:

export URL_PREFIX=/c
python app.py

The app will then be accessible at https://yourserver.com/c/. The URL_PREFIX variable tells the frontend JavaScript where to make API calls, while nginx strips the prefix before forwarding to the Flask backend.

Troubleshooting

WoL not working?

  • Verify WoL is enabled in the machine's BIOS
  • Check that the MAC address is correct
  • Ensure the machine is on the same network
  • Try using --network host with Docker

Status always showing offline?

  • Check firewall settings (ICMP/ping must be allowed)
  • Verify the IP address is correct
  • Some machines may not respond to ping when sleeping

Technology Stack

  • Backend: Python, Flask
  • Frontend: HTML, CSS, JavaScript
  • Libraries: wakeonlan, subprocess (for ping)
  • Containerization: Docker

License

MIT License - Feel free to use and modify as needed.