Commit Graph

2928 Commits

Author SHA1 Message Date
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] 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
Christian Krakau-Louis f9b4975093 Merge branch 'main' into sentinel-ssrf-imap-9566695902417221069 2026-03-23 17:14:50 +01:00
copilot-swe-agent[bot] 47595818b4 Initial plan 2026-03-23 16:14:14 +00:00
github-actions[bot] cc5e879ea9 docs(changelog): update changelog [skip ci] 2026-03-23 16:07:58 +00:00
Christian Krakau-Louis 7490462c67 Merge pull request #818 from christianlouis/sentinel/fix-path-traversal-3335474446649715249
🛡️ Sentinel: [CRITICAL] Fix path traversal vulnerability in file utilities
2026-03-23 17:07:36 +01:00
Christian Krakau-Louis c25e1b0e21 Merge branch 'main' into sentinel/fix-path-traversal-3335474446649715249 2026-03-23 17:07:30 +01:00
google-labs-jules[bot] 1018ea17d9 🛡️ Sentinel: [CRITICAL] Fix path traversal vulnerability in file utilities
🚨 Severity: CRITICAL
💡 Vulnerability: The generic file hashing utility `app/utils/file_operations.py:hash_file` was vulnerable to path traversal. An attacker controlling the `filepath` argument could read arbitrary files on the system by passing relative paths like `../../../etc/passwd` or providing absolute paths directly.
🎯 Impact: This could lead to Arbitrary File Read and potential information disclosure.
🔧 Fix: Used `pathlib.Path.resolve()` to resolve both the target file path and the allowed base directory (`settings.workdir`). Added a strict check to ensure the resolved target path is strictly within the allowed boundary using `filepath_obj.relative_to(workdir_obj)`, catching the `ValueError` raised when the path is out of bounds. This safely blocks both relative traversal attacks and arbitrary absolute paths, without breaking legitimate relative application paths.
 Verification: Ran the test suite `pytest tests/test_path_traversal_security.py -v` successfully, which explicitly checks for `FileNotFoundError` upon traversal attempts.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-23 15:53:18 +00:00
google-labs-jules[bot] 341839fe5e chore: simplify and fix naming for save settings endpoints
- Renamed `save_dropbox_settings` inside `app/api/google_drive.py` to `save_google_drive_settings` to fix a copy-paste naming error.
- Extracted duplicate `.env` file updating logic from `app/api/google_drive.py`, `app/api/onedrive.py`, and `app/api/dropbox.py` into a new reusable helper function `update_env_file` inside `app/utils/settings_service.py`.
- Refactored the three API endpoints to use the new helper function, significantly reducing complexity and code duplication.
- Updated relevant test files (`tests/test_api_google_drive_final.py`) to reflect the new function name.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-23 15:15:38 +00:00
google-labs-jules[bot] 28d4bced0c 🛡️ Sentinel: [HIGH] Fix Server-Side Request Forgery in IMAP connections
🚨 Severity: HIGH
💡 Vulnerability: User-provided IMAP `host` in `_test_imap_connection` and `pull_inbox` was not validated against private IPs, creating an SSRF risk.
🎯 Impact: Attackers could abuse the endpoints to port-scan or interact with internal/private network services.
🔧 Fix: Integrated `is_private_ip` from `app.utils.network` to block connections resolving to private, loopback, link-local, or reserved IPs.
 Verification: Ran `test_imap_tasks.py` and `test_api_imap_accounts.py` successfully. Checked `ruff` output and diffs. Removed all scratch files from the commit.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-23 14:58:49 +00:00
google-labs-jules[bot] d22175310a 🛡️ Sentinel: [HIGH] Fix Server-Side Request Forgery in IMAP connections
🚨 Severity: HIGH
💡 Vulnerability: User-provided IMAP `host` in `_test_imap_connection` and `pull_inbox` was not validated against private IPs, creating an SSRF risk.
🎯 Impact: Attackers could abuse the endpoints to port-scan or interact with internal/private network services.
🔧 Fix: Integrated `is_private_ip` from `app.utils.network` to block connections resolving to private, loopback, link-local, or reserved IPs.
 Verification: Ran `test_imap_tasks.py` and `test_api_imap_accounts.py` successfully. Checked `ruff` output and diffs. Removed all scratch files from the commit.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-23 14:45:22 +00:00
github-actions[bot] 0497fbbbad docs(changelog): update changelog [skip ci] 2026-03-23 14:40:10 +00:00
google-labs-jules[bot] 57795ee487 chore: simplify and fix naming for save settings endpoints
- Renamed `save_dropbox_settings` inside `app/api/google_drive.py` to `save_google_drive_settings` to fix a copy-paste naming error.
- Extracted duplicate `.env` file updating logic from `app/api/google_drive.py`, `app/api/onedrive.py`, and `app/api/dropbox.py` into a new reusable helper function `update_env_file` inside `app/utils/settings_service.py`.
- Refactored the three API endpoints to use the new helper function, significantly reducing complexity and code duplication.
- Updated relevant test files (`tests/test_api_google_drive_final.py`) to reflect the new function name.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-23 14:39:53 +00:00
Christian Krakau-Louis a4bd1d7178 Merge pull request #811 from christianlouis/fix-test-api-process-assertions-2136380211698614662
🧪 Add assertions for task enqueuing parameters in process tests
2026-03-23 15:39:48 +01:00
Christian Krakau-Louis d94e9ca4bc Merge branch 'main' into sentinel-ssrf-imap-9566695902417221069 2026-03-23 15:39:29 +01:00
google-labs-jules[bot] d71945b7b9 🛡️ Sentinel: [HIGH] Fix Server-Side Request Forgery in IMAP connections
🚨 Severity: HIGH
💡 Vulnerability: User-provided IMAP `host` in `_test_imap_connection` and `pull_inbox` was not validated against private IPs, creating an SSRF risk.
🎯 Impact: Attackers could abuse the endpoints to port-scan or interact with internal/private network services.
🔧 Fix: Integrated `is_private_ip` from `app.utils.network` to block connections resolving to private, loopback, link-local, or reserved IPs.
 Verification: Ran `test_imap_tasks.py` and `test_api_imap_accounts.py` successfully. Checked `ruff` output and diffs.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-23 14:38:34 +00:00
google-labs-jules[bot] eeae47ddec test: add assertions for task enqueuing parameters
Added `mock_task.delay.assert_called_once_with(str(test_file))` to all integration tests involving background task enqueuing in `app/api/process.py` endpoints to ensure background tasks are called with the correct file path arguments.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-23 14:23:12 +00:00
github-actions[bot] 45d3ac8cf0 docs(changelog): update changelog [skip ci] 2026-03-23 14:12:41 +00:00
Christian Krakau-Louis 4df4673628 Merge pull request #807 from christianlouis/sentinel-fix-ssrf-dns-resolution-16520734505214840647
🛡️ Sentinel: [HIGH] Fix SSRF bypass on DNS resolution failure
2026-03-23 15:12:16 +01:00
github-actions[bot] 9642020887 chore(release): update build metadata files [skip ci] 2026-03-23 14:11:26 +00:00
semantic-release 89dec45062 0.172.2
Automatically generated by python-semantic-release
2026-03-23 14:11:22 +00:00
Christian Krakau-Louis 34457f9775 Merge pull request #805 from christianlouis/copilot/fix-image-build-failure
fix(build): remove --omit=dev from npm ci in Dockerfile frontend-builder stage
2026-03-23 15:10:59 +01:00
google-labs-jules[bot] 8b4280d5dd 🛡️ Sentinel: [HIGH] Fix SSRF bypass on DNS resolution failure
Modified `is_private_ip` in `app/utils/network.py` to fail securely by returning True (blocking the request) when a hostname cannot be resolved. The previous implementation failed open, creating a risk for Server-Side Request Forgery (SSRF) and DNS rebinding attacks.

Updated corresponding tests to expect the secure behavior.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-23 13:42:14 +00:00
copilot-swe-agent[bot] 93629ff440 fix: update test assertions and lint fixes for Starlette 1.0 TemplateResponse API
Update test mocks to check kwargs["context"] instead of positional
args[1] for tests that verify auth.py and base.py wrapper behavior.
Fix B026 lint error by avoiding star-arg after keyword argument.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/7b5f7e0d-89ad-43be-b68d-a9c0c5407a7e
2026-03-23 13:14:25 +00:00
copilot-swe-agent[bot] c4e10bee5e fix: adapt TemplateResponse calls to Starlette 1.0 new-style API
Starlette 1.0.0 changed TemplateResponse signature from
(name, context_dict) to (request, name, context=dict).

- Update base.py wrapper to convert old-style calls to new-style
- Update main.py error handler TemplateResponse calls
- Update local_auth.py, billing.py, auth.py, share.py calls
- Update test mocks for new calling convention

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/7b5f7e0d-89ad-43be-b68d-a9c0c5407a7e
2026-03-23 12:50:09 +00:00
github-actions[bot] 084171395d docs(changelog): update changelog [skip ci] 2026-03-23 12:17:55 +00:00
Christian Krakau-Louis 958b195e79 Merge pull request #806 from christianlouis/alert-autofix-400
Potential fix for code scanning alert no. 400: Clear-text logging of sensitive information
2026-03-23 13:17:29 +01:00
Christian Krakau-Louis c5ef1ec50c Potential fix for code scanning alert no. 400: Clear-text logging of sensitive information
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-03-23 13:17:19 +01:00
copilot-swe-agent[bot] b4e0067a27 fix(build): remove --omit=dev from npm ci in Dockerfile frontend-builder stage
The Tailwind CSS CLI is a devDependency in frontend/package.json. Using
`npm ci --omit=dev` skipped installing it, causing the Docker build to
fail with 'sh: tailwindcss: not found' at the `npm run build` step.

Since this is a multi-stage build where the frontend-builder stage is
discarded after compilation, all dependencies (including devDependencies)
are needed during the build but do not bloat the final image.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/f16fabb4-4d8c-48e3-8d26-c2d38cc7129f
2026-03-22 18:54:52 +00:00
copilot-swe-agent[bot] 6188003897 Initial plan 2026-03-22 18:48:13 +00:00
github-actions[bot] ef897f660d chore(release): update build metadata files [skip ci] 2026-03-22 18:47:10 +00:00
semantic-release 6cb9feacab 0.172.1
Automatically generated by python-semantic-release
2026-03-22 18:47:07 +00:00
Christian Krakau-Louis 76c0e91500 Merge pull request #804 from christianlouis/copilot/enable-qr-code-upload
fix: social login providers load from DB without restart; connections page shows accurate linked status
2026-03-22 19:46:48 +01:00
copilot-swe-agent[bot] 0c7ea6748d fix: social login providers now work from DB config without restart
- Extract all OAuth registration into _setup_social_providers() with a
  _register_oauth_client() helper that clears the authlib _clients cache
  so credentials can change without a restart
- Add refresh_social_providers() public function called after every
  settings reload (lifespan startup + settings_sync live reload)
- Fix connections page linked status to use _get_effective() (DB-aware)
  instead of the stale startup-time SOCIAL_PROVIDERS dict
- Fix oauth_configured template variable similarly
- Add tests: DB-driven linked status, stale-provider clearing,
  register_oauth_client cache-clear, refresh function coverage

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/ef15910f-fd25-469a-814b-9e1fb40659c9
2026-03-22 18:42:18 +00:00
github-actions[bot] 78077fa8c7 chore(release): update build metadata files [skip ci] 2026-03-22 18:24:56 +00:00
semantic-release 242846aa9c 0.172.0
Automatically generated by python-semantic-release
2026-03-22 18:24:52 +00:00
Christian Krakau-Louis 868613ac49 Merge pull request #802 from christianlouis/copilot/migrate-tailscale-to-3-x
feat(ui): migrate Tailwind CSS from v2 CDN to compiled v3 production build
2026-03-22 19:24:31 +01:00
copilot-swe-agent[bot] 33a0e49acd Initial plan 2026-03-22 18:21:40 +00:00
copilot-swe-agent[bot] 14b3031e63 feat(ui): replace Tailwind CSS CDN with compiled v3 production build
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/85d2244d-170a-48d3-8f6b-b4c124a49ed9
2026-03-22 18:07:32 +00:00
copilot-swe-agent[bot] 1d7df13c94 feat(ui): migrate Tailwind CSS from v2 CDN to v3 Play CDN (interim step)
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/85d2244d-170a-48d3-8f6b-b4c124a49ed9
2026-03-22 17:50:11 +00:00
github-actions[bot] ce4bca0186 chore(release): update build metadata files [skip ci] 2026-03-22 17:46:30 +00:00
semantic-release 4b07e996ad 0.171.3
Automatically generated by python-semantic-release
2026-03-22 17:46:27 +00:00
Christian Krakau-Louis 720c9c11b0 Merge pull request #803 from christianlouis/copilot/fix-html-lint-errors
fix(ui): add missing opening `<script>` tag in base.html Sentry init block
2026-03-22 18:46:06 +01:00
copilot-swe-agent[bot] 425472c839 fix(ui): add missing opening script tag in base.html Sentry block
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/3780cab7-11b6-470a-935a-57d63bf1d36b
2026-03-22 17:42:54 +00:00
copilot-swe-agent[bot] 55afa4981b Initial plan 2026-03-22 17:41:40 +00:00
github-actions[bot] 63f7b62fc0 chore(release): update build metadata files [skip ci] 2026-03-22 17:37:52 +00:00
copilot-swe-agent[bot] 48a303d498 Initial plan 2026-03-22 17:37:51 +00:00
semantic-release 8f1fe79411 0.171.2
Automatically generated by python-semantic-release
2026-03-22 17:37:50 +00:00
Christian Krakau-Louis 3e1b352930 Merge pull request #801 from christianlouis/copilot/fix-toggle-not-working
fix(ui): replace broken Tailwind v3-only peer toggles on admin connections page
2026-03-22 18:37:25 +01:00