upgrade dependencies
This commit is contained in:
parent
c6ba207a2f
commit
515cc06dec
8 changed files with 744 additions and 556 deletions
1230
Cargo.lock
generated
1230
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
27
Cargo.toml
27
Cargo.toml
|
@ -1,32 +1,35 @@
|
|||
[package]
|
||||
name = "nomilo"
|
||||
version = "0.1.0-dev"
|
||||
authors = ["Gaël Berthaud-Müller <blacksponge@tuta.io>"]
|
||||
authors = ["DNS Witch Collective <dns-witch@familier.net.eu.org>"]
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
readme = "README.md"
|
||||
repository = "https://git.familier.net.eu.org/dns-witch/nomilo"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
trust-dns-client = { version = "0.21", features = ["dnssec-openssl"] }
|
||||
trust-dns-proto = "0.21"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "6bdd2f8", version = "0.5.0-rc.1", features = ["json"], default-features = false }
|
||||
rocket_sync_db_pools = { git = "https://github.com/SergioBenitez/Rocket", rev = "6bdd2f8", default-features = false, features = ["diesel_sqlite_pool"], version = "0.1.0-rc.1"}
|
||||
base64 = "0.13.0"
|
||||
uuid = { version = "0.8.2", features = ["v4", "serde"] }
|
||||
trust-dns-client = { version = "0.22", features = ["dnssec-openssl"] }
|
||||
trust-dns-proto = "0.22"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
rocket = { version = "0.5.0-rc.2", features = ["json"], default-features = false }
|
||||
rocket_sync_db_pools = { default-features = false, features = ["diesel_sqlite_pool"], version = "0.1.0-rc.2"}
|
||||
base64 = "0.21"
|
||||
uuid = { version = "0.8", features = ["v4", "serde"] }
|
||||
diesel = { version = "1.4", features = ["sqlite", "chrono"] }
|
||||
diesel_migrations = "1.4"
|
||||
diesel-derive-enum = { version = "1", features = ["sqlite"] }
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
humantime = "2.1.0"
|
||||
humantime = "2.1"
|
||||
tokio = "1"
|
||||
figment = { version = "0.10.6", features = ["toml", "env"] }
|
||||
figment = { version = "0.10", features = ["toml", "env"] }
|
||||
clap = {version = "3", features = ["derive", "cargo"]}
|
||||
argon2 = {version = "0.4", default-features = false, features = ["alloc", "password-hash"] }
|
||||
rand = "0.8"
|
||||
tera = {version = "1", default-features = false}
|
||||
# From trust-dns-client
|
||||
futures-util = { version = "0.3.5", default-features = false, features = ["std"] }
|
||||
futures-util = { version = "0.3", default-features = false, features = ["std"] }
|
||||
# From rocket / cookie-rs
|
||||
time = "0.3"
|
||||
|
|
|
@ -2,6 +2,7 @@ use std::net::SocketAddr;
|
|||
use std::time::Duration;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use base64::{Engine, engine::general_purpose};
|
||||
use serde::{Deserialize, Deserializer};
|
||||
|
||||
use crate::models::name::SerdeName;
|
||||
|
@ -53,7 +54,7 @@ fn from_base64<'de, D>(deserializer: D) -> Result<Vec<u8>, D::Error>
|
|||
{
|
||||
use serde::de::Error;
|
||||
String::deserialize(deserializer)
|
||||
.and_then(|string| base64::decode(&string).map_err(|err| Error::custom(err.to_string())))
|
||||
.and_then(|string| general_purpose::STANDARD.decode(&string).map_err(|err| Error::custom(err.to_string())))
|
||||
}
|
||||
|
||||
fn from_tsigalg<'de, D>(deserializer: D) -> Result<TsigAlgorithm, D::Error>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
use time;
|
||||
use rocket::http::{Cookie, SameSite, CookieJar};
|
||||
use rocket::State;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use trust_dns_proto::DnsHandle;
|
||||
use trust_dns_client::client::ClientHandle;
|
||||
use trust_dns_client::rr::{DNSClass, RecordType};
|
||||
use trust_dns_client::op::{UpdateMessage, OpCode, MessageType, Message, Query, ResponseCode};
|
||||
use trust_dns_client::op::{UpdateMessage, OpCode, MessageType, Message, Query, ResponseCode, Edns};
|
||||
use trust_dns_client::error::ClientError;
|
||||
|
||||
use super::{Name, Record, RData};
|
||||
|
@ -61,7 +61,11 @@ impl std::fmt::Display for DnsConnectorError {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
fn set_edns(message: &mut Message) {
|
||||
let edns = message.extensions_mut().get_or_insert_with(Edns::new);
|
||||
edns.set_max_payload(MAX_PAYLOAD_LEN);
|
||||
edns.set_version(0);
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl RecordConnector for DnsConnectorClient {
|
||||
|
@ -115,11 +119,7 @@ impl RecordConnector for DnsConnectorClient {
|
|||
message.add_zone(zone_query);
|
||||
message.add_updates(new_records);
|
||||
|
||||
{
|
||||
let edns = message.edns_mut();
|
||||
edns.set_max_payload(MAX_PAYLOAD_LEN);
|
||||
edns.set_version(0);
|
||||
}
|
||||
set_edns(&mut message);
|
||||
|
||||
let response = match ClientResponse(self.client.send(message)).await.map_err(|e| Box::new(DnsConnectorError::ClientError(e))) {
|
||||
Err(e) => return Err(e),
|
||||
|
@ -179,11 +179,7 @@ impl RecordConnector for DnsConnectorClient {
|
|||
message.add_updates(new_records);
|
||||
|
||||
// Extended dns
|
||||
{
|
||||
let edns = message.edns_mut();
|
||||
edns.set_max_payload(MAX_PAYLOAD_LEN);
|
||||
edns.set_version(0);
|
||||
}
|
||||
set_edns(&mut message);
|
||||
|
||||
let response = match ClientResponse(self.client.send(message)).await.map_err(|e| Box::new(DnsConnectorError::ClientError(e))) {
|
||||
Err(e) => return Err(e),
|
||||
|
@ -229,11 +225,7 @@ impl RecordConnector for DnsConnectorClient {
|
|||
message.add_updates(delete);
|
||||
|
||||
// Extended dns
|
||||
{
|
||||
let edns = message.edns_mut();
|
||||
edns.set_max_payload(MAX_PAYLOAD_LEN);
|
||||
edns.set_version(0);
|
||||
}
|
||||
set_edns(&mut message);
|
||||
|
||||
let response = match ClientResponse(self.client.send(message)).await.map_err(|e| Box::new(DnsConnectorError::ClientError(e))) {
|
||||
Err(e) => return Err(e),
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use std::convert::TryFrom;
|
||||
use std::net::{Ipv6Addr, Ipv4Addr};
|
||||
|
||||
use base64::{Engine, engine::general_purpose};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use trust_dns_client::serialize::binary::BinEncoder;
|
||||
|
@ -127,7 +128,7 @@ impl From<dns::RData> for RData {
|
|||
mail_exchanger: SerdeName(mx.exchange().clone())
|
||||
},
|
||||
dns::RData::NULL(null) => RData::NULL {
|
||||
data: base64::encode(null.anything())
|
||||
data: general_purpose::STANDARD.encode(null.anything())
|
||||
},
|
||||
dns::RData::NS(target) => RData::NS {
|
||||
target: SerdeName(target)
|
||||
|
@ -168,7 +169,7 @@ impl From<dns::RData> for RData {
|
|||
|
||||
RData::Unknown {
|
||||
code,
|
||||
data: base64::encode(data),
|
||||
data: general_purpose::STANDARD.encode(data),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -212,7 +213,7 @@ impl TryFrom<RData> for dns::RData {
|
|||
),
|
||||
RData::NULL { data } => dns::RData::NULL(
|
||||
dns::null::NULL::with(
|
||||
base64::decode(data).map_err(|e| ProtoError::from(format!("{}", e)))?
|
||||
general_purpose::STANDARD.decode(data).map_err(|e| ProtoError::from(format!("{}", e)))?
|
||||
)
|
||||
),
|
||||
RData::NS { target } => dns::RData::NS(target.into_inner()),
|
||||
|
|
|
@ -56,9 +56,7 @@ impl<'r, S: Serialize> Template<'r, S> {
|
|||
|
||||
impl<'r, 't, S: Serialize> Responder<'r, 'static> for Template<'t, S> {
|
||||
fn respond_to(self, request: &'r Request<'_>) -> response::Result<'static> {
|
||||
let template_state = request.rocket().state::<TemplateState>().ok_or_else(|| {
|
||||
Status::InternalServerError
|
||||
})?;
|
||||
let template_state = request.rocket().state::<TemplateState>().ok_or(Status::InternalServerError)?;
|
||||
|
||||
self.render(&template_state.tera).respond_to(request)
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{% block title %}{{ current_zone }} ⋅ Records ⋅ {% endblock title %}
|
||||
|
||||
{% block main %}
|
||||
<h1>Gestion la zone {{ current_zone }}</h1>
|
||||
<h1>Gestion de la zone {{ current_zone }}</h1>
|
||||
<nav aria-label="Secondaire">
|
||||
<ul>
|
||||
<li>
|
||||
|
|
Loading…
Reference in a new issue