Fix DDNS registration and wizard pre-fill after installer run
Unit Tests / test (push) Successful in 15m29s

DDNS registration (setup_cell.py):
- Replace pyotp dependency with stdlib TOTP (HMAC-SHA1, RFC 6238)
  pyotp is only available inside the Docker container, not on the host
  where setup_cell.py runs — registration was silently skipped every time
- OTP header still sent if generation succeeds; omitted gracefully if not

Wizard pre-fill (setup_manager + Setup.jsx):
- GET /api/setup/status now returns 'preconfigured' dict with cell_name,
  domain_mode, domain_name, and provider tokens from installer-written config
- Setup.jsx fetches status on mount and pre-fills all form state so the
  user only needs to set password, services, and timezone — not re-enter
  the identity they already configured in the bash installer
- Fails silently so wizard still works on fresh installs with no config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 12:22:53 -04:00
parent 579f49ba13
commit f550f04ce2
4 changed files with 68 additions and 15 deletions
+20
View File
@@ -300,3 +300,23 @@ def test_get_setup_status_timezones_match_module_constant(setup_manager, mock_co
mock_config_manager.get_identity.return_value = {}
status = setup_manager.get_setup_status()
assert status['available_timezones'] == AVAILABLE_TIMEZONES
def test_get_setup_status_preconfigured_empty_when_identity_blank(setup_manager, mock_config_manager):
mock_config_manager.get_identity.return_value = {}
status = setup_manager.get_setup_status()
assert status['preconfigured'] == {}
def test_get_setup_status_preconfigured_returns_installer_values(setup_manager, mock_config_manager):
mock_config_manager.get_identity.return_value = {
'cell_name': 'myhome',
'domain_mode': 'pic_ngo',
'domain_name': 'myhome.pic.ngo',
}
status = setup_manager.get_setup_status()
pre = status['preconfigured']
assert pre['cell_name'] == 'myhome'
assert pre['domain_mode'] == 'pic_ngo'
assert pre['domain_name'] == 'myhome.pic.ngo'
assert 'cloudflare_api_token' not in pre