fix(morning_briefing): CalDAV host.docker.internal 해결, field_reports 컬럼명, Karakeep env var
- CALDAV_BRIDGE_URL: host.docker.internal → 127.0.0.1 치환 (네이티브 실행 대응) - field_reports: description → summary (실제 스키마 반영) - KARAKEEP_URL: KARAKEEP_API_URL env var도 체크 (맥미니 .env 호환) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,8 +13,8 @@ load_dotenv()
|
||||
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")
|
||||
logger = logging.getLogger("morning_briefing")
|
||||
|
||||
CALDAV_BRIDGE_URL = os.getenv("CALDAV_BRIDGE_URL", "http://127.0.0.1:8092")
|
||||
KARAKEEP_URL = os.getenv("KARAKEEP_URL", "http://localhost:3000")
|
||||
CALDAV_BRIDGE_URL = os.getenv("CALDAV_BRIDGE_URL", "http://127.0.0.1:8092").replace("host.docker.internal", "127.0.0.1")
|
||||
KARAKEEP_URL = os.getenv("KARAKEEP_API_URL", os.getenv("KARAKEEP_URL", "http://localhost:3000"))
|
||||
KARAKEEP_API_KEY = os.getenv("KARAKEEP_API_KEY", "")
|
||||
GPU_OLLAMA_URL = os.getenv("GPU_OLLAMA_URL", "http://192.168.1.186:11434")
|
||||
SYNOLOGY_CHAT_WEBHOOK_URL = os.getenv("SYNOLOGY_CHAT_WEBHOOK_URL", "")
|
||||
@@ -84,13 +84,13 @@ def fetch_open_reports() -> list[dict]:
|
||||
conn = get_db_connection()
|
||||
with conn.cursor() as cur:
|
||||
cur.execute(
|
||||
"SELECT category, description, created_at FROM field_reports "
|
||||
"SELECT category, summary, created_at FROM field_reports "
|
||||
"WHERE status = 'open' "
|
||||
"ORDER BY created_at DESC LIMIT 10"
|
||||
)
|
||||
rows = cur.fetchall()
|
||||
conn.close()
|
||||
return [{"category": r[0], "description": r[1], "created_at": r[2]} for r in rows]
|
||||
return [{"category": r[0], "summary": r[1], "created_at": r[2]} for r in rows]
|
||||
except Exception as e:
|
||||
logger.error(f"Reports fetch failed: {e}")
|
||||
return []
|
||||
@@ -206,7 +206,7 @@ def format_briefing(events: list | None, mails: list | None,
|
||||
lines = []
|
||||
for r in reports[:limit]:
|
||||
cat = r.get("category", "")
|
||||
desc = (r.get("description") or "")[:50]
|
||||
desc = (r.get("summary") or "")[:50]
|
||||
created = r.get("created_at")
|
||||
date_str = ""
|
||||
if created:
|
||||
|
||||
Reference in New Issue
Block a user