Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unify configuration formats #252

Open
runborg opened this issue Jun 12, 2024 · 3 comments
Open

unify configuration formats #252

runborg opened this issue Jun 12, 2024 · 3 comments
Labels
enhancement New feature or request post-zino2.0 These are features Zino1 does not have, but might be desired later

Comments

@runborg
Copy link

runborg commented Jun 12, 2024

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

  • Main configuration will use a toml file,
  • polldevs uses <key>:<value> with a new element/object on every name key
  • secrets uses <username> <password>

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
Copy link
Contributor

hmpf commented Jun 12, 2024

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
Copy link
Author

runborg commented Jun 12, 2024

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
Copy link
Author

runborg commented Jun 12, 2024

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 :)

@lunkwill42 lunkwill42 added enhancement New feature or request api post-zino2.0 These are features Zino1 does not have, but might be desired later and removed api labels Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request post-zino2.0 These are features Zino1 does not have, but might be desired later
Projects
None yet
Development

No branches or pull requests

3 participants