Skip to content

Commit

Permalink
Use TOML config
Browse files Browse the repository at this point in the history
  • Loading branch information
akiroz committed Jan 18, 2024
1 parent 8dd6267 commit 6932a77
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 211 deletions.
107 changes: 84 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zika"
version = "3.2.2"
version = "3.2.3"
license = "MIT"
description = "IP Tunneling over MQTT"
repository = "https://github.com/akiroz/zika"
Expand All @@ -24,12 +24,13 @@ ipnetwork = "0.20.0"
log = "0.4.20"
lru = "0.12.0"
rand = "0.8.5"
rumqttc = { version = "0.23.0", features = ["use-rustls"] }
rustls = "0.21.8"
rustls = "0.21.10"
rustls-pemfile = "2.0.0"
rumqttc = { version = "0.23.0", features = ["use-rustls"] }
toml = "0.8.8"
serde = { version = "1.0.193", features = ["derive"] }
serde_json = "1.0.108"
tokio = { version = "1.34.0", features = ["full"] }
serde_default_utils = "0.2.1"
tokio-rustls = "0.25.0"
tokio-util = "0.7.10"
tokio = { version = "1.34.0", features = ["full"] }
tun = { version = "0.6.1", features = ["async"] }
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ it's possible capture/inject arbitrary IP packets to/from the target device if t

### Configuration

See [zika_config.sample.json](zika_config.sample.json)
See [zika_config.example.toml](zika_config.example.toml)

### Building

Dependencies:
- cargo
- ...

```
$ cargo build
```
2 changes: 1 addition & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct Tunnel {

impl Client {
pub async fn from_config(config: config::Config) -> Self {
let mqtt_options = config.broker_mqtt_options();
let mqtt_options = config.mqtt.to_mqtt_options().expect("valid mqtt config");
let client_config = config.client.expect("non-null client config");
Self::new(mqtt_options, client_config).await
}
Expand Down
Loading

0 comments on commit 6932a77

Please sign in to comment.