diff options
author | Michael Neumann <mneumann@ntecs.de> | 2021-04-07 15:19:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-07 15:19:06 +0200 |
commit | 6472cb57fe196b5e19bc7a5eceeb994843dfa095 (patch) | |
tree | 74b7036564396239c1f8946602b297d3505c3660 /tedge/Cargo.toml | |
parent | f9c30859d284145c25a1fd9121f968c7d011994a (diff) |
Refactor TEdge config (#155)
- Refactor TEdgeConfig
- Move configuration into `tedge_config` crate.
- Add `ConfigSetting` trait. Each "thing" that we want to make
configurable will have it's own struct-type. For example `struct
DeviceIdSetting` or `C8yUrlSetting`.
- The `ConfigSetting` trait does not provide any means of how to
read/write/unset a configuration setting. It only provides the key,
description and the value type of the setting, but no implementation.
- Use trait `ConfigSettingAccessor` to implemenent `query`, `update` and
`unset` methods.
- `TEdgeConfigRepository` implements functionality to read/write a
`TEdgeConfig`. The `TEdgeConfig` struct itself just holds data.
- Add `TEdgeConfigLocation` which holds all data that we need to resolve the defaults in
TEdgeConfig, including the name of the config file (TODO: we might want to split these two apart).
The defaults differ depending on the location of the `tedge.toml`, whether it's located in `/etc` or a users `$HOME/.tedge`
(or in tests).
- Only add the `tedge_config` crate. `tedge` is currently not modified
to use the new API.
- Remove remaining `unwrap`s, also from tests
- No longer create intermediate directories upon saving configuration
# FOLLOW-UP TASKS
- Refactor the `tedge` crate to use `tedge_config`.
- Compute the `device.id` from the certificate stored in `device.cert.path`, if any.
- Ensure that the config is updated only by `tedge config set/unset`.
- Extend tedge_config_location to also manage the paths to the bridge configuration files.
- Update `ConfigRepository::store()` to properly set file ownership.
Diffstat (limited to 'tedge/Cargo.toml')
-rw-r--r-- | tedge/Cargo.toml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tedge/Cargo.toml b/tedge/Cargo.toml index fa06d9de..af568516 100644 --- a/tedge/Cargo.toml +++ b/tedge/Cargo.toml @@ -30,6 +30,7 @@ which = "4.0" x509-parser = "0.9" zeroize = "1.2" sha-1 = "0.9" +tedge_config = { path = "../tedge_config" } [target.'cfg(unix)'.dependencies] users = "0.11.0" |