Backend: - routes_auth: POST /v1/auth/dev-login — bypass Azure AD (disabled in production), creates admin in DB and sets JWT cookie; takes email + full_name - routes_auth: use settings.frontend_callback_url instead of parsing CORS origins for SSO post-login redirect — configurable per environment - config: add frontend_callback_url setting - dependencies: fix get_current_admin — was querying _id as string (ObjectId bug) and filtering is_active:True (never set by SSO flow) Frontend: - Login.tsx: dev login form shown in non-production builds below SSO button - api.ts: use import.meta.env.BASE_URL so API paths work under any subpath prefix - main.tsx: pass BASE_URL as BrowserRouter basename for correct SPA routing - vite.config.ts: read VITE_BASE_PATH env var to set Vite base (default /) - nginx.conf: serve app at /cost-tracker/ prefix, proxy API routes internally - Dockerfile: accept VITE_BASE_PATH build arg, copy build to /cost-tracker/ subdir Infra: - docker-compose.yml: API host port 8003 (8001 taken by ppt-tool on optical-dev) - infra/deploy/apache-cost-tracker.conf: Apache include for optical-dev routing - infra/deploy/deploy.sh: one-shot deploy script (clone/pull, build, Apache config) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 lines
2.6 KiB
Text
33 lines
2.6 KiB
Text
# ── App ────────────────────────────────────────────────────────────────────────
|
|
APP_ENV=dev
|
|
JWT_SECRET=change-me-in-production-use-openssl-rand-hex-32
|
|
|
|
# ── MongoDB ────────────────────────────────────────────────────────────────────
|
|
MONGODB_URI=mongodb://admin:changeme@mongodb:27017/cost_tracker?authSource=admin
|
|
MONGODB_DB=cost_tracker
|
|
|
|
# ── Redis ──────────────────────────────────────────────────────────────────────
|
|
REDIS_URL=redis://redis:6379/0
|
|
|
|
# ── Microsoft Azure AD (admin SSO) ────────────────────────────────────────────
|
|
AZURE_CLIENT_ID=your-app-registration-client-id
|
|
AZURE_CLIENT_SECRET=your-client-secret
|
|
AZURE_TENANT_ID=your-tenant-id
|
|
AZURE_AUTHORITY=https://login.microsoftonline.com/your-tenant-id
|
|
AZURE_REDIRECT_URI=https://cost-tracker.oliver.solutions/v1/auth/callback
|
|
|
|
# ── SendGrid (alerts) ──────────────────────────────────────────────────────────
|
|
SENDGRID_API_KEY=SG.xxxx
|
|
EMAIL_FROM=no-reply@oliver.agency
|
|
ALERT_EMAIL_TO=vadymsamoilenko@oliver.agency,another@oliver.agency
|
|
|
|
# ── LiteLLM pricing sync ───────────────────────────────────────────────────────
|
|
LITELLM_PRICES_URL=https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json
|
|
LITELLM_COMMIT_HASH=
|
|
|
|
# ── CORS ───────────────────────────────────────────────────────────────────────
|
|
CORS_ORIGINS=http://localhost:5174,https://optical-dev.oliver.solutions
|
|
|
|
# ── Frontend ───────────────────────────────────────────────────────────────────
|
|
# Where to redirect after Azure SSO callback (include subpath if using one)
|
|
FRONTEND_CALLBACK_URL=https://optical-dev.oliver.solutions/cost-tracker/auth/callback
|