Skip to content

Commit

Permalink
dnsdist: Fix the build process for the YAML configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
rgacogne committed Oct 22, 2024
1 parent c55c3e6 commit b395dca
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 505 deletions.
2 changes: 1 addition & 1 deletion pdns/dnsdistdist/dnsdist-rust-bridge.hh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

struct DNSRule;

#include "dnsdist-rust-lib/rust/cxx.h"
#include "rust/cxx.h"

namespace dnsdist::rust::settings
{
Expand Down
15 changes: 14 additions & 1 deletion pdns/dnsdistdist/dnsdist-rust-lib/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
EXTRA_DIST = \
settings-generator.py \
dnsdist-rules-definitions.yml \
rust/src/lib.rs

all:
all: rust/src/lib.rs

BUILT_SOURCES=rust/src/lib.rs

rust/src/lib%rs: settings-generator.py dnsdist-rules-definitions.yml
@if test "$(PYTHON)" = ":"; then echo "Settings definitions have changed, python is needed to regenerate the related settings files but python was not found. Please install python and re-run configure"; exit 1; fi
@if ! $(PYTHON) --version | grep -q "Python 3"; then echo $(PYTHON) should be at least version 3. Please install python 3 and re-run configure; exit 1; fi
$(MAKE) -C rust clean
(cd ${srcdir} && $(PYTHON) settings-generator.py dnsdist-rules-definitions.yml)

clean-local:
rm -f rust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
Carbon:
carbon:
section: "metrics"
type: "list"
parameters:
Expand Down Expand Up @@ -43,7 +43,7 @@ Protobuf-Logger:
default: 1
description: "Time in seconds between reconnection attempts"

Webserver:
webserver:
section: "global"
parameters:
- name: "listen-addresses"
Expand Down Expand Up @@ -79,7 +79,7 @@ Webserver:
default: "false"
description: "Whether passwords and API keys provided in plaintext should be hashed during startup, to prevent the plaintext versions from staying in memory. Doing so increases significantly the cost of verifying credentials"

Console:
console:
section: "global"
parameters:
- name: "listen-address"
Expand Down Expand Up @@ -115,7 +115,7 @@ acl:
default: "127.0.0.0/8, 10.0.0.0/8, 100.64.0.0/10, 169.254.0.0/16, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fc00::/7, fe80::/10"
description: "CIDR netmasks of the clients allowed to send DNS queries"

ring-buffer:
ring-buffers:
section: "global"
parameters:
- name: "size"
Expand Down Expand Up @@ -165,7 +165,7 @@ outgoing-tls:
type: "bool"
default: "true"

doh:
incoming-doh:
parameters:
- name: "provider"
type: "String"
Expand All @@ -179,7 +179,7 @@ outgoing-doh:
- name: "path"
type: "String"
default: "/dns-query"
- name: "add-x-forwarded-for-headers"
- name: "add-x-forwarded-headers"
type: "bool"
default: "false"

Expand All @@ -201,8 +201,10 @@ binds:
default: "1"
- name: "tls"
type: "TlsConfiguration"
default: true
- name: "doh"
type: "DohConfiguration"
type: "IncomingDohConfiguration"
default: true

backends:
section: "global"
Expand All @@ -214,8 +216,10 @@ backends:
type: "String"
- name: "tls"
type: "OutgoingTlsConfiguration"
default: true
- name: "doh"
type: "OutgoingDohConfiguration"
default: true
- name: "max-in-flight"
type: "u16"
default: "1"
Expand All @@ -225,6 +229,9 @@ backends:
- name: "use-proxy-protocol"
type: "bool"
default: "false"
- name: "health-check"
type: "String"
default: "auto"

tcp:
section: "tuning"
Expand Down Expand Up @@ -260,7 +267,6 @@ packet-caches:
- name: "shards"
type: "u32"


pools:
section: "global"
type: "list"
Expand All @@ -269,10 +275,10 @@ pools:
type: "String"
- name: "packet-cache"
type: "String"
default: true
- name: "policy"
type: "String"


default: "least-outstanding"

MaxQPSIPRule:
section: "selectors"
Expand Down
Loading

0 comments on commit b395dca

Please sign in to comment.