Commit Graph

965 Commits

Author SHA1 Message Date
Christian Krakau-Louis e2acf6b7b7 Merge pull request #368 from christianlouis/copilot/automate-changelog-updates
docs/ci: fix automated CHANGELOG generation and retroactively document v0.6.0–v0.40.0
2026-02-23 15:49:57 +01:00
copilot-swe-agent[bot] d796206bf7 docs/ci: automate CHANGELOG updates and retroactively document post-v0.5.0 changes
- Fix semantic-release autoescape=true Jinja2 bug preventing CHANGELOG generation
- Add explicit changelog_file, mode=update, output_format=md to pyproject.toml
- Add fallback semantic-release changelog step in release.yml
- Manually true up CHANGELOG.md with comprehensive v0.40.0 retroactive entry covering
  all post-v0.5.0 additions: security middleware, 6 new storage providers, PDF processing
  improvements, dual-table status tracking, notification system, admin file manager,
  browser extension v1.1, path traversal fixes, and documentation additions
- Add Documentation-First Development section to CONTRIBUTING.md and AGENTIC_CODING.md
- Fix README.md quick-start commands and screenshots note
- Update TODO.md to reflect current version and completed tasks"

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-23 13:00:49 +00:00
github-actions[bot] fc1028cbd8 chore(release): update build metadata files [skip ci] 2026-02-23 12:59:55 +00:00
Christian Krakau-Louis 270e456a82 Merge pull request #367 from christianlouis/copilot/investigate-onedrive-token-issues
fix(config): decrypt sensitive settings when loading from database into settings object
2026-02-23 13:59:36 +01:00
copilot-swe-agent[bot] efb3fa7d6c fix(config): decrypt sensitive settings when loading from database
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-23 12:54:34 +00:00
copilot-swe-agent[bot] 18ab358838 Initial plan 2026-02-23 12:48:44 +00:00
copilot-swe-agent[bot] ddbc6859ef Initial plan 2026-02-23 12:48:26 +00:00
github-actions[bot] e072178620 chore(release): update build metadata files [skip ci] 2026-02-23 12:30:26 +00:00
Christian Krakau-Louis 0166260c2c Merge pull request #363 from christianlouis/copilot/fix-settings-rollback-issue
fix(settings): rollback uses old_value, Remove from DB button always visible
2026-02-23 13:30:05 +01:00
github-actions[bot] c37a2878d6 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-02-23 12:28:59 +00:00
copilot-swe-agent[bot] 1cf6adbc7f feat(ui): always show Remove from DB button for DB-sourced settings with confirmation dialog
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-23 12:26:45 +00:00
copilot-swe-agent[bot] 862ba99802 fix(settings): rollback restores old_value instead of new_value and supports deletion fallback
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-23 12:15:44 +00:00
copilot-swe-agent[bot] 8fd107a682 Initial plan 2026-02-23 12:07:50 +00:00
github-actions[bot] 516f21eeb4 chore(release): update build metadata files [skip ci] 2026-02-23 11:50:41 +00:00
Christian Krakau-Louis 810c1380a0 Merge pull request #360 from christianlouis/copilot/fix-settings-page-errors
Fix settings page stale values, export-env 400 error, in-process settings reload, and add Back to ENV button
2026-02-23 12:50:20 +01:00
copilot-swe-agent[bot] 96fd0b8dd5 feat(settings): patch API in-memory settings on save and add Back to ENV button
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-23 11:42:37 +00:00
copilot-swe-agent[bot] ec7a35e747 fix(settings): fix route ordering and settings page display of DB values
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-23 11:39:13 +00:00
copilot-swe-agent[bot] c95c144410 Initial plan 2026-02-23 11:30:30 +00:00
github-actions[bot] 36cf4c1763 chore(release): update build metadata files [skip ci] 2026-02-23 11:08:53 +00:00
Christian Krakau-Louis a1fc5dcaec Merge pull request #358 from christianlouis/copilot/fix-mypy-error-in-tests
fix: isolate token_hex patch scope and resolve mypy no-untyped-def error
2026-02-23 12:08:29 +01:00
copilot-swe-agent[bot] 0188575c27 fix: isolate token_hex mock to wizard module and fix mypy annotation
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-23 10:01:07 +00:00
copilot-swe-agent[bot] 4e1cd73338 Initial plan 2026-02-23 09:53:27 +00:00
github-actions[bot] 17776941c6 chore(release): update build metadata files [skip ci] 2026-02-23 09:37:41 +00:00
Christian Krakau-Louis 8128c2eba3 Merge pull request #357 from christianlouis/copilot/enhance-settings-management
feat(settings): per-option save, audit log, rollback, live worker sync, wizard DB persistence, and ENV exporter
2026-02-23 10:37:22 +01:00
github-actions[bot] 540541eec6 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-02-23 09:33:48 +00:00
copilot-swe-agent[bot] 7fe25474bb feat(settings): wizard DB persistence, worker sync, ENV exporter, and setup wizard improvements
E) Wizard DB persistence + worker sync
- app/api/dropbox.py: save-settings persists to DB (primary); .env write
  is now best-effort (no 500 on missing file); notify_settings_updated()
  called; update-settings already done in previous commit
- app/api/google_drive.py: update-settings + save-settings both persist
  to DB and call notify_settings_updated(); .env write remains best-effort
- app/api/onedrive.py: save-settings + update-settings persist to DB +
  notify; test-token auto-refresh path persists rotated token via
  SessionLocal + notifies; .env write is best-effort throughout
- app/views/wizard.py: setup-wizard POST calls notify_settings_updated()
  when settings are saved; GET pre-fills fields from DB > ENV > default
  with a source badge; new GET /setup/undo-skip route removes skip marker

F) ENV Exporter
- app/utils/settings_service.py: get_settings_for_export(db, source)
  supports source=db (DB-only) and source=effective (full runtime config)
- app/api/settings.py: GET /api/settings/export-env admin-only endpoint
  returns downloadable .env file; source= query param selects scope
- frontend/templates/settings.html: Export .env dropdown (DB / effective)
  + Setup Wizard button added alongside existing Audit Log button

G) Setup Wizard improvements
- frontend/templates/setup_wizard.html: inputs pre-filled with
  current_value; DB/ENV/DEFAULT source badges; undo-skip messaging
- app/views/wizard.py: passes setup_skipped flag to template

Tests
- tests/test_wizard_db_persist.py: 28 tests across 7 classes covering
  wizard DB persistence, undo-skip, ENV exporter service + endpoint
- tests/test_api_dropbox.py: updated two tests to match new best-effort
  .env behavior (was: assert 500; now: assert 200)
- tests/test_api_onedrive_comprehensive.py: same for two OneDrive tests;
  fixed settings singleton pollution by adding @patch("app.api.*.settings")
  to all new wizard tests that call save/update endpoints

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-23 03:06:00 +00:00
copilot-swe-agent[bot] 22ab9255e2 fix(test): simplify always-false conditional in patch decorator
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-23 02:49:45 +00:00
copilot-swe-agent[bot] c2e60d3d71 test: add comprehensive tests for wizard DB persistence and settings export
- TestSetupWizardDbPersist: verify save_setting_to_db and notify_settings_updated called
- TestSetupWizardUndoSkip: verify skip marker removed and redirect
- TestDropboxSaveSettingsDbPersist: verify DB written even without .env
- TestGoogleDriveUpdateSettingsDbPersist: verify per-field DB persistence
- TestOneDriveSaveSettingsDbPersist: verify DB written without .env file
- TestGetSettingsForExport: unit tests for source=db and source=effective
- TestExportEnvEndpoint: admin-only, text/plain, content-disposition, 400 on invalid source

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-23 02:48:18 +00:00
copilot-swe-agent[bot] ecc8100e24 feat(settings): persist storage provider settings to DB, add export endpoint, enrich setup wizard
- dropbox/google_drive/onedrive save-settings: switch to DB as primary,
  .env write as best-effort (no longer fails when .env is absent)
- onedrive/google_drive update-settings: persist changes to DB alongside
  in-memory update; call notify_settings_updated()
- onedrive test_onedrive_token: persist rotated refresh token to DB
- settings_service: add get_settings_for_export() (db / effective modes)
- settings API: add GET /api/settings/export-env (admin-only, downloads .env)
- wizard: enrich settings with current values (DB > ENV > default) and
  value_source badges; pass setup_skipped to template; call
  notify_settings_updated() on save; add /setup/undo-skip route
- setup_wizard.html: pre-populate inputs with current_value; show
  DB/ENV/DEFAULT source badges; skip/undo-skip messaging
- settings.html: replace single Audit Log button with Setup Wizard link,
  Export .env dropdown, and Audit Log button group

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-23 02:41:04 +00:00
copilot-swe-agent[bot] 0d5c20f685 chore: outline plan for wizard DB persistence, worker sync, and ENV exporter
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-23 02:30:56 +00:00
copilot-swe-agent[bot] 90e5e0037c feat(settings): per-option save, live worker sync, audit log, and rollback
A) Per-option Save Button
- Add per-setting Save button in settings.html (visible only when value changed)
- Button calls POST /api/settings/{key} directly; existing bulk Save retained
- Add Audit Log link in settings page header

B) Immediate Worker Sync
- New app/utils/settings_sync.py with notify_settings_updated() (Redis version key)
  and register_settings_reload_signal() (Celery task_prerun handler)
- Register signal in celery_worker.py at startup
- All API write paths call notify_settings_updated() after successful saves

C) Audit Log
- Add SettingsAuditLog model (key, old_value, new_value, changed_by, changed_at, action)
- save_setting_to_db / delete_setting_from_db accept changed_by and write audit entries
- New get_audit_log() service function (masks sensitive values)
- New GET /api/settings/audit-log endpoint (admin-only)
- New GET /admin/settings/audit-log view + audit_log.html template
- Visible to all admins (per clarified requirement)

D) Config Rollback / History
- New get_setting_history() and rollback_setting() service functions
- New GET /api/settings/{key}/history endpoint
- New POST /api/settings/{key}/rollback/{history_id} endpoint
- Rollback buttons in audit_log.html with confirmation dialog
- Tests: 25 new tests covering audit log, rollback, worker sync helpers, and API endpoints

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-23 02:28:08 +00:00
copilot-swe-agent[bot] 05d03531b9 Initial plan 2026-02-23 02:14:05 +00:00
github-actions[bot] 11e543d443 chore(release): update build metadata files [skip ci] 2026-02-22 21:44:46 +00:00
Christian Krakau-Louis cbb221ed04 Merge pull request #356 from christianlouis/copilot/fix-file-upload-regression
fix(ui): send X-CSRF-Token on file upload XHR and retry fetch calls
2026-02-22 22:44:23 +01:00
copilot-swe-agent[bot] a9dcdb7a0d fix(ui): add X-CSRF-Token header to retry fetch calls in file_detail.html
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-22 21:37:22 +00:00
copilot-swe-agent[bot] 29e059cb75 fix(ui): add X-CSRF-Token header to XHR file upload requests
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-22 21:24:24 +00:00
copilot-swe-agent[bot] 8d45321c9b Initial plan 2026-02-22 21:18:55 +00:00
github-actions[bot] 23e02569a5 chore(release): update build metadata files [skip ci] 2026-02-22 21:09:47 +00:00
Christian Krakau-Louis fb8aea4cff Merge pull request #354 from christianlouis/copilot/fix-ci-pipeline-test-failures
fix(tests): resolve CI test failures from asyncio event loop destruction and settings singleton reload
2026-02-22 22:09:26 +01:00
copilot-swe-agent[bot] 9f4b162811 fix(tests): resolve CI test failures from asyncio event loop and settings reload side-effects
Two root causes identified and fixed:

1. tests/test_api_settings.py (TestListCredentials):
   asyncio.get_event_loop().run_until_complete() raised RuntimeError in
   Python 3.12 because test_api_auth_enabled.py's asyncio.run() sets the
   current event loop to None on completion. Replace all 7 occurrences
   with asyncio.run() which creates its own event loop each time.

2. tests/test_cors.py:
   reload(app.config) replaced the app.config.settings singleton with a
   new instance, so app modules holding the original reference no longer
   saw patches applied to app.config.settings.X. This caused the
   notification, OpenAI, and file-upload tests to behave as if unpatched.
   Remove the redundant reload() calls — the tests only need a fresh
   Settings(...) instance constructed with the env var already set.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-22 20:56:58 +00:00
copilot-swe-agent[bot] e632e0333f fix(api): return 200 with value=None for unknown setting keys in GET endpoint
`GET /api/settings/{key}` was calling `validate_setting_key()` which raises
HTTP 404 for keys not in SETTING_METADATA. The test expects 200 with value=None
for unknown keys.

Added `validate_setting_key_format()` to `input_validation.py` that validates
only the key format without the SETTING_METADATA existence check. Updated
`get_setting` to use the format-only validator; POST/DELETE endpoints continue
using the full `validate_setting_key()` for write-side security.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-22 20:04:57 +00:00
copilot-swe-agent[bot] bfabc79949 Initial plan 2026-02-22 19:44:21 +00:00
github-actions[bot] a5622412dc chore(release): update build metadata files [skip ci] 2026-02-22 19:44:18 +00:00
Christian Krakau-Louis d870dd9fa7 Merge pull request #350 from christianlouis/copilot/implement-api-key-rotation
feat: API key rotation mechanisms — audit endpoint, rotation guide, and admin UI
2026-02-22 20:44:01 +01:00
github-actions[bot] 6cea3a370c 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-02-22 19:43:15 +00:00
copilot-swe-agent[bot] 3fa24c0686 feat(ui): add Credential Audit page under Admin menu
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-22 19:39:01 +00:00
github-actions[bot] 2aad519107 chore(release): update build metadata files [skip ci] 2026-02-22 19:32:54 +00:00
Christian Krakau-Louis 389beaa1ed Merge pull request #351 from christianlouis/copilot/configure-cors-for-api-endpoints
feat(api): Add configurable CORS middleware, disabled by default
2026-02-22 20:32:36 +01:00
github-actions[bot] 969b2d3d2f 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-02-22 19:29:32 +00:00
copilot-swe-agent[bot] 1648d8c745 feat(api): configure CORS middleware for API endpoints
- Add CORSMiddleware (disabled by default, enabled via CORS_ENABLED=true)
- Add cors_enabled, cors_allowed_origins, cors_allow_credentials,
  cors_allowed_methods, cors_allowed_headers settings to config.py
- Add parse_comma_separated_list validator for CORS list env vars
- Insert CORS middleware between SessionMiddleware and ProxyHeaders
  so preflight runs before CSRF/auth but after proxy-header processing
- Document CORS env vars in .env.demo with rationale for proxy-first approach
- Mark CORS TODO as completed in SECURITY_AUDIT.md
- Add tests/test_cors.py with 12 unit and integration tests

Closes #175

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-02-22 19:26:39 +00:00