Skip to content

Commit

Permalink
Merge pull request #26 from thibault-cne/issue/25
Browse files Browse the repository at this point in the history
Fixed the tsig validation
  • Loading branch information
thibault-cne authored Aug 1, 2024
2 parents 24588be + 0ef9038 commit d422a71
Show file tree
Hide file tree
Showing 20 changed files with 827 additions and 556 deletions.
25 changes: 15 additions & 10 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ version = "0.1.0"
edition = "2021"

[dependencies]
base16ct = "0.2.0"
base64 = "0.22.1"
bytes = "1.6.1"
convert_case = "0.6.0"
domain = { version = "0.10.1", features = [
domain = { features = [
"zonefile",
"net",
"unstable-server-transport",
"unstable-zonetree",
"tsig",
] }
], git = "https://github.com/thibault-cne/domain", branch = "main" }
futures = "0.3.30"
log = { version = "0.4.22", features = ["std"] }
notify = { version = "6.1.1" }
octseq = { version = "0.5.1", default-features = false }
ring = { version = "0.17.8", features = ["std"] }
serde = { version = "1.0.204", features = ["derive"], default-features = false }
serde_yaml = { version = "0.9.34", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ LABEL org.opencontainers.image.source="https://github.com/thibault-cne/dnsr"

COPY --from=builder /usr/dnsr/target/release/dnsr /usr/local/bin

EXPOSE 8053/udp
EXPOSE 53/udp

ENTRYPOINT ["/usr/local/bin/dnsr"]
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ The `config.yml` file is used to configure the `dnsr server. The following is th
log:
# The log level. This can be one of the following: trace, debug, info, warn, error, or off.
level: info
# Enable the udp metrics.
enable_udp_metrics: true
# Enable the tcp metrics.
enable_tcp_metrics: true
# Enable the metrics.
enable_metrics: true
# Enable thread ID in logs.
enable_thread_id: true
# Log on stderr.
stderr: false

# The keys and domains configuration
keys:
Expand Down
10 changes: 6 additions & 4 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
log:
# The log level. This can be one of the following: trace, debug, info, warn, error, or off.
level: debug
# Enable the udp metrics.
enable_udp_metrics: true
# Enable the tcp metrics.
enable_tcp_metrics: true
# Enable the metrics.
enable_metrics: true
# Enable thread ID in logs.
enable_thread_id: true
# Log on stderr.
stderr: false

keys:
key1:
Expand Down
11 changes: 4 additions & 7 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@ pub const BASE_CONFIG_FILE: &str = "/etc/dnsr/config.yml";
#[derive(Deserialize, Clone, Debug)]
pub struct Config {
pub log: LogConfig,
pub keys: Option<Keys>,
pub keys: Keys,
}

impl Config {
pub fn take_keys(&mut self) -> Option<Keys> {
self.keys.take()
}

pub fn config_file_path() -> String {
std::env::var("DNSR_CONFIG").unwrap_or(BASE_CONFIG_FILE.into())
}
Expand All @@ -40,8 +36,9 @@ impl TryFrom<&Vec<u8>> for Config {
pub struct LogConfig {
#[serde(deserialize_with = "de_level_filter")]
pub level: log::LevelFilter,
pub enable_udp_metrics: bool,
pub enable_tcp_metrics: bool,
pub enable_metrics: bool,
pub enable_thread_id: bool,
pub stderr: bool,
}

fn de_level_filter<'de, D>(deserializer: D) -> std::result::Result<log::LevelFilter, D::Error>
Expand Down
80 changes: 0 additions & 80 deletions src/dns/mod.rs

This file was deleted.

Loading

0 comments on commit d422a71

Please sign in to comment.