Git Product home page Git Product logo

desktop-control-gateway's Introduction

Desktop Control Gateway

This is the gateway (API) server for managing your devices in LAN.

Disclaimer

For secure communication from WAN make sure you use https connection for handling all incoming traffic! Using http is insecure and not recomended!

Features

  • Automatic API Key generation on first start
  • Wake on Lan support
  • Remote shutdown using ssh
  • Ping support

Getting Started

To get a local copy up and running follow these steps:

Prerequisites

  • Node and npm installed
  • [Optional] Forwarded selected port (default: 3001) (for WAN communication)
  • [Optional] SSL certificate (highly recomended)

Installation

  1. Clone the repo

    git clone https://github.com/eRgo35/desktop-control-gateway.git
    
  2. Install node modules by running

    npm install
    

    or

    yarn install
    

Usage

To execute a command you need a program or a website that supports POST requests

Avaiable Commands:


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

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.