Skip to content

Code review fixes + power control, app icon, Go tests & CI - #1

Merged
mkl159 merged 4 commits into
masterfrom
claude/code-review-verification-4h26dp
Jun 21, 2026
Merged

mkl159 merged 4 commits into
masterfrom
claude/code-review-verification-4h26dp

Conversation

@mkl159

@mkl159 mkl159 commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Résumé

Revue complète du projet MiyooDeck, corrections de qualité/sécurité, et ajout de fonctionnalités pour le rendre vraiment complet. Tout est vérifié : gofmt ✓ · go vet ✓ · go test ✓ · cross-build ARM ✓ · build frontend ✓.

🔧 Corrections (commit 76ef518)

  • Sécurité : remplacement de HasPrefix(SDCard) (qui laissait passer un voisin comme /mnt/SDCARDevil) par un helper withinSD() strict, sur les 11 contrôles d'accès fichiers.
  • i18n : textes « En jeu » et page d'erreur de connexion qui étaient codés en dur en français → déplacés dans i18n.js (le mode EN est désormais complet).
  • Bug UI : le message « écran indisponible » ne s'affichait jamais (Svelte élaguait le sélecteur CSS frère) → piloté par un état réactif imgError.
  • gofmt sur games.go, input.go, mdns.go, system.go ; bannière de version v1.1 → v1.6.
  • Docs : chemins de build erronés dans le README (miyoodeck/webdeck inexistant) corrigés.
  • Chore : .gitignore pour le binaire de dev server/webdeck.

✨ Ajouts (commit fe076a4)

  • 🔌 Contrôle d'alimentation : POST /api/system/power (reboot/poweroff) avec sync avant arrêt et réponse envoyée avant l'extinction ; boutons Redémarrer / Éteindre dans le Dashboard (confirmation + i18n FR/EN). La veille est volontairement exclue (elle couperait le WiFi et figerait le serveur).
  • 🖼️ Icône de l'app : webdeck.png aux couleurs de la marque, livré dans le package ; config.json pointe vers l'icône locale (package auto-suffisant dans le menu Onion).
  • 🧪 Tests Go (server_test.go) : withinSD, hashPin, channelTo8bit, parseVoltageFromAxp, encodeDNSName, isQueryForMiyooDeck, sum.
  • 🚀 CI/CD : ci.yml (gofmt/vet/test/build ARM/build frontend sur push & PR) et release.yml (build + zip MiyooDeck-<tag>.zip attaché à la release sur tag v*).

Vérification

gofmt -l .      # vide
go vet ./...    # OK
go test ./...   # ok
GOOS=linux GOARCH=arm GOARM=7 go build  # ARM 32-bit stripped, ~6.6 MB
npm run build   # OK

Le binaire ARM et le bundle web du package ont été régénérés.

https://claude.ai/code/session_01XmGfBz6k1Z8YFPitFjuEGp


Generated by Claude Code

claude added 4 commits June 15, 2026 10:35
…rebuild

- server: replace naive HasPrefix(SDCard) with withinSD() helper to reject
  sibling paths like /mnt/SDCARDevil (path traversal hardening)
- server: gofmt games.go, input.go, mdns.go, system.go; bump banner v1.1 -> v1.6
- frontend: move hardcoded French strings (game badge, connection-error page)
  into i18n so EN mode is fully translated
- frontend: fix live-screen 'unavailable' fallback never showing (Svelte was
  pruning the sibling CSS selector); now driven by reactive imgError state
- docs: fix wrong build paths in README (miyoodeck/webdeck -> miyoodeck)
- chore: ignore stray server/webdeck dev binary; rebuild ARM binary + www bundle
- server: add /api/system/power (reboot/poweroff) with sync-before-halt;
  response is flushed before the device goes down
- frontend: Reboot / Power off buttons on the Dashboard (confirm + i18n FR/EN)
- package: ship a brand webdeck.png app icon so it shows in the Onion menu;
  point config.json at the local icon instead of a non-shipped path
- test: add server_test.go covering withinSD, hashPin, channelTo8bit,
  parseVoltageFromAxp, encodeDNSName, isQueryForMiyooDeck, sum
- ci: add GitHub Actions — CI (gofmt/vet/test/ARM build/frontend build) and
  Release (build + zip package + attach to GitHub release on v* tags)
- docs: README features, file tree and architecture updated
- rebuild ARM binary + www bundle
Useful / important:
- system: read SoC temperature (/sys/class/thermal) -> /api/system + WS stats;
  new Temperature card on the Dashboard with a hot-threshold color
- brightness: /api/system/brightness GET/POST via /sys/class/backlight;
  debounced brightness slider on the Dashboard (hidden if unsupported)

Useful + fun:
- search: /api/search?q= scans every system for matching ROMs; global search
  box in the Games tab shows cross-system results with a system tag
- random: /api/random[?system=] picks a ROM at random; '🎲 Surprise me'
  button launches it instantly

Futile:
- a live clock in the header

- i18n FR/EN for all new strings; README features/architecture updated
- rebuild ARM binary + www bundle
Important / useful:
- favorites: persist favorite ROMs to SD (/api/favorites GET/POST); ★ toggle
  on every ROM row and a dedicated Favorites view in the Games tab
- quit-game: /api/system/quit-game cleanly stops RetroArch (saves first);
  button shown on the Dashboard while a game runs
- logs: /api/logs returns the tail of the server log; collapsible viewer
- version: public /api/version endpoint, shown in the header

Brain breakers:
- stream: native MJPEG live view (/api/stream.mjpeg, multipart/x-mixed-replace),
  toggled from the Dashboard for a smooth video-like screen
- macros: /api/input/macro plays a server-side button sequence; Konami preset
  in the on-screen controller

Futile:
- live CPU sparkline on the Dashboard
- keyboard Konami code -> rainbow party mode
- header clock + version badge

- i18n FR/EN for all new strings; README features/architecture updated
- bump version to 1.7; rebuild ARM binary + www bundle
@mkl159
mkl159 merged commit 9c0f9e0 into master Jun 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants