Commit Graph

1607 Commits

Author SHA1 Message Date
Claudio Ortolina f9845e8b7c Dry up CSP policies 2026-03-08 19:56:05 +00:00
Claudio Ortolina 77c45bddc6 Update CSP policies for musicbrainz covers + fallbacks 2026-03-08 19:54:00 +00:00
Claudio Ortolina 27519fca29 Fix CSP for images from brave 2026-03-08 19:47:43 +00:00
Claudio Ortolina 59616e58b5 Allow LiveDebugger origins in dev 2026-03-08 19:44:41 +00:00
Claudio Ortolina b30f0fa1ee Add metrics around image resize/convert/dominant color extration 2026-03-08 13:56:31 +00:00
Claudio Ortolina 4584b7bcb8 Remove drop down from record set items
Have just a bin icon, and rely on drag and drop.

This solves a massive performance issue with the page, which is
traceable to the Fluxon dropdowns, particularly the Class.merge logic
used to merge Tailwind classes
2026-03-08 13:21:33 +00:00
Claudio Ortolina d76471b03e Use MDEx to consolidate Markdown handling 2026-03-08 09:31:09 +00:00
Claudio Ortolina e4d03a19e4 Compute in advance all needed assigns in record_set_card
Theory is that this makes change tracking easier, and therefore
rendering more performant.
2026-03-07 23:52:32 +00:00
Claudio Ortolina 1bfe501b3d Split strings for readability 2026-03-07 23:44:00 +00:00
Claudio Ortolina 05354b9f78 Explain the CSP policies 2026-03-07 23:40:40 +00:00
Claudio Ortolina 46da8eea38 EXP: fix CSP issues for /dev routes 2026-03-07 21:07:24 +00:00
Claudio Ortolina 41480316c2 Fix CSP settings
⏺ Here's a breakdown of each directive:

  ┌─────────────────┬────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
  │    Directive    │                     Value                      │                                                         Purpose                                                         │
  ├─────────────────┼────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ default-src     │ 'self'                                         │ Fallback for any resource type not explicitly listed — only allow from the app's own origin                             │
  ├─────────────────┼────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ script-src      │ 'self'                                         │ JavaScript can only be loaded from the app's origin (no external scripts, no inline)                                    │
  ├─────────────────┼────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ style-src       │ 'self' 'unsafe-inline' https://rsms.me         │ Stylesheets from the app's origin, inline styles (needed by LiveView), and the https://rsms.me/inter/ hosted on rsms.me │
  ├─────────────────┼────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ font-src        │ 'self' https://rsms.me                         │ Font files from the app's origin and rsms.me (Inter font)                                                               │
  ├─────────────────┼────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ img-src         │ 'self' data: https://lastfm.freetls.fastly.net │ Images from the app's origin, data: URIs (inline base64 images), and Last.fm's CDN for album/artist artwork             │
  ├─────────────────┼────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ connect-src     │ 'self'                                         │ XHR/fetch/WebSocket connections only to the app's origin (covers LiveView's WebSocket)                                  │
  ├─────────────────┼────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ frame-ancestors │ 'self'                                         │ The app can only be embedded in iframes by itself (clickjacking protection)                                             │
  ├─────────────────┼────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ base-uri        │ 'self'                                         │ Restricts <base> tag to the app's origin (prevents base tag injection attacks)                                          │
  └─────────────────┴────────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

  Notable things not allowed by this policy:
  - No inline <script> tags or eval()
  - No external JavaScript from CDNs
  - No embedding in third-party iframes
  - No connections to external APIs from the browser (all external API calls go through the server)
2026-03-07 19:13:48 +00:00
Claudio Ortolina 52815bde2f When doing markdown to HTML, sanitize HTML
Closes #101
Closes #102
2026-03-07 19:05:37 +00:00
Claudio Ortolina 3812b6c402 Add Content-Security-Policy header
Closes #100
2026-03-07 18:53:52 +00:00
Claudio Ortolina 2e3732e38b Apply all necessary exclusions to sobelow findings 2026-03-07 18:37:24 +00:00
Claudio Ortolina c87f946479 Skip Sobelow Traversal.SendDownload warning for archive controller 2026-03-07 18:21:57 +00:00
Claudio Ortolina 27e5f68fbb Skip Sobelow XSS.ContentType warning for asset controller 2026-03-07 18:16:50 +00:00
Claudio Ortolina 6a89d31d4c Don't extract dominant colors if provided in params
This as the side effect of massively speeding up the test suite: on M1,
it goes from 24 seconds to 14.
2026-03-07 09:05:44 +00:00
Claudio Ortolina 5a86989df1 Add '/blog/wp-includes/wlwmanifest.xml' to blocked paths 2026-03-07 07:13:57 +00:00
Claudio Ortolina 97f4267c5e Add telemetry for Markdown rendering 2026-03-06 20:27:58 +00:00
Claudio Ortolina effcc3966c Fix id in record set show page 2026-03-06 20:20:48 +00:00
Claudio Ortolina c9ee94bd4a Key record set item ids during rendering
Makes live render faster by 20%
2026-03-06 20:02:58 +00:00
Claudio Ortolina 436274a8ef Extract internal record set card component 2026-03-06 17:02:19 +00:00
Claudio Ortolina 518a4e9623 Remove finch req duration by normalized path metric
Too noisy
2026-03-06 15:27:13 +00:00
Claudio Ortolina 1063c43a65 Revert "Remove finch req duration by path metric"
This reverts commit c1e4024095.
2026-03-06 15:26:36 +00:00
Claudio Ortolina 0d7ed39b4c Extend tracked metrics 2026-03-06 15:19:47 +00:00
Claudio Ortolina c1e4024095 Remove finch req duration by path metric
Paths are too many and too long
2026-03-06 15:06:39 +00:00
Claudio Ortolina 63e44518a3 Order blocked paths alphabetically 2026-03-06 15:01:53 +00:00
Claudio Ortolina 34717a618a Add two more blocked routes 2026-03-06 15:00:29 +00:00
Claudio Ortolina 05afcc7732 Make sure tags are part of the telemetry storage key 2026-03-06 12:40:22 +00:00
Claudio Ortolina a23f772c04 Re-enable Credo CyclomaticComplexity check 2026-03-06 10:08:25 +00:00
Claudio Ortolina d3ae3a7381 Fix ScrobbleRule timestamps to use utc_datetime 2026-03-06 09:58:40 +00:00
Claudio Ortolina 54f19cd9a2 Fix ArtistInfo.country/1 crash when area is missing 2026-03-06 09:51:56 +00:00
Claudio Ortolina 6c2036ff7d Make excluded genres configurable 2026-03-06 09:45:42 +00:00
Claudio Ortolina 7cf9b4e7f8 First pass at uniformed types, specs and docs
- spec public functions (skipping controllers, views, live views and
components)
- use types instead of explanations in docs
- remove redundant docs
- fix typos
2026-03-06 08:33:11 +00:00
Claudio Ortolina a3ccc06d14 Extract shared SQL builder for scrobble rules 2026-03-05 20:52:25 +00:00
Claudio Ortolina d738032f8a Add string length validations to user-input schemas 2026-03-05 20:42:44 +00:00
Claudio Ortolina 08f7565d44 Replace inspect(reason) with friendly error messages
Closes #81
2026-03-05 20:25:13 +00:00
Claudio Ortolina e8f393c5a0 Guard against nil medium in scrobble_medium
Closes #76
2026-03-05 19:54:32 +00:00
Claudio Ortolina 6d72df3905 Extract apply_fallback_index to shared helper
Closes #92
2026-03-05 19:50:50 +00:00
Claudio Ortolina d4376e5fa0 Extract DB queries from MaintenanceLive into context 2026-03-05 18:01:50 +00:00
Claudio Ortolina 4b1f6bb245 Fix inconsistent toast arity in form components
Closes #94
2026-03-05 17:06:23 +00:00
Claudio Ortolina eb8a00ab54 Replace String.to_integer with safe Integer.parse
Use Integer.parse/1 instead of String.to_integer/1 on user-supplied
and external API input to prevent ArgumentError crashes on non-numeric
values. Adds fallback defaults or nil returns at each call site.
2026-03-05 14:27:37 +00:00
Claudio Ortolina 23c478fe4c Mount telemetry repo in live dashboard stats 2026-03-05 13:52:55 +00:00
Claudio Ortolina f109057be5 Persist telemetry data in local sqlite database 2026-03-05 13:39:38 +00:00
Claudio Ortolina bb541c8004 Add error_tracker metrics in LiveDashboard 2026-03-05 11:48:17 +00:00
Claudio Ortolina 73a943bc63 Server records on this day email assets from a public endpoint 2026-03-05 10:50:35 +00:00
Claudio Ortolina 478832249b Send record of the day email 2026-03-05 10:37:04 +00:00
Claudio Ortolina adc7ef49e5 Add /admin to the blocked both pats 2026-03-05 09:05:09 +00:00
Claudio Ortolina 08d01e5939 Catch /xmlrpc.php bot request 2026-03-05 06:59:14 +00:00