From 64afa0fd8c863deb6a1568428dfaf2ce67ef9085 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 01:06:38 +0100 Subject: copyparty: never send the password to foreign hosts --- src/voice/mod.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/voice/mod.rs') diff --git a/src/voice/mod.rs b/src/voice/mod.rs index fcb0b07..5a89f93 100644 --- a/src/voice/mod.rs +++ b/src/voice/mod.rs @@ -16,6 +16,7 @@ use symphonia::core::meta::MetadataOptions; use tokio::sync::Mutex; use tracing::{info, warn}; +use crate::copyparty::redact_url; use crate::error::{Error, Result}; use crate::lang; use crate::recording::{Recorder, RecorderEventHandler}; @@ -241,7 +242,11 @@ pub async fn ytdlp_download(url: &str) -> Result> { let stderr = String::from_utf8_lossy(&output.stderr); // Keep the full yt-dlp trace in the logs for debugging — the user // only ever sees the short, translated `fmt_ytdlp_stderr` message. - warn!(url = %url, "yt-dlp failed:\n{}", stderr.trim_end()); + warn!( + url = %redact_url(url), + "yt-dlp failed:\n{}", + stderr.trim_end() + ); return Err(Error::Custom(lang::fmt_ytdlp_stderr(&stderr))); } @@ -256,11 +261,11 @@ pub async fn download_url(client: &reqwest::Client, url: &str) -> Result .get(url) .send() .await - .map_err(|e| Error::Custom(format!("HTTP GET failed for {url}: {e}")))?; + .map_err(|e| Error::Custom(format!("HTTP GET failed for {}: {e}", redact_url(url))))?; let bytes = resp .bytes() .await - .map_err(|e| Error::Custom(format!("Failed to read body for {url}: {e}")))?; + .map_err(|e| Error::Custom(format!("Failed to read body for {}: {e}", redact_url(url))))?; Ok(bytes.to_vec()) } @@ -398,7 +403,11 @@ pub async fn ffmpeg_stream_input(url: &str) -> Result { let _ = reader.read_to_end(&mut buf).await; let text = String::from_utf8_lossy(&buf); if !text.is_empty() { - warn!(url = %url_owned, "ffmpeg stderr: {}", text.trim_end()); + warn!( + url = %redact_url(&url_owned), + "ffmpeg stderr: {}", + text.trim_end() + ); } }); } -- cgit v1.2.3