mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-21 22:47:55 +01:00
Merge branch 'development' of gitlab.com:fabinfra/fabaccess/bffh into development
This commit is contained in:
commit
a77841edce
@ -15,8 +15,8 @@ FROM debian:buster-slim
|
||||
RUN apt-get update && apt-get upgrade -yqq
|
||||
RUN apt-get install -yqq libgsasl7 && rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=builder /usr/local/cargo/bin/diflouroborane /usr/local/bin/diflouroborane
|
||||
COPY --from=builder /usr/src/bffh/examples/bffh.dhall /etc/diflouroborane.dhall
|
||||
#COPY --from=builder /usr/src/bffh/examples/bffh.dhall /etc/diflouroborane.dhall
|
||||
# RUN diflouroborane --print-default > /etc/diflouroborane.toml
|
||||
VOLUME /etc/diflouroborane.dhall
|
||||
VOLUME /etc/bffh/
|
||||
EXPOSE 59661
|
||||
ENTRYPOINT ["diflouroborane"]
|
||||
ENTRYPOINT ["sh", "-c", "diflouroborane -c /etc/bffh/bffh.dhall --load=/etc/bffh; diflouroborane -c /etc/bffh/bffh.dhall"]
|
||||
|
@ -7,3 +7,5 @@ wirklich nur um das API zu testen. ATM implementiert: machines::* & machine::rea
|
||||
1. Daemon starten: `cargo run -- -c examples/bffh.dhall`
|
||||
1. ???
|
||||
1. PROFIT!
|
||||
|
||||
A dockerized version of this example can be found in the docker subdirectory
|
@ -1,10 +1,5 @@
|
||||
# API-Testsetup, aber mit Docker
|
||||
|
||||
wirklich nur um das API zu testen. ATM implementiert: machine::read
|
||||
wirklich nur um das API zu testen. ATM implementiert: machines::* & machine::read, authenticate
|
||||
|
||||
* 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`
|
||||
* run `docker-compose up` in this directory
|
@ -1,12 +0,0 @@
|
||||
machines = "/etc/bffh/machines.toml"
|
||||
|
||||
[[listens]]
|
||||
address = "127.0.0.1"
|
||||
port = 59661
|
||||
|
||||
[[listens]]
|
||||
address = "::1"
|
||||
port = 59661
|
||||
|
||||
[shelly]
|
||||
mqtt_url = "mqtt:1883"
|
20
examples/docker/config/bffh.dhall
Normal file
20
examples/docker/config/bffh.dhall
Normal file
@ -0,0 +1,20 @@
|
||||
{ actor_connections = [{ _1 = "Testmachine", _2 = "Actor" }]
|
||||
, actors =
|
||||
{ Actor = { module = "Shelly", params = {=} }
|
||||
}
|
||||
, init_connections = [{ _1 = "Initiator", _2 = "Testmachine" }]
|
||||
, initiators =
|
||||
{ Initiator = { module = "Dummy", params = {=} }
|
||||
}
|
||||
, listens = [{ address = "::", port = Some 59661 }]
|
||||
, machines =
|
||||
{ Testmachine =
|
||||
{ description = Some "A test machine"
|
||||
, disclose = "lab.test.read"
|
||||
, manage = "lab.test.admin"
|
||||
, name = "Testmachine"
|
||||
, read = "lab.test.read"
|
||||
, write = "lab.test.write"
|
||||
} }
|
||||
, mqtt_url = "tcp://mqtt:1883"
|
||||
}
|
1
examples/docker/config/pass.toml
Normal file
1
examples/docker/config/pass.toml
Normal file
@ -0,0 +1 @@
|
||||
Testuser = "secret"
|
11
examples/docker/config/users.toml
Normal file
11
examples/docker/config/users.toml
Normal file
@ -0,0 +1,11 @@
|
||||
[Testuser]
|
||||
# Define them in roles.toml as well
|
||||
roles = []
|
||||
|
||||
# If two or more users want to use the same machine at once the higher prio
|
||||
# wins
|
||||
priority = 0
|
||||
|
||||
# You can add whatever random data you want.
|
||||
# It will get stored in the `kv` field in UserData.
|
||||
noot = "noot!"
|
@ -6,7 +6,7 @@ services:
|
||||
- "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"
|
||||
- "./config:/etc/bffh"
|
||||
links:
|
||||
- mqtt
|
||||
mqtt:
|
||||
|
@ -1,14 +0,0 @@
|
||||
[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"
|
Loading…
Reference in New Issue
Block a user