Giter Club home page Giter Club logo

ewake's Introduction

ewake

Web application that manages computers to wake up via WakeOnLan

Installation

Install with npm:

npm install

Install with pnpm:

pnpm install

Install with yarn:

yarn

Introduction

ewake is an application that helps you manage your WOL-enabled computers.

It allows users to start their computers themselves via a web frontend (no SSH access is needed anymore to send the magic packet).

http://localhost:5555/etherwake?user=1thorsten

The administration (creation and deletion) is done via a simple REST API.

PUT http://localhost:5555/manageClients
Content-Type: application/json

{
"name": "1thorsten",
"description": "serv1",
"mac": "E4:54:E8:A4:17:1F",
"ip": "10.40.4.162",
"check": "tcp:3389"
}

###

DELETE http://localhost:5555/manageClients
Content-Type: application/json

{
  "mac": "E4:54:E8:A4:17:1F",
  "ip": "10.40.4.162"
}

ewake shows which computers are currently running by applying the specified check (e.g. check tcp-port 3389).

http://localhost:5555/activeClients

ewake records the actions to detect problems easier.

http://localhost:5555/check

Get it to work

direct without Docker

ewake uses webpack to put all the components into a dependency-free javascript file that is simply executed using node.

Thus, only the resulting javascript file is needed on the server running ewake. The modules needed for development (node_modules) are no longer needed here.

Compilation of ewake to a file:

npm run build:dist

Execution of ewake:

cd dist/ewake
node ewake.js

You can also just download the latest release from here.

with Docker

network = host

network should be host to use all features (e.g. dissolving client mac-address)

  • manage clients with a file (no cluster possible)
docker run -d --restart unless-stopped --network host -e EWAKE_PORT=5555 -v ewake-clients:/ewake-clients --name ewake 1thorsten/ewake:latest
  • manage clients through http (cluster mode) you can link the client-resource for reading the data
docker run -d --restart unless-stopped --network host -e EWAKE_PORT=5555 -e EWAKE_JSON_HTTP=https://raw.githubusercontent.com/1thorsten/ewake/main/src/resources/client.json --name ewake 1thorsten/ewake:latest
  • manage clients through http and write via dav (cluster mode) you can use e.g. https://github.com/1thorsten/http-over-all for manage the client-resource. http-over-all offers access via http and also dav. So ewake can write the data back from every running instance. Perfect for shared usage.
docker run -d --restart unless-stopped --network host -e EWAKE_PORT=5555 -e EWAKE_JSON_HTTP=http://http-over-all:8338/mysamba/clients.json -e EWAKE_JSON_HTTP_WRITE=http://http-over-all:8338/dav/mysamba/clients.json --name ewake 1thorsten/ewake:latest

network = bridged

on Windows and mac network=host does not work properly

docker run -d --restart unless-stopped -p 5555:5555 -v ewake-clients:/ewake-clients --name ewake 1thorsten/ewake:latest
  • manage clients through http (cluster mode) you can link the client-resource for reading the data
docker run -d --restart unless-stopped -p 5555:5555 -e EWAKE_JSON_HTTP=https://raw.githubusercontent.com/1thorsten/ewake/main/src/resources/client.json --name ewake 1thorsten/ewake:latest
  • manage clients through http and write via dav (cluster mode) you can use e.g. https://github.com/1thorsten/http-over-all for manage the client-resource. http-over-all offers access via http and also dav. So ewake can write the data back from every running instance. Perfect for shared usage.
docker run -d --restart unless-stopped -p 5555:5555 -e EWAKE_JSON_HTTP=http://http-over-all:8338/mysamba/clients.json -e EWAKE_JSON_HTTP_WRITE=http://http-over-all:8338/dav/mysamba/clients.json --name ewake 1thorsten/ewake:latest

ewake's People

Contributors

1thorsten avatar dependabot[bot] avatar thorsten-sce avatar

Stargazers

 avatar  avatar

Watchers

 avatar

ewake's Issues

internal/errors:497

Installed on multiple host docker environments to verify issue. While host is running if I click any of the options.

show active clients
show internal logs
show ip address and mac address of the requesting host

The host server docker container crashes. Networking is set to Host. Open ports are 5555 --> 5555. -V mapped to /opt/ewake --> /ewake-clients

Docker logs show.

node:internal/errors:497
ErrorCaptureStackTrace(err);
^
Error [ERR_HTTP_HEADERS_SENT]: Cannot write headers after they are sent to the client
at new NodeError (node:internal/errors:406:5)
at ServerResponse.writeHead (node:_http_server:345:11)
at a.httpError (/ewake/ewake.js:2:54010)
at Server. (/ewake/ewake.js:2:259856)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_HTTP_HEADERS_SENT'
}
Node.js v20.9.0

Thanks for any help!

Docker

  • Dockerfile and docker-compose.yml
  • add npm script to build docker image as well
  • update README.md to reflect usage with docker
  • use environment variables as another possiblity to control the app (use env as default value which can be changed with arguments)
    e.g, control of the server of the server port (--port)

at the moment the default is port 5555. Idea is that the default comes from env.PORT and only when this is not defined take a fixed default value (5555)

set default network interface as argument

Currently, the network interface can be passed as an HTTP argument. Accordingly, the transfer is made by the user.
This makes no sense, the network interface is a setting that must apply to the server.

Therefore it should be possible to pass the network interface as an argument (command line) when starting the server. The possibility for the user is to be omitted.

tasks

  • add command line argument (-i --interface)
  • adjust call to arp (windows, linux, mac)
  • show the choosen network interface after starting the server
  • adjust documentation

client configuration via HTTP

In order to enable cluster operation, it should also be possible to access the configuration via HTTP as an alternative to the file system.
Writing requires WebDAV support on the part of the HTTP server.

Tasks:

  • argument file should be handle URI as well
  • introduce another argument for readonly access to the configuration.
  • update the documentation

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.