Commit Graph

1206 Commits

Author SHA1 Message Date
Claudio Ortolina d2cccce9dc Uniform margins 2026-03-15 20:58:50 +00:00
Claudio Ortolina 4fb148e9db Simplify signatures of scrobbling functions 2026-03-14 22:22:41 +00:00
Claudio Ortolina 69ff926aba Allow WASM evaluation on prod 2026-03-14 18:02:27 +00:00
Claudio Ortolina 2dd6f10a7f Fix CSP error for barcode detection 2026-03-14 17:38:04 +00:00
Claudio Ortolina 4d1ac9652c Link the scrobbled count in stats 2026-03-14 09:59:09 +00:00
Claudio Ortolina 7cdd502701 Streamline print/scrobble buttons 2026-03-14 08:51:19 +00:00
Claudio Ortolina 3d66d7a6d7 Remove unnecessary spacing in the application footer 2026-03-14 07:17:08 +00:00
Claudio Ortolina 1dd7974cc7 Use socket assigns instead of threading IDs via JS.push
Extends the same optimization from the previous commit to
all remaining show page handlers across collection, wishlist,
and artist LiveViews. Also simplifies bare JS.push() calls
to plain phx-click strings.
2026-03-13 16:48:12 +00:00
Claudio Ortolina 0b9d008ecb No need to thread the record ID when we can use the record directly 2026-03-13 16:29:11 +00:00
Claudio Ortolina 002c81d3b8 Load Tidewave only in dev 2026-03-13 15:13:37 +00:00
Claudio Ortolina 854a6e1816 Allow worker blob URLs in CSP directives
canvas-confetti creates web workers from blob URLs,
which requires an explicit worker-src directive.
2026-03-13 15:01:28 +00:00
Claudio Ortolina 145c5c288c Allow loading img blobs in csp directives 2026-03-13 14:47:35 +00:00
Claudio Ortolina 9e1dbfd530 Re-enable Credo ModuleDoc check
Closes #108
2026-03-13 10:52:01 +00:00
Claudio Ortolina d057f29ba1 Split ScrobbleActivity into focused modules
Move track CRUD/listing to ListeningStats and diagnostics
to Maintenance, leaving ScrobbleActivity for scrobbling only.

Closes #111
2026-03-12 16:51:33 +00:00
Claudio Ortolina ee4d2555ee Move scrobble queries from Records to ListeningStats
Closes #110
2026-03-12 16:32:10 +00:00
Claudio Ortolina d6553ae061 Uniform record detail page title logic 2026-03-12 14:58:25 +00:00
Claudio Ortolina 1a62360b21 Group records in records on this day widget 2026-03-12 09:09:25 +00:00
Claudio Ortolina a6348fe647 Streamline record detail actions, and add a quick scrobble everything button 2026-03-12 08:26:25 +00:00
Claudio Ortolina cd0101ba4a Make page_title/2 private in all LiveViews
The Index modules were calling Show.page_title/2 for modal edit
routes. Inlined the logic as private functions in each Index
module and removed the now-unused Show aliases.

Closes #104
2026-03-12 07:44:39 +00:00
Claudio Ortolina 8d9bf78974 Extract shared TopByPeriod LiveComponent
Closes #103
2026-03-12 07:38:58 +00:00
Claudio Ortolina c4bbd7a0f6 Add counter for errored requests 2026-03-11 11:33:11 +00:00
Claudio Ortolina 5ddc9ae466 Add metrics for requests by status code 2026-03-11 11:14:07 +00:00
Claudio Ortolina 159d5ad695 Include more maintenance tasks
- Asset tasks
- Records on this day email
2026-03-11 09:31:59 +00:00
Claudio Ortolina 20b497bbb8 Don't track route not found errors 2026-03-10 20:05:27 +00:00
Claudio Ortolina fa535393e0 Fix toggling/scrobbling event handlers in scrobble anything show view 2026-03-10 20:04:39 +00:00
Claudio Ortolina 3ddb287187 Fix csp directives for online store template logos 2026-03-09 18:30:29 +00:00
Claudio Ortolina c352ad4809 Can print an individual medium tracklist 2026-03-09 14:52:26 +00:00
Claudio Ortolina 4569c6727e Add function to download a record's tracklist for printing 2026-03-09 13:39:12 +00:00
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 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