Skip to content

Commit

Permalink
Rename: dns_listen_adr -> dns_listen_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
justinas authored and krtab committed Nov 22, 2023
1 parent ac0f4b6 commit 7962f1a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ There are three "levels" in the configuration:
The general configuration level is where the IP address to listen on is provided.

```toml
dns_listen_adr = "1.2.3.4:53"
dns_listen_addr = "1.2.3.4:53"
```

### 2. Accounts
Expand Down
4 changes: 3 additions & 1 deletion config_example.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Address for the DNS server to listen on.
# The port should probably be 53.
dns_listen_adr = "1.2.3.4:53"
# Can also be spelled "dns_listen_adr" for
# retro-compatibility.
dns_listen_addr = "1.2.3.4:53"

# A first account
# accounts are identified by
Expand Down
2 changes: 1 addition & 1 deletion src/bin/agnos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async fn main() -> anyhow::Result<()> {
tokio::fs::read_to_string(cli_ops.get_one::<String>("config").unwrap()).await?;
let config: Config = toml::from_str(&config_file)?;

let dns_worker = DnsWorker::new(config.dns_listen_adr).await?;
let dns_worker = DnsWorker::new(config.dns_listen_addr).await?;
let dns_handle = dns_worker.challenges();

let acme_url = if cli_ops.get_flag("no-staging") {
Expand Down
4 changes: 3 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ use std::{net::SocketAddr, path::PathBuf};
#[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
// Alternative spelling for retro-compatibility
#[serde(alias = "dns_listen_adr")]
/// One listening address per config
pub dns_listen_adr: SocketAddr,
pub dns_listen_addr: SocketAddr,
/// Several accounts per config
pub accounts: Vec<Account>,
}
Expand Down
2 changes: 1 addition & 1 deletion test-docker/agnos/config_test.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Address for the DNS server to listen on.
# The port should probably be 53.
dns_listen_adr = "0.0.0.0:53"
dns_listen_addr = "0.0.0.0:53"

# A first account
# accounts are identified by
Expand Down

0 comments on commit 7962f1a

Please sign in to comment.