Commit Graph
511 Commits
Author SHA1 Message Date
MartinNYHC 5607eeab70 Revert "Add STL thumbnail generation support"
This reverts commit 24280fdbd5.
2026-01-29 15:44:44 +01:00
MisterBeardyandClaude Opus 4.5 24280fdbd5 Add STL thumbnail generation support
- Add trimesh and matplotlib dependencies for software-based 3D rendering
- Create stl_thumbnail service with generate_stl_thumbnail() function
- Handle mesh simplification for large files (>100k vertices)
- Auto-generate thumbnails during STL file upload and ZIP extraction
- Add POST /library/files/{id}/regenerate-thumbnail endpoint
- Add POST /library/generate-stl-thumbnails batch endpoint
- Add "Generate Thumbnails" button to file manager toolbar
- Add "Regenerate Thumbnail" option to file context menu
- Add unit and integration tests for new functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 15:43:04 +01:00
maziggy d2c720e70f Updated CI 2026-01-29 15:10:34 +01:00
maziggy 86ad13398a Updated CI 2026-01-29 13:31:07 +01:00
maziggy 54abee53f8 Updated Github workflow 2026-01-28 09:15:46 +01:00
maziggy a1c59fd6cb Updated the workflow:
- Changed stale-issue-label from feedback to stale (so stale issues get the "stale" label)
- Added remove-issue-labels: 'feedback' to remove the feedback label when issues are auto-closed
2026-01-28 07:13:35 +01:00
maziggy 56efb44c4f Added explicit permissions: issues: write 2026-01-27 11:44:23 +01:00
maziggy aa5ab135c7 Added stale issues workflow 2026-01-27 11:15:13 +01:00
maziggy 51df60cb91 Fixed CI 2026-01-26 15:53:54 +01:00
maziggy 2da519a86e Replace python-jose with PyJWT to eliminate ecdsa vulnerability 2026-01-26 13:25:07 +01:00
maziggy 580225a38d Add security scanning to CI pipeline
- Add pip-audit check to PR workflow (non-blocking warning)
- Add npm audit check to PR workflow (non-blocking, high severity only)
- Create scheduled weekly security audit workflow that:
  - Runs strict pip-audit and npm audit
  - Creates/updates GitHub issues when vulnerabilities found
  - Uploads audit results as artifacts
  - Supports manual trigger via workflow_dispatch
2026-01-26 13:21:02 +01:00
maziggy 164d22f2bb Add security scanning to CI pipeline
- Add pip-audit check to PR workflow (non-blocking warning)
- Add npm audit check to PR workflow (non-blocking warning)
- Create scheduled weekly security audit workflow that:
  - Runs strict pip-audit and npm audit
  - Creates/updates GitHub issues when vulnerabilities found
  - Uploads audit results as artifacts
  - Supports manual trigger via workflow_dispatch
2026-01-26 13:18:29 +01:00
MartinNYHC 1cbde60e90 Merge pull request #142 from maziggy/0.1.6b11
v0.1.6b11

  **New Features**

  Optional Authentication & User Management (PR #117)
  - Enable password protection for your BamBuddy instance
  - Multi-user support with admin and regular user roles
  - User management page in Settings for admins
  - Login page with session handling
  - Initial setup wizard for first-time configuration
  - API key support for programmatic access

  Home Assistant Energy Sensor Support (#119)
  - Configure dedicated power (W), energy today (kWh), and total energy (kWh) sensors for HA smart plugs
  - Enables energy tracking for plugs that expose data as separate sensors (Tapo P110M, IKEA Zigbee2mqtt, etc.)
  - Searchable dropdowns for selecting HA entities and energy sensors
  - Print energy tracking now works for HA plugs, not just Tasmota

  ZIP File Support in File Manager (#121)
  - Upload ZIP files to automatically extract contents
  - Option to preserve folder structure or flatten files

  Finish Photo URL in Notifications (#126)
  - New {finish_photo_url} template variable for print_complete, print_failed, print_stopped events
  - Photo capture completes before notification is sent
  - New External URL setting in Settings → Network for constructing URLs for external services

  Camera Viewer Improvements (#132)
  - Proper zoom and fullscreen support for both embedded and window viewing modes

  **Bug Fixes**

  - Print Time Stats (#137): Quick Stats now uses actual elapsed time instead of slicer estimates; cancelled prints only count time actually printed
  - Skip Objects Modal Overflow (#134): Modal now scrollable when printing many objects
  - Mattermost/Slack Webhooks (#133): Added "Slack / Mattermost" payload format option for compatibility
  - Camera Protocol Detection (#127): Fixed P2S and other models reporting internal codes (e.g., "N7") not being recognized for RTSP
  - Filament Cost Setting: Default filament cost setting now properly used instead of hardcoded value
  - Spoolman Tag Field (#123): Auto-creates required 'tag' extra field on Spoolman connect
  - Telegram Markdown: Fixed parsing errors when messages contain URLs
  - Re-auth Setup: Fixed authentication re-setup flow

  **Improvements**

  - Rearranged Network settings cards (Home Assistant moved to right column above MQTT)
  - Delete operations in File Manager now show loading indicator
  - P2S added to printer model dropdown
  - GitHub issue template updated with Support Package instructions
  - Added timeouts to GitHub CI runner

  **Internal**

  - Added internal model code mapping for camera protocol detection (BL-P001, C13, O1D, N7, etc.)
  - New tests for ZIP extraction, HA energy sensors, and authentication
  - Updated CI configuration
v0.1.6b11
2026-01-23 11:31:56 +01:00
maziggy ec83593456 Merge remote-tracking branch 'origin/main' into 0.1.6b11
# Conflicts:
#	backend/app/api/routes/auth.py
#	frontend/src/contexts/AuthContext.tsx
#	frontend/src/pages/SetupPage.tsx
#	frontend/src/pages/UsersPage.tsx
2026-01-23 11:19:49 +01:00
maziggy f8220e8931 Changed version 2026-01-23 10:59:21 +01:00
maziggy 179499359d Rearranged network setting cards 2026-01-23 10:10:13 +01:00
maziggy 6225fac398 Multiple fixes and ZIP file support in File Manager
Features:
  - ZIP file support in File Manager (Issue #121): Upload ZIP files to
    automatically extract contents with option to preserve folder structure
  - Delete operation loading indicator: Shows progress during folder/file
    deletion operations

Fixed:
  - Print time stats using actual elapsed time instead of slicer estimates
    (Issue #137)
  - Skip objects modal overflow with scrollable list for many objects
    (Issue #134)

Removed:
  - Duplicate badge feature from File Manager (per user request)

Tests:
  - Added ZIP extraction backend tests (5 tests)
  - Added ConfirmModal loading state frontend tests (5 tests)
2026-01-23 09:02:25 +01:00
maziggy ea570a12f5 Skip objects modal overflow
Modal now has max height (85vh) with scrollable object list when printing many items on the bed

Closes #134
2026-01-23 08:24:30 +01:00
maziggy a6b1c5adbe Print time stats using slicer estimates
Quick Stats "Print Time" now uses actual elapsed time (`completed_at - started_at`) instead of slicer estimates;
cancelled prints only count time actually printed

Closes #137
2026-01-23 08:20:19 +01:00
maziggy ecd6c3e152 Updated README 2026-01-23 08:09:39 +01:00
maziggy d6f76db81a Updated README 2026-01-23 08:09:24 +01:00
maziggy 79333045aa Updated README 2026-01-23 08:07:48 +01:00
maziggy df66f9aa14 Updated README 2026-01-23 08:07:29 +01:00
maziggy 3991c2b154 Updated CHANGELOG 2026-01-23 07:56:44 +01:00
maziggy 4a3e42db36 Home Assistant smart plug improvements:
- Add search parameter to /ha/entities endpoint for searching all entities
- Replace entity dropdown with searchable combobox (type to filter)
- Default shows switch/light/input_boolean; search queries all domains
- Make all three energy sensor dropdowns searchable (Power, Energy Today, Total)
- Each dropdown filters by entity_id or friendly_name
- Shows entity details (name, id, state, unit) in dropdown options

Fixes issue where HA plugs with non-standard entity naming couldn't
find their related power/energy sensors.
2026-01-23 07:52:56 +01:00
maziggy f9915237a2 The camera viewer now has proper zoom and fullscreen support for both viewing modes
Closes #132
2026-01-23 07:28:39 +01:00
maziggy 6c5aad1b73 Fix: Mattermost/Slack Webhook Support
Root Cause: The generic webhook sent a JSON payload with custom field names plus timestamp and source fields. Mattermost/Slack webhooks only accept {"text": "..."}
format and reject unknown fields with HTTP 400.

Users just need to select "Slack / Mattermost" from the Payload Format dropdown when configuring their Mattermost webhook.

Closes #133
2026-01-23 07:13:46 +01:00
maziggy 08e4797544 Fix: Internal Model Code Detection for Camera Protocol
Root Cause: P2S (and other newer models) may report their model as internal codes (e.g., "N7" for P2S) rather than display names in MQTT/SSDP responses. The camera code
only checked for display names like "P2S", causing it to incorrectly use the chamber image protocol (for A1/P1) instead of RTSP.

Internal Code Mapping:
BL-P001 → X1/X1C (RTSP)
C13     → X1E    (RTSP)
O1D     → H2D    (RTSP)
O1C     → H2C    (RTSP)
O1S     → H2S    (RTSP)
O1E     → H2D Pro (RTSP)
N7      → P2S    (RTSP)
C11     → P1P    (Chamber)
C12     → P1S    (Chamber)
N2S     → A1     (Chamber)
N1      → A1 Mini (Chamber)

Closes #127
2026-01-23 07:09:22 +01:00
MartinNYHC ce8968f893 Merge pull request #128 from JesseFPV/0.1.6b11
Fixed re-auth setup and gitignore node modules
2026-01-22 12:33:05 +01:00
maziggy 4babcf6187 Updated CI 2026-01-22 12:32:45 +01:00
JesseFPV 3a848643c0 Fixed re-auth setup and gitignore node modules 2026-01-22 12:21:07 +01:00
maziggy 0c864dc3f4 Updated Github issue template
- Support Package section - A markdown block with instructions to download the support package
  from Settings → System Info, plus a link to the debug logging guide
- P2S added - Added to the printer model dropdown between P1P and A1
2026-01-22 10:50:14 +01:00
maziggy 821d3ba748 Updated Github issue template
- Support Package section - A markdown block with instructions to download the support package
  from Settings → System Info, plus a link to the debug logging guide
- P2S added - Added to the printer model dropdown between P1P and A1
2026-01-22 10:48:55 +01:00
maziggy 0354218657 Add finish photo URL to notification templates (Issue #126)
- Add {finish_photo_url} template variable for print_complete, print_failed,
  print_stopped events
- Photo capture now completes before notification is sent (ensures image exists)
- Add External URL setting in Settings → Network (auto-detects from browser)
- Full URL constructed using external_url setting for external services
- Fix Telegram Markdown parsing error when messages contain URLs
- Add backend schema for external_url setting
- Add unit test for finish_photo_url variable passing
2026-01-22 10:42:20 +01:00
maziggy 0caa68b77f Auto-create Spoolman 'tag' extra field on connect (Issue #123)
The 'tag' extra field is required in Spoolman for storing RFID/UUID
identifiers that link Bambu Lab spools to Spoolman entries. Previously,
users had to manually create this field in Spoolman, causing sync
failures for fresh installations.

Added ensure_tag_extra_field() method to SpoolmanClient that:
- Checks if the 'tag' field exists via GET /api/v1/field/spool/tag
- Creates it via POST if missing

The method is called automatically:
- On app startup when auto-connecting to Spoolman
- When user clicks "Connect" in Spoolman settings
2026-01-22 09:23:40 +01:00
maziggy 01ab2cbb45 Fix filament cost not using default setting
The "Default filament cost (per kg)" setting was being ignored when
calculating filament costs. A hardcoded value of 25.0 was used instead.

All three now read the default_filament_cost setting from the database,
falling back to 25.0 only if the setting doesn't exist.

Users can run "Recalculate Costs" from the Archives page to update
existing archives with the correct default cost.
2026-01-22 09:13:48 +01:00
maziggy d6935c9253 Add Home Assistant energy sensor entity support (Issue #119)
Home Assistant smart plugs can now use separate sensor entities for
energy monitoring, enabling energy tracking for plugs that expose
power/energy data as separate sensors (Tapo, IKEA Zigbee2mqtt, etc.).

Features:
- Configure dedicated power (W), today (kWh), and total (kWh) sensors
- New API endpoint GET /api/v1/smart-plugs/ha/sensors lists available sensors
- Falls back to switch entity attributes if no sensors configured
- Print energy tracking now works for HA plugs (not just Tasmota)

Backend:
- Added ha_power_entity, ha_energy_today_entity, ha_energy_total_entity
  fields to SmartPlug model
- Updated get_energy() to fetch from configured sensor entities
- Added _get_plug_energy() helper to handle both plug types
- Updated backup/restore to include new fields
- Added database migration for new columns

Frontend:
- Added energy sensor dropdowns in AddSmartPlugModal (shown for HA plugs)
- Dropdowns filtered by unit (W/kW for power, kWh/Wh for energy)

Tests:
- Added 4 new integration tests for HA energy sensor functionality

Docs:
- Updated README with new feature
- Updated CHANGELOG with 0.1.6b11 entry
2026-01-22 09:04:40 +01:00
maziggy fa9a154c5d Added back navigation to user management page 2026-01-21 16:51:17 +01:00
maziggy f334c74d02 Post tasks for PR #117 (Authentication Feature)
Fixes:

  - Fixed is_auth_enabled() returning None instead of False when setting doesn't exist (in both auth.py and routes/auth.py)
  - Fixed get_current_user() crashing when credentials is None
  - Added missing async_session patch in conftest.py for auth tests

  Backup/Restore - Added Users Support
  - Added include_users parameter to backup export
  - Users are exported with username, role, and is_active (passwords excluded for security)
  - Restore creates users with temporary passwords that must be changed

Backend Tests - 16 New Auth Tests
  - test_auth_api.py with tests for:
  - Auth status endpoint
  - Auth setup (enable/disable)
  - Login flow (success, invalid credentials, auth disabled)
  - /me endpoint with/without token
  - User management (list, create, update, delete)
  - Auth disable

Frontend Tests - 6 New Login Tests
  - LoginPage.test.tsx with tests for:
  - Form rendering
  - Input validation
  - Login submission
  - Loading states

Documentation Updates
  - CHANGELOG.md/README.md: Added authentication feature description
  - Website (features.html): Added new "Optional Authentication" section
  - Wiki: Created authentication.md with full documentation
  - Wiki index: Added authentication to features list
2026-01-21 16:41:37 +01:00
maziggy dc30856238 Fixed background tests to support new authentication and user module 2026-01-21 16:25:35 +01:00
maziggy 2e7caf38da Added from future import annotations which defers annotation evaluation so APIKey doesn't need to be imported at runtime. 2026-01-21 16:15:53 +01:00
maziggy af49d7686e Added optional authentication and user management 2026-01-21 16:04:50 +01:00
maziggy 7bca0d733f Fixed Github CI 2026-01-21 16:02:30 +01:00
MartinNYHC 8614252aa8 Merge pull request #118 from maziggy/revert-117-main
Revert "Added optional authentication and user management"
2026-01-21 15:59:13 +01:00
MartinNYHC a9f340f2c9 Revert "Added optional authentication and user management" 2026-01-21 15:58:24 +01:00
MartinNYHC c3cbdd8d73 Merge pull request #117 from JesseFPV/main
Added optional authentication and user management
2026-01-21 15:58:06 +01:00
JesseFPV 6e5cc55190 Fixed auth check and conftest 2026-01-21 15:36:39 +01:00
maziggy 0d1056ded4 Added timeouts to Github CI runner
- Backend tests: 10 min (step-level)
- Frontend tests: 10 min (step-level)
- Docker tests: 20 min (job-level, since it has multiple build/test steps)
2026-01-21 15:27:24 +01:00
JesseFPV deeaabfa8d Fixed frontend lint test error 2026-01-21 15:13:27 +01:00
JesseFPV d731cd2a91 Fixed lint errors 2026-01-21 14:50:31 +01:00