How xhmiss/wolgoweb works
Project Overview & Main Purpose
• WolGoWeb is a web API tool that enables triggering Wake-on-LAN (WOL) commands remotely. It’s designed to be deployed on a LAN server or NAS.
• Its primary role is to expose an HTTP API (with an optional Web UI) that—when called—sends a WOL magic packet to power on target machines. It also includes support for optional API authorization using token-based verification.
• The project is written in Go (see go.mod, go.sum, and source files under the src folder) and supports multiple deployment strategies (native binary, Docker, Docker Compose, and even deployment on Synology NAS).
Analyzing the File Structure
• Top-level files include versioning (.version, version.bat, version.vbs) and standard git and license files.
• The src folder contains the main Go application files (e.g., main.go and wol.go), where the core logic (HTTP server and WOL functions) is implemented.
• The docker folder includes Dockerfiles, Docker-compose files, and related shell scripts for building container images as well as usage instructions in its own README.
• The presence of a .github/workflows directory indicates CI/CD integration (for example, automated Docker image builds).
Core Components to Capture
a. Web/API Server:
• This is the heart of the application. It listens on a configurable port (default 9090) for incoming HTTP requests.
• It provides the Web UI (when enabled) for administrative interaction as well as the REST API endpoints (e.g., /wol endpoint) to trigger the magic packet.
b. WOL Processing Module:
• Separate logical component (represented by the wol.go file) which handles the creation and sending of the Wake-on-LAN magic packet.
• This module is invoked by the HTTP server upon receiving valid WOL requests.
c. Configuration Management:
• The system pulls configuration from command-line flags (e.g., -port, -username, -password, -c, -web, -key) and environment variables.
• This component ensures the application behavior is customizable and supports various deployment scenarios (Docker environment variables versus command-line arguments).
d. Security/Token Verification (Optional):
• When enabled (via key parameter), the API validates incoming requests by computing a token (MD5(key+mac+time)) and comparing it to the token sent by the client.
• This module should be represented to show the security measure built into the request handling.
e. External Clients:
f. Deployment Orchestration:
• Deployment modes: native binary deployment on Windows/Linux, containerization via Docker, Docker Compose, and even specific instructions for platforms such as Synology.
• A “Docker Environment” block to denote container-specific configurations and integration with CI/CD (GitHub Actions).
Relationships and Data Flow
• A feedback path from the WOL Module back to the HTTP server for response delivery (e.g., confirmation message).
• For API requests that require validation, show the flow that includes the security module (token generation and verification).
Architectural Patterns and Technologies
• Technologies to indicate:
• Golang (as the programming language and runtime)
• Docker & Docker Compose (for container and deployment management)
• GitHub Actions (for CI/CD pipelines)
• HTTP/REST for API communication