[4.0.0] - 2025-11-11
🚀 Features
- Add authentication database schema and services
- Add authentication middleware, API routes, and quota system
- Add user-scoped file storage to FileService
- Add authentication and quota checks to /api/files route
- Add authentication and quota checks to /api/files/[filename] route
- Add optional authentication to search-db route
- Add authentication and quota checks to /api/ai route
- Add development authentication bypass
- Add complete authentication UI with auto-redirect
- Add security hardening and email service
- Add CSP nonce support and security hardening
🐛 Bug Fixes
- Resolve TypeScript errors in auth-service and database
- Add proper return type to verifySession method
- Resolve TypeScript errors in usage tracker
- Ensure user markdown folder is created after signup and session is established
- Properly create user markdown folders on signup and login
💼 Other
- Fix CodeQL alerts
- Pre-check Content-Length and return 413 before JSON parse
- Tighten early Content-Length check to 10MB exact
- Accept 500 for oversized uploads
- Copy better-sqlite3 native bindings to fix database support
- Rebuild better-sqlite3 for production and copy dependencies
- Align libc by using Debian-based builder (glibc)\n\n- Switch builder to node:20-bookworm-slim to match distroless Debian runtime\n- Rebuild better-sqlite3 against glibc to fix musl libc error\n- Keeps copying native module into standalone output
- Enable QEMU for multi-arch native module build (better-sqlite3)
- Fix cookie secure flag for non-HTTPS Docker deployments
- Switch to bookworm-slim runtime for shell access
- Fix permissions for database file creation
- Prevent env files from being indexed as markdown
- Ensure user markdown directory exists on login; FileService: expose ensureUserDirExists()
- Clarify markdown folder is auto-created in docker-compose
- Clarify markdown folder auto-creation in Docker deployment
📚 Documentation
- Add environment configuration template
- Add managed hosting implementation status document
- Update implementation status - all core routes protected
⚙️ Miscellaneous Tasks
- Migrate middleware to proxy.ts and clean AppHeader props
🛡️ Security
- Add required JWT_SECRET and ENCRYPTION_KEY for v4.0.0