feat: fix content sharing — nginx proxy, file path resolution, catalog filtering

- Add /content and /dwn proxy locations to nginx config (both HTTP and HTTPS)
  so peer requests reach the backend instead of the SPA catch-all
- Update content_file_path() to check FileBrowser data dir as fallback when
  files aren't in the dedicated content/files/ directory
- Populate size_bytes from actual file metadata in content.add
- Filter out availability:nobody items from the public catalog endpoint

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-13 02:20:55 +00:00
co-authored by Claude Opus 4.6
parent 8c3c2104b2
commit fc8e3f2d39
5 changed files with 61 additions and 4 deletions
+7 -1
View File
@@ -31,7 +31,7 @@ impl RpcHandler {
.and_then(|v| v.as_str())
.unwrap_or("");
let item = ContentItem {
let mut item = ContentItem {
id: uuid::Uuid::new_v4().to_string(),
filename: filename.to_string(),
mime_type: mime_type.to_string(),
@@ -42,6 +42,12 @@ impl RpcHandler {
added_at: chrono::Utc::now().to_rfc3339(),
};
// Resolve actual file size from disk
let file_path = content_server::content_file_path(&self.config.data_dir, &item);
if let Ok(metadata) = std::fs::metadata(&file_path) {
item.size_bytes = metadata.len();
}
content_server::add_item(&self.config.data_dir, item.clone()).await?;
Ok(serde_json::json!({ "item": item }))
}