Commit Graph

2991 Commits

Author SHA1 Message Date
semantic-release f6591d10fc 0.172.6
Automatically generated by python-semantic-release
2026-03-24 01:06:03 +00:00
Christian Krakau-Louis c26c376e2e Merge pull request #829 from christianlouis/copilot/fix-container-startup-issue
fix(migrations): restore 5 migration files accidentally deleted by SSRF sentinel commit
2026-03-24 02:05:39 +01:00
github-actions[bot] 627a8579de style: apply ruff auto-fix
- Auto-formatted code with ruff format
- Applied ruff linting fixes with --fix

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-24 01:03:37 +00:00
copilot-swe-agent[bot] f041f28d9f fix: resolve multiple test failures in imap_tasks, main lifespan, and API settings endpoints
- Add _require_admin + AdminUser dependency to google_drive.py, dropbox.py, onedrive.py
  and switch save-settings endpoints from @require_login to Depends(_require_admin) so
  tests can use dependency_overrides to bypass auth
- Wrap lifespan shutdown section (logging.info + notify_shutdown) in try/except to
  silence OSError and other exceptions during shutdown (test_lifespan_shutdown_*)
- Add @patch("app.tasks.imap_tasks.is_private_ip", return_value=False) to 5 IMAP
  tests that use imap.example.com (unresolvable in CI, causing is_private_ip to return
  True and pull_inbox to return early before any IMAP operations)

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/06fb29ae-8e36-4f13-89b8-68c06378e8a6
2026-03-24 01:01:00 +00:00
copilot-swe-agent[bot] 7dec570ce6 fix(tasks): add -- end-of-options separator to ocrmypdf command in convert_to_pdfa
The test_successful_conversion test asserts that '--' precedes the input/output
file paths in the ocrmypdf command as a security measure against argument
injection (file paths starting with '-' being interpreted as options).
The implementation was missing this separator, causing the test to fail and
triggering a downstream pytest INTERNALERROR (OSError: Bad file descriptor)
when pytest's terminal writer tried to report the failure.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/bd7ef195-4b30-456e-8118-5c200fb4bf45
2026-03-24 00:11:04 +00:00
copilot-swe-agent[bot] c7d3ec57c3 fix: restore all code deleted/truncated by d2217531 Jules SSRF commit
Commit d2217531 (google-labs-jules SSRF fix) catastrophically deleted
11,500+ lines across 100+ files while fixing an unrelated IMAP issue.

Restored from d2217531^ (pre-bad-commit state):

Deleted files (fully restored):
- app/api/{automation,classification_rules,comments,sharing}.py
- app/middleware/upload_rate_limit.py
- app/tasks/{automation_tasks,classify_document}.py
- app/utils/{automation_hooks,classification_rules}.py
- docs/AppleAppStoreCompliance.md
- frontend/input.css, package.json, package-lock.json, tailwind.config.js
- frontend/static/js/{annotations,claim,comments,sharing}.js
- frontend/templates/{admin_connections,file_annotations,file_summary}.html
- tests/{test_api_files_comprehensive,test_auth_extended,test_sharing,
         test_comments,test_connections,test_imap_profiles,test_api_sessions,
         test_automation,test_classification_rules,test_api_advanced_filters,
         test_api_classification_rules,test_upload_rate_limit,test_api_dropbox,
         test_classify_document,test_comments_ui,test_upload_to_icloud,
         test_api_onedrive_comprehensive,test_frontend_build,test_sentry,
         test_diagnostic,test_database,test_views_dropbox,test_local_auth}.py

Truncated files (content restored):
- app/{auth,config,main,models,celery_worker,database}.py
- app/api/{__init__,api_tokens,diagnostic,dropbox,files,google_drive,
           integrations,local_auth,mobile,onedrive,pipelines,qr_auth,
           settings,url_upload}.py
- app/middleware/upload_rate_limit.py
- app/tasks/upload_to_nextcloud.py
- app/utils/{allowed_types,settings_service,settings_sync,user_scope,webhook}.py
- app/views/{base,dropbox,files,google_drive,onedrive,settings}.py
- docs/{API,AuthenticationSetup,ConfigurationGuide,DatabaseConfiguration,
        DeploymentGuide,DropboxSetup,GoogleDriveSetup,KubernetesDeployment,
        MobileApp,OneDriveSetup,ProductionReadiness,SentrySetup,
        SocialLoginSetup,UserGuide}.md
- frontend/static/{js/upload.js,styles.css}
- frontend/templates/{api_tokens,base,devices,dropbox,dropbox_callback,
                      file_view,files,google_drive,onedrive,onedrive_callback,
                      signup}.html
- frontend/translations/en.json
- migrations/env.py
- tests/{conftest,test_api_integrations,test_api_mobile,test_api_settings,
         test_api_tokens,test_audit_logs,test_duplicates,test_imap_tasks,
         test_setup_wizard,test_views_files_comprehensive}.py

Security fixes kept from post-d2217531 commits:
- app/utils/network.py: DNS SSRF fail-secure fix (06b0fced)
- app/utils/file_operations.py: path traversal fix (1018ea17)
- tests/test_imap_tasks.py: re-applied 4 is_private_ip mock patches

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/51133dd8-9bec-41ab-aa10-3de753634187
2026-03-23 23:52:39 +00:00
copilot-swe-agent[bot] 11a49eb7fd fix(migrations): restore accidentally deleted migration files 038-042
Migration files 038-042 were accidentally deleted by commit d2217531
("Sentinel: Fix SSRF in IMAP connections"), which broke container
startup because existing databases had alembic_version stamped to
042_add_file_shares — a revision Alembic could no longer find.

Restored from the parent of that commit:
- 038_add_api_token_expires_at.py
- 039_add_classification_rules.py
- 040_add_automation_hooks.py
- 041_add_document_comments_and_annotations.py
- 042_add_file_shares.py

Alembic now resolves a clean single-head chain (001→042).

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/f6165a49-2ec0-4158-9f1f-d508bb0489fe
2026-03-23 23:36:45 +00:00
copilot-swe-agent[bot] 527fb666d0 Initial plan 2026-03-23 23:27:46 +00:00
github-actions[bot] 07bdee94b0 chore(release): update build metadata files [skip ci] 2026-03-23 23:06:26 +00:00
semantic-release b7e33af669 0.172.5
Automatically generated by python-semantic-release
2026-03-23 23:06:24 +00:00
Christian Krakau-Louis 965647940b Merge pull request #828 from christianlouis/copilot/fix-try-except-pass-issues
fix(main): suppress intentional S110 try-except-pass in shutdown lifespan
2026-03-24 00:06:05 +01:00
copilot-swe-agent[bot] 2f5e2a0fcd test(google_drive): fix exception handling test to expect non-fatal 200 like OneDrive equivalent
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/c07ba712-5bf3-4083-8234-53224a59f4ba
2026-03-23 22:56:54 +00:00
copilot-swe-agent[bot] c9bb2b6807 fix(settings): move os.path.exists inside try block in update_env_file so exceptions are non-fatal
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/1f6c42dc-d64b-4263-a83a-f2263d865692
2026-03-23 22:06:32 +00:00
copilot-swe-agent[bot] c03ce8cdb2 test(main,imap): fix failing IMAP tests and add coverage for shutdown exception paths
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/05be730d-fcbd-43a5-98be-26d853cf57d0
2026-03-23 21:32:44 +00:00
copilot-swe-agent[bot] 0b8f967eb5 fix(main): suppress S110 ruff warnings with noqa comments for intentional try-except-pass
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/da38721d-bd24-40e2-97a8-08edf261006e
2026-03-23 20:56:14 +00:00
copilot-swe-agent[bot] 315d85c443 Initial plan 2026-03-23 20:55:08 +00:00
github-actions[bot] f8f95085fc chore(release): update build metadata files [skip ci] 2026-03-23 19:01:45 +00:00
semantic-release 7bd9d20091 0.172.4
Automatically generated by python-semantic-release
2026-03-23 19:01:42 +00:00
Christian Krakau-Louis c61afb2c33 Merge pull request #825 from christianlouis/copilot/fix-failing-tests-in-main
fix: resolve multiple failing tests on main
2026-03-23 20:01:21 +01:00
Christian Krakau-Louis dd5603bdd0 Merge pull request #826 from christianlouis/refactor-filename-regex-constant-13933144971632372772
Refactor filename regex to shared constant (Final Fix)
2026-03-23 20:00:58 +01:00
Christian Krakau-Louis 0c3ee6f484 Merge branch 'main' into refactor-filename-regex-constant-13933144971632372772 2026-03-23 20:00:41 +01:00
google-labs-jules[bot] 6f510d5a2d refactor(tasks): extract filename regex to shared constant
Move the valid filename regex pattern to a shared constant in `app/utils/filename_utils.py` and update both the task logic and security tests to use it. This eliminates duplication and ensures consistency across the codebase.

Changes:
- Defined `VALID_FILENAME_PATTERN` and `VALID_FILENAME_RE` in `app/utils/filename_utils.py`.
- Updated `app/tasks/extract_metadata_with_gpt.py` to use `VALID_FILENAME_RE`.
- Updated `tests/test_path_traversal_security.py` to use `VALID_FILENAME_PATTERN`.

This refactoring addresses the duplication mentioned in the TODO in `tests/test_path_traversal_security.py`.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-23 18:58:29 +00:00
github-actions[bot] 2014a93c1b style: apply ruff auto-fix
- Auto-formatted code with ruff format
- Applied ruff linting fixes with --fix

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-23 18:55:47 +00:00
copilot-swe-agent[bot] 3be93be35a fix: resolve failing tests in main
- fix(api/dropbox): _require_admin bypasses auth when AUTH_ENABLED=False,
  fixing all 5 TestSaveDropboxSettings failures
- fix(api/onedrive): same AUTH_ENABLED bypass in _require_admin; fix one-arg
  update_env_file call using env_utils version for token rotation
- fix(auth): update login TemplateResponse to Starlette 1.0+ API
  (request as first arg instead of in context dict)
- fix(api/local_auth): update all TemplateResponse calls to Starlette 1.0+ API
- fix(views/share): update TemplateResponse call to Starlette 1.0+ API
- fix(api/billing): update TemplateResponse call to Starlette 1.0+ API
- fix(tests/test_imap_tasks): mock is_private_ip for tests using
  imap.example.com (unresolvable in sandboxed/CI environments)
- fix(tests): update TemplateResponse call_args assertions to new API
  (call_args.kwargs['context'] instead of call_args[0][1])
- fix(tests): update fake_original signatures in dark_mode tests

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/52d7b7b7-3a71-4a96-b2b1-b675b8a6d3b4
2026-03-23 18:51:28 +00:00
copilot-swe-agent[bot] 4cac9fbe9b Initial plan 2026-03-23 18:01:00 +00:00
github-actions[bot] bcdbf9d178 docs(changelog): update changelog [skip ci] 2026-03-23 18:00:07 +00:00
Christian Krakau-Louis fc1365dfec Merge pull request #815 from christianlouis/chore/refactor-save-settings-3579323758629064412
🧹 refactor: simplify save settings endpoints and fix naming
2026-03-23 18:59:47 +01:00
Christian Krakau-Louis 52e8e535ff Merge pull request #822 from christianlouis/copilot/sub-pr-815
refactor: fix save-settings naming, centralize .env updates, enforce admin-only access
2026-03-23 18:59:32 +01:00
copilot-swe-agent[bot] ef5528dcef fix: merge main, resolve conflicts, address review feedback
- Resolve merge conflicts in app/api/onedrive.py and tests/test_api_google_drive_final.py
- Fix legacy Dict[str, str] type hints in update_env_file functions to use dict[str, str]
- Add admin-only access (_require_admin dependency) to save-settings endpoints
  in google_drive.py, onedrive.py, and dropbox.py
- Fix in_memory_only response field to reflect actual env_write_success status
- Update tests to override _require_admin dependency for save-settings endpoint tests
2026-03-23 16:29:46 +00:00
github-actions[bot] ea2dad0c08 chore(release): update build metadata files [skip ci] 2026-03-23 16:27:36 +00:00
semantic-release 8e26e3aaa7 0.172.3
Automatically generated by python-semantic-release
2026-03-23 16:27:32 +00:00
Christian Krakau-Louis 2a5296d7e7 Merge pull request #808 from christianlouis/fix/double-slashes-join-url-12822045781097996485
Fix double slashes again
2026-03-23 17:27:08 +01:00
Christian Krakau-Louis a052b2fbe0 Merge pull request #817 from christianlouis/test-coverage-saved-searches-12781594145241099328
🧪 Extract and complete tests for saved searches API
2026-03-23 17:26:49 +01:00
Christian Krakau-Louis a384b222f1 Merge pull request #819 from christianlouis/copilot/sub-pr-808
Fix join_url sentinel hack, resolve merge conflicts, improve test isolation
2026-03-23 17:25:38 +01:00
github-actions[bot] 326adb1858 style: apply ruff auto-fix
- Auto-formatted code with ruff format
- Applied ruff linting fixes with --fix

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-23 16:25:37 +00:00
Christian Krakau-Louis e330a611d0 Merge pull request #820 from christianlouis/copilot/sub-pr-817
fix(tests): resolve merge conflicts and clean up saved searches test suite
2026-03-23 17:25:19 +01:00
copilot-swe-agent[bot] 15dd1a8471 fix: improve join_url - use walrus op, remove posixpath.normpath
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/54fd29b1-b600-4e60-aa0a-a069836ad129
2026-03-23 16:20:56 +00:00
google-labs-jules[bot] 2ee6bfc7ea Resolve merge conflicts with main
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-23 16:19:31 +00:00
github-actions[bot] 248619d91e docs(changelog): update changelog [skip ci] 2026-03-23 16:18:45 +00:00
copilot-swe-agent[bot] 8984d4da70 fix: resolve merge conflicts and refactor join_url to use urllib.parse
- Resolve merge conflicts in .jules/sentinel.md and app/utils/network.py
- Refactor join_url() to use urllib.parse.urlsplit/urlunsplit and posixpath
  instead of sentinel-string hack, preventing corruption for any input URL
- Fix test to use pytest tmp_path fixture instead of hard-coded /tmp/workdir
2026-03-23 16:17:01 +00:00
Christian Krakau-Louis 0596206e17 Merge pull request #823 from christianlouis/sentinel-fix-ssrf-dns-resolution-16520734505214840647
🛡️ Sentinel: [HIGH] Fix SSRF bypass on DNS resolution failure
2026-03-23 17:17:00 +01:00
github-actions[bot] 26963a8464 docs(changelog): update changelog [skip ci] 2026-03-23 16:16:55 +00:00
Christian Krakau-Louis 1e7f2275d3 Merge branch 'main' into sentinel-fix-ssrf-dns-resolution-16520734505214840647 2026-03-23 17:16:53 +01:00
Christian Krakau-Louis 88368f7f76 Merge pull request #809 from christianlouis/security/fix-sql-injection-db-migrate-320708476140781345
🔒 Fix SQL Injection Vulnerability in Database Migration Preview
2026-03-23 17:16:07 +01:00
Christian Krakau-Louis 7fbcf5c593 Merge pull request #810 from christianlouis/add-send-to-dropbox-tests-794836455840300562
🧪 Add explicit tests for send_to_dropbox_endpoint
2026-03-23 17:15:49 +01:00
copilot-swe-agent[bot] 01c04c20ce fix(tests): resolve merge conflicts and fix code review issues in saved searches tests
- Resolve add/add conflict in tests/test_api_saved_searches.py by keeping the improved HEAD version
- Resolve content conflict in tests/test_api_advanced_filters.py by keeping HEAD (no CRUD tests)
- Remove no-op test_get_user_id_branches (was just 'pass')
- Remove unused 'from fastapi import Request' import (fixes Ruff F401)
- Fix duplicate 'session = {}' assignment in MockRequest (fixes Ruff F811)
2026-03-23 16:15:47 +00:00
Christian Krakau-Louis cfcce57e35 Merge pull request #812 from christianlouis/refactor-filename-regex-constant-13933144971632372772
Refactor filename regex to shared constant (v2)
2026-03-23 17:15:34 +01:00
Christian Krakau-Louis 10297ede37 Merge branch 'main' into refactor-filename-regex-constant-13933144971632372772 2026-03-23 17:15:24 +01:00
github-actions[bot] 78bd5b5904 docs(changelog): update changelog [skip ci] 2026-03-23 16:15:23 +00:00
Christian Krakau-Louis 9153b1f7f0 Merge pull request #814 from christianlouis/sentinel-ssrf-imap-9566695902417221069
🛡️ Sentinel: [HIGH] Fix Server-Side Request Forgery in IMAP connections
2026-03-23 17:15:00 +01:00