gitea-bot/config.py
2026-04-07 10:00:27 +01:00

23 lines
839 B
Python

from pathlib import Path
import yaml
_cfg_path = Path(__file__).parent / "config.yaml"
_cfg = yaml.safe_load(_cfg_path.read_text())
# Gitea
GITEA_URL: str = _cfg["gitea"]["url"]
GITEA_TOKEN: str = _cfg["gitea"]["token"]
WEBHOOK_SECRET: str = _cfg["gitea"].get("webhook_secret", "")
# Bot
BOT_USERNAME: str = _cfg["bot"]["username"]
LISTEN_PORT: int = _cfg["bot"].get("listen_port", 9880)
WORKSPACE_DIR: Path = Path(_cfg["bot"].get("workspace_dir", "/data/src/gitea-bot/workspaces"))
# Claude
CLAUDE_COMMAND: str = _cfg["claude"]["command"]
CLAUDE_ARGS: list[str] = _cfg["claude"].get("args", ["-p", "--output-format", "text"])
CLAUDE_MODEL: str = _cfg["claude"].get("model", "sonnet")
CLAUDE_MAX_TURNS: int = _cfg["claude"].get("max_turns", 30)
CLAUDE_SYSTEM_PROMPT: str = _cfg["claude"].get("system_prompt", "You are a helpful bot.")