aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md38
1 files changed, 35 insertions, 3 deletions
diff --git a/README.md b/README.md
index 03779a1..cf536c4 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,4 @@
1# webol 1# webol
2
3## Config 2## Config
4Default `config.toml`: 3Default `config.toml`:
5```toml 4```toml
@@ -12,9 +11,7 @@ timeoffset = 0 # i8
12method = "none" # "none"|"key" 11method = "none" # "none"|"key"
13secret = "" # String 12secret = "" # String
14``` 13```
15
16## Docker 14## Docker
17
18minimal `docker-compose.yaml`: 15minimal `docker-compose.yaml`:
19```yaml 16```yaml
20services: 17services:
@@ -27,3 +24,38 @@ services:
27 - ./logs:/logs 24 - ./logs:/logs
28 network_mode: host 25 network_mode: host
29``` 26```
27## Register Device
28A device is registered with a PUT request to the server with a JSON representation of the device as payload.
29| field | description | example |
30|--------------|------------------------------------------------------------------------|-------------------|
31| server-ip | ip of the webol server, including its port | webol.local:7229 |
32| secret | secret set in the server settings | password |
33| device-id | any string, "name" of the device | foo |
34| mac-address | mac address of the device | 12:34:56:AB:CD:EF |
35| broadcast-ip | broadcast ip of the network, including the port Wake-on-Lan listens on | 10.0.1.255:7 |
36| device-ip | (**optional**) ip of the device, used for ping feature | 10.0.1.47 |
37
38Examples using curl with and without authentification enabled on the server.
39### With Authentification
40```sh
41curl -X PUT http://<server-ip>/device \
42 -H 'Authorization: <secret>' \
43 -H 'Content-Type: application/json' \
44 -d '{
45 "id": "<device-id>",
46 "mac": "<mac-address>",
47 "broadcast_addr": "<broadcast-ip>",
48 "ip": "<device-ip>"
49 }'
50```
51### Without Authentification
52```sh
53curl -X PUT http://<server-ip>/device \
54 -H 'Content-Type: application/json' \
55 -d '{
56 "id": "<device-id>",
57 "mac": "<mac-address>",
58 "broadcast_addr": "<broadcast-ip>",
59 "ip": "<device-ip>"
60 }'
61```