176 Commits

Author SHA1 Message Date
8d1b766947 test: expand coverage to 49% (+78 new tests, 175 total)
Add 78 new tests targeting high-impact uncovered modules:
- tests/test_search_advanced.py (23 tests): InvertedIndex CRUD,
  search/advanced_search/suggest functions, tag/title indexing
- tests/test_indexer_advanced.py (15 tests): hooks, file CRUD,
  path index, lookup, generation counter
- tests/test_modules.py (40 tests): audit, history, rate limit,
  saved searches, vault settings, webhooks, share

Coverage improvements:
  ratelimit.py:  80% → 100%
  share.py:      24% →  97%
  saved_searches: 37% →  95%
  history.py:    26% →  86%
  audit.py:       0% →  85%
  search.py:     44% →  82%
  webhooks.py:   31% →  67%
  vault_settings: 31% →  69%
  indexer.py:    47% →  65%
  Overall:       35% →  49%
2026-05-27 22:32:10 -04:00
edb9e98f81 test: add pytest suite - 97 tests, search + indexer + auth
Create comprehensive test suite with 97 passing tests:
- tests/conftest.py: fixtures (TestClient, temp vault dirs, index setup)
- tests/test_search.py (27 tests): tokenizer, snippets, highlight,
  tag filter, search API, advanced search, suggest, tags API
- tests/test_indexer.py (32 tests): frontmatter parsing, inline tags,
  title extraction, scan_vault, find_file_in_index, backlinks
- tests/test_auth.py (38 tests): password hashing, JWT create/decode,
  token revocation, user CRUD, login lockout, rate limiting, middleware

Also fix: lazy WeasyPrint import (graceful fallback when GTK missing),
add data/ to .gitignore (runtime files from test runs).
2026-05-27 22:06:27 -04:00
a5afbb1dc1 fix: SSE sync indicator stuck on 'Connexion...' (3 fixes)
1. Move initSyncStatus() AFTER auth check — EventSource was connecting
   before the access_token cookie was available, causing 401 errors.

2. Reconnect SSE after login — Login form handler now calls
   IndexUpdateManager.connect() + showWelcome() after successful auth.

3. SSESafeGZipMiddleware — GZip buffering breaks Server-Sent Events
   streaming. Custom middleware subclass skips compression for
   /api/events endpoint (path-based bypass).
2026-05-27 21:40:32 -04:00
2469026c1d fix: login endpoint - request variable shadowing Starlette Request
The login() function used 'request: LoginRequest' which shadowed
FastAPI's Starlette Request object. Request.client was accessed on
the LoginRequest Pydantic model instead of the HTTP request, causing
AttributeError: 'LoginRequest' object has no attribute 'client'.

Fix: rename the Pydantic parameter to 'body' and add explicit
'request: Request' for IP extraction and rate limiting.
2026-05-27 21:16:11 -04:00
17eea0559d docs: update README with quick wins, security features, .env workflow
- Add GZip + Cache-Control + .dockerignore to Features & Performance
- Update installation: add .env creation step
- Update docker-compose example: include env_file + data volume
- Rewrite auth activation: use .env instead of docker-compose.yml
- Expand auth env vars table: TTL, rate limiting
- Expand Security section: rate limiting, audit, backup, secret redaction
- Update Stack technique: security, PDF, compression, .dockerignore
2026-05-27 21:12:13 -04:00
58a0ffc76c feat: quick wins - dockerignore, env secrets, gzip, cache-control
- Add .dockerignore to exclude .git, __pycache__, docs, etc. from Docker context
- Create .env.example template with documented env vars
- Move OBSIGATE_ADMIN_PASSWORD from docker-compose.yml to env_file: .env
- Add .env.* to .gitignore (excluding .env.example)
- Enable GZipMiddleware for ~70% bandwidth reduction on text responses
- Add Cache-Control: immutable for /static/ assets
- Update ROADMAP: mark all 4 quick wins as done, add audit findings
- Add comprehensive technical audit report (AUDIT_TECHNIQUE_2026-05-27.md)
2026-05-27 20:35:08 -04:00
d6cf2a1a7f Remove vault filter dropdown from dashboard 2026-05-27 15:57:59 -04:00
6e742bfa2c Adjust dashboard tab styling for responsive layout 2026-05-27 15:23:50 -04:00
b5aae2b2fd Reduce dashboard tab padding and font, enlarge icons 2026-05-27 15:09:08 -04:00
b879163052 Refine mobile styles and improve search, sidebar, and layout 2026-05-27 12:55:46 -04:00
a7c719afb1 Prioritize autocomplete dropdown over search results on Enter keypress 2026-05-27 12:25:25 -04:00
8055b20e5f Fix tag filtering to preserve "all" vault filter 2026-05-27 12:08:59 -04:00
fcf134d37e Always show tags section with placeholder or error message 2026-05-27 12:01:23 -04:00
73593f5e89 Remove duplicate _collectItems call 2026-05-27 11:54:24 -04:00
c3d583177a Handle aborted requests by returning early 2026-05-27 11:51:10 -04:00
96218f872e Avoid flashing loading state on fast search queries 2026-05-27 11:39:37 -04:00
56b2a004f9 Show loading state while fetching suggestions 2026-05-27 10:56:44 -04:00
e5b5f2d4f4 Limit search history to 5 items and isolate suggestion fetches 2026-05-27 09:59:35 -04:00
586acbe9a1 Keep the dropdown hidden after search execution 2026-05-27 09:45:22 -04:00
0d3de28967 Simplify sidebar tabs, improve saved search display, and refactor
suggestions
2026-05-27 09:27:26 -04:00
1c59300f11 Remove stray extra closing brace 2026-05-27 08:44:18 -04:00
e3c25b5b09 Add saved searches with CRUD API and UI sidebar
Add extension field to search results and display it
Add active filter badges and save button to search header
2026-05-27 08:39:52 -04:00
aa2c05b05f Add regex search with highlighted snippet support 2026-05-27 08:15:39 -04:00
0630aeba77 Remove case-sensitive toggle and reset search options on clear 2026-05-27 08:01:57 -04:00
ff06d89eda Support non-Markdown files in public share and add raw download endpoint 2026-05-26 22:34:45 -04:00
7c4f2964eb Render frontmatter as styled cards in public share view
Split search query tokens on word boundaries for accurate inverted-index
matching
2026-05-26 22:16:21 -04:00
dc9684e56c Remove deprecated PDF endpoint and update frontend download actions
Remove the old HTML-based PDF download endpoint in favor of the new
WeasyPrint-based one, and replace the generic "Télécharger" button
in popout.html with a dedicated .md download and a new PDF button.
Also remove the unused generic download button from the main file view.
2026-05-26 21:55:42 -04:00
4929ff7beb Remove unnecessary libgdk-pixbuf2.0-0 dependency 2026-05-26 21:32:07 -04:00
c79202716c Add WeasyPrint PDF export for markdown files 2026-05-26 21:22:02 -04:00
9776311c20 Add public share PDF download endpoint 2026-05-26 20:56:59 -04:00
b0b5541bc5 Style shared page with SVG icons and theme-aware banner 2026-05-26 20:43:15 -04:00
9752b18529 Add dark theme support and bookmark status to share view
- Implement dark/light theme toggle with persistent preference via
  localStorage
- Add a sticky toolbar with theme toggle, Markdown export, and PDF
  export buttons
- Update bookmark button to reflect current state with visual feedback
- Introduce CSS custom properties for theming and responsive layout
  improvements
2026-05-26 20:19:58 -04:00
d4896a5df1 Sync YAML frontmatter with share and bookmark actions 2026-05-26 20:02:37 -04:00
32a41532ba Auto-set Content-Type for JSON HTTP requests
- Add automatic Content-Type header injection for JSON string bodies
- Explicitly set Content-Type on bookmark toggle and share creation
  calls
- Add escapeHtml helper function for safe string handling
2026-05-26 15:46:26 -04:00
b1fcc080e5 Add bookmark support and enhance share dialog
- Add bookmark button to file header and context menu
- Implement toggle bookmark API call with toast notification
- Redesign share dialog to show existing shares with revocation
- Add expiration options when creating a new share
- Add CSS styles for share action buttons
2026-05-26 15:40:02 -04:00
20f9bad9c0 Replace replace UI with search result navigation 2026-05-26 15:25:20 -04:00
6cd981f9bc Move search state variables to module scope 2026-05-26 14:37:44 -04:00
f2170e9ac8 Guard against missing search elements and restyle search layout 2026-05-26 14:05:26 -04:00
8fdcdaf412 Add search toggles, path filters, and find/replace functionality 2026-05-26 13:35:38 -04:00
6c282ac77f Add index change hook for incremental updates 2026-05-26 12:43:38 -04:00
775722f5d4 Switch inverted index from stale check to incremental updates
Register a hook with the indexer so that file add/remove events
incrementally maintain the inverted index, removing the need for
periodic staleness checks and cooldowns. Rebuild the index once on
startup via init_inverted_index().
2026-05-26 12:37:59 -04:00
872a3e56dd Refactor file opening to use TabManager and add dashboard tab system 2026-05-26 12:14:47 -04:00
b38f3f16e4 Coalesce index generation increments and add rebuild cooldown 2026-05-26 11:42:47 -04:00
0b611a8735 Add share, webhook, and conflict management features 2026-05-26 11:00:48 -04:00
ed2bb4f7fb Add missing imports and clear backlink index
Resolve build index regression causing stale backlink data on reindex.
2026-05-26 10:35:22 -04:00
482937fb30 Add audit logging, rate limiting, secret redactor, and backlinks
Implement several security and feature improvements across the backend
and frontend:
- New IP-based rate limiter for authentication endpoints
- New audit logging system for sensitive operations
- New secret redactor to mask sensitive patterns in rendered content
- Configurable token TTL and IGNORED_DIRS via environment variables
- Add backlink index and API endpoint
- Add preview tab support with single/double-click behavior in tree
- Add file backup before write/delete operations
2026-05-26 10:27:00 -04:00
5280dc7a50 Add comprehensive documentation and analysis files
Add extensive project documentation including analysis review, image
rendering changelog and guide,
contributing guidelines, hidden files configuration guide, PWA
documentation suite, roadmap, and
dashboard specification.
2026-05-26 08:35:58 -04:00
456b308af6 Remove obsolete changelog, guides, specs and TODO files 2026-05-26 08:34:35 -04:00
c65063fbca Update README docker-compose syntax and add incremental sidebar refresh
Implement `incrementalLoadDirectory` to update tree items without full
DOM
rebuild. Modify `refreshSidebarTreePreservingState` to use incremental
updates for expanded vaults and directories, preserving existing DOM
state.
2026-05-25 22:05:40 -04:00
9ce95eda2d Remove toast notification for silent auto-indexing
Replace `loadVaults()` and `loadTags()` calls with state-preserving
sidebar and tag refresh functions after silent indexing
2026-05-25 21:54:25 -04:00