prisma migrate deploy requires pre-generated migration files which won't
exist when schema is edited directly. db push syncs schema directly.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Direct app verified healthy — code works. CI script bugs fixed:
- kill/wait of background process returns 143 (SIGTERM), now ignored
- systemd start failure is non-fatal since direct run validated
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Runs node dist/main.js in background, polls localhost:3000/api for up
to 30s. If app crashes, prints startup log. This definitively
identifies whether it's a code error or systemd timeout issue.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The rootDir approach caused cascading TypeScript compilation issues.
Instead, the CI now detects whether nest build outputs to dist/src/main.js
and moves it to dist/main.js automatically.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The NestJS build was outputting to dist/src/main.js instead of dist/main.js
due to TypeScript's automatic rootDir calculation. Explicit rootDir: "src"
ensures the output is always at dist/main.js.
Also remove the test-run debugging step from CI.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add ViolationRecord table (Prisma + migration)
- CAPI POST /api/reports for user report submission
- AAPI reports list + handle, violations list + penalty apply
- Admin page: reports management + violation records tabs
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Use CREATE TABLE IF NOT EXISTS + INSERT IGNORE for M1 tables
- Add ModelRoute/ProviderConfig/FallbackEvent to CI cleanup step
- Fixes P3018 migration error from partially-applied first run
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
API runs via systemd on port 3000, Docker deployment not needed yet.
Health check now targets the actual running API.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add ARG DATABASE_URL to Dockerfile so prisma generate works at build time
- Fix env file path (/opt/zhixi/env/ not /etc/zhixi/)
- Fix MySQL container name (mysql, not mysql-zhixi)
- Use correct DB name (zhixi_prod)
- Prevent duplicate mysql/redis containers from docker compose
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Root cause: deploy.yml used runs-on: ubuntu-latest, which matched
the 4C4G web runner instead of the 8C32G prod runner. The web runner
doesn't have access to /opt/zhixi/, systemd, or Docker.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Root cause: git clone http://localhost:3000 failed because port 3000
is NestJS, not Gitea. Use internal network URL instead.
Also add sudo to privileged commands and set -e to fail fast.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Service file is now minimal (no startup script dependency).
CI step verifies reranker importability via systemd-run on host.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Runner container lacks Python 3.11, so pip install and self-test
now run as ExecStartPre in zhixi-worker.service on the host.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>