Merge pull request #87 from lifenjoiner/win

Add compiling condition for Windows
slab
Frank Denis 2 years ago committed by GitHub
commit 88c8db8ab2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -38,7 +38,6 @@ log = { version = "0.4.17", features = ["std", "release_max_level_debug"] }
mimalloc = { version = "0.1.29", default-features = false }
socket2 = "0.4.4"
parking_lot = "0.12.1"
privdrop = "0.5.2"
rand = "0.8.5"
rustc-hash = "1.1.0"
serde = "1.0.137"
@ -55,6 +54,9 @@ tokio = { version = "1.19.2", features = [
] }
toml = "0.5.9"
[target.'cfg(not(target_family = "windows"))'.dependencies]
privdrop = "0.5.2"
[dependencies.prometheus]
optional = true
version = "0.13.1"

@ -64,7 +64,7 @@ Make a copy of the `example-encrypted-dns.toml` configuration file named `encryp
Then, review the [`encrypted-dns.toml`](https://raw.githubusercontent.com/jedisct1/encrypted-dns-server/master/example-encrypted-dns.toml) file. This is where all the parameters can be configured, including the IP addresses to listen to.
You should probably at least change the `listen_addresses` and `provider_name` settings.
You should probably at least change the `listen_addrs` and `provider_name` settings.
Start the proxy. It will automatically create a new provider key pair if there isn't any.

@ -63,6 +63,7 @@ use futures::prelude::*;
use globals::*;
use parking_lot::Mutex;
use parking_lot::RwLock;
#[cfg(not(target_family = "windows"))]
use privdrop::PrivDrop;
use rand::prelude::*;
use siphasher::sip128::SipHasher13;
@ -461,6 +462,7 @@ fn bind_listeners(
Ok(sockets)
}
#[cfg(not(target_family = "windows"))]
fn privdrop(config: &Config) -> Result<(), Error> {
let mut pd = PrivDrop::default();
if let Some(user) = &config.user {
@ -552,6 +554,7 @@ fn main() -> Result<(), Error> {
runtime_builder.thread_name("encrypted-dns-");
let runtime = runtime_builder.build()?;
#[cfg(not(target_family = "windows"))]
privdrop(&config)?;
let key_cache_capacity = config.dnscrypt.key_cache_capacity;

Loading…
Cancel
Save