diff --git a/.env.prod.example b/.env.prod.example index 56e846a..3965d45 100644 --- a/.env.prod.example +++ b/.env.prod.example @@ -8,7 +8,7 @@ # RELEASE VERSION # ===================================================== # Tag fra Gitea (f.eks. v1.0.0, v1.2.3) -RELEASE_VERSION=v2.0.4 +RELEASE_VERSION=v2.0.5 # ===================================================== # GITEA AUTHENTICATION diff --git a/RELEASE_NOTES_v2.0.5.md b/RELEASE_NOTES_v2.0.5.md new file mode 100644 index 0000000..7f68fdf --- /dev/null +++ b/RELEASE_NOTES_v2.0.5.md @@ -0,0 +1,8 @@ +# Release Notes v2.0.5 + +## Fixes +- The migration execution endpoint now probes for the available container runtime (`docker` or `podman`) instead of assuming `docker`, preventing failures when Docker is absent but Podman is installed. +- Improved the validation error to clearly report when neither runtime is reachable and provided a more reliable command execution flow. + +--- +Release Date: 28. januar 2026 \ No newline at end of file diff --git a/VERSION b/VERSION index 26e3379..b9d2bdf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.4 \ No newline at end of file +2.0.5 \ No newline at end of file diff --git a/app/settings/backend/views.py b/app/settings/backend/views.py index b14c1ca..89e8bc4 100644 --- a/app/settings/backend/views.py +++ b/app/settings/backend/views.py @@ -9,6 +9,7 @@ from fastapi.responses import HTMLResponse from fastapi.templating import Jinja2Templates from pydantic import BaseModel import os +import shutil import subprocess from app.core.config import settings @@ -65,9 +66,15 @@ def execute_migration(payload: MigrationExecution): raise HTTPException(status_code=404, detail="Migration file not found") # Determine the container runtime (Podman or Docker) - runtime = settings.CONTAINER_RUNTIME.lower() - if runtime not in {"docker", "podman"}: - runtime = "docker" + runtime_preference = (settings.CONTAINER_RUNTIME or "").strip().lower() + available_runtimes = [cmd for cmd in ("podman", "docker") if shutil.which(cmd)] + if not available_runtimes: + raise HTTPException(status_code=500, detail="No container runtime (docker/podman) found in PATH") + + if runtime_preference and runtime_preference in available_runtimes: + runtime = runtime_preference + else: + runtime = available_runtimes[0] command = [ runtime,