Phase 19: compose validate (docker compose config) + diff vs deployed in editor (0.25.0)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
menzelj
2026-06-09 11:32:55 +00:00
co-authored by Claude Opus 4.8
parent 34c5fffa85
commit 9c4d319f8f
4 changed files with 108 additions and 5 deletions
+12
View File
@@ -7,10 +7,16 @@ from pydantic import BaseModel
from auth import get_current_user
from models.user import User
from services import compose_edit_service as edit
from services import compose_service
router = APIRouter(prefix="/api/editor", tags=["editor"])
class ValidateBody(BaseModel):
yaml: str
env: str = ""
class AddVolumeBody(BaseModel):
yaml: str
service: str
@@ -52,6 +58,12 @@ def _run(fn, *args) -> dict:
raise HTTPException(status_code=400, detail=str(exc)) from exc
@router.post("/validate")
async def validate(body: ValidateBody, _user: User = Depends(get_current_user)) -> dict:
"""Run `docker compose config -q` on the supplied YAML (+ optional .env)."""
return await compose_service.validate_yaml(body.yaml, body.env)
@router.post("/services")
def services(body: dict, _user: User = Depends(get_current_user)) -> dict:
try: