diff --git a/config/bffh/bffh.dhall b/config/bffh/bffh.dhall new file mode 100644 index 0000000..c1cc0a3 --- /dev/null +++ b/config/bffh/bffh.dhall @@ -0,0 +1,48 @@ +-- { actor_connections = [] : List { _1 : Text, _2 : Text } +{ actor_connections = [{ _1 = "Testmachine", _2 = "Actor" }] +, actors = + { Actor = { module = "Shelly", params = {=} } + } + , init_connections = [] : List { _1 : Text, _2 : Text } +--, 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" + }, + Another = + { description = Some "Another test machine" + , disclose = "lab.test.read" + , manage = "lab.test.admin" + , name = "Another" + , read = "lab.test.read" + , write = "lab.test.write" + }, + Yetmore = + { description = Some "Yet more test machines" + , disclose = "lab.test.read" + , manage = "lab.test.admin" + , name = "Yetmore" + , read = "lab.test.read" + , write = "lab.test.write" + } + } +, mqtt_url = "tcp://mqtt:1883" +, db_path = "/tmp/bffh" +, roles = + { Testrole = + { parents = [] : List Text + , permissions = [] : List Text + } + } +} diff --git a/config/bffh/pass.toml b/config/bffh/pass.toml new file mode 100644 index 0000000..6d4855d --- /dev/null +++ b/config/bffh/pass.toml @@ -0,0 +1 @@ +Testuser = "secret" diff --git a/config/bffh/roles.toml b/config/bffh/roles.toml new file mode 100644 index 0000000..2c91a30 --- /dev/null +++ b/config/bffh/roles.toml @@ -0,0 +1,19 @@ +[anotherrole] + +[testrole] +permissions = [ + "lab.test.*" +] + +[somerole] +parents = ["testparent/lmdb"] +permissions = [ + "lab.some.admin" +] + +[testparent] +permissions = [ + "lab.some.write", + "lab.some.read", + "lab.some.disclose", +] diff --git a/config/bffh/users.toml b/config/bffh/users.toml new file mode 100644 index 0000000..2d5ef75 --- /dev/null +++ b/config/bffh/users.toml @@ -0,0 +1,11 @@ +[Testuser] +# Define them in roles.toml as well +roles = ["somerole/lmdb", "testrole/lmdb"] + +# 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!" diff --git a/config/mosquitto/mosquitto.config b/config/mosquitto/mosquitto.config new file mode 100644 index 0000000..d33a1a7 --- /dev/null +++ b/config/mosquitto/mosquitto.config @@ -0,0 +1,3 @@ +persistence true +persistence_location /mosquitto/data/ +log_dest file /mosquitto/log/mosquitto.log \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index a814cf8..dfc4e62 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -17,4 +17,4 @@ services: ports: - "1883:1883" volumes: - - "./config/mosquitto:/mosquitto/config" + - "./config/mosquitto:/mosquitto/config/"