Config export/import: tame_vendor_packages never exported; fleet mode skips preference keys same-hardware fleets need; fleet-credentials recipe undocumented

Aperta
#48 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
28/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
android, kotlin

Direzione di ricerca

Read SettingsRegistry.kt and Config.kt to trace why tame_vendor_packages is absent from exports, then inspect fleet import scope handling and docs/provisioning.md. The issue raises three separate outcomes: register the setting with an agreed scope, decide whether profile-matched fleet imports apply non-secret device keys, and document fleet provisioning with explicit credential flags and per-panel --id.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

While deploying a 16-panel NSPanel Pro fleet from one panel's --export bundle (same context as #46 / #47), a freshly provisioned panel came up visibly barer than the source panel even after --restore-fleet reported success. Comparing the two panels' full /api/v1/config key-by-key surfaced three distinct findings — one bug, one design question, one docs gap.

1. Bug: tame_vendor_packages is missing from every export bundle

tame_vendor_packages exists in Config.kt and is settable via POST /api/v1/config, but it is not registered in SettingsRegistry.kt — so it never travels in an export bundle. Consequences:

  • Full same-panel --restore (the disaster-recovery / like-for-like-replacement path) silently loses the tame list — the replacement panel comes back with the vendor apps untamed and nothing reports the drop.
  • Fleet deployments have no way to carry it at all; each panel must be re-tamed by hand.

This looks like an omission rather than a scope decision. Happy to PR the registration if you confirm which scope you'd want (DEVICE fixes the restore loss; arguably it is PORTABLE, since taming is a no-op for package names that aren't present on the target).

2. Design question: DEVICE-scoped keys that same-hardware fleets want cloned

import?mode=fleet applies only Scope.PORTABLE, and SettingSpec's scope defaults to DEVICE, so preference-like keys sit in the skip pile. Deploying nsp1's bundle to an identical panel skipped, among others:

key source panel fresh panel after fleet restore
navbar_mode Swipe reveal Off
self_update on off
silence_boot_chime on off
zigbee_router on off
manufacturer / model Sonoff / NS Panel Pro empty

For a mixed-hardware fleet the conservative default makes sense (e.g. zigbee_router on a panel without the radio). But for the common case — N identical panels — the operator ends up hand-applying these per panel via the config API.

Suggestion: since both the bundle and the live panel know their hardware profile id (e.g. nspanel-pro@26b9e6493565), the import endpoint could support a profile-matched fleet mode that also applies non-secret DEVICE keys when the source and target profiles match, keeping today's behavior when they differ. Alternatively (or additionally), some of the above may simply deserve PORTABLE. zigbee_router has one extra wrinkle worth noting for any future auto-apply: it acts like an action (starts the vendor gateway), and in my testing a value batched together with other settings could get lost across the settings restart — applying it separately with a verify/retry was reliable.

3. Docs gap: fleet deployments with shared credentials

--restore-fleet correctly never carries secrets, and provision.sh already has the right explicit channels (--ha-token, --mqtt-user, --mqtt-pass). But the combination isn't spelled out anywhere: a fleet bootstrapped from an export bundle alone comes up with MQTT discovered-but-auth-failed, which looks like a broker problem rather than a deliberately-skipped secret. A short "deploying a fleet from one panel's export" recipe in docs/provisioning.md — bundle for portable settings, explicit flags for the shared secrets, per-panel --id — would have saved me a diagnosis round.

I have the 16-panel fleet available to test any of the above; happy to send PRs for whichever directions you'd take.

Lingua principale
Kotlin
Stelle
63
Fork
5
Merge medio
1g 5h
PR unite (30g)
11

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di panel-assistant/android

Tutte le issue di panel-assistant/android

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.