Commit graph dashcam-transfer/dashcam-transfer.py
Author SHA1 Message Date
Eddy de Vink
0461fbc074 fix: service draait als uid 1000 (eddy), eigenaar van de exfat-SSD
Root was bad practice (oude staat); aiaiaiaiagent (uid 1001) kon geen
chmod/utime op de exfat-mount (uid=1000) -> elke copy2-kopie faalde met
EPERM (10-15, 0/68). Correcte laag is de identity-laag, niet de kopieer-
primitive: User=eddy (mount-eigenaar). copy2 behouden (timestamps op
doel). Matrix-secrets sherpa-token/eddy-report-room -> mode 640 group
eddy + traverse op /home/aiaiaiaiagent zodat de notificatie werkt.

Revert eerdere copyfile-workaround (dd46ad6/69d08ba): die maskeerde de
mismatch in plaats van de principal te aligneren.
2026-10-15 20:25:50 +02:00
Eddy de Vink
69d08ba8ba fix: kopieer met shutil.copyfile (data-only) i.p.v. copy/copy2
copy doet na copyfile ook copymode (os.chmod); op exfat met mountuid=1000
zijn alle bestanden eigendom van uid 1000 en wordt chmod/utime voor de
niet-eigenaar service-gebruiker geweigerd (EPERM op elke kopie, ook na de
copy2-fix). copyfile schrijft alleen data; verificatie gebeurt op grootte
en mode/opnametijd voegen op exfat niets toe.
2026-10-15 20:17:09 +02:00
Eddy de Vink
dd46ad6d3c fix: kopieer met shutil.copy i.p.v. copy2 (EPERM op exfat voor niet-eigenaar)
copy2 preserveert timestamps via os.utime; de exfat-SSD draait met
uid=1000,allow_utime=0022, waardoor een niet-eigenaar (service-gebruiker
aiaiaiaiagent sinds 2026-10-13, voorheen root) geen willekeurige
tijdsstempels mag zetten -> EPERM op elke kopie. Mode is op exfat altijd
0777 en het opnamemoment staat al in de bestandsnaam.
2026-10-15 20:09:55 +02:00
Eddy de Vink
55c282906e feat: verstuur dashcam-notificatie via Matrix (sherpa) i.p.v. WhatsApp
wwebjs-api is vervangen door wuzapi; notificatiekanaal is nu Matrix:
- send_matrix_notification() POST -> sherpa compat-token uit
  ~/whatsed-new/secrets/sherpa-token naar eddy-report-room
- zelfde patronen als watchdog-report/WAN IP Guard
- tests: SendWhatsappTest -> SendMatrixTest (+2 asserts)
2026-10-13 23:49:18 +02:00
Eddy de Vink
8cc04ea409 feat: harden dashcam transfer tegen flakke SD-lezer + stale-mount cleanup
- dashcam-transfer.py: log echte OSError (shutil.copy2 i.p.v. cp), pre-flight
  leesbaarheidscheck voor ruimte-wissen, retry (3x) + early-abort (5x), guards
  op bestandssysteem-calls, WhatsApp GESTOPT bij defecte kaart
- dashcam-transfer-mount.sh: skip als service al draait, read-only fsck.exfat
  health check, %k device-naam doorgeven
- dashcam-transfer-cleanup.sh: nieuw - ruimt stale mount op bij udev REMOVE
- udev/99-dashcam-trigger.rules: ADD + REMOVE regels met %k
- tests: 20 python + 7 mount + 12 cleanup checks
- README: architectuur, robuustheid, deploy-instructies
2026-08-11 20:37:48 +02:00
Eddy de Vink
c7e046f4ab fix: corrigeer WHATSAPP_API URL naar localhost:3001 (nextcloud)
- WHATSAPP_API gebruikte 100.97.199.84:3000 (Mac Mini Tailscale IP, verkeerde poort)
- Gewijzigd naar localhost:3001 (wwebjs-api container op nextcloud zelf)
- Comment toegevoegd om verwarring te voorkomen
- README herschreven met WhatsApp notificatie sectie en correcte architectuur
- Verouderd plan geüpdatet met juiste URL
2026-06-23 11:04:39 +02:00
Eddy de Vink
c57363fe24 Voeg GB-data toe aan WhatsApp notificatie 2026-06-22 10:29:04 +02:00
Eddy de Vink
e0b36a5b9c feat: stuur WhatsApp notificatie na dashcam transfer 2026-06-07 16:18:43 +02:00
Eddy de Vink
4b4179e01c feat: copy+verify+delete, --limit flag, fix exfat compat 2026-05-29 19:54:02 +02:00
Eddy de Vink
80ebd79451 feat: add dashcam-transfer.py script 2026-05-29 19:37:50 +02:00