From 6aefcf97710cd1e52dd4a249b75df7d0ae7e1a02 Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Tue, 11 Aug 2026 12:33:18 +0100 Subject: [PATCH 1/3] feat(spoolman): diagnose blocked live updates Spoolman 0.26 added browser origin checks, which silently break Fluidd's direct browser-to-Spoolman WebSocket (used for live spool/ filament/vendor updates) unless SPOOLMAN_CORS_ORIGIN is set. Only that WebSocket is affected; the Moonraker proxy connection keeps working, so the dashboard card looked "connected" with no live data. Generalizes the existing HTTP endpoint diagnostics util with a configurable probe path, reuses it to probe Spoolman when the direct WebSocket fails to open, and surfaces the result (CORS, mixed content, unreachable) as a warning in the Spoolman dashboard card. Documents the SPOOLMAN_CORS_ORIGIN fix in the multi-material, third-party integrations, and FAQ docs pages. Closes #1928 Signed-off-by: Pedro Lamas --- docs/docs/faq.md | 8 + docs/docs/features/multi-material.md | 30 ++++ .../docs/features/third-party-integrations.md | 6 + .../widgets/spoolman/SpoolmanCard.vue | 167 +++++++++++------- src/locales/en.yaml | 15 ++ src/store/spoolman/actions.ts | 41 +++++ src/store/spoolman/mutations.ts | 5 + src/store/spoolman/state.ts | 3 +- src/store/spoolman/types.ts | 3 + .../http-endpoint-diagnostics.spec.ts | 12 ++ src/util/http-endpoint-diagnostics.ts | 11 +- 11 files changed, 234 insertions(+), 67 deletions(-) diff --git a/docs/docs/faq.md b/docs/docs/faq.md index 0a5d5df6f5..7956835a05 100644 --- a/docs/docs/faq.md +++ b/docs/docs/faq.md @@ -129,6 +129,14 @@ Files must be uploaded after enabling these settings. See See [Slicer Uploads](/features/slicer-uploads) for setup instructions covering OrcaSlicer, PrusaSlicer, SuperSlicer, and Cura. +### My Spoolman spool weight stopped updating after a Spoolman upgrade + +Spoolman 0.26 added browser origin checks that block the direct connection +Fluidd uses for live spool updates, even though spool selection and everything +else still work. Add Fluidd's address to `SPOOLMAN_CORS_ORIGIN` on your +Spoolman host and restart it. See +[Live updates](/features/multi-material#live-updates) for details. + ## System ### The host reboot / shutdown commands don't work diff --git a/docs/docs/features/multi-material.md b/docs/docs/features/multi-material.md index 0e1521a1ab..8dd1568856 100644 --- a/docs/docs/features/multi-material.md +++ b/docs/docs/features/multi-material.md @@ -26,6 +26,36 @@ Pressure Advance values. Fluidd integrates with [Spoolman](https://github.com/Donkie/Spoolman) for filament spool tracking. +### Live updates + +Fluidd connects to Spoolman in two different ways: through Moonraker, for +loading spool data, and directly from your browser, for live updates (spool +weight, filament, and vendor changes). Only the direct browser connection is +subject to your browser's cross-origin rules. + +Spoolman 0.26 and newer reject that direct connection unless Fluidd's origin +is explicitly allowed, which breaks live updates while everything else +(spool selection, sanity checks) keeps working normally. If your spool +weight stops updating during a print after upgrading Spoolman, add the +`SPOOLMAN_CORS_ORIGIN` environment variable to your Spoolman host and +restart it: + +```text title=".env" +SPOOLMAN_CORS_ORIGIN=http://fluidd.local,http://192.168.1.50 +``` + +Each entry is the scheme, host, and port shown in your browser's address bar +when you access Fluidd (no path), separated by commas if you use more than +one address. + +!!! warning "Avoid the wildcard" + `SPOOLMAN_CORS_ORIGIN=*` allows every origin and turns off Spoolman's + origin checks entirely. Only use it on a trusted network. + +See the +[`.env.example` file](https://github.com/Donkie/Spoolman/blob/master/.env.example) +in the Spoolman repository for more examples. + ### Print start On print start, Fluidd shows a modal asking you to select a spool. You can diff --git a/docs/docs/features/third-party-integrations.md b/docs/docs/features/third-party-integrations.md index d1bd2e7f04..e3d2887a17 100644 --- a/docs/docs/features/third-party-integrations.md +++ b/docs/docs/features/third-party-integrations.md @@ -123,6 +123,12 @@ Filament spool tracking with QR code scanning, toolchanger support, and print-start sanity checks. See [Spool Management](/features/multi-material#spool-management-spoolman) for details. +!!! warning "Spoolman 0.26+ requires a CORS configuration change" + Fluidd connects to Spoolman directly from your browser for live spool + updates. Spoolman 0.26 and newer block that connection unless you add + Fluidd's address to `SPOOLMAN_CORS_ORIGIN`. See + [Live updates](/features/multi-material#live-updates) for details. + [Spoolman on GitHub](https://github.com/Donkie/Spoolman){.md-button} ### Timelapse diff --git a/src/components/widgets/spoolman/SpoolmanCard.vue b/src/components/widgets/spoolman/SpoolmanCard.vue index 7dedc0b823..8839d3e726 100644 --- a/src/components/widgets/spoolman/SpoolmanCard.vue +++ b/src/components/widgets/spoolman/SpoolmanCard.vue @@ -99,74 +99,67 @@ /> - - - - - {{ $t('app.spoolman.msg.tracking_inactive') }} - + + {{ socketDiagnosticMessage }} + + - {{ $t('app.spoolman.msg.not_connected') }} + + + + {{ $t('app.spoolman.msg.tracking_inactive') }} + + + + + + {{ $t('app.spoolman.msg.not_connected') }} + + +