Files
odysseus/tests/test_searxng_image_pinned.py
T
RaresKeYandLéo ed78beee1b fix(security): refresh client trust and adopt corrected upstream SearXNG (#6791)
Select the official immutable SearXNG release with corrected system and certifi stores in all Compose deployments. Retain native offline, actual-entrypoint and Compose/live regression checks while removing the custom trust-repair image and registry publication path. Reuse the canonical CA inventory checker.

Include released Python, certifi, grpcio, uv and Docker CLI trust updates and strict fourteen-chain validation. Keep unreleased CPython verifier and native-helper fixes separate from claims about shipped artifacts.

Part of #6784 and #6790.

Co-authored-by: Léo <leograndcontact@gmail.com>
2026-10-24 17:26:21 +02:00

32 lines
1.3 KiB
Python

"""Regression guard for issue #1414 — a broken upstream `searxng:latest` tag
(2026.6.2 crashed on boot with KeyError: 'default_doi_resolver') failed the
searxng healthcheck, and because `odysseus` waits on it via
`depends_on: condition: service_healthy`, the whole app never started on fresh
Docker installs.
Pin the SearXNG image to a known-good tag so a bad upstream `latest` can't block
startup. This guards that the pin stays in place.
"""
import re
from pathlib import Path
import yaml
ROOT = Path(__file__).resolve().parent.parent
COMPOSE = ROOT / "docker-compose.yml"
def test_searxng_image_is_pinned_not_latest():
text = COMPOSE.read_text(encoding="utf-8")
image = yaml.safe_load(text)["services"]["searxng"]["image"]
assert re.fullmatch(
r"docker\.io/searxng/searxng:\d{4}\.\d[^\s@]*@sha256:[0-9a-f]{64}", image
), f"SearXNG must use a versioned immutable upstream image: {image!r}"
def test_all_standalone_compose_files_select_the_same_searxng_image():
expected = yaml.safe_load(COMPOSE.read_text())["services"]["searxng"]["image"]
for name in ("docker-compose.gpu-amd.yml", "docker-compose.gpu-nvidia.yml"):
actual = yaml.safe_load((ROOT / name).read_text())["services"]["searxng"]["image"]
assert actual == expected, f"{name} selects a different SearXNG image"