Compare commits
1 commit
2e133ef515
...
29916c0841
Author | SHA1 | Date | |
---|---|---|---|
29916c0841 |
2 changed files with 7 additions and 7 deletions
|
@ -4,7 +4,7 @@ use std::{
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
};
|
};
|
||||||
|
|
||||||
use axum_client_ip::SecureClientIpSource;
|
use axum_client_ip::ClientIpSource;
|
||||||
use miette::{Context, IntoDiagnostic};
|
use miette::{Context, IntoDiagnostic};
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, Copy, serde::Deserialize, serde::Serialize)]
|
#[derive(Debug, Default, Clone, Copy, serde::Deserialize, serde::Serialize)]
|
||||||
|
@ -99,9 +99,9 @@ pub struct Records {
|
||||||
|
|
||||||
/// Set client IP source
|
/// Set client IP source
|
||||||
///
|
///
|
||||||
/// see: <https://docs.rs/axum-client-ip/latest/axum_client_ip/enum.SecureClientIpSource.html>
|
/// see: <https://docs.rs/axum-client-ip/latest/axum_client_ip/enum.ClientIpSource.html>
|
||||||
#[serde(default = "default_ip_source")]
|
#[serde(default = "default_ip_source")]
|
||||||
pub ip_source: SecureClientIpSource,
|
pub ip_source: ClientIpSource,
|
||||||
|
|
||||||
/// Set which IPs to allow updating (ipv4, ipv6 or both)
|
/// Set which IPs to allow updating (ipv4, ipv6 or both)
|
||||||
#[serde(default = "default_ip_type")]
|
#[serde(default = "default_ip_type")]
|
||||||
|
@ -198,8 +198,8 @@ fn default_address() -> SocketAddr {
|
||||||
SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 5353)
|
SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 5353)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_ip_source() -> SecureClientIpSource {
|
fn default_ip_source() -> ClientIpSource {
|
||||||
SecureClientIpSource::RightmostXForwardedFor
|
ClientIpSource::RightmostXForwardedFor
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_ip_type() -> IpType {
|
fn default_ip_type() -> IpType {
|
||||||
|
|
|
@ -10,7 +10,7 @@ use axum::{
|
||||||
routing::get,
|
routing::get,
|
||||||
Router,
|
Router,
|
||||||
};
|
};
|
||||||
use axum_client_ip::SecureClientIp;
|
use axum_client_ip::ClientIp;
|
||||||
use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine};
|
use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine};
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use clap_verbosity_flag::Verbosity;
|
use clap_verbosity_flag::Verbosity;
|
||||||
|
@ -456,7 +456,7 @@ impl FritzBoxUpdateParams {
|
||||||
#[tracing::instrument(skip(state), level = "trace", ret(level = "info"))]
|
#[tracing::instrument(skip(state), level = "trace", ret(level = "info"))]
|
||||||
async fn update_records(
|
async fn update_records(
|
||||||
State(state): State<AppState<'static>>,
|
State(state): State<AppState<'static>>,
|
||||||
SecureClientIp(ip): SecureClientIp,
|
ClientIp(ip): ClientIp,
|
||||||
Query(update_params): Query<FritzBoxUpdateParams>,
|
Query(update_params): Query<FritzBoxUpdateParams>,
|
||||||
) -> axum::response::Result<&'static str> {
|
) -> axum::response::Result<&'static str> {
|
||||||
info!("accepted update from {ip}");
|
info!("accepted update from {ip}");
|
||||||
|
|
Loading…
Add table
Reference in a new issue