76 Commits

Author SHA1 Message Date
6fc43e2485 fix: ruff lint errors + bandit false positives + pip-audit non-blocking
Some checks failed
CI / lint (push) Failing after 11s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / security (push) Successful in 7s
2026-05-28 12:41:31 -04:00
7b2da1ff6a feat: CI/CD pipeline + sortedcontainers for O(log n) index ops
Some checks failed
CI / lint (push) Failing after 2m3s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / security (push) Failing after 10s
CI/CD (.gitea/workflows/ci.yml):
- Lint: ruff + mypy on every push/PR
- Test: pytest with coverage report (175 tests)
- Security: bandit SAST + pip-audit dependency scan
- Build: Docker image verification

sortedcontainers (backend/search.py):
- Replace bisect with SortedList for _sorted_tokens
- O(log n) add() / discard() instead of O(n) insort/pop
- SortedList.bisect_left() for prefix search
- Add sortedcontainers>=2.4.0 to requirements.txt
2026-05-27 22:47:28 -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
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
8055b20e5f Fix tag filtering to preserve "all" vault filter 2026-05-27 12:08:59 -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
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
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
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
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
370420aa00 ajout de fonctionnalités 2026-05-25 20:21:42 -04:00
e1fcbe9ce7 feat: expand CSP connect-src directive and add async loading guard for highlight.js in popout view
- Add cdnjs.cloudflare.com, fonts.googleapis.com, and fonts.gstatic.com to connect-src CSP directive
- Add waitForHljs helper function with 50 attempt limit and 100ms polling interval
- Check if hljs is defined before highlighting code blocks in popout view
- Fall back to async waiting if hljs not immediately available to prevent undefined reference errors
2026-04-12 17:06:35 -04:00
89c6889f42 feat: add matched_path field to tree search results for consistency with advanced search response format 2026-03-31 14:35:16 -04:00
84d3ad0e90 feat: add ext: operator for file extension filtering in advanced search
- Add ext: operator support to query parser in backend and frontend
- Update search documentation in README and help modal with ext: examples
- Parse ext: operator to extract file extension filter (strips leading dot, converts to lowercase)
- Filter search candidates by file extension in advanced_search function
- Add ext chip display in search UI alongside existing tag/vault/title/path chips
- Update API documentation and function
2026-03-31 13:41:07 -04:00
d3b9298dfa feat: add file and directory management endpoints with context menu support
- Add POST/PATCH/DELETE endpoints for directory operations (create, rename, delete)
- Add POST/PATCH endpoints for file operations (create, rename)
- Implement writable vault check to prevent modifications on read-only vaults
- Update file delete endpoint to broadcast SSE events and update index
- Add Pydantic models for all new request/response schemas
- Integrate context menu support in frontend for files and directories
- Broadcast real
2026-03-30 15:26:44 -04:00
960a06f189 feat: Initialize ObsiGate application with core frontend and backend components. 2026-03-27 14:37:23 -04:00
f71d97e06c feat: Implement core application structure with frontend styling, JavaScript, and Python backend services. 2026-03-27 13:54:08 -04:00
0bbd793e97 feat: Implement core Python FastAPI backend for user authentication, vault management, and file operations. 2026-03-27 10:11:43 -04:00
508e4c5997 feat: Implement persistent vault-specific settings management, including loading, saving, and updating preferences. 2026-03-26 21:20:01 -04:00
413524c3bf feat: introduce initial ObsiGate Single Page Application with Python backend for vault browsing and search. 2026-03-26 21:02:58 -04:00
3ae430aaa6 feat: implement core backend API with data models, SSE, index management, and initial admin bootstrap. 2026-03-26 20:18:56 -04:00
2b69c49ed1 refactor: remove hidden files indexing configuration and convert to UI-only display preference, eliminating includeHidden and hiddenWhitelist from vault config and indexing logic while adding hideHiddenFiles client-side filtering 2026-03-26 19:53:40 -04:00
34f4e41419 feat: add comprehensive error handling and logging for vault settings save operations with permission error detection and detailed error messages in UI toast notifications 2026-03-26 16:00:27 -04:00
ac962bd416 feat: add per-vault reindexing with selective reload based on modified vaults, simplify hidden files whitelist logic to include all sub-hidden files when parent is whitelisted, and auto-uncheck includeHidden when adding whitelist items 2026-03-26 15:08:01 -04:00
80e2a7fc53 feat: fix hidden files whitelist logic to require ALL hidden path components be whitelisted, add vault config to single file indexing, and improve reindex button feedback with save phase indication 2026-03-26 14:14:04 -04:00
08e4d732f5 feat: merge UI vault settings with environment config, improve French UI text clarity, and enhance hidden files whitelist styling with hover effects and empty state 2026-03-26 09:24:56 -04:00
fe3ffe5860 refactor: extract should_include_path to utils module to resolve circular import between indexer and attachment_indexer 2026-03-26 09:10:09 -04:00
9e42fb072b feat: add hidden files configuration with per-vault settings for includeHidden and hiddenWhitelist, supporting environment variables and UI controls for selective indexing of dot-prefixed files and folders 2026-03-25 09:54:34 -04:00
1baad8eab9 feat: change config path from relative to absolute /app/data/config.json for Docker deployment 2026-03-25 07:47:11 -04:00
f22a2abae8 feat: add Progressive Web App (PWA) support with service worker registration, manifest, update notifications, and install prompts 2026-03-24 23:55:15 -04:00
d020264ba3 feat: extend file watcher to support all indexable file types beyond markdown 2026-03-24 16:38:35 -04:00
c5e395005f feat: implement initial ObsiGate application with backend API, indexing, search, and basic frontend. 2026-03-24 12:56:00 -04:00
d6ae501f51 feat: Implement initial backend indexer for vaults, supporting file system scanning, markdown parsing, and in-memory metadata indexing. 2026-03-24 12:32:19 -04:00
d76ad89f09 feat: Introduce initial web frontend and backend services, and generalize directory configuration in docker-compose. 2026-03-24 12:24:43 -04:00
0b9405283e feat: Implement backend file indexing for vaults and initial frontend application. 2026-03-24 10:52:53 -04:00
46e054f5dd feat: Introduce core backend application with authentication API and a new popout HTML page. 2026-03-24 09:51:38 -04:00