All Projects → daBONDi → go-rest-wol

daBONDi / go-rest-wol

Licence: MIT License
Simple HTTP Server with WebUI and REST API for Sending WoL Package over the Wire

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to go-rest-wol

wake-pc
Wake PC is a tiny self-hosted Wake-On-Lan (WOL) app written in PHP for linux machines that you can use to wake up machines on your local network.
Stars: ✭ 44 (-43.59%)
Mutual labels:  wakeonlan, wol
OC-Little-Translated
ACPI Hotpatches and Guides for the OpenCore Bootmanager. Enhance and fine-tune your system by adding devices and enabling additional features not covered in the OpenCore Install Guide.
Stars: ✭ 129 (+65.38%)
Mutual labels:  wake
wakeup
HTTP API and front-end for sending Wake-on-LAN messages
Stars: ✭ 30 (-61.54%)
Mutual labels:  wakeonlan
liwasc
List, wake and scan nodes in a network.
Stars: ✭ 129 (+65.38%)
Mutual labels:  wol
WakeOnLAN
A simple C program that sends a magic packet
Stars: ✭ 49 (-37.18%)
Mutual labels:  wakeonlan
php-wol
PHP WakeOnLan Interface
Stars: ✭ 30 (-61.54%)
Mutual labels:  wakeonlan
UpSnap
A simple wake on lan app written with Django, Django-Channels (websockets), Celery, Redis and nmap.
Stars: ✭ 65 (-16.67%)
Mutual labels:  wakeonlan

GoLang HTTP Server for Remote WOL Requesting from an CSV Computer List

A HTTP server who sends a Wake On LAN package on an HTTP request.

Docker Image

Simple bootstrap UI for easy usage

Screenshot

Simple REST API to let a machine wake someone up

/api/wakeup/computer/<hostname> - Returns a JSON object

{
  "success":true,
  "message":"Succesfully Wakeup Computer Computer1 with Mac 64-07-2D-BB-BB-BF on Broadcast IP 192.168.10.254:9",
  "error":null
}

Enviroment Variables

Variable Name Description
WOLHTTPPORT Define the port on which the webserver will listen to (Default: 8080)
WOLFILE Path to the CSV file containing the list of hosts (Default: .\computer.csv)

Commandline arguments

Commandline argument Example Description
--port --port 80 Define the port on which the webserver will listen to (Default: 8080)
--file --file comp.csv Path to the CSV file containing the list of hosts (Default: .\computer.csv)

Computer list file CSV layout

Columns

<name of the computer>,<mac address of the computer>,<broadcast ip to send the magic packet>

Example

name,mac,ip
Computer1,64-07-2D-BB-BB-BF,192.168.10.254:9
Computer2,2D-F2-3D-06-17-00,192.168.10.254:9
Computer3,FF-B3-95-62-1C-DD,192.168.10.254:9

Docker

Docker Image: dabondi/go-rest-wol

docker build -t go-rest-wol .
docker run go-rest-wol

If you want to run it on a different port (i.e.: 6969) and also want to provide the CSV file on your host:

docker run -p 6969:8080 -v $(pwd)/externall-file-on-host.csv:/app/computer.csv dabondi/go-rest-wol

If you want to run the WOL Webserver Process in the Webserver on a different Port:

# Used if you run in Network Host Mode
docker run -e "WOLHTTPPORT=9090" -p 9090:9090 -v $(pwd)/externall-file-on-host.csv:/app/computer.csv dabondi/go-rest-wol

This was a good exercise to learn Golang (and refresh my Docker skills).

Thx https://github.com/sabhiram/go-wol for the WOL code, sorry that I stole it from you, because I got no clue how I can inject it into my program. :-(

If you have any good ideas, I'm open for pull requests.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].