This is the gateway (API) server for managing your devices in LAN.
For secure communication from WAN make sure you use https connection for handling all incoming traffic! Using http is insecure and not recomended!
- Automatic API Key generation on first start
- Wake on Lan support
- Remote shutdown using ssh
- Ping support
To get a local copy up and running follow these steps:
- Node and npm installed
- [Optional] Forwarded selected port (default: 3001) (for WAN communication)
- [Optional] SSL certificate (highly recomended)
-
Clone the repo
git clone https://github.com/eRgo35/desktop-control-gateway.git
-
Install node modules by running
npm install
or
yarn install
To execute a command you need a program or a website that supports POST requests
Route: /api/auth
{
"key": "YOUR_API_KEY"
}
Returns if provided API KEY is correct. Should not be used for authentication!
Route: /api/manage
{
"command": "isAlive",
"address": "IP_ADDRESS_OR_HOSTNAME",
"key": "YOUR_API_KEY"
}
Pings the provided address (or hostname) and returns the response
{
"command": "powerOn",
"mac": "DEVICE_MAC_ADDRESS",
"broadcast": "NETWORK_BROADCAST_ADDRESS",
"key": "YOUR_API_KEY"
}
Sends the magic packet to the provided device on the network
{
"command": "powerOff",
"address": "IP_ADDRESS_OR_HOSTNAME",
"port": "OPTIONAL_SSH_PORT",
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD",
"shutdownCmd": "SHUTDOWN_CMD",
"key": "YOUR_API_KEY"
}
Connects to the machine using SSH and executes provided shutdown command
Login by id_rsa will be added in the future release
Default SSH port is set to 22 if nothing is provided