Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
🥺
conduwuit
Commits
3d0f0cc1
Commit
3d0f0cc1
authored
11 months ago
by
🥺
Committed by
🥺
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
add query_all_nameservers config option
Signed-off-by:
strawberry
<
strawberry@puppygock.gay
>
parent
cb12f285
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
conduwuit-example.toml
+6
-0
6 additions, 0 deletions
conduwuit-example.toml
src/config/mod.rs
+7
-0
7 additions, 0 deletions
src/config/mod.rs
src/service/globals/mod.rs
+2
-0
2 additions, 0 deletions
src/service/globals/mod.rs
src/service/globals/resolver.rs
+14
-1
14 additions, 1 deletion
src/service/globals/resolver.rs
with
29 additions
and
1 deletion
conduwuit-example.toml
+
6
−
0
View file @
3d0f0cc1
...
...
@@ -413,6 +413,12 @@ url_preview_check_root_domain = false
# Number of retries after a timeout.
#dns_attempts = 5
# Enable to query all nameservers until the domain is found. Referred to as "trust_negative_responses" in hickory_resolver.
# This can avoid useless DNS queries if the first nameserver responds with NXDOMAIN or an empty NOERROR response.
#
# The default is to query one nameserver and stop (false).
#query_all_nameservers = false
### Request Timeouts, Connection Timeouts, and Connection Pooling
...
...
This diff is collapsed.
Click to expand it.
src/config/mod.rs
+
7
−
0
View file @
3d0f0cc1
...
...
@@ -67,6 +67,8 @@ pub struct Config {
pub
dns_attempts
:
u16
,
#[serde(default
=
"default_dns_timeout"
)]
pub
dns_timeout
:
u64
,
#[serde(default)]
pub
query_all_nameservers
:
bool
,
#[serde(default
=
"default_max_request_size"
)]
pub
max_request_size
:
u32
,
#[serde(default
=
"default_max_concurrent_requests"
)]
...
...
@@ -322,6 +324,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
(
"DNS minimum nxdomain ttl"
,
&
self
.dns_min_ttl_nxdomain
.to_string
()),
(
"DNS attempts"
,
&
self
.dns_attempts
.to_string
()),
(
"DNS timeout"
,
&
self
.dns_timeout
.to_string
()),
(
"Query all nameservers"
,
&
self
.query_all_nameservers
.to_string
()),
(
"Maximum request size (bytes)"
,
&
self
.max_request_size
.to_string
()),
(
"Maximum concurrent requests"
,
&
self
.max_concurrent_requests
.to_string
()),
(
"Request connect timeout"
,
&
self
.request_conn_timeout
.to_string
()),
...
...
@@ -511,6 +514,10 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
),
(
"URL preview maximum spider size"
,
&
self
.url_preview_max_spider_size
.to_string
()),
(
"URL preview check root domain"
,
&
self
.url_preview_check_root_domain
.to_string
()),
(
"Allow check for updates / announcements check"
,
&
self
.allow_check_for_updates
.to_string
(),
),
];
let
mut
msg
:
String
=
"Active config values:
\n\n
"
.to_owned
();
...
...
This diff is collapsed.
Click to expand it.
src/service/globals/mod.rs
+
2
−
0
View file @
3d0f0cc1
...
...
@@ -235,6 +235,8 @@ pub fn query_trusted_key_servers_first(&self) -> bool { self.config.query_truste
pub
fn
dns_resolver
(
&
self
)
->
&
TokioAsyncResolver
{
&
self
.resolver.resolver
}
pub
fn
query_all_nameservers
(
&
self
)
->
bool
{
self
.config.query_all_nameservers
}
pub
fn
actual_destinations
(
&
self
)
->
&
Arc
<
RwLock
<
resolver
::
WellKnownMap
>>
{
&
self
.resolver.destinations
}
pub
fn
jwt_decoding_key
(
&
self
)
->
Option
<&
jsonwebtoken
::
DecodingKey
>
{
self
.jwt_decoding_key
.as_ref
()
}
...
...
This diff is collapsed.
Click to expand it.
src/service/globals/resolver.rs
+
14
−
1
View file @
3d0f0cc1
...
...
@@ -40,9 +40,22 @@ pub(crate) fn new(config: &Config) -> Self {
.unwrap
();
let
mut
conf
=
hickory_resolver
::
config
::
ResolverConfig
::
new
();
if
let
Some
(
domain
)
=
sys_conf
.domain
()
{
conf
.set_domain
(
domain
.clone
());
}
for
sys_conf
in
sys_conf
.search
()
{
conf
.add_search
(
sys_conf
.clone
());
}
for
sys_conf
in
sys_conf
.name_servers
()
{
let
mut
ns
=
sys_conf
.clone
();
ns
.trust_negative_responses
=
true
;
if
config
.query_all_nameservers
{
ns
.trust_negative_responses
=
true
;
}
conf
.add_name_server
(
ns
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment