Fix fallback dependency detection

This commit is contained in:
Dymas
2026-07-19 14:40:03 +02:00
parent 02226ad5c9
commit 348d97488a
7 changed files with 46 additions and 5 deletions
+5
View File
@@ -1,5 +1,10 @@
# Changelog
## 0.49.2 - 2026-07-19
- Fixed the Config page dependency check so Docker-installed fallback tools are detected from `/usr/local/bin` and `/usr/bin`, matching the runtime command lookup.
- Set the Docker image `PATH` explicitly to include system binary directories before the app starts.
## 0.49.1 - 2026-07-19
- Fixed Docker fallback tool discovery by exposing `anipy-cli` and `animdl` from fixed system paths and checking common system install locations at runtime.
+1
View File
@@ -11,6 +11,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
ANI_CLI_BRANCH=${ANI_CLI_BRANCH} \
ANI_CLI_WEB_REPO=${ANI_CLI_WEB} \
ANI_CLI_WEB_BRANCH=${ANI_CLI_WEB_BRANCH} \
PATH=/usr/local/bin:/usr/bin:/bin \
ANI_CLI_BIN=ani-cli \
ANIPY_CLI_BIN=/usr/local/bin/anipy-cli \
ANIMDL_BIN=/usr/local/bin/animdl \
+2 -2
View File
@@ -2,7 +2,7 @@
Local web UI for a system-wide `ani-cli` install.
Current version: `0.49.1`
Current version: `0.49.2`
## What it does
@@ -96,7 +96,7 @@ Docker notes:
- `UPDATE_ON_START=true` runs `ani-cli --update` before startup
- `ANI_CLI_WEB_BRANCH` lets the image clone a specific `ani-cli-web` branch at build time
- `botan` is installed inside the container for providers or scripts that need Botan cryptography tooling
- `anipy-cli` and `animdl` are installed systemwide inside the container at `/usr/local/bin` and linked from `/usr/bin`, so fallback retries are available without extra container setup
- `anipy-cli` and `animdl` are installed systemwide inside the container at `/usr/local/bin`, linked from `/usr/bin`, and included in the runtime `PATH`, so fallback retries are available without extra container setup
## Key behavior
+1 -1
View File
@@ -1 +1 @@
0.49.1
0.49.2
+4
View File
@@ -1009,6 +1009,10 @@ def cli_executable_exists(command):
return bool(shutil.which(text) or (Path(text).exists() and os.access(text, os.X_OK)))
def cli_executable_exists_any(*commands):
return any(cli_executable_exists(command) for command in commands)
def printable_command(command):
return " ".join(sh_quote(part) for part in command)
+13 -2
View File
@@ -35,6 +35,7 @@ from app_support import (
debug_enabled,
debug_log,
load_project_text_file,
cli_executable_exists_any,
cli_executable_exists,
normalize_config,
path_is_within_roots,
@@ -94,8 +95,18 @@ def dependency_status():
checks = ["curl", "sed", "grep", "openssl", "fzf", "aria2c", "ffmpeg", "yt-dlp"]
result = {name: bool(shutil.which(name)) for name in checks}
result["ani-cli"] = cli_executable_exists(ANI_CLI)
result["anipy-cli"] = cli_executable_exists(ANIPY_CLI)
result["animdl"] = cli_executable_exists(ANIMDL)
result["anipy-cli"] = cli_executable_exists_any(
ANIPY_CLI,
"anipy-cli",
"/usr/local/bin/anipy-cli",
"/usr/bin/anipy-cli",
)
result["animdl"] = cli_executable_exists_any(
ANIMDL,
"animdl",
"/usr/local/bin/animdl",
"/usr/bin/animdl",
)
return result
+20
View File
@@ -3119,6 +3119,26 @@ class HandlerRouteTests(unittest.TestCase):
self.assertIn("anipy-cli", handler.json_payload)
self.assertIn("animdl", handler.json_payload)
def test_dependency_status_checks_docker_fallback_tool_paths(self):
with mock.patch.object(http_handler, "cli_executable_exists", return_value=True), mock.patch.object(
http_handler, "cli_executable_exists_any", return_value=True
) as exists_any:
status = http_handler.dependency_status()
self.assertTrue(status["animdl"])
exists_any.assert_any_call(
http_handler.ANIMDL,
"animdl",
"/usr/local/bin/animdl",
"/usr/bin/animdl",
)
exists_any.assert_any_call(
http_handler.ANIPY_CLI,
"anipy-cli",
"/usr/local/bin/anipy-cli",
"/usr/bin/anipy-cli",
)
def test_clear_failed_route_removes_failed_jobs(self):
with APP.DOWNLOAD_QUEUE._connect() as conn:
conn.execute("DELETE FROM jobs")