summaryrefslogtreecommitdiffstats
path: root/tedge_config
AgeCommit message (Collapse)Author
2021-11-24Restructure directories of the workspace (#559)Lukasz Woznicki
* Restructure directories of the workspace * Rename c8y_translator_lib to c8y_translator * Update comment on how to get dummy plugin path Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
2021-11-24(cargo release) bump version 0.4.3github-actions[bot]
Co-authored-by: Versioneer <info@thin-edge.io>
2021-11-17[CIT-678] Change error message to inform about new way to set device id (#572)Lukasz Woznicki
* Change error message to inform about new way to set device id. * Fix tests for tedge config Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
2021-11-11Patch version bump (#573)github-actions[bot]
* (cargo release) bump version * Update get-thin-edge_io.sh to 0.4.2 Co-authored-by: Versioneer <info@thin-edge.io> Co-authored-by: Lukasz Woznicki <75632179+makr11st@users.noreply.github.com>
2021-10-29(cargo release) bump version (#538)github-actions[bot]
Co-authored-by: Versioneer <info@thin-edge.io> Co-authored-by: Sebastian Büttner <sebastian.buettner@softwareag.com>
2021-10-22[CIT-620] Modify certificate configuration for external MQTT access (#515)Lukasz Woznicki
* Add conditional configuration to enable or disable external mqtt certificates * Add a quick tutorial how to use external settings Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
2021-10-14Release 0.4.0 (#493)Lukasz Woznicki
* (cargo release) bump version 0.4
2021-09-29add option to allow connection from external clients (#452)Yudai Kiyofuji
Signed-off-by: z8674558 <own7000hr@gmail.com>
2021-09-29(cargo release) bump version (#457)github-actions[bot]
Co-authored-by: Versioneer <info@thin-edge.io>
2021-09-16Clippy lints fixes for latest code (#433)Lukasz Woznicki
Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
2021-09-15(cargo release) bump version (#429)github-actions[bot]
Co-authored-by: Versioneer <info@thin-edge.io>
2021-08-31Release 0.3.0 (#410)Lukasz Woznicki
2021-08-19[CIT-502] Default software plugin support (#386)Albin Suresh
* [CIT-502] Default software plugin support
2021-08-19Patch version bump (#390) 0.2.4github-actions[bot]
* (cargo release) bump version Co-authored-by: Versioneer <info@thin-edge.io>
2021-08-04Add async version of atomically write file and move it to tedge_utils (#364)Lukasz Woznicki
* Add async version of atomically write file and move it to tedge_utils Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
2021-07-21(cargo release) bump version (#352)github-actions[bot]
Co-authored-by: Versioneer <info@thin-edge.io>
2021-07-12CIE-437: Use Display for the path in the certificate exists message, rather ↵ChrisGreenaway
than Debug (#342)
2021-07-08Update crates dependencies versions (#337)Lukasz Woznicki
Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
2021-07-08Patch version bump to 0.2.2github-actions[bot]
* (cargo release) bump version Co-authored-by: Versioneer <info@thin-edge.io>
2021-07-01[CIT-417] Address mqtt port change issues (#303)PradeepKiruvale
* [CIT-417] update mqtt port * Fix the check connection functions * [CIT-417] update mqtt port * [CIT-417] Add system tests * [CIT-417] fix system test * [CIT-417] split the tests * [CIT-417] address review comment * [CIT-417] addressed review comments * fix mqtt port unset test * simplify the test * [CIT-417] test collectd-mapper * [CIT-417] cleanup test environment properly * Fix * [CIT-417] remove redundant test Co-authored-by: Pradeep K J <Pradeep K J pradeekumar.kj@softwareag.com> Co-authored-by: Pradeep K J <pradeekumar.kj@softwareag.com>
2021-06-23(cargo release) bump version (#308)github-actions[bot]
Co-authored-by: Versioneer <info@thin-edge.io>
2021-06-14[CIT-408] Add az.mapper.timestamp unit tests and refactoring in config tests ↵Rina Fujino
(#289) Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
2021-06-09(cargo release) bump version (#284)Lukasz Woznicki
2021-06-07[CIT-391] Change to accept the old configuration using azure for Azure IoT ↵Rina Fujino
related keys (#273) Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
2021-06-02[CIT-298] Make all Azure related commands consistent (#265)Rina Fujino
- Rename config keys: azure.xxx -> az.xxx - Update docs and tests accordingly Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
2021-05-25[CIT-270] configure moquitto port (#248)PradeepKiruvale
* [CIT-270] Configure mosquitto port * [CIT-270] added and updated tests * [CIT-270] Added document for configuring port * cargo fmt * Fixed markup issues * Updated the configure mqtt port doc link * Added configure mqtt port doc link * fixed merge conflicts * [CIT-270] rename mosquitto to mqtt * [CIT-270] fixed review comments * [CIT-270] fix the tests * [CIT-270] use mqtt.port in mappers * [CIT-270] use mqtt.port in dm agent * [CIT-270] update the doc * [CIT-270] addressed review comments * [CIT-270] renamed document and fixed comments Co-authored-by: pradeekumar.kj@softwareag.com <pradeekumar.kj@softwareag.com> Co-authored-by: Pradeep K J <Pradeep K J pradeekumar.kj@softwareag.com>
2021-05-20[CIT-162] Implement Azure IoT Mapper (#242)Rina Fujino
Implement Azure Mapper Features: - Azure Mapper takes Thin Edge JSON formatted input and coverts to Thin Edge JSON. - It adds a timestamp when `azure.mapper.timestamp` is true in the tedge config. Code changes: - Add many files in tedge_mapper crate. - Now `tedge_mapper` requires one argument, c8y or az. Lauch by `tedge_mapper az` - Add a key `azure.mapper.timestamp` in tedge config - Give a temporary solution to add `az` to tedge-mapper systemd service.
2021-05-14Fix clippy warnings (#223)Lukasz Woznicki
* clippy: fix warnings
2021-04-20[CIT-218] Extract the device id from the device certificate (#190)Didier Wenzek
* [CIT-218] Derive the device id from the device certificate * [CIT-218] Remove un-necssary updates of the config * [CIT-218] Fix error message * [CIT-218] Fix typo in help meessage * [CIT-218] Avoid to serialize device.id Co-authored-by: Wenzek <diw@softwareag.com>
2021-04-15[CIT-304] Migrate `tedge connect` to new config API and get rid of old ↵Michael Neumann
TEdgeConfig * Split `tedge connect` command implementation into separate files. * Refactor `tedge connect` command. * Get rid of old `TEdgeConfig`. Remove unused code. * Use `url::Host` for parsing in `tedge_config::models::ConnectUrl`
2021-04-14Replace crate `tempfile` with custom code - Fixes #169 (#181)Michael Neumann
- Write our own `atomically_write_file` function instead of using `tempfile`. - Save data to `tedge.toml.tmp` and then atomically renaming it to the final destination `tedge.toml`. - By storing the temporary file in the same directory as the destination file we get around issues with cross-device link errors (EXDEV), which occur when the tempfile and the destination file would be on different file systems (`/tmp` on FreeBSD is a separate file system from `/home` or `/`). - Only use POSIX functionality explosed by Rust's `std`, so it should really be cross-platform. - Tested on FreeBSD 12.2 Fixes bug: #169
2021-04-14Migrate `tedge cert` to new config API (#184)Michael Neumann
- `tedge_config` uses more precise types. Some complexity can go away. - Had to add `impl AsRef<Path>` here and there to avoid having to convert from `FilePath` to `String`, which can fail. - Implement `Display` for `FilePath` so that you can print out a `FilePath` with `format!("{}", FilePath::from("abc"))`. This uses `to_string_lossy()`. - Need to inject `TEdgeConfigRepository` into commands that update the config. TODO: Once `device.id` will be infered from the certificates, this can go away. - Had to introduce `WritableDeviceIdSetting` in order to not break tests. This code should be dropped again later on, once `device.id` is infered from certificate. - Tests will no longer try to write `tedge.toml` to the default location!!! Everthing is local to the temporary directory created by `tempdir`. - Use `std::fs::{read, write}` instead of home-grown functions.
2021-04-13[CIT-304] Migrate tedge config to use the new tedge_config crate (#168)Michael Neumann
- Disentangle TEdgeConfig from `tedge config` CLI - Disentangle `tedge config` commands from CLI parsing - Do all the parsing in `config/cli.rs`. - Commands are defined in `config/commands/*.rs`. One (sub-)command per file. - The implementation of the commands become easier to read and understand, and you can test each command independently. - Do not list valid keys when running `tedge config [get|set|unset] --help` - When running `tedge config get --help`, the output is now: ARGS: <key> Configuration key. Run `tedge config list --doc` for available keys - Prior to this commit, a list of keys was shown after the `<key>`, but formatting was pretty ugly. - The list of valid keys was generated by the macro. Get rid of it. IMHO this was a mistake in the first place. - Instead, point the user at running `tedge config list --doc` for a list of valid keys. TODO: Currently the `tedge config list --doc` output does not mention whether a given key is read-only or not. - If we want the previous behaviour, it's better to just maintain the list of valid keys in the structopt comment. - tedge_config - Fix KEY's of some ConfigSettings These are the keys that are used in tedge/tests/main.rs. - Use crate tedge_config in `tedge config` CLI - Add `ConfigSettingAccessorStringExt` trait to `tedge_config`. We need that in order to get/set keys as strings. It provides a `query_string`, `query_string_optional` and `update_string` methods. - Provide a default implementation for `ConfigSettingAccessorStringExt` for all ConfigSettings on `TEdgeConfig`. - Introduce newtype `FilePath` and get rid of `PathBuf` in `TEdgeConfig` and `TEdgeConfigDto`. We need this because `PathBuf` does not implement `TryInto<String>` which we need for the default implementation mentioned in the previous step. - Make `TEdgeConfig` clonable. This is required when we update or unset a config setting in cli/config/commands/{set,unset}.rs. In the command we receive a `config: TEdgeConfig`, but as we are accessing it through the `&self` in `execute`, we cannot modify it. To get a mutable version of `config`, simply clone it. - For those `tedge config` commands that need to write a configuration back, inject a `TEdgeConfigRepository`. TODO: We should already inject the `TEdgeConfigRepository` in `build_command`. - Get rid of parts of the macro. We still need to keep parts of it around for the other commands. - Pass BuildCommandContext to BuildCommand::build_command - This allows to inject TEdgeConfigRepository for commands that need to write a config. - Especially useful during the migration period, where we can still provide `build_command` with an old config::TEdgeConfig. - TODO: Some tests failing. I think some of the test conditions are wrong! - Fix test - We changed the default value - When writing tedge.toml, create parent directory - This fixes the tests. - Create $HOME/.tedge or /etc/tedge if it does not exist yet. - This needs some more love. Permissions should be set correctly. - Remove underscored from trait definition - Split TEdgeConfigDefaults from TEdgeConfigLocation - `TEdgeConfigLocation` only tells us something about where the `tedge.config` is located (and about it's root directory). - `TEdgeConfigDefaults` only tells us something about the default values used in `TEdgeConfig` as fallbacks. - Both of them are independent entities. - You can derive `TEdgeConfigDefaults::from(&TEdgeConfigLocation)`. - Drop `Clone` - Use `config_repo.load()` instead of `config.clone()` - Silence a few clippy warnings - Rename BuildCommandContext to just BuildContext
2021-04-07Refactor TEdge config (#155)Michael Neumann
- 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.