Guides
Security Hardening
Secure your textrawl deployment
Security best practices for production deployments.
Authentication
Always set API_BEARER_TOKEN in production:
All API endpoints require Authorization: Bearer <token> header.
Row Level Security
Run the RLS script after schema setup:
Environment Security
- Never commit
.envto version control - Use secret managers in production
- Rotate API keys regularly
- Use separate keys for dev/prod
Network Security
- Deploy behind reverse proxy (nginx, Caddy)
- Enable HTTPS/TLS
- Set
ALLOWED_ORIGINSfor CORS - Use private networking for database
Rate Limiting
Built-in limits (not configurable):
| Endpoint | Limit |
|---|---|
| API | 100/min |
| Upload | 10/min |
| Health | 300/min |
Logging
- All logs go to stderr (stdout reserved for MCP)
- Set
LOG_LEVEL=infoin production - Monitor for authentication failures
- Alert on repeated 401/403 errors
Checklist
- API_BEARER_TOKEN set (32+ chars)
- RLS script executed
- HTTPS enabled
- CORS configured
- Secrets in secret manager
- Logging configured
- Health monitoring active