feat(config,caddy): single gateway port and site.caddy per the komodo convention

This commit is contained in:
hh
2026-08-29 00:49:27 +02:00
parent c6bf30b5af
commit c830ca73e6
8 changed files with 63 additions and 72 deletions
+13 -17
View File
@@ -212,11 +212,6 @@ agents: list[BaseAgent] = [
PUBLIC_BASE_URL = os.environ.get("PUBLIC_BASE_URL", "").rstrip("/")
def _public(suffix: str) -> str | None:
return f"{PUBLIC_BASE_URL}{suffix}" if PUBLIC_BASE_URL else None
# §3.8: личка с ботом - домашний фронтенд мастера и веток (General и топики).
# Токен и id - секреты gateway, в env процесса модели они не попадают.
TELEGRAM = (
@@ -230,31 +225,25 @@ TELEGRAM = (
else None
)
# Один порт: каждый HTTP-фронтенд живёт под своим путём (/anthropic, /mcp,
# /admin, /api, /md), `/` ведёт в админку. Caddy ничего не срезает.
frontends: list[Frontend] = [
*([TELEGRAM] if TELEGRAM is not None else []),
AnthropicMessagesFrontend(
host="0.0.0.0", port=62990, public_base_url=_public("/anthropic")
),
McpServerFrontend(host="0.0.0.0", port=62991, public_base_url=_public("/mcp")),
AdminFrontend(host="0.0.0.0", port=62992, public_base_url=_public("/admin")),
AnthropicMessagesFrontend(),
McpServerFrontend(),
AdminFrontend(),
# §3.9: /api показывает всё; дефолт master/branch здесь - запасной на случай
# gateway без телеграма, deep - у markdown.
ApiFrontend(
host="0.0.0.0",
port=62994,
public_base_url=_public("/api"),
master_agent="beaver-dispatcher",
branch_agent="beaver-dispatcher",
memory_root=BEAVER,
),
MarkdownFrontend(
host="0.0.0.0",
port=62993,
vault_path=CHATS_DIR,
default_agent="beaver-opus-high",
log_all_chats=True,
chat_path=chat_path,
public_base_url=_public("/md"),
),
]
@@ -277,4 +266,11 @@ texts = ConversationTexts(
seed=seed_body,
)
gateway = Gateway(agents=agents, mcps=mcps, frontends=frontends, texts=texts)
gateway = Gateway(
agents=agents,
mcps=mcps,
frontends=frontends,
texts=texts,
port=62990,
public_url=PUBLIC_BASE_URL or None,
)