Updated BFFH Config to v0.2

This commit is contained in:
TheJoKlLa 2021-12-24 01:05:15 +01:00
parent 9c3c0f5a89
commit edc22c84e7
3 changed files with 104 additions and 84 deletions

View File

@ -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"
}
},
-- 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"
}
}
, mqtt_url = "tcp://mqtt:1883"
, db_path = "/var/lib/bffh/db"
, roles =
{ testrole =
{ permissions = [ "lab.test.*" ] }
, somerole =
{ parents = ["testparent"]
, permissions = [ "lab.some.admin" ]
}
, 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"
]
}
}

View File

@ -1 +0,0 @@
Testuser = "secret"

View File

@ -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",
]