Commit Graph

62 Commits

Author SHA1 Message Date
1ed5012a95 fix: key melody binary storage on pid instead of uid, add migration script
melody.uid is never actually populated anywhere in MelodyForm.jsx, so keying
local .bsm storage on it (as the previous commit did) would silently break
for every existing melody. pid is the correct key anyway: it identifies the
underlying archetype binary, and multiple melodies legitimately share one
pid (each remaps the same note sequence to different bells/speed/duration
via its own settings). Deletion is now share-aware — a melody's binary is
only removed from disk once no other melody still references its pid.

Also adds backend/scripts/migrate_melody_binaries_to_local.py to backfill
existing melodies from their old Firebase URLs to local storage, with
--dry-run support and a warning list for pids whose melodies point at
different source files (a pre-existing data issue, flagged for manual
review via each melody's playback button rather than silently resolved).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-06 10:53:25 +03:00
72f7e00990 feat: serve melody .bsm binaries over plain HTTP instead of Firebase Storage
ESP32 devices can't spare the 40KB+ RAM a TLS client needs, so Firebase
Storage's HTTPS-only download URLs were blocking melody downloads. Binaries
are now written to local disk (./data/melody_binaries) and served through a
new unauthenticated /api/melodies/download/{pid} route, exposed publicly on
a separate melodies.bellsystems.net vhost (plain HTTP, no TLS) so the main
console domain can stay HTTPS-only with no exceptions. Preview audio still
uses Firebase Storage since it's only ever fetched by the HTTPS admin UI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-06 09:41:24 +03:00
024ba88470 fix: route manufacturing audit logs to shared Postgres audit log
- Manufacturing router now uses shared/audit.log_action (Postgres) instead
  of the separate manufacturing/audit.py (SQLite mfg_audit_log), so all
  manufacturing events appear in the Log Viewer
- Added log_action calls to 5 previously unlogged endpoints: lifecycle
  patch, lifecycle create, lifecycle delete, flash asset upload, flash
  asset note
- Removed the now-redundant /manufacturing/audit-log endpoint
- Log Viewer restricted to sysadmin only: backend uses require_sysadmin
  (was require_admin_or_above), frontend adds role guard on the page
- Fixed Action badge column clipping: table-layout auto + whiteSpace nowrap
  so the column sizes to fit the widest badge (Status Change)
- Added device_batch entity type to Log Viewer entity labels and filters

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 19:21:39 +03:00
6a958a8d7d update: Add Global Search on Header, Add Global Audit log for all actions. 2026-04-19 15:41:29 +03:00
4f35bef6e3 fix: login issue #2 2026-04-17 16:04:12 +03:00
2ef199e4c5 fix: login issue 2026-04-17 16:01:50 +03:00
a605143c5d Phase 5 of Migration 2026-04-17 15:51:27 +03:00
da4608c937 Phase 4 of Migration 2026-04-17 15:44:17 +03:00
83361fad77 Phase 3 of Migration 2026-04-17 15:39:29 +03:00
c7d5206d0c fix: deduplicate order_number collisions during Firestore orders migration 2026-04-17 15:30:45 +03:00
914027e580 fix: use full doc.id as fallback order_number to avoid unique constraint collision 2026-04-17 15:28:28 +03:00
b70753d805 Phase 2 of Migration 2026-04-17 15:25:58 +03:00
a7b73b0564 fix: move SET LOCAL inside transaction in quotation/media/comms migration scripts 2026-04-17 15:15:43 +03:00
4c2400b596 Phase 1 of Migration. Running Scripts 2026-04-17 15:11:12 +03:00
0a8a42d69b Initial Switch to V2. Completely Overhauled Backend, Frontend and General Structure. 2026-04-17 14:45:30 +03:00
eb773c5531 fix: added ACL fix script 2026-04-03 18:08:07 +03:00
ea8b2c96d6 feature: added archetype migration script 2026-04-03 17:46:39 +03:00
7a5321c097 update: Added NVS Gen on the Flasher 2026-03-27 11:17:10 +02:00
b2d1e2bdc4 feature: Added Transactions and major Order System Overhaul 2026-03-25 10:32:47 +02:00
2d57c75d2f fix: Cloudflash now supports full-wipe before flashing 2026-03-20 08:40:20 +02:00
d8ba64da55 fix: NVS Generator. cosmetic: Changed CloudFlash page a bit 2026-03-19 21:01:17 +02:00
29bbaead86 update: added assets manager and extra nvs settings on cloudflash 2026-03-19 11:11:29 +02:00
d0ac4f1d91 update: overhauled firmware ui. Added public flash page. 2026-03-18 17:49:40 +02:00
4381a6681d update: firmware and provisioning now supports bootloader and partition tables 2026-03-16 08:52:58 +02:00
15c419b7bf fix: devices list accepts ips as single strings / various ui changes 2026-03-14 10:58:25 +02:00
6f9fd5cba3 fix: Bugs created after the overhaul, performance and layout fixes 2026-03-08 22:30:56 +02:00
c62188fda6 update: Major Overhaul to all subsystems 2026-03-07 11:36:46 +02:00
810e81b323 fix: Various fixes. Mail, UI, Flash etc 2026-02-27 14:32:24 +02:00
7585e43b52 style: Updated the overall UI of the provisining pages 2026-02-27 12:23:17 +02:00
7f51c60062 fix: Trying to fix Auto Restart. And Fixed MQTT admin auth 2026-02-27 10:17:38 +02:00
4ea8e56485 fix: configure gitea webhook auto-deploy, fix NVS CRC, and improve flash UI
- Add deploy-host.sh for webhook-triggered docker redeploy
- Update docker-compose.yml and nginx.conf for auto-pull setup
- Fix vite.config.js and admin router for deployment environment
- Fix NVS CRC seed to use 0xFFFFFFFF to match esp_rom_crc32_le
- Add dual-panel flash UI: esptool log + live 115200 serial monitor
- Auto-reset device via RTS after flash (no manual power cycle needed)
- Clean up Header.jsx debug title text

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 09:19:07 +02:00
57259c2c2f feat: Phase 6, Device provisioning and deployment of updates on git-pull 2026-02-27 04:42:41 +02:00
32a2634739 feat: Phase 3 manufacturing + firmware management 2026-02-27 02:47:08 +02:00
2f610633c4 Add .dockerignore to prevent service account being baked into image 2026-02-25 22:16:43 +02:00
8cb639c1bd First Production Push 2026-02-25 21:29:56 +02:00
cd218a55fe CODEX - Added modal colours for the Bells 2026-02-23 19:20:30 +02:00
04b2a0bcb8 CODEX - More changes to the binary files, listing and storing 2026-02-23 13:58:40 +02:00
d390bdac0d CODEX - Added Warning sign if Archetype is missing 2026-02-23 13:21:42 +02:00
9437307e0f Fixed minor issues with the Archetypes 2026-02-22 19:38:57 +02:00
ae4b31328f Fixes and Changes again 2026-02-22 17:28:27 +02:00
ef31852fd8 Further improvements 2026-02-22 15:32:45 +02:00
c5ef4406f6 improvemtns again, to the archetype builder, and playback 2026-02-22 15:03:23 +02:00
bdddc304ee Fixes to the Download Errors 2026-02-22 14:16:06 +02:00
cfae55025d First Fixes/Adjustments to the MelodyBuilder and SpeedCalc 2026-02-22 13:59:31 +02:00
8703c4fe26 Added SpeedCalc and MelodyBuilder. Evaluation Pending 2026-02-22 13:17:54 +02:00
f09979c653 Major overhaul to the Notes/Issues. Minor tweaks to the UI. Added Profile photos 2026-02-19 06:30:57 +02:00
124db39183 added device images and fixed layout issues 2026-02-18 23:17:09 +02:00
aad8942d65 Added Draft Melodies. Further improvements to the UI 2026-02-18 19:33:59 +02:00
dbd15c00f8 Added Roles and Permissions. Some minor UI fixes 2026-02-18 13:12:55 +02:00
f54cdd525d Adjustments to the Devices Layout 2026-02-18 10:22:41 +02:00