b166477202
fix: harden security, eliminate panics, remove dead code, add Dockerfile
...
Security:
- Use constant-time password comparison (subtle crate) to prevent timing attacks
- Replace permissive CORS with configurable origin-restricted CORS
- Add TLS warning when password auth is used without HTTPS
Bug fixes:
- Convert MetaPlugin panics to anyhow::Result (get_meta_plugin, outputs_mut, options_mut)
- Replace item.id.unwrap() with proper error handling across 15 call sites
- Fix panic on unknown column type in list mode
- Fix conflicting PIPESIZE constant (was 8192 vs 65536, now unified to 8192)
- Add 256MB filter chain buffer limit to prevent OOM
- Gracefully skip unregistered plugins instead of panicking
Dead code removal:
- Delete unused filter parser files (filter_parser.rs, filter.pest, parser/ module)
- ~260 lines of dead PEG parser code removed
Code consolidation:
- Add is_content_binary_from_metadata() helper (was duplicated in 4 places)
- Simplify save_item_raw() to delegate to save_item_raw_streaming() (~90 lines removed)
Incomplete features:
- Populate filter_plugins in status output from global registry
- Add FallbackMagicFileMetaPlugin (was referenced but never implemented)
- Document init_plugins() as intentional no-op
Infrastructure:
- Add Dockerfile (static musl binary on scratch, 4.8MB)
- Add .dockerignore
- Add cors_origin to ServerConfig and config.rs
2026-03-13 07:57:36 -03:00
8a8a6e1c4b
fix: correct critical bugs and improve pipe streaming performance
...
Critical bug fixes:
- save_item now returns real Item from database, not a hardcoded fake
- AsyncDataService::save() reuses self.sync_service instead of creating redundant instance
- GenerateStatus trait signature mismatch fixed (CLI/API decoupling)
Performance improvements (pipe path untouched):
- CompressionEngine::open() returns Box<dyn Read + Send> enabling true streaming
- mode_get eliminates triple full-file read (was sampling then re-reading entire file)
- FilteringReader adds fast-path bypass when no filters, pre-allocates temp buffer
- text.rs meta plugin processes &[u8] slice directly, eliminates data.to_vec() clone
API correctness:
- Tag parse errors now return 400 instead of being silently discarded
- compute_diff uses similar crate (LCS-based) instead of naive positional comparison
Cleanup:
- Modernize string formatting (format!({x})) across codebase
- Remove redundant DB query in get mode
- Derive Debug/ToSchema on public types
- Delete placeholder test files with no real assertions
- Extract parse_comma_tags utility function
2026-03-11 20:45:05 -03:00
Andrew Phillips
fdeb5f7951
Ugh
2026-02-19 13:57:39 -04:00
Andrew Phillips
d44f3fbb5b
docs: Add Rustdoc comments for various structs and functions
...
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat >
2025-09-10 14:23:12 -03:00
Andrew Phillips
2e62878acb
fix: Resolve compilation errors with missing imports and closure moves
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-09-03 07:34:13 -03:00
Andrew Phillips
426eff309b
refactor: Improve error handling and borrowing in item services
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-09-03 07:32:25 -03:00
Andrew Phillips
1bd3f95627
refactor: Introduce execute_blocking to reduce code duplication in AsyncItemService
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-09-03 07:29:30 -03:00
Andrew Phillips
61d7dcb94e
refactor: Consolidate item content filtering into a single filter string
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-09-02 18:54:50 -03:00
Andrew Phillips
8795756232
refactor: Simplify streaming content API to use a single filter option
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-09-02 18:37:15 -03:00
Andrew Phillips
2fcf922dd8
refactor: Simplify content streaming by consolidating filter parameters
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-09-02 18:36:54 -03:00
Andrew Phillips
22c91202a5
fix: Add context_bytes_len parameter to get_item_content_info_streaming
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-09-02 18:32:01 -03:00
Andrew Phillips
35bbf42e24
feat: update item streaming and binary check parameters
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-28 21:10:34 -03:00
Andrew Phillips
8fcccf68e3
fix: remove unused filter_plugin import and unused ringbuf import
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-28 21:05:23 -03:00
Andrew Phillips
4c8466bb21
refactor: reduce code duplication in filter and item services
...
Co-authored-by: aider (openai/andrew/openrouter/mistralai/mistral-medium-3.1) <aider@aider.chat >
2025-08-28 20:51:39 -03:00
Andrew Phillips
ee555b253f
feat: add grep option to content endpoints
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-28 20:16:24 -03:00
Andrew Phillips
a419ae960c
feat: add content filtering options to content endpoints
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-28 20:13:06 -03:00
Andrew Phillips
9ef4ba2abe
refactor: optimize tail filter to use ring buffer directly
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-28 20:09:45 -03:00
Andrew Phillips
c50a7db130
feat: implement content filtering for non-streaming and improve streaming tail handling
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-28 18:22:28 -03:00
Andrew Phillips
1ded347355
feat: add head/tail/line range options to content endpoints
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-28 18:20:54 -03:00
Andrew Phillips
7be728e233
fix: update AsyncItemService::new() to accept wrapped Command and Settings types
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-28 15:19:01 -03:00
Andrew Phillips
cb8caed662
fix: remove unused meta plugin imports
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-28 14:30:25 -03:00
Andrew Phillips
f6220eb16e
feat: replace binary detection with text metadata check
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-28 13:09:00 -03:00
Andrew Phillips
3fb436dc44
fix: add missing meta_name implementation and fix compilation errors
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-26 18:05:02 -03:00
Andrew Phillips
f48d7b33b8
fix: update warnings to use log::warn
...
Co-authored-by: aider (openai/andrew/openrouter/mistralai/mistral-medium-3.1) <aider@aider.chat >
2025-08-26 15:02:31 -03:00
Andrew Phillips
9b525445f3
fix: remove unused variable prefixes and fix scope errors
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:34:35 -03:00
Andrew Phillips
43dac36c39
fix: remove unused variable prefixes in async_item_service
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:32:20 -03:00
Andrew Phillips
58b7cba55a
fix: resolve PIPESIZE redefinition and unused variable warnings
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:31:25 -03:00
Andrew Phillips
6719dff149
feat: replace hardcoded buffer sizes with PIPESIZE constant
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:27:02 -03:00
Andrew Phillips
bb9901e9bc
fix: properly handle length parameter in stream_item_content_by_id_with_metadata
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:22:40 -03:00
Andrew Phillips
cf76aa8bc2
fix: mark unused variables with underscores
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:18:58 -03:00
Andrew Phillips
564accddfd
fix: remove unused variables and content_len
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:18:38 -03:00
Andrew Phillips
bbdbdfa5be
fix: unify stream types with trait object
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:17:06 -03:00
Andrew Phillips
bfeba4151e
fix: resolve type mismatches in async_item_service and compression_service
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:14:58 -03:00
Andrew Phillips
f3132ec569
fix: resolve type mismatch in async item stream handling
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:13:48 -03:00
Andrew Phillips
c00b6230d4
fix: remove unused imports and fix type mismatches
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:11:40 -03:00
Andrew Phillips
36a53c890c
fix: resolve async read and send trait bounds issues
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:10:14 -03:00
Andrew Phillips
9f140923bc
fix: resolve private field access and type issues
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:09:13 -03:00
Andrew Phillips
3611c93a4a
fix: update imports and correct stream type
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:07:48 -03:00
Andrew Phillips
1640932148
feat: implement streaming for large file handling
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 21:07:04 -03:00
Andrew Phillips
41ff152a12
fix: clone content for binary check closure
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 20:56:51 -03:00
Andrew Phillips
1fdb08b493
feat: optimize item content streaming to reduce redundant database calls
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 20:55:42 -03:00
Andrew Phillips
5830601150
refactor: add get_item_content_info to AsyncItemService and simplify binary checks
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 20:48:09 -03:00
Andrew Phillips
04554fe04d
refactor: extract content info logic to item_service
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 20:46:30 -03:00
Andrew Phillips
0932ea9614
chore: remove unused imports and variables
...
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat >
2025-08-25 20:42:31 -03:00
Andrew Phillips
1f11351d9b
refactor: optimize item service creation by creating it once per connection
...
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat >
2025-08-25 20:27:21 -03:00
Andrew Phillips
4acec3d3dd
refactor: optimize item content streaming to reduce redundant database queries
...
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat >
2025-08-25 20:17:45 -03:00
Andrew Phillips
b9d6bd52d5
feat: implement streaming for item content with offset and length support
...
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat >
2025-08-25 19:33:24 -03:00
Andrew Phillips
6ee1c64080
feat: implement length parameter handling in stream_item_content_by_id
...
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat >
2025-08-25 19:11:03 -03:00
Andrew Phillips
694575ad36
fix: replace streaming with synchronous content retrieval
...
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat >
2025-08-25 19:06:48 -03:00
Andrew Phillips
b039bc4b33
fix: remove unused imports and fix field access errors
...
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat >
2025-08-25 19:05:33 -03:00