Uninett / zino

Zino 2.0 - Network state monitor for research networks
Apache License 2.0
3 stars 4 forks source link

unify configuration formats #252

Open runborg opened 2 weeks ago

runborg commented 2 weeks ago

the format used for configuration files are by now quite different.

What about unifying all these formats to use the same toml structure? example polldevs format:

[defaults]
interval = 5
community = "<community>"
domain = "<domain-name>"
statistics = true
hcounters = true

[router.<router-name>]
address = "<mgmt-ip>"
interval = 2
priority = 500
ignorepat =  "Mgmt"
timeout = 11

example secrets:

[users]
username = "<password>"

or

[user.<username>]
realname = "Users Real Name"
password= " <password>"
....

this later then supports multiple attributes pr. user if this is needed.

hmpf commented 2 weeks ago

https://learnxinyminutes.com/docs/toml/

We could also do arrays:

[[router]]
name = <router-name-1>
address = "<mgmt-ip-1>"
interval = 2
priority = 500
ignorepat =  "Mgmt"
timeout = 11

[[router]]
name = <router-name-2>
address = "<mgmt-ip-2>"
interval = 2
priority = 500
ignorepat =  "Mgmt"
timeout = 11

and

[[user]]
username = "<username-1>"
password= " <password-1>"
magic = false

[[user]]
username = "<username-2>"
password= " <password-2>"
magic = true
favorite-date = 1970-01-01T00:00:00Z
runborg commented 2 weeks ago

We could also do arrays:

as we never should have two routers or users with the same name i see no reason to use arrays. i think its better to user the username/routername as a key identifier on this

runborg commented 2 weeks ago

i also se the use for creating eg. read-only users.. with no permissions to change/update things.. so a format witch allows multiple options pr. user is a good thing :)