diff --git a/config/bffh/bffh.dhall b/config/bffh/bffh.dhall index bfb2864..9a899fc 100644 --- a/config/bffh/bffh.dhall +++ b/config/bffh/bffh.dhall @@ -1,73 +1,113 @@ --- { actor_connections = [] : List { _1 : Text, _2 : Text } -{ actor_connections = - -- Link up machines to actors - [ { _1 = "Testmachine", _2 = "Shelly_1234" } - , { _1 = "Another", _2 = "Bash" } - -- One machine can have as many actors as it wants - , { _1 = "Yetmore", _2 = "Bash2" } - , { _1 = "Yetmore", _2 = "FailBash"} - ] -, actors = - { Shelly_1234 = { module = "Shelly", params = {=} } - , Bash = { module = "Process", params = - { cmd = "/usr/local/lib/bffh/adapters/actor.sh" - , args = "your ad could be here" - }} - , Bash2 = { module = "Process", params = - { cmd = "/usr/local/lib/bffh/adapters/actor.sh" - , args = "this is a different one" - }} - , FailBash = { module = "Process", params = - { cmd = "/usr/local/lib/bffh/adapters/fail-actor.sh" - }} - } - , 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" +{ + -- General Server Configuration + listens = + [ + { address = "::", port = Some 59661 } + ], + mqtt_url = "tcp://mqtt:1883", + db_path = "/var/lib/bffh/db", + + -- Machines Configuration + machines = + { + Testmachine = + { + name = "Testmachine", + description = Some "A test machine", + + disclose = "lab.test.read", + read = "lab.test.read", + write = "lab.test.write", + manage = "lab.test.admin" }, Another = - { description = Some "Another test machine" - , disclose = "lab.test.read" - , manage = "lab.test.admin" - , name = "Another" - , read = "lab.test.read" - , write = "lab.test.write" + { + name = "Another", + description = Some "Another test machine", + + disclose = "lab.test.read", + read = "lab.test.read", + write = "lab.test.write", + manage = "lab.test.admin" }, 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" + { + name = "Yetmore", + description = Some "Yet more test machines", + + disclose = "lab.test.read", + read = "lab.test.read", + write = "lab.test.write", + manage = "lab.test.admin" } - } -, mqtt_url = "tcp://mqtt:1883" -, db_path = "/var/lib/bffh/db" -, roles = - { testrole = - { permissions = [ "lab.test.*" ] } - , somerole = - { parents = ["testparent"] - , permissions = [ "lab.some.admin" ] + }, + + -- Actors Configuration + actors = + { + Shelly_1234 = + { + module = "Shelly", + params = {=} + }, + Bash = + { + module = "Process", + params = + { + cmd = "/usr/local/lib/bffh/adapters/actor.sh", + args = "your ad could be here" + } + }, + Bash2 = + { + module = "Process", + params = + { + cmd = "/usr/local/lib/bffh/adapters/actor.sh", + args = "this is a different one" + } + }, + FailBash = + { + module = "Process", + params = + { + cmd = "/usr/local/lib/bffh/adapters/fail-actor.sh" + } } - , testparent = - { permissions = - [ "lab.some.write" - , "lab.some.read" - , "lab.some.disclose" + }, + actor_connections = + [ + { machine = "Testmachine", actor = "Shelly_1234" }, + { machine = "Another", actor = "Bash" }, + { machine = "Yetmore", actor = "Bash2" }, + { machine = "Yetmore", actor = "FailBash"} + ], + + -- Initiator Configuration + initiators = {=}, + init_connections = [] : List { machine : Text, initiator : Text }, + + -- Roles + roles = + { + testrole = + { + permissions = [ "lab.test.*" ] + }, + somerole = + { + parents = ["testparent"], + permissions = [ "lab.some.admin" ] + }, + testparent = + { + permissions = + [ + "lab.some.write", + "lab.some.read", + "lab.some.disclose" ] } } diff --git a/config/bffh/pass.toml b/config/bffh/pass.toml deleted file mode 100644 index 6d4855d..0000000 --- a/config/bffh/pass.toml +++ /dev/null @@ -1 +0,0 @@ -Testuser = "secret" diff --git a/config/bffh/roles.toml b/config/bffh/roles.toml deleted file mode 100644 index 2c91a30..0000000 --- a/config/bffh/roles.toml +++ /dev/null @@ -1,19 +0,0 @@ -[anotherrole] - -[testrole] -permissions = [ - "lab.test.*" -] - -[somerole] -parents = ["testparent/lmdb"] -permissions = [ - "lab.some.admin" -] - -[testparent] -permissions = [ - "lab.some.write", - "lab.some.read", - "lab.some.disclose", -]