Skip to content

Installer: one module for storing settings (assistant and settings form) - #253

Merged
ThomasPohl merged 1 commit into
mainfrom
refactor/installer-shared-code
Nov 15, 2026
Merged

ThomasPohl merged 1 commit into
mainfrom
refactor/installer-shared-code

Conversation

@ThomasPohl

Copy link
Copy Markdown
Owner

The setup assistant (wizard.js) and the settings form of the advanced view (device-setup.js) each had their own hex encoding, their own list of secret settings and their own checks of the values, and the copies had drifted apart.

New web/hub-settings.js (window.trailcamSettings) holds what both need: the list of secrets, the value of a form field as it is stored (passwords untrimmed), the early checks, the config set-hex command and the text shown for it, and clearing the secret fields.

Differences that come from merging the two copies:

  • The assistant's list of secrets lacked web_password and camera_password (it has no such fields today, so nothing was shown in clear).
  • Both forms now apply the union of the checks. The settings form newly checks the WebDAV URL, the bot token, the health check URL and the web UI password before sending; the assistant newly checks the device key. The firmware checked all of them already (hub_config_rules.cpp), so only the moment of the message changes.
  • A few messages are worded the same in both places now.

Tested in headless Chrome with a simulated hub: saving in the assistant (order, hex values, an untrimmed password, masked secrets, cleared fields) and in the settings form, and the rejected values in both. Not tested on a hub.


Generated by Claude Code

wizard.js and device-setup.js each had their own hex encoding, list of
secret settings and value checks. web/hub-settings.js now holds them once;
both forms apply the same checks, which mirror hub_config_rules.cpp.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Csa4N778M5kZxErLfAfd7D
@ThomasPohl
ThomasPohl merged commit 6516997 into main Nov 15, 2026
13 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