Age | Commit message (Collapse) | Author |
|
* 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>
|
|
Co-authored-by: Versioneer <info@thin-edge.io>
|
|
* 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>
|
|
* (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>
|
|
Co-authored-by: Versioneer <info@thin-edge.io>
Co-authored-by: Sebastian Büttner <sebastian.buettner@softwareag.com>
|
|
* 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>
|
|
* (cargo release) bump version 0.4
|
|
Signed-off-by: z8674558 <own7000hr@gmail.com>
|
|
Co-authored-by: Versioneer <info@thin-edge.io>
|
|
Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
|
|
Co-authored-by: Versioneer <info@thin-edge.io>
|
|
|
|
* [CIT-502] Default software plugin support
|
|
* (cargo release) bump version
Co-authored-by: Versioneer <info@thin-edge.io>
|
|
* Add async version of atomically write file and move it to tedge_utils
Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
|
|
Co-authored-by: Versioneer <info@thin-edge.io>
|
|
than Debug (#342)
|
|
Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
|
|
* (cargo release) bump version
Co-authored-by: Versioneer <info@thin-edge.io>
|
|
* [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>
|
|
Co-authored-by: Versioneer <info@thin-edge.io>
|
|
(#289)
Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
|
|
|
|
related keys (#273)
Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
|
|
- Rename config keys: azure.xxx -> az.xxx
- Update docs and tests accordingly
Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
|
|
* [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>
|
|
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.
|
|
* clippy: fix warnings
|
|
* [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>
|
|
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`
|
|
- 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
|
|
- `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.
|
|
- 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
|
|
- 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.
|