Compare commits

..

1 Commits

Author SHA1 Message Date
Simon Wicky 847aa65d66 better ip address extraction 2025-06-05 14:05:01 +02:00
4 changed files with 5 additions and 7 deletions
Generated
+1 -1
View File
@@ -7224,7 +7224,7 @@ dependencies = [
[[package]]
name = "nym-statistics-api"
version = "0.1.3"
version = "0.1.1"
dependencies = [
"anyhow",
"axum 0.7.9",
+1 -1
View File
@@ -3,7 +3,7 @@
[package]
name = "nym-statistics-api"
version = "0.1.3"
version = "0.1.1"
authors.workspace = true
repository.workspace = true
homepage.workspace = true
+1 -1
View File
@@ -53,7 +53,7 @@ async fn submit_stats_report(
let maybe_connection_info = ConnectionInfoDto::maybe_new(
now,
&report,
insecure_ip_addr.0,
insecure_ip_addr.0.to_string(),
maybe_location,
from_mixnet,
);
+2 -4
View File
@@ -1,5 +1,3 @@
use std::net::IpAddr;
use axum_extra::headers::UserAgent;
use celes::Country;
use nym_statistics_common::report::vpn_client::VpnClientStatsReport;
@@ -53,13 +51,13 @@ impl ConnectionInfoDto {
pub(crate) fn maybe_new(
received_at: OffsetDateTime,
stats_report: &VpnClientStatsReport,
received_from: IpAddr,
received_from: String,
maybe_country: Option<Country>,
from_mixnet: bool,
) -> Option<Self> {
stats_report.basic_usage.as_ref().map(|usage_report| Self {
received_at,
received_from: received_from.to_string(),
received_from,
connection_time_ms: usage_report.connection_time_ms,
two_hop: usage_report.two_hop,
country_code: maybe_country.map(|c| c.alpha2.into()),