aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md44
1 files changed, 41 insertions, 3 deletions
diff --git a/README.md b/README.md
index 03779a1..e84d646 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,44 @@ services:
27 - ./logs:/logs 24 - ./logs:/logs
28 network_mode: host 25 network_mode: host
29``` 26```
27# Usage
28## Register Device
29A device is registered with a PUT request to the server with a JSON representation of the device as payload.
30| field | description | example |
31|--------------|------------------------------------------------------------------------|-------------------|
32| server-ip | ip of the webol server, including its port | webol.local:7229 |
33| secret | secret set in the server settings | password |
34| device-id | any string, "name" of the device | foo |
35| mac-address | mac address of the device | 12:34:56:AB:CD:EF |
36| broadcast-ip | broadcast ip of the network, including the port Wake-on-Lan listens on | 10.0.1.255:7 |
37| device-ip | (**optional**) ip of the device, used for ping feature | 10.0.1.47 |
38
39Examples using curl with and without authentification enabled on the server.
40### With Authentification
41```sh
42curl -X PUT http://<server-ip>/device \
43 -H 'Authorization: <secret>' \
44 -H 'Content-Type: application/json' \
45 -d '{
46 "id": "<device-id>",
47 "mac": "<mac-address>",
48 "broadcast_addr": "<broadcast-ip>",
49 "ip": "<device-ip>"
50 }'
51```
52### Without Authentification
53```sh
54curl -X PUT http://<server-ip>/device \
55 -H 'Content-Type: application/json' \
56 -d '{
57 "id": "<device-id>",
58 "mac": "<mac-address>",
59 "broadcast_addr": "<broadcast-ip>",
60 "ip": "<device-ip>"
61 }'
62```
63## Start Device
64The easiest way to start a device is using a GET request with its id:
65```sh
66curl http://<server-ip>/start/<device-id>
67``` \ No newline at end of file