Generalize OCI device setup and remove unused catalog hashes

This commit is contained in:
MacRimi
2026-09-26 01:22:37 +02:00
parent 88acceb8ef
commit f7266e7b44
26 changed files with 689 additions and 487 deletions
+11
View File
@@ -29,10 +29,13 @@ class DescriptionTests(unittest.TestCase):
self.assertIn('Image: <code>adguard/adguardhome:latest</code> ', notes)
self.assertIn('>Image</a> &middot; ', notes)
self.assertIn('>App</a>', notes)
self.assertNotIn('>App docs</a>', notes)
self.assertNotIn('>Repository</a>', notes)
self.assertIn('href="http://192.168.0.42:3000/" target="_blank" rel="noopener noreferrer">Setup (first run)</a>', notes)
self.assertIn('>http://192.168.0.42:3000/</a>', notes)
self.assertIn('href="http://192.168.0.42:80/" target="_blank" rel="noopener noreferrer">Web UI (after setup)</a>', notes)
self.assertIn('>http://192.168.0.42:80/</a>', notes)
self.assertEqual(notes.count('&#127760; '), 2)
def test_missing_ip_does_not_publish_placeholder_links(self):
template = json.loads((CATALOG / 'adguard-home.json').read_text())
@@ -40,6 +43,14 @@ class DescriptionTests(unittest.TestCase):
self.assertNotIn('http://:3000', notes)
self.assertIn('proxmenux-instance=' + INSTANCE, notes)
def test_chromium_notes_keep_only_image_and_app_links(self):
template = json.loads((CATALOG / 'chromium.json').read_text())
notes = render(template, '', INSTANCE, '192.168.0.37')
self.assertIn('>Image</a>', notes)
self.assertIn('>App</a>', notes)
self.assertNotIn('>App docs</a>', notes)
self.assertNotIn('>Repository</a>', notes)
def test_untrusted_title_is_escaped(self):
template = {'id': 'example', 'catalog_ui': {'title': {'en_US': '<script>x</script>'}},
'container_contract': {'image': {'reference': 'example:latest'}}}