Skip to content

Commit cd95457

Browse files
committed
Change configuration format to TOML
This introduces several improvements to the agent configuration. - The file format is modified from INI style files to TOML formatted files. - The configuration is constructed using an hierarchical organization following the order: - The default hardcoded values are loaded - If a configuration file is found in /usr/etc/keylime-agent.conf, it is loaded and any option set overrides the default values - Load configuration snippets from /usr/etc/keylime-agent.conf.d/*, overriding the previous values - Load the configuration from /etc/keylime-agent.conf, overriding previous values - Load configuration snippets from /etc/keylime-agent.conf.d/*, overriding previous values - Finally any configuration option can be overriden via environment variable, by using the 'KEYLIME_AGENT_' prefix. For example, KEYLIME_AGENT_PORT=9003 will override the 'port' option from the 'agent' section with the value '9003'. This was introduced by using an added dependency, the 'config' crate using the 'toml' feature for the toml file format. Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
1 parent 7d2fe35 commit cd95457

File tree

10 files changed

+1232
-885
lines changed

10 files changed

+1232
-885
lines changed

Cargo.lock

Lines changed: 185 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ base64 = "0.13"
2323
cfg-if = "1"
2424
clap = { version = "~3.1.18", features = ["derive"] }
2525
compress-tools = "0.12"
26+
config = { version = "0.13", features = ["toml"] }
2627
futures = "0.3.6"
28+
glob = "0.3"
2729
hex = "0.4"
2830
libc = "0.2.43"
2931
log = "0.4"
@@ -39,6 +41,7 @@ serde_json = { version = "1.0", features = ["raw_value"] }
3941
static_assertions = "1"
4042
tempfile = "3.0.4"
4143
tokio = {version = "1.13.1", features = ["full"]}
44+
toml = "0.5"
4245
tss-esapi = "7.1.0"
4346
thiserror = "1.0"
4447
uuid = {version = "0.8", features = ["v4"]}

0 commit comments

Comments
 (0)