Files
school_compare/integrator/scripts/config.py
Tudor f1fb847164
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 47s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m13s
Build and Push Docker Images / Build Integrator (push) Successful in 40s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 0s
feat(integrator): add KS2 re-import via Kestra and backend admin endpoint
- backend: POST /api/admin/reimport-ks2 runs full CSV migration in a thread
- backend/docker-compose: ADMIN_API_KEY env var (default: changeme) so the
  key is stable across restarts and the integrator can call the endpoint
- integrator: sources/ks2.py triggers the backend endpoint (900s timeout)
- integrator: flows/ks2.yml Kestra flow (manual trigger, no schedule)

To re-ingest after a DB wipe: trigger the ks2-reimport flow from the
Kestra UI at http://localhost:8080.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 12:25:29 +00:00

15 lines
431 B
Python

"""Configuration for the data integrator."""
import os
from pathlib import Path
DATABASE_URL = os.environ.get(
"DATABASE_URL",
"postgresql://schoolcompare:schoolcompare@db:5432/schoolcompare",
)
DATA_DIR = Path(os.environ.get("DATA_DIR", "/data"))
SUPPLEMENTARY_DIR = DATA_DIR / "supplementary"
BACKEND_URL = os.environ.get("BACKEND_URL", "http://backend:80")
ADMIN_API_KEY = os.environ.get("ADMIN_API_KEY", "changeme")