fix(komodo,config): fresh pagerless shell per exec, panel and api injects framed as the user

This commit is contained in:
hh
2026-08-29 17:07:45 +02:00
parent 02723c21a7
commit 4415e890c9
2 changed files with 27 additions and 6 deletions
+6 -6
View File
@@ -46,7 +46,9 @@ class Komodo:
secret: str
exec_deny: tuple[str, ...] = ("*periphery*", "*komodo*")
terminal: str = "beaver"
shell: str = "sh"
shell: str = "env PAGER=cat GIT_PAGER=cat TERM=dumb sh"
"""Terminal is a tty: without ``PAGER=cat`` psql/git open a pager and
wait for a key forever, wedging the terminal."""
timeout: float = 120.0
wait: float = 180.0
max_chars: int = 12_000
@@ -77,7 +79,8 @@ class Komodo:
- deploy / restart: стек целиком или один service; ждёт исхода до 3 мин.
- exec: команда внутри контейнера (container, command; server, если имя
контейнера есть на нескольких серверах). Это `docker exec` от
пользователя контейнера. Долгое - запускай в фон с выводом в файл.
пользователя контейнера, свежий шелл на каждый вызов, без tty-пейджера.
Лимит ~2 мин: долгое запускай в фон с выводом в файл и читай файл.
Деплой и рестарт - только когда об этом попросили, не «заодно».
"""
@@ -211,12 +214,9 @@ class Komodo:
},
"terminal": self.terminal,
"command": command,
"init": {"command": self.shell, "recreate": "Never"},
"init": {"command": self.shell, "recreate": "Always"},
}
status, text = await self._post("terminal/execute", body)
if status != 200:
body["init"]["recreate"] = "Always"
status, text = await self._post("terminal/execute", body)
if status != 200:
return f"exec {container}: Komodo {status}: {text[:500]}"
output, _, code = ANSI.sub("", text).rpartition(EXIT_MARK)