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
Support multiple configuration files #829
Conversation
5bd8d99
to
59fdd60
Compare
Seems that the |
Moving the helpers from Removing the licensing header needs to be discussed, because we currently this header in every file. |
Dropped this commit. I will create an issue for the discussion. |
If |
They are merged, you can see it in the tests (5860d8c#diff-45fa5f8530eb815c0cf606032e587adedb04dc70e59b203535d51c44654cfc4dR52) This will enable the separation of a system wide configuration (/usr/etc/keylime.conf), an admin overwrite (/etc/keylime.conf) and a user overwrite ($HOME/.config/keylime.conf) The overwrites can add new key/values and replace previous set key/values. |
That changes the current behaviour, but I think this change is a good one and should not break deployments (outside of testing). It might be nice to have the option to load only one configuration for testing etc. |
This would be my expectation as well. I like the "stacked" nature of the default config paths, but I would assume that something like KEYLIME_CONFIG would be used for testing or other automated setups that would like to completely control the whole config. But I'm willing to be convinced otherwise. |
The exposed API is the same, and the changes outside the module are minimal.
For tests it is there already. Check test code, is adjusting the list of config files to load for validation. For a more general case, like for example adding a |
As commented, the new tests added for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'm fine with KEYLIME_CONFIG
also to be stacking as long we introduce -c /path/to/config
as an option to manually overwrite it.
Currently Keylime read the config for all the services from the same file, in /etc/keylime.conf. This commit support the load of multiple configuration files, and merge the contents together. This will enable the separation of a system wide configuration file in /usr/etc/keylime.conf, and a admin owerwrite in /etc/keylime.conf. Signed-off-by: Alberto Planas <aplanas@suse.com>
And other refactoring of the
config
module