added a dockerized version of the example

This commit is contained in:
Kai Jan Kriegel 2020-11-29 20:54:26 +01:00
parent 2fbb1bb4b6
commit 6f56b32e89
6 changed files with 69 additions and 13 deletions

View File

@ -1,13 +0,0 @@
version: "3.8"
services:
bffh:
build: .
ports:
- "59661:59661"
volumes:
# generate a sample config.toml by running "docker run diflouroborane --print-default". You may have to delete the ipv6 listen section.
- "$PWD/config.toml:/etc/diflouroborane.toml"
links:
- mqtt
mqtt:
image: eclipse-mosquitto

10
examples/docker/README.md Normal file
View File

@ -0,0 +1,10 @@
# API-Testsetup, aber mit Docker
wirklich nur um das API zu testen. ATM implementiert: machine::read
* Use included config.toml, or
* generate a sample config.toml by running "docker run registry.gitlab.com/fabinfra/fabaccess/bffh:dev-latest --print-default > config.toml". You may have to delete the ipv6 listen section.
1. change mqtt-server hostname to `mqtt` in config.toml
1. change machines path to `/etc/bffh/machines.toml`
* run `docker-compose up`

View File

@ -0,0 +1,12 @@
machines = "/etc/bffh/machines.toml"
[[listens]]
address = "127.0.0.1"
port = 59661
[[listens]]
address = "::1"
port = 59661
[shelly]
mqtt_url = "mqtt:1883"

View File

@ -0,0 +1,13 @@
version: "3.8"
services:
bffh:
image: registry.gitlab.com/fabinfra/fabaccess/bffh:dev-latest
ports:
- "59661:59661"
volumes:
# generate a sample config.toml by running "docker run registry.gitlab.com/fabinfra/fabaccess/bffh:dev-latest --print-default > examples/config.toml" from the project root. You may have to delete the ipv6 listen section.
- "$PWD/examples/docker:/etc/bffh"
links:
- mqtt
mqtt:
image: eclipse-mosquitto

View File

@ -0,0 +1,14 @@
[e5408099-d3e5-440b-a92b-3aabf7683d6b]
name = "Somemachine"
disclose = "lab.some.disclose"
read = "lab.some.read"
write = "lab.some.write"
manage = "lab.some.admin"
[eaabebae-34d1-4a3a-912a-967b495d3d6e]
name = "Testmachine"
description = "An optional description"
disclose = "lab.test.read"
read = "lab.test.read"
write = "lab.test.write"
manage = "lab.test.admin"

View File

@ -0,0 +1,20 @@
[testrole]
name = "Testrole"
permissions = [
"lab.test.*"
]
[somerole]
name = "Somerole"
parents = ["testparent%lmdb"]
permissions = [
"lab.some.admin"
]
[testparent]
name = "Testparent"
permissions = [
"lab.some.write",
"lab.some.read",
"lab.some.disclose",
]