Domain link Update

This commit is contained in:
2025-12-12 19:18:33 +00:00
parent e021191eb3
commit 4094355cf9
+13 -1
View File
@@ -124,7 +124,10 @@ fn load_config() -> Config {
.parse::<usize>()
.expect("Invalid CHUNK_SIZE_KB")
* 1024,
domain: std::env::var("DOMAIN").ok().map(|d| d.trim_end_matches('/').to_string()),
domain: std::env::var("DOMAIN")
.ok()
.map(|d| d.trim().trim_end_matches('/').to_string())
.filter(|d| !d.is_empty()),
}
}
@@ -226,7 +229,16 @@ async fn list_files(State(state): State<AppState>) -> Html<String> {
.config
.domain
.clone()
.map(|d| {
if d.contains("://") {
d
} else {
format!("https://{}", d)
}
})
.unwrap_or_else(|| format!("http://localhost:{}", state.config.port));
tracing::info!("Using base URL for commands: {}", base_url);
let mut file_list_items = String::new();