Commit Graph

45 Commits

Author SHA1 Message Date
Christian Krakau-Louis 67e5fedce5 feat: add dashboard change summaries 2026-05-22 21:40:59 +02:00
Christian Krakau-Louis 364d517e07 feat: add source recommendations 2026-05-22 21:30:41 +02:00
Christian Krakau-Louis 34d8a655a2 feat: add domain report csv export 2026-05-22 21:21:39 +02:00
Christian Krakau-Louis ccc634a10b feat: add domain daily rollups 2026-05-22 21:12:43 +02:00
Christian Krakau-Louis 692ca913e0 feat: add dashboard top source report 2026-05-22 21:01:14 +02:00
Christian Krakau-Louis 8485514445 feat: add dashboard trend charts 2026-05-22 20:52:47 +02:00
Christian Krakau-Louis 14f9f6defd feat: add source pass fail rollups 2026-05-22 20:41:34 +02:00
Christian Krakau-Louis b5d0ecaf85 feat: add mail source backfill controls 2026-05-22 20:22:28 +02:00
Christian Krakau-Louis c1b81d3e06 feat: add mail import detail events 2026-05-22 20:11:56 +02:00
Christian Krakau-Louis 1b7f00e7a0 feat: add per-source mail import trigger 2026-05-22 19:54:11 +02:00
Christian Krakau-Louis 69aa1459eb feat: show mail import history 2026-05-22 19:44:18 +02:00
copilot-swe-agent[bot] 523b0529f4 fix: use Logto Account Center routes for password change and MFA management
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/d566f8d7-4560-4945-b9e5-388259f626a3

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-04-02 17:05:20 +00:00
copilot-swe-agent[bot] c81173e417 implement password reset on login screen and MFA management for users
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/0419399d-3a03-4f02-a3a8-fc75da7172bc

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-30 19:58:40 +00:00
copilot-swe-agent[bot] 274b0b09c5 Add favicon to the app
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/d5386c25-5b4f-4f21-8537-ae2d0fc06c04

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-30 15:46:23 +00:00
copilot-swe-agent[bot] 04931172dd feat: add AUTH_DISABLED no-auth fallback mode
- config.py: AUTH_DISABLED: bool = False setting
- middleware/auth.py: bypass all checks when AUTH_DISABLED=True
- security.py: require_admin_auth returns synthetic context when disabled
- endpoints/auth.py: /me returns synthetic admin; /sign-out → / when disabled
- main.py: startup WARNING when disabled; pass auth_disabled to login.html
- templates/login.html: info banner with Go to dashboard link when disabled
- templates/setup.html: document AUTH_DISABLED option with security warning
- tests/test_auth.py: 4 new AUTH_DISABLED tests (445 total, all pass)

Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/18f41bf2-0b68-4b7d-afb5-d2894c212a8f

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-30 11:38:52 +00:00
copilot-swe-agent[bot] 531dc968a8 feat: integrate Logto OIDC for user authentication
- Add Logto OIDC integration (app/core/logto.py): CookieStorage adapter,
  create/decode session token helpers, sync_logto_user upsert
- New auth endpoints (/api/v1/auth): sign-in, callback, sign-out, me
- AuthRedirectMiddleware: protects HTML pages, redirects to /setup when
  Logto is unconfigured, to /login otherwise
- Update require_admin_auth: accepts dmarq_session cookie JWT first,
  then API key, then Bearer JWT (fully backward compatible)
- Update User model: add logto_id, username, picture, created_at, updated_at;
  make hashed_password nullable for Logto-only users; is_superuser default=True
- New Alembic migration d4e5f6a7b8c9 for the above schema changes
- Add LOGTO_ENDPOINT / LOGTO_APP_ID / LOGTO_APP_SECRET / LOGTO_REDIRECT_URI
  settings with logto_configured property
- Create login.html (Sign in with Logto button) and setup.html (step-by-step
  configuration guide)
- Update base.html: user menu with avatar/name and sign-out via Alpine.js
  fetch to /api/v1/auth/me
- Update settings.html: remove localStorage adminApiKey; session cookie is
  sent automatically by browser; add 401 → /login redirect
- Update requirements.txt: replace fastapi-users additions with logto + aiohttp
- Add test_auth.py: 18 new tests covering session tokens, CookieStorage,
  sync_logto_user, /me, /sign-in (503), /sign-out cookie clearing
- Fix test_security_extra.py: pass Request mock to require_admin_auth;
  add new test_valid_session_cookie_returns_auth_context

Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/b448f585-7646-40f8-ae2d-9986c361e3fd

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-30 10:09:50 +00:00
Christian Krakau-Louis 42e3a1f148 Merge pull request #78 from christianlouis/copilot/fix-update-settings-persistence
Add persistent settings system with database backend and comprehensive settings UI
2026-03-30 10:30:07 +02:00
copilot-swe-agent[bot] 241713083b Add persistent settings system with database backend and comprehensive UI
- New Setting ORM model (key-value store with category, value_type, audit fields)
- Alembic migration to create the settings table
- Settings API endpoints: GET/PUT /api/v1/settings/{key}, GET /api/v1/settings (list+filter), POST /api/v1/settings/bulk
- Default seeding (17 sensible defaults across general/dmarc/dns/cloudflare/notifications categories)
- Secret redaction for cloudflare.api_token and notifications.smtp_password
- Updated settings.html: General, DMARC Policy Defaults, DNS Resolver, Cloudflare Integration, Email Notifications sections
- All forms wired to the API via Alpine.js with flash feedback
- 12 new tests for the settings model and endpoints

Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/19dbc6cd-07cb-406e-b3b6-411f7721f737

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-30 07:58:51 +00:00
copilot-swe-agent[bot] 61cb428f54 feat: add delete buttons to reports list and report detail pages
- Add "Delete" button to reports list table (reports.html): clicking
  shows a confirmation dialog then calls the existing DELETE API.
  On success, the row is removed from the table without a page reload.
  Domain filter dropdown is pruned if the domain has no remaining reports.

- Add "Delete Report" button to report detail page (report_detail.html):
  clicking shows a confirmation dialog then calls the DELETE API.
  On success, redirects to /reports.

The backend DELETE endpoint and re-upload-after-delete (deduplication
exemption) were already in place and covered by existing tests.

Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/d6c0078b-9338-49f0-87bd-32238fbde237

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-30 00:37:53 +00:00
Christian Krakau-Louis 06a007d9db Merge pull request #76 from christianlouis/copilot/update-dkim-selectors
Fix DKIM selector extraction: surface all working selectors and auto-discovered report selectors
2026-03-30 01:57:12 +02:00
copilot-swe-agent[bot] 596a9b882e Fix DKIM selector extraction: show all working selectors and report-discovered selectors
- check_dkim now returns ALL matching selectors instead of stopping at first match
- DomainDNSResult.dkim_selectors is now a List[str] instead of a single Optional[str]
- DNSRecordResponse.dkimSelectors is now List[str]
- /selectors endpoint now also returns report_selectors (auto-discovered from DMARC reports)
- Frontend shows all live-check selectors and auto-discovered selectors as read-only
- Updated tests to match new data structures; added tests for multi-selector and report_selectors

Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/87d8b8d9-23c3-4d3b-85a3-8e354e62c768

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 23:54:45 +00:00
Christian Krakau-Louis bf9d1f6755 Merge pull request #77 from christianlouis/copilot/fix-unauthorized-error
Fix 401 Unauthorized on poll-status dashboard widget
2026-03-30 01:51:56 +02:00
copilot-swe-agent[bot] 04e6dcfb8c Rename poll-status to public path /api/v1/poll-status to reflect no-auth design
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/15d037ef-2d5e-44ab-a15d-7908187e9106

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 23:46:37 +00:00
copilot-swe-agent[bot] dfef73040c Fix 401 on poll-status: remove auth requirement from read-only status endpoint
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/15d037ef-2d5e-44ab-a15d-7908187e9106

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 23:43:54 +00:00
copilot-swe-agent[bot] de225bc1cd Replace dummy/bogus reports data with real API data on /reports page
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/c6e36fd9-00c9-4000-985f-f7a42e2ba451

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 23:24:40 +00:00
copilot-swe-agent[bot] 58b5755f72 refactor: extract _spf_fix_hint and _safe_ptr_lookup helpers; fix spelling
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/9eaa7749-047c-46bd-8bc0-2851ea02ffe4

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 22:46:49 +00:00
copilot-swe-agent[bot] 30007d21d6 feat: add rDNS hostname, SPF fix hints and auth tooltips to domain sources view
- dns_resolver.py: add _ip_to_arpa_name() helper and lookup_ptr() to
  BaseDNSProvider (no-op default), SystemDNSProvider (dnspython PTR),
  and CloudflareDNSProvider (DoH PTR type=12)
- domains.py: extend SourceEntry with hostname + spf_fix_hint; update
  get_domain_sources to run async PTR lookups and generate ip4:/ip6:
  SPF mechanism hints for failing IPs
- domain_details.html: show rDNS hostname below IP in sources table;
  add DaisyUI tooltip explaining each auth result; add "Fix SPF" popover
  with copy-paste mechanism for IPs that fail SPF
- tests: 15 new tests covering _ip_to_arpa_name, SystemDNSProvider/
  CloudflareDNSProvider PTR lookup, and sources endpoint hostname +
  fix-hint fields

Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/9eaa7749-047c-46bd-8bc0-2851ea02ffe4

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 22:44:18 +00:00
Christian Krakau-Louis 1815747fba Merge pull request #69 from christianlouis/copilot/debug-not-found-error
Fix /reports/{report_id} returning 404 Not Found
2026-03-30 00:27:52 +02:00
Christian Krakau-Louis c144fc7a86 Merge pull request #71 from christianlouis/copilot/debug-content-security-policy-error
Fix CSP violation: self-host chart.js to eliminate CDN connect-src breach
2026-03-30 00:27:26 +02:00
copilot-swe-agent[bot] 1455db9298 Fix CSP violation: self-host chart.js instead of loading from CDN
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/11546dac-cb66-4028-95d6-420763b626e4

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 22:18:38 +00:00
copilot-swe-agent[bot] af122881a5 Fix /reports/{report_id} returning 404 - add report detail page and API endpoint
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/4a412936-3bf7-4c02-b121-c0c342c34f1b

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 22:18:17 +00:00
copilot-swe-agent[bot] 551d604b8f fix: address code review - clarify plaintext note, fix misleading template ternary
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/0c63851e-a69a-4a76-8dd8-25618e825b8c

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 19:37:10 +00:00
copilot-swe-agent[bot] 25b3567414 feat: implement Gmail API mail source with OAuth2, ingestion tracking, and UI
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/0c63851e-a69a-4a76-8dd8-25618e825b8c

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 19:34:03 +00:00
Christian Krakau-Louis 298ca938ec Merge pull request #62 from christianlouis/copilot/check-dns-data-in-dashboard
fix: repair corrupted dns_resolver.py to pass black --check (py310 target)
2026-03-29 21:17:25 +02:00
copilot-swe-agent[bot] a04006f75b fix: address code review — narrow exception types, computed dkimLiveText getter
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/19d17518-732d-4644-889b-cc63256e19b1

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 18:56:08 +00:00
copilot-swe-agent[bot] 0d1a4fdac3 feat: real DNS lookups, manual DKIM selectors, Cloudflare-ready DNS provider architecture
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/19d17518-732d-4644-889b-cc63256e19b1

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 18:53:35 +00:00
copilot-swe-agent[bot] dd9aeb0aac Fix domain detail page: quote domain_id in Alpine.js x-data attribute
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/e56426a2-da63-4f8a-95cc-e05972be9e51

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 18:44:33 +00:00
Christian Krakau-Louis a679459f5c Merge pull request #57 from christianlouis/copilot/fix-not-found-error
Fix 404 on /domains/{domain_id} page route
2026-03-29 20:21:37 +02:00
copilot-swe-agent[bot] a64ed4acb3 feat: multi-file drag-and-drop upload with auto sequential ingest
- Add `multiple` attribute to file input so users can select/drop
  multiple DMARC report files at once
- Remove the manual "Upload Report" button; files start uploading
  automatically as soon as they are dropped or selected
- Show a per-file queue with status icons: pending (clock), uploading
  (spinner), success (checkmark), error (×) plus a result message
- Sequential upload via a while-loop that processes each pending entry
  one at a time; newly-dropped files during an active upload are
  picked up automatically on the next iteration
- "Clear all" button removes completed/failed files while keeping any
  in-flight upload untouched; individual files can be removed too
- Summary alert after the full batch completes: all-success,
  all-error, or mixed
- Use lastIndexOf for robust file-extension extraction
- Updated card description to reflect automatic multi-file upload

Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/d6fb5b08-e55f-4f96-ac9b-3e4b69b3945c

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 18:06:49 +00:00
copilot-swe-agent[bot] 17116d8603 Fix 404 on /domains/{domain_id} by adding plural route alias and updating template link
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/c498fef5-0a5e-4182-b765-fc3ec074b515

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 17:57:00 +00:00
copilot-swe-agent[bot] 883d54a428 fix: address code review - Alpine.js $set, SQLAlchemy bool filter style
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/f141cd3b-8d0a-4c7e-b479-ee973c209c11

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 16:20:11 +00:00
copilot-swe-agent[bot] 6d9392e5e7 feat: refactor IMAP config to DB, add multi-account mail sources admin UI
Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/f141cd3b-8d0a-4c7e-b479-ee973c209c11

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-29 16:18:15 +00:00
Christian Krakau-Louis 5e8b1f033f Add comprehensive documentation for DMARQ, including user guides, deployment instructions, and feature descriptions
- Created main documentation index and user guide with sections on getting started, dashboard overview, managing domains, and reports.
- Added detailed deployment guide for Docker and manual installation.
- Included user-friendly explanations of DMARC, its benefits, and how to manage domains and reports.
- Implemented visual assets for dashboard, domains, IMAP, and reports.
- Established requirements for documentation build using MkDocs and Material theme.
- Integrated navigation structure for easy access to all documentation sections.
2025-04-21 01:49:34 +02:00
Christian Krakau-Louis 69f8438a36 Add domain management, reports, settings, and upload templates
- Implemented domain management page with a list of monitored domains and their DMARC, SPF, and DKIM statuses.
- Created reports page with filtering options for domain, report type, and date range, displaying DMARC reports.
- Developed settings page for IMAP configuration and DMARC policy management, including form validation and feedback.
- Added upload page for DMARC report files with drag-and-drop functionality and file type validation.
- Integrated Alpine.js for interactivity and dynamic data handling across all templates.
2025-04-20 18:38:29 +02:00
Christian Krakau-Louis f910cb0ba4 Add initial MVP documentation for DMARQ platform, detailing backend architecture, frontend implementation, and deployment structure 2025-04-17 15:20:42 +02:00