fix: skip optional captcha docker preinstall

This commit is contained in:
Nick Sweeting 2026-06-01 09:20:48 -07:00
parent dd96e56846
commit a5bbdd425d
No known key found for this signature in database
2 changed files with 48 additions and 0 deletions

View File

@ -322,6 +322,14 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-$TARGETARCH$T
abxpkg install --no-cache --install-timeout=600 --binproviders=playwright --bin-dir="$LIB_DIR/env/bin" chromium; \
fi \
&& ABXPKG_INSTALL_TIMEOUT=600 TIMEOUT=600 PUID=0 PGID=0 abx-dl plugins --install \
accessibility archivedotorg archivewebpage base chrome chrome_mhtml chrome_screencast \
claudechrome claudecode claudecodecleanup claudecodeextract consolelog defuddle dns dom \
favicon forumdl gallerydl git hashes headers htmltotext infiniscroll \
istilldontcareaboutcookies liteparse media mercury modalcloser opendataloader papersdl \
parse_dom_outlinks parse_html_urls parse_jsonl_urls parse_netscape_urls parse_rss_urls \
parse_txt_urls pdf readability redirects responses screenshot search_backend_ripgrep \
search_backend_sonic search_backend_sqlite seo singlefile ssl sslcerts staticfile title \
trafilatura ublock wget ytdlp \
&& abxpkg install --no-cache --binproviders=chromewebstore --overrides='{"chromewebstore":{"install_args":["fpeoodllldobpkbkabpblcfaogecpndd","--name=archivewebpage"]}}' archivewebpage \
&& test -f "$LIB_DIR/chromewebstore/extensions/fpeoodllldobpkbkabpblcfaogecpndd__archivewebpage/manifest.json" \
&& mkdir -p "$LIB_DIR/env/bin" \

View File

@ -22,15 +22,55 @@ _REQUIRED_DOCKER_INSTALL_TARGETS = {
"search_backend_sonic",
}
_REQUIRED_DOCKER_PREINSTALL_TARGETS = {
"archivewebpage",
"defuddle",
"forumdl",
"gallerydl",
"git",
"istilldontcareaboutcookies",
"liteparse",
"mercury",
"opendataloader",
"papersdl",
"parse_rss_urls",
"readability",
"search_backend_ripgrep",
"search_backend_sonic",
"ublock",
"wget",
"ytdlp",
}
_DOCKER_PREINSTALL_EXCLUDED_TARGETS = {
"twocaptcha",
}
def _archivebox_install_commands(dockerfile: Path) -> list[str]:
text = dockerfile.read_text()
return re.findall(r"archivebox install ([^\\\n]+)", text)
def _abx_dl_plugin_install_targets(dockerfile: Path) -> set[str]:
text = dockerfile.read_text()
commands = re.findall(r"abx-dl plugins --install((?: \\\n|[^\n])*)", text)
targets: set[str] = set()
for command in commands:
command_text = command.replace("\\", " ")
targets.update(re.findall(r"\b[a-z][a-z0-9_]*\b", command_text))
return targets
def test_dockerfiles_install_binaries_required_by_version_validation() -> None:
for dockerfile_name in ("Dockerfile", "Dockerfile.multistage"):
commands = _archivebox_install_commands(REPO_ROOT / dockerfile_name)
target_command = max(commands, key=lambda command: len(command.split()))
targets = set(target_command.split())
assert _REQUIRED_DOCKER_INSTALL_TARGETS <= targets
def test_dockerfile_prewarms_stable_plugin_dependencies_without_optional_captcha() -> None:
targets = _abx_dl_plugin_install_targets(REPO_ROOT / "Dockerfile")
assert _REQUIRED_DOCKER_PREINSTALL_TARGETS <= targets
assert not (_DOCKER_PREINSTALL_EXCLUDED_TARGETS & targets)