Python REST API that wakes a machine (that supports wol) from outside of the local network.
git clone https://github.com/Urpagin/WoL_Api/
cd WoL_Api
vim .env
Then populate .env with HASHED_KEY=<HASHEDKEY>
Use this webpage to hash your password using the SHA384 hashing algorithm.
docker build -t urpagin/wol-api:0.0.1 .
docker images
Then copy image ID
docker run -d --restart=always --network host --name wol-api <IMAGEID>
It's all good man. Now you can execute docker ps
to show all running containers or docker ps -a
to show all running and exited containers in case wol-api crashed.
/
(GET): simple static HTTP to check the API
/wake
(POST): takes key
and ip
wakes a machine with pagic packet
/ping
(GET): takes key
and ip
returns the ping response of the machine
/add-machine
(PUT): takes key
and ip
gets the mac address of ip
and ands the tuple (ip, mac) into database
/database
(GET): takes key
returns the database content in the form of a list.
Note: all responses are json {"detail": <RESPONSE>}
Note X2: before using /wake
make sure you added the machine's mac address to the database with /add-machine
Image Credits: Image by www.slon.pics on Freepik