Commit Graph

28 Commits

Author SHA1 Message Date
17be6abaab refactor: streaming, security hardening, and MCP removal
Major overhaul of server architecture and security posture:

- Streaming: Unified all I/O through PIPESIZE (8192-byte) buffers.
  POST bodies stream via MpscReader through the save pipeline. GET
  content streams from disk via decompression to client. Removed
  save_item_with_reader, get_item_content_info, ChannelReader.
  413 responses keep partial items (nonfatal by design).

- Security: XSS protection in all HTML pages via html_escape crate.
  Security headers middleware (nosniff, frame deny, referrer policy).
  CORS tightened to explicit headers. Input validation for tags
  (256 chars), metadata (128/4096), pagination (10k cap). Config
  file reads use from_utf8_lossy. Generic error messages in HTML.
  Diff endpoint has 10 MB per-item cap. max_body_size config option.

- Panics eliminated: Path unwraps → proper error propagation.
  Mutex unwraps → map_err (registries) / expect with message (local).

- MCP removed: Deleted all MCP code, rmcp dependency, mcp feature.

- Docs: Updated README, DESIGN, AGENTS to reflect all changes.
2026-03-14 00:03:42 -03:00
237a581429 fix: add server streaming support, fix pre-existing compilation errors
Server changes for client mode streaming:
- POST /api/item/ now streams body via async channel → ChannelReader
  → save_item_raw_streaming when compress=false or meta=false
- Add POST /api/item/{id}/meta endpoint for client-side metadata
- Add save_item_raw_streaming<R: Read> to SyncDataService
- Add add_item_meta to AsyncDataService

Fix pre-existing issues that were hidden behind swagger cfg gate:
- Remove #[cfg(feature = "swagger")] from item module so it compiles
  with just the server feature
- Fix parse_comma_tags usage (returns Vec, not Result)
- Fix TextDiff temporary value lifetime issue
- Fix io::Error::new → io::Error::other
- Fix ok_or_else → ok_or for Copy types
- Inline format args throughout server code
- Fix empty line after doc comment in pages.rs
- Add cfg_attr for unused_mut where mcp feature gates mutation
- Add type_complexity allow on create_auth_middleware
- Distinguish task error vs save error in spawn_blocking handlers

Co-Authored-By: andrew/openrouter/hunter-alpha <noreply@opencode.ai>
2026-03-12 18:02:56 -03:00
Andrew Phillips
fdeb5f7951 Ugh 2026-02-19 13:57:39 -04:00
Andrew Phillips
11ec6cf01e docs: Add Rustdoc for pages.rs structs and functions
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
2025-09-10 15:56:45 -03:00
Andrew Phillips
b88daca131 fix: Handle ColumnAlignment::Center in server pages
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-09-08 19:06:24 -03:00
Andrew Phillips
b58d0a2df5 feat: add "Keep - " prefix to page titles
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 13:19:39 -03:00
Andrew Phillips
4f417c29a8 feat: add item id to page title
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 13:18:12 -03:00
Andrew Phillips
9d9f98dc54 feat: add clickable tags to item details table
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 13:16:20 -03:00
Andrew Phillips
32a79c0a1b feat: disable max length truncation for tags column in HTML
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 12:27:35 -03:00
Andrew Phillips
2b0e958b1f fix: add debug logging for tag counts per item
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 12:23:03 -03:00
Andrew Phillips
0c9e861307 feat: use existing items to get recent tags instead of database query
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 12:21:19 -03:00
Andrew Phillips
eb42b207f0 feat: add recent tags section to items page
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 12:20:34 -03:00
Andrew Phillips
467e91ab47 feat: make tags clickable for searching specific tags
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 12:19:37 -03:00
Andrew Phillips
e0536506b9 fix: remove unused http::StatusCode import
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 12:16:35 -03:00
Andrew Phillips
8005f9baf0 feat: add missing imports for Response and StatusCode
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 12:11:52 -03:00
Andrew Phillips
79b63d2d73 feat: add content-length header to responses
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 12:10:18 -03:00
Andrew Phillips
47fd796d50 feat: add unified styling with style.css route
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 12:06:32 -03:00
Andrew Phillips
e056678799 feat: make item ID clickable link to details page
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-29 12:04:16 -03:00
Andrew Phillips
06a4b3ec73 fix: update meta map iteration to use tuple pattern
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-28 15:17:45 -03:00
Andrew Phillips
9ab4341c2e fix: fix meta processing in pages.rs
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-28 15:17:31 -03:00
Andrew Phillips
761542743c feat: implement configurable columns for item list page
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
2025-08-28 15:15:38 -03:00
Andrew Phillips
24d7c4742c chore: update dependencies and remove unused test modules 2025-08-14 12:23:46 -03:00
Andrew Phillips
8207c29d9c fix: add missing db module import and fix router merge issue
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
2025-08-12 17:09:12 -03:00
Andrew Phillips
4d3a9fd3ac fix: resolve compilation errors by adding missing imports and fixing schema definitions
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
2025-08-12 16:58:29 -03:00
Andrew Phillips
3395c54843 refactor: reformat route addition for better readability 2025-08-12 16:58:27 -03:00
Andrew Phillips
96bfc09c51 feat: add swagger documentation link to main page
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
2025-08-12 16:40:09 -03:00
Andrew Phillips
d4c3f5a090 feat: add HTML endpoints for item listing and details pages
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
2025-08-12 16:37:15 -03:00
Andrew Phillips
6ec8e7a669 feat: add server pages mode implementation 2025-08-12 16:37:13 -03:00