Added: QR-Code

This commit is contained in:
TheJoKlLa 2021-12-12 00:43:57 +01:00
parent 42248a34b0
commit d21229e30f
4 changed files with 76 additions and 32 deletions

View File

@ -3,10 +3,9 @@
BFFH uses [DHALL](https://dhall-lang.org/) for Config-File structure
BFFH uses [RBAC](https://en.wikipedia.org/wiki/Role-based_access_control) for access control
BFFH Config is in `bffh.dhall` file.
## General BFFH Config
General BFFH Config is in `bffh.dhall` file.
#### `listens`
### `listens`
Contains the Addresses BFFH is listen for Connection for the API
Default Port for BFFH is `59661`
@ -18,14 +17,14 @@ listens =
]
```
#### `mqtt_url`
### `mqtt_url`
Contains the Address for the MQTT Server BFFH connects to
**Example:**
```
mqtt_url = "tcp://localhost:1883"
```
#### `db_path`
### `db_path`
Contains the Path for the internal Database BFFH uses.
BFFH will create two files: `<db_path>` and `<db_path>-lock`.
Make sure that BFFH has write access in the relevant directory
@ -34,7 +33,7 @@ Make sure that BFFH has write access in the relevant directory
db_path = "/tmp/bffh"
```
Permissions
## Permissions
---
BFFH uses a Path-style string as permission format, separated by ".".
So for example `this.is.a.permission` consists of the parts `this`, `is`, `a` and `permission`.
@ -92,11 +91,9 @@ This way if you buy a different anycubic and split the permissions to e.g.
It still works out.
Machine Config
---
Machine Config is in ```machine.dhall``` file.
## Machine Config
#### `machines`
### `machines`
Contains list of machines
Machines have different perission levels to interact with:
@ -105,14 +102,23 @@ Machines have different perission levels to interact with:
* write: User can use the machine
* manage: User can interact with the machine as Manager (Check, ForceFree, ForceTransfer)
Each machine must have an ID to reference the machine in other part of this config or over the API.
And each machine must have a name.
#### Optional Information
To provide more information about the machine you can add it to the description or provid an external wiki link.
Both attributes are only optional and do not need to be set.
**Example:**
```
machines =
{
Testmachine =
machine123 =
{
name = "Testmachine",
description = Some "A test machine",
wiki = "https://someurl"
disclose = "lab.test.read",
read = "lab.test.read",
write = "lab.test.write",
@ -120,12 +126,11 @@ machines =
}
}
```
"machine123" is in this case the "Machine-ID"
Roles Config
---
Roles Config is in `roles.dhall` file.
## Roles Config
#### `roles`
### `roles`
Contains list of roles
Roles have a list of permission and can be inherited.
@ -156,43 +161,63 @@ roles =
}
```
Actors Config
---
Actors Config is in `actors.dhall` file.
## Actors Config
#### `actors`
### `actors`
Contains list of actors
Actors are defined by a module and one or more paramters
Currenty supported actors:
**`Shelly`**
Parameters:
`id` = ID of the Shelly
#### `Shelly Actor`
This actor connects BFFH over an MQTT-Server to an shelly device.
You need to set the `topic` parameter of the Shelly to the Shelly specific MQTT-Topic.
[Find shelly topic here](https://shelly-api-docs.shelly.cloud/gen1/#shelly-plug-plugs-overview)
**Example:**
```
actors =
{
Shelly_123 =
{
module = "Shelly",
params =
{
topic = "shellyplug-s-123456"
}
}
}
```
"Shelly_123" is in this case the "Actor-ID".
#### `Process Actor`
This actor makes it possible for you to connect your own Devices to BFFH.
**`Process`**
Parameters:
`cmd` = Path of executable
`args` = Arguments for executable
**Example:**
```
actors =
{
Shelly_1234 = { module = "Shelly", params =
{
id = "12345"
}},
Bash = { module = "Process", params =
Bash =
{
cmd = "./examples/actor.sh",
args = "your ad could be here"
}}
module = "Process", params =
{
cmd = "./examples/actor.sh",
args = "your ad could be here"
}
}
}
```
#### `actor_connections`
Connects the actor with a machine
A machine can have multiple actors
Use the "Machine-ID" and "Actor-ID".
**Example:**
```
actor_connections =

View File

@ -18,3 +18,4 @@ We will inform you about breaking changes over our Zulip. Please subscript to it
installation/installation.rst
configuration/configuration.rst
usage/usage.rst

View File

@ -0,0 +1,7 @@
# QR-Codes on Machines
To imporve the selection of the right machine for youre users you can apply a QR-Code label on the machine.
The QR-Code must have the following content:
`urn:fabaccess:resource:{machine id}`

11
source/usage/usage.rst Normal file
View File

@ -0,0 +1,11 @@
Use FabAccess
=================
FabAccess is highly customisable so you can use FabAccess the way you like to.
But to explain our Features we will documentated some best Practices.
.. toctree::
feature_qr.md