Files not displaying after upload due to missing EVIDENCE_DIR and EVIDENCE_URL_SECRET environment variables. Uploads fail silently when env vars unset, files never inserted into database. Add bug fix documentation with root cause analysis and VPS deployment instructions. Update .env.local.example to emphasize these vars are required for file uploads to work. See docs/BUG_FIX_evidence_display.md for details.
30 lines
1012 B
Bash
30 lines
1012 B
Bash
# Database (plain PostgreSQL — no Supabase)
|
|
DATABASE_URL=postgres://app_user:<password>@127.0.0.1:5432/ims
|
|
DATABASE_URL_ADMIN=postgres://app_admin:<password>@127.0.0.1:5432/ims
|
|
|
|
# Auth (custom JWT)
|
|
JWT_SECRET=<generate with: openssl rand -hex 32>
|
|
|
|
# App
|
|
APP_URL=http://localhost:3000
|
|
NEXT_PUBLIC_SITE_URL=http://localhost:3000
|
|
CRON_SECRET=<generate with: openssl rand -hex 32>
|
|
|
|
# Evidence storage (local filesystem) — REQUIRED for file uploads
|
|
# Without these, file uploads fail silently and no files appear in incidents
|
|
EVIDENCE_DIR=/tmp/ims-evidence
|
|
EVIDENCE_URL_SECRET=<generate with: openssl rand -hex 32>
|
|
|
|
# Email (Brevo)
|
|
BREVO_API_KEY=<your-brevo-api-key>
|
|
BREVO_FROM_EMAIL=noreply@setia.com.my
|
|
BREVO_FROM_NAME=Setia IMS
|
|
|
|
# AI keys — optional here; preferred location is the app_settings table (/hse/settings)
|
|
ANTHROPIC_API_KEY=sk-ant-...
|
|
VOYAGE_API_KEY=pa-...
|
|
|
|
# Meta WhatsApp Cloud API — optional here; preferred location is app_settings
|
|
META_WHATSAPP_PHONE_NUMBER_ID=
|
|
META_WHATSAPP_ACCESS_TOKEN=
|