thin-edge / thin-edge.io

The open edge framework for lightweight IoT devices
https://thin-edge.io
Apache License 2.0
210 stars 54 forks source link

feat: use loopback ip address instead of alias to improve compatibility #2952

Closed reubenmiller closed 1 week ago

reubenmiller commented 1 week ago

Proposed changes

Some Linux distributions installations where the /etc/hosts file is not defined, the loopback address (127.0.0.1), the localhost alias does not get resolved to 127.0.0.1. And devices which have a read-only rootfs, can't even add a manual entry to the list, so the only option is to change the tedge.toml values (which is not ideal for such basic settings).

Changing the defaults from localhost to 127.0.0.1 improves the out of the box compatibility.

Types of changes

Paste Link to the issue


Checklist

Further comments

github-actions[bot] commented 1 week ago

Robot Results

:white_check_mark: Passed :x: Failed :next_track_button: Skipped Total Pass % :stopwatch: Duration
453 0 3 453 100 1h0m38.032027s
reubenmiller commented 1 week ago

Ok, seems like the mosquitto TLS cert generation might need to change to also support TLS connections when using the loopback address, currently it only supports the hostname, or localhost.

Update

Addressed by 05ca44280aed90319c1826fa63b993e0a2ff880c

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.2%. Comparing base (ed0b7fd) to head (e54f81a). Report is 1 commits behind head on main.

Additional details and impacted files | [Files](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2952?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge) | Coverage Δ | | |---|---|---| | [crates/common/mqtt\_channel/src/config.rs](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2952?src=pr&el=tree&filepath=crates%2Fcommon%2Fmqtt_channel%2Fsrc%2Fconfig.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge#diff-Y3JhdGVzL2NvbW1vbi9tcXR0X2NoYW5uZWwvc3JjL2NvbmZpZy5ycw==) | `45.9% <100.0%> (ø)` | | | [.../tedge\_config/src/tedge\_config\_cli/tedge\_config.rs](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2952?src=pr&el=tree&filepath=crates%2Fcommon%2Ftedge_config%2Fsrc%2Ftedge_config_cli%2Ftedge_config.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge#diff-Y3JhdGVzL2NvbW1vbi90ZWRnZV9jb25maWcvc3JjL3RlZGdlX2NvbmZpZ19jbGkvdGVkZ2VfY29uZmlnLnJz) | `76.8% <100.0%> (ø)` | | | [...s/core/tedge/src/bridge/common\_mosquitto\_config.rs](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2952?src=pr&el=tree&filepath=crates%2Fcore%2Ftedge%2Fsrc%2Fbridge%2Fcommon_mosquitto_config.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge#diff-Y3JhdGVzL2NvcmUvdGVkZ2Uvc3JjL2JyaWRnZS9jb21tb25fbW9zcXVpdHRvX2NvbmZpZy5ycw==) | `75.3% <100.0%> (ø)` | | | [crates/extensions/c8y\_mapper\_ext/src/converter.rs](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2952?src=pr&el=tree&filepath=crates%2Fextensions%2Fc8y_mapper_ext%2Fsrc%2Fconverter.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge#diff-Y3JhdGVzL2V4dGVuc2lvbnMvYzh5X21hcHBlcl9leHQvc3JjL2NvbnZlcnRlci5ycw==) | `84.1% <100.0%> (ø)` | | | [crates/extensions/tedge\_mqtt\_bridge/src/config.rs](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2952?src=pr&el=tree&filepath=crates%2Fextensions%2Ftedge_mqtt_bridge%2Fsrc%2Fconfig.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge#diff-Y3JhdGVzL2V4dGVuc2lvbnMvdGVkZ2VfbXF0dF9icmlkZ2Uvc3JjL2NvbmZpZy5ycw==) | `96.1% <100.0%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/thin-edge/thin-edge.io/pull/2952/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thin-edge)