From 2faba139906da15741db2702b3bed3e92ad7ee26 Mon Sep 17 00:00:00 2001 From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:46:30 +0100 Subject: [PATCH] Pin the reviewed Ixian DuneChest release for all six servers --- tools/install-plugin-fleet.py | 39 +++++++++++++++++++++++++----- tools/test_plugin_fleet_install.py | 20 +++++++++++++++ 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/tools/install-plugin-fleet.py b/tools/install-plugin-fleet.py index 1f050ddb..40eacb89 100644 --- a/tools/install-plugin-fleet.py +++ b/tools/install-plugin-fleet.py @@ -52,14 +52,36 @@ def identity(path): return result +DUNECHEST_PLANETS = {'arrakis', 'caladan', 'giedi_prime', 'kaitain', 'sigma_draconis_iv'} +DUNECHEST_FLEET_JAR = 'f797c8bea59817a761ab18d87b045258698881d38e9aff776462cedb7d94627a' +DUNECHEST_ORDOS_PREDECESSOR = '94e591f11f10c3174c821bbfc8734f50a9638981e17269db2682be6e36d8fb97' +DUNECHEST_PLANET_PREDECESSOR = 'a1cd67aeea65d4a9dc98b75b1466fd54a120213e3eef31582c9492d546e484c2' + + +def verify_dunechest_fleet_target(sid, root, unit, incoming, installed): + expected_root = Path('/opt/dunerealms/lobby') if sid == 'lobby' else Path('/opt/dunerealms/servers') / sid + if sid not in DUNECHEST_PLANETS | {'lobby'} or root != expected_root or unit != f'dune-{sid}.service': + raise ValueError('DuneChest fleet release requires an exact reviewed server root and unit') + if incoming != DUNECHEST_FLEET_JAR: + raise ValueError('Fleet release must install the exact reviewed DuneChest JAR') + allowed = {None, incoming} if sid == 'lobby' else {incoming} + if sid == 'sigma_draconis_iv': + allowed.add(DUNECHEST_ORDOS_PREDECESSOR) + elif sid in DUNECHEST_PLANETS: + allowed.add(DUNECHEST_PLANET_PREDECESSOR) + if installed not in allowed: + raise ValueError('Unexpected DuneChest fleet predecessor') + + def plan(artifacts, inventory, expected_source): mode=inventory.get('mode') - if mode not in {'gui-preserve-backends','pillager-preserve-economy','arrakis-crysknife','navigator','planet-dunechest'}: + if mode not in {'gui-preserve-backends','pillager-preserve-economy','arrakis-crysknife','navigator','planet-dunechest','fleet-dunechest'}: raise ValueError('An explicit supported rollout mode is required') pillager=mode=='pillager-preserve-economy' crysknife=mode=='arrakis-crysknife' navigator=mode=='navigator' - dunechest=mode=='planet-dunechest' + fleet_dunechest=mode=='fleet-dunechest' + dunechest=mode=='planet-dunechest' or fleet_dunechest artifacts = Path(artifacts).resolve(strict=True) manifest = json.loads((artifacts / 'release-manifest.json').read_text()) if not re.fullmatch(r'[0-9a-f]{40}', expected_source) or manifest.get('sourceCommit') != expected_source: @@ -101,6 +123,8 @@ def plan(artifacts, inventory, expected_source): verify_public_menu(inventory['menuPack']['url'], menu) if (pillager or crysknife or navigator or dunechest) and not(menu and menu.get('unified')): raise ValueError('This rollout requires its verified unified item/skin pack') + if fleet_dunechest and menu['sha256'] != '25ae69ae7198002ebff65b1eafbb454be7df235f51cdc46bb6233aa0b3ceec7a': + raise ValueError('Fleet release must use the exact resource pack tested on Ordos') if navigator: from plugin_navigator_transition import verify_module as verify_navigator, verify_jarvis as verify_navigator_jarvis transition=json.loads((artifacts/'navigator-transition.json').read_text()) @@ -145,10 +169,11 @@ def plan(artifacts, inventory, expected_source): expected={'dunemenus','dunerealmsgui'} | ({'jarvistranslator'} if sid in planets else set()) if sid not in planets|{'lobby'} or root!=target or unit!=f'dune-{sid}.service' or wanted!=expected or selected_prerequisites: raise ValueError('Navigator rollout requires its reviewed server root, unit and plugin selection') - if dunechest and ( + if dunechest and (wanted!={'dunechest'} or selected_prerequisites): + raise ValueError('DuneChest rollout allows only the DuneChest artifact') + if dunechest and not fleet_dunechest and ( sid not in {'arrakis','caladan','giedi_prime','kaitain','sigma_draconis_iv'} or root!=Path('/opt/dunerealms/servers')/sid or unit!=f'dune-{sid}.service' - or wanted!={'dunechest'} or selected_prerequisites ): raise ValueError('DuneChest rollout requires an exact planet root and only the DuneChest artifact') if pillager: @@ -277,9 +302,11 @@ def plan(artifacts, inventory, expected_source): installed=existing_paths.get('dunechest') approved_dunechest = { chosen[0]['sha256'], - '94e591f11f10c3174c821bbfc8734f50a9638981e17269db2682be6e36d8fb97', + DUNECHEST_ORDOS_PREDECESSOR, } - if installed is not None and digest(installed) not in approved_dunechest: + if fleet_dunechest: + verify_dunechest_fleet_target(sid, root, unit, chosen[0]['sha256'], digest(installed) if installed else None) + elif installed is not None and digest(installed) not in approved_dunechest: raise ValueError('Existing DuneChest differs from the approved release or predecessor') replaced={entry['filename'] for entry in previous} retained=[{'filename':path.name,'sha256':digest(path),'metadata':metadata(path)} diff --git a/tools/test_plugin_fleet_install.py b/tools/test_plugin_fleet_install.py index ed903e6b..7ccd48c5 100644 --- a/tools/test_plugin_fleet_install.py +++ b/tools/test_plugin_fleet_install.py @@ -58,6 +58,26 @@ class FleetInstallerTests(unittest.TestCase): def deployment(self): return installer.plan(self.artifacts, self.inventory, SOURCE) + def test_dunechest_fleet_requires_exact_lobby_and_planet_predecessors(self): + check = installer.verify_dunechest_fleet_target + incoming = installer.DUNECHEST_FLEET_JAR + predecessor = installer.DUNECHEST_PLANET_PREDECESSOR + lobby = Path('/opt/dunerealms/lobby') + arrakis = Path('/opt/dunerealms/servers/arrakis') + sigma = Path('/opt/dunerealms/servers/sigma_draconis_iv') + check('lobby', lobby, 'dune-lobby.service', incoming, None) + check('arrakis', arrakis, 'dune-arrakis.service', incoming, predecessor) + check('sigma_draconis_iv', sigma, 'dune-sigma_draconis_iv.service', incoming, installer.DUNECHEST_ORDOS_PREDECESSOR) + for target in ( + ('lobby', arrakis, 'dune-lobby.service', incoming, None), + ('lobby', lobby, 'dune-lobby.service', incoming, predecessor), + ('arrakis', arrakis, 'dune-arrakis.service', incoming, None), + ('sigma_draconis_iv', sigma, 'dune-sigma_draconis_iv.service', incoming, predecessor), + ('arrakis', arrakis, 'dune-arrakis.service', predecessor, predecessor), + ): + with self.subTest(target=target), self.assertRaises(ValueError): + check(*target) + def test_planning_is_read_only_and_requires_exact_source_and_hash(self): before = {p.name: p.read_bytes() for p in self.plugins.iterdir()} self.deployment()