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

Đang mở
#48 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
28/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
android, kotlin
Lĩnh vực
backend, documentation

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Kotlin
Star
63
Fork
5
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của panel-assistant/android

Tất cả issue của panel-assistant/android

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.