diff options
author | FxQnLr <[email protected]> | 2024-04-15 21:04:58 +0200 |
---|---|---|
committer | FxQnLr <[email protected]> | 2024-04-15 21:04:58 +0200 |
commit | fbb8cbc9f36975c4a414c9485347515d16f42333 (patch) | |
tree | 19cf631b708b4588954dce60ec76f7df12319966 | |
parent | d3cf93fb6c9b7e0faf9b7907328f0a042009e164 (diff) | |
download | webol-fbb8cbc9f36975c4a414c9485347515d16f42333.tar webol-fbb8cbc9f36975c4a414c9485347515d16f42333.tar.gz webol-fbb8cbc9f36975c4a414c9485347515d16f42333.zip |
Added register docs to README
-rw-r--r-- | README.md | 38 |
1 files changed, 35 insertions, 3 deletions
@@ -1,5 +1,4 @@ | |||
1 | # webol | 1 | # webol |
2 | |||
3 | ## Config | 2 | ## Config |
4 | Default `config.toml`: | 3 | Default `config.toml`: |
5 | ```toml | 4 | ```toml |
@@ -12,9 +11,7 @@ timeoffset = 0 # i8 | |||
12 | method = "none" # "none"|"key" | 11 | method = "none" # "none"|"key" |
13 | secret = "" # String | 12 | secret = "" # String |
14 | ``` | 13 | ``` |
15 | |||
16 | ## Docker | 14 | ## Docker |
17 | |||
18 | minimal `docker-compose.yaml`: | 15 | minimal `docker-compose.yaml`: |
19 | ```yaml | 16 | ```yaml |
20 | services: | 17 | services: |
@@ -27,3 +24,38 @@ services: | |||
27 | - ./logs:/logs | 24 | - ./logs:/logs |
28 | network_mode: host | 25 | network_mode: host |
29 | ``` | 26 | ``` |
27 | ## Register Device | ||
28 | A 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 | |||
38 | Examples using curl with and without authentification enabled on the server. | ||
39 | ### With Authentification | ||
40 | ```sh | ||
41 | curl -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 | ||
53 | curl -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 | ``` | ||