No description
Find a file
2024-10-06 15:45:09 +02:00
.github/workflows docker after test 2024-06-17 12:37:31 +02:00
src Merge remote-tracking branch 'origin/conf' 2024-10-06 15:45:09 +02:00
.gitignore Closes #24. Changed postgres to json directory storage 2024-04-10 00:16:55 +02:00
Cargo.lock version bump 2024-08-12 17:21:16 +02:00
Cargo.toml version bump 2024-08-12 17:21:16 +02:00
Dockerfile version bump 2024-08-12 17:21:16 +02:00
LICENSE Create LICENSE 2023-10-30 13:07:21 +01:00
README.md Version bump 2024-06-17 12:02:44 +02:00

webol

Config

Default config.toml:

serveraddr = "0.0.0.0:7229" # String
pingtimeout = 10 # i64
pingthreshold = 1 # u64

[auth]
method = "none" # "none"|"key"
secret = "" # String

Docker

minimal docker-compose.yaml:

services:
  webol:
    image: ghcr.io/fxqnlr/webol:latest
    container_name: webol
    restart: unless-stopped
    volumes:
      - ./devices:/devices
      - ./logs:/logs
    network_mode: host

Usage

Register Device

A device is registered with a PUT request to the server with a JSON representation of the device as payload.

field description example
server-ip ip of the webol server, including its port webol.local:7229
secret secret set in the server settings password
device-id any string, "name" of the device foo
mac-address mac address of the device 12:34:56:AB:CD:EF
broadcast-ip broadcast ip of the network, including the port Wake-on-Lan listens on 10.0.1.255:7
device-ip (optional) ip of the device, used for ping feature 10.0.1.47

Examples using curl with and without authentification enabled on the server.

With Authentification

curl -X PUT http://<server-ip>/device \
  -H 'Authorization: <secret>' \
  -H 'Content-Type: application/json' \
  -d '{
	"id": "<device-id>",
	"mac": "<mac-address>",
	"broadcast_addr": "<broadcast-ip>",
	"ip": "<device-ip>"
  }'

Without Authentification

curl -X PUT http://<server-ip>/device \
  -H 'Content-Type: application/json' \
  -d '{
	"id": "<device-id>",
	"mac": "<mac-address>",
	"broadcast_addr": "<broadcast-ip>",
	"ip": "<device-ip>"
  }'

Start Device

The easiest way to start a device is using a GET request with its id:

curl http://<server-ip>/start/<device-id>