Coder Social home page Coder Social logo

julionadal / go-rest-wol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dabondi/go-rest-wol

0.0 0.0 0.0 65 KB

Simple HTTP Server with WebUI and REST API for Sending WoL Package over the Wire

License: MIT License

Go 66.31% HTML 29.25% Dockerfile 4.44%

go-rest-wol's Introduction

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.

Credits

Full credits go to daBONDi

go-rest-wol's People

Contributors

dabondi avatar vincentcox avatar julionadal avatar rdch106 avatar aenduweber avatar bjakobs avatar mattheys avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.