This repository has been archived on 2026-07-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
chaim e947bca655 fix: code audit — security, correctness, and robustness fixes
Security:
- Path traversal: validate user_id, case_id, skill_name against safe regex
- Input sanitization in memory.py and skills.py file path construction

Correctness:
- ISR timezone: replace hardcoded UTC+3 with ZoneInfo("Asia/Jerusalem") for DST
- save_rule: use EspoCrmApiError.status_code instead of fragile string matching
- Background tasks: store references to prevent GC before completion
- Lock race: use dict.setdefault() for atomic lock creation
- Version: health.py now matches main.py (0.2.0)
- Skill names: normalized to lowercase for dedup consistency

Build:
- Dockerfile: install from pyproject.toml instead of hardcoded pip list
- Remove unused mcp>=1.0.0 dependency from pyproject.toml

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:18:01 +00:00

27 lines
695 B
Docker

FROM python:3.13-slim
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy project files
COPY pyproject.toml .
COPY api/ api/
COPY mcp_server/ mcp_server/
COPY config/ config/
# Install dependencies from pyproject.toml
RUN pip install --no-cache-dir .
# Create persistent data directories
RUN mkdir -p /opt/data/skills /opt/data/profiles /opt/data/cases
# Copy pre-seeded skills (will be overridden by persistent volume if mounted)
COPY config/skills/ /opt/data/skills/
ENV PORT=3000
ENV SHIRA_DATA_DIR=/opt/data
EXPOSE 3000
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "3000", "--log-level", "info"]