diff --git a/docs/releases/console-3.1.30.md b/docs/releases/console-3.1.30.md new file mode 100644 index 0000000..b90b8ad --- /dev/null +++ b/docs/releases/console-3.1.30.md @@ -0,0 +1,10 @@ +# Console 3.1.30 — complete Git update domain audit + +- All ten Console stages use the shared stage_versions/git_delivery owner for + catalog checks, individual updates, update-all, snapshots and package delivery. +- Bootstrap accepts legacy saved repository URLs but always connects to + git.iomatex.com, including network retries; no fallback to git.it-screen.com. +- Preserve TLS verification, exact-host validation, commit pinning and checksums. +- New snapshots, credentials, stage config and APT sources store the new host. + Legacy virtual APT addresses remain readable and resolve through the new host. +- Client binaries remain 5.1.44; this release updates Console/delivery only. diff --git a/docs/releases/console-update-domain-audit-2026-10-29.md b/docs/releases/console-update-domain-audit-2026-10-29.md new file mode 100644 index 0000000..0ea079f --- /dev/null +++ b/docs/releases/console-update-domain-audit-2026-10-29.md @@ -0,0 +1,34 @@ +# Debian Console update transport audit — 2026-10-29 + +Published target: Console 3.1.30, client 5.1.44 unchanged. + +| Entry | Shared owner | Network destination | +| --- | --- | --- | +| Console version check `/api/stages/check` | stage_versions.refresh → git_delivery.open_git | HTTPS git.iomatex.com | +| Single stage `/api/stages/install` | stage_versions.install → git_delivery.bootstrap | HTTPS git.iomatex.com | +| Update all `/api/stages/install-all` | same owner, ordered stage queue | HTTPS git.iomatex.com | +| Initial installer, including old `--git-url` input | bootstrap then shared delivery owner | HTTPS git.iomatex.com, including retries | +| APT packages and native runtime dependencies | custom iomatex APT method → download_object → open_git | HTTPS git.iomatex.com | +| Client ELF and Zigbee2MQTT archive | git_delivery fetch → download_object | HTTPS git.iomatex.com | +| Snapshot/credential/stage/source persistence | bootstrap/activate/configure | canonical new host | + +Audited stages: environment, Wi-Fi/AP, MQTT, Zigbee2MQTT, Console, +Avahi/mDNS, Cockpit, display/client, IP streaming, reverse tunnels. +They use offline/require-local.sh (Zigbee2MQTT through its shared library). +The optional dashboard bridge installer uses the same delivery owner. +The legacy full-clone functions in local_installer.sh are unreachable: its Git +entry refuses to run and directs the user to the lightweight bootstrap. + +Old host literals remain only as accepted migration inputs and virtual APT +identifiers, test fixtures, or historical documentation. They are not network +fallback destinations. Registration servers and local service health URLs are +separate contracts and are unchanged. Build-time Debian dependency collection +in offline/build.sh is not an Edge updater. + +Security remains: exact allowlisted hosts, TLS verification, redirect refusal, +commit-pinned contents and package hashes, authenticated Console actions, +explicit installation confirmation and shared installation lock. + +Regression coverage: bootstrap retry with either input alias; stage catalog +refresh with legacy/new/missing host; legacy snapshot persistence; package +transport; individual/bulk Console API permission and confirmation tests. diff --git a/install_iomatex_edge.sh b/install_iomatex_edge.sh index 4e20d61..e81e798 100755 --- a/install_iomatex_edge.sh +++ b/install_iomatex_edge.sh @@ -58,9 +58,11 @@ class NoRedirect(urllib.request.HTTPRedirectHandler): raise RuntimeError('Git download redirect refused') headers = {'User-Agent': 'IomatexOS-Updater/1.0', 'Authorization': 'Basic ' + base64.b64encode((os.environ['IOMATEX_GIT_USERNAME'] + ':' + os.environ['IOMATEX_GIT_PASSWORD']).encode()).decode()} opener = urllib.request.build_opener(NoRedirect) -hosts = [parsed.netloc] + [h for h in ('git.it-screen.com', 'git.iomatex.com') if h != parsed.netloc] +# Accept old saved URLs as input only; never make a request to the blocked host. +host = 'git.iomatex.com' +attempts = 2 commit = None -for index, host in enumerate(hosts): +for index in range(attempts): base = 'https://' + host + '/api/v1/repos/' + repo + '/' try: if commit is None: @@ -80,9 +82,9 @@ for index, host in enumerate(hosts): raise SystemExit('Git TLS verification/connection failed. No domain switch; check certificates and system time.') from None if not isinstance(reason, OSError): raise SystemExit('Git request failed; no domain switch.') from None - if index + 1 == len(hosts): - raise SystemExit('Both Git domains are unreachable. Check DNS and Internet connectivity; installation has not started.') from None - print('Git network/DNS failure on ' + host + '; trying ' + hosts[index + 1], flush=True) + if index + 1 == attempts: + raise SystemExit('git.iomatex.com is unreachable. Check DNS and Internet connectivity; installation has not started.') from None + print('Git network/DNS failure; retrying ' + host, flush=True) PYTHON GIT_URL=$(cat "$work/git_delivery.py.source") diff --git a/offline/test_bootstrap_fallback.py b/offline/test_bootstrap_fallback.py index c9930f8..9af88e5 100644 --- a/offline/test_bootstrap_fallback.py +++ b/offline/test_bootstrap_fallback.py @@ -22,21 +22,23 @@ class BootstrapFallbackTest(unittest.TestCase): opener.open.side_effect = responses with patch('urllib.request.build_opener', return_value=opener), patch.dict(os.environ, {'IOMATEX_GIT_USERNAME':'user','IOMATEX_GIT_PASSWORD':'secret'}), patch.object(sys, 'argv', ['-', 'https://'+host+'/An-J/Iomatex_OS.git', 'ci-cd', str(destination)]): exec(compile(SOURCE, 'bootstrap', 'exec'), {}) + for call in opener.open.call_args_list: + self.assertTrue(call.args[0].full_url.startswith('https://git.iomatex.com/')) return destination, opener - def test_dns_failure_selects_alternative_and_persists_source(self): + def test_dns_retry_stays_on_canonical_host_and_persists_source(self): dest, opener = self.run_bootstrap([URLError(socket.gaierror(-3, 'DNS failure')), io.BytesIO(BRANCH), io.BytesIO(b'loader')]) self.assertEqual(b'loader', dest.read_bytes()) self.assertEqual('https://git.iomatex.com/An-J/Iomatex_OS.git', Path(str(dest)+'.source').read_text()) self.assertEqual(3, opener.open.call_count) self.assertIn('git.iomatex.com', opener.open.call_args.args[0].full_url) - def test_payload_timeout_keeps_same_commit_on_alternate(self): + def test_payload_timeout_keeps_same_commit_and_host(self): _, opener = self.run_bootstrap([io.BytesIO(BRANCH), socket.timeout(), io.BytesIO(b'loader')]) self.assertIn('git.iomatex.com', opener.open.call_args.args[0].full_url) self.assertTrue(opener.open.call_args.args[0].full_url.endswith('a'*40)) - def test_explicit_alternate_is_tried_first(self): + def test_canonical_host_is_used_directly(self): _, opener = self.run_bootstrap([io.BytesIO(BRANCH), io.BytesIO(b'loader')], 'git.iomatex.com') self.assertIn('git.iomatex.com', opener.open.call_args_list[0].args[0].full_url) self.assertEqual('IomatexOS-Updater/1.0', opener.open.call_args_list[0].args[0].get_header('User-agent')) @@ -47,6 +49,12 @@ class BootstrapFallbackTest(unittest.TestCase): with self.assertRaises(SystemExit): self.run_bootstrap([error, AssertionError('Must not switch')]) - def test_both_domains_unreachable_reports_failure(self): - with self.assertRaisesRegex(SystemExit, 'Both Git domains are unreachable'): + def test_canonical_host_unreachable_reports_failure(self): + with self.assertRaisesRegex(SystemExit, 'git.iomatex.com is unreachable'): self.run_bootstrap([URLError(socket.gaierror()), socket.timeout()]) + + def test_both_input_aliases_only_use_new_host(self): + for host in ('git.it-screen.com', 'git.iomatex.com'): + with self.subTest(host=host): + _, opener = self.run_bootstrap([io.BytesIO(BRANCH), io.BytesIO(b'loader')], host) + self.assertEqual(2, opener.open.call_count) diff --git a/offline/test_snapshot_update.py b/offline/test_snapshot_update.py index 063fd1e..ca8fad4 100644 --- a/offline/test_snapshot_update.py +++ b/offline/test_snapshot_update.py @@ -34,6 +34,7 @@ class SnapshotUpdateTest(unittest.TestCase): def test_confirmed_update_preserves_hotfix_and_operator_files(self): self.bootstrap() self.assertEqual(b'new release', (self.root/'install.sh').read_bytes()) + self.assertEqual('git.iomatex.com', json.loads((self.root/'.iomatex-source.json').read_text())['host']) self.assertEqual(b'operator configuration', (self.root/'operator.conf').read_bytes()) backup, = self.parent.glob('.installer-local-changes-*') self.assertEqual(0o700, backup.stat().st_mode & 0o777) diff --git a/offline/test_stage_versions.py b/offline/test_stage_versions.py index 88df4ea..cf79337 100644 --- a/offline/test_stage_versions.py +++ b/offline/test_stage_versions.py @@ -37,6 +37,25 @@ class StageVersionsTest(unittest.TestCase): versions.configure(root) self.assertEqual('git.iomatex.com', versions.read_json(versions.CONFIG)['host']) + def test_all_stage_catalogs_use_new_host_for_legacy_and_missing_config(self): + for host in (None, 'git.it-screen.com', 'git.iomatex.com'): + with self.subTest(host=host): + cfg = {'repo': 'An-J/Iomatex_OS', 'branch': 'ci-cd'} + if host is not None: + cfg['host'] = host + versions.delivery.write_json(versions.CONFIG, cfg) + with mock.patch.object(versions.delivery, 'auth_from_env', return_value={'username':'u','password':'p'}), \ + mock.patch.object(versions.delivery.urllib.request, 'build_opener') as opener: + opener.return_value.open.side_effect = [ + io.BytesIO(json.dumps({'commit': {'id': COMMIT}}).encode()), + io.BytesIO(json.dumps(self.catalog).encode())] + versions.refresh() + result = versions.read_json(versions.STATE / 'available.json') + self.assertEqual('', result['error']) + self.assertEqual(set(versions.STAGES), set(result['stages'])) + for call in opener.return_value.open.call_args_list: + self.assertTrue(call.args[0].full_url.startswith('https://git.iomatex.com/')) + def test_published_catalog_is_accepted_by_legacy_console(self): raw = json.loads((ROOT / 'stage-releases.json').read_text()) # This is the exact set checked by Console 3.1.2's validator. diff --git a/stage-releases.json b/stage-releases.json index a45896a..ccd3e89 100644 --- a/stage-releases.json +++ b/stage-releases.json @@ -14,7 +14,7 @@ "version": "1.0.1" }, "stage_ui": { - "version": "3.1.29" + "version": "3.1.30" }, "stage_avahi": { "version": "1.0.0" diff --git a/stage_ui/version.json b/stage_ui/version.json index 7d26b1e..6a2480f 100644 --- a/stage_ui/version.json +++ b/stage_ui/version.json @@ -1,3 +1,3 @@ { - "version": "3.1.29" + "version": "3.1.30" }