Initial commit: RSS platform phase 1 skeleton with code review fixes
Features: - FastAPI + SQLAlchemy 2.0 async + PostgreSQL/pgvector + Redis backend - Vue 3 + TypeScript + Element Plus frontend - JWT auth with access/refresh tokens and revocation - Admin/member RBAC - RSS feed CRUD and article listing - Settings management with Fernet encryption for sensitive values - Redis distributed lock service - Alembic initial migration - Docker Compose development environment Fixes from code review: - Fix DB session leak in dependency injection - Restrict registration to admin only - Add default admin password warning - Implement JWT refresh tokens and jti blacklist - Strengthen password policy - Use func.count for pagination totals - Replace NullPool with AsyncAdaptedQueuePool - Remove init_db from lifespan to enforce alembic migrations - Add request_id middleware and logging filter - Fix vite.config.ts env loading - Add frontend token refresh interceptor - Add Vue error handler Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# 数据库
|
||||
DATABASE_URL=postgresql+asyncpg://rss:rss@postgres:5432/rss_platform
|
||||
|
||||
# Redis
|
||||
REDIS_URL=redis://redis:6379/0
|
||||
|
||||
# JWT
|
||||
# 生产环境必须使用随机生成的、长度 >= 32 的字符串
|
||||
SECRET_KEY=change-me-in-production-min-32-chars-long-required
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES=15
|
||||
REFRESH_TOKEN_EXPIRE_DAYS=7
|
||||
|
||||
# AI(占位,后续阶段启用)
|
||||
AI_DEFAULT_PROVIDER=openai
|
||||
AI_DEFAULT_MODEL=gpt-4o-mini
|
||||
|
||||
# 对象存储
|
||||
STORAGE_TYPE=minio
|
||||
MINIO_ENDPOINT=minio:9000
|
||||
MINIO_ACCESS_KEY=minioadmin
|
||||
MINIO_SECRET_KEY=minioadmin
|
||||
MINIO_BUCKET=rss-platform
|
||||
|
||||
# CORS
|
||||
CORS_ALLOWED_ORIGINS=http://localhost:5173,http://127.0.0.1:5173
|
||||
|
||||
# 敏感设置加密密钥(可选但强烈建议)
|
||||
# 生成方式:python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
|
||||
# 为空时敏感配置以明文存储
|
||||
SETTINGS_ENCRYPTION_KEY=
|
||||
|
||||
# 日志
|
||||
LOG_LEVEL=INFO
|
||||
|
||||
# RSS 抓取
|
||||
FETCH_CONCURRENCY=10
|
||||
FETCH_TIMEOUT=30
|
||||
DEFAULT_FETCH_INTERVAL=60
|
||||
MIN_FETCH_INTERVAL=15
|
||||
|
||||
# 端口(开发环境)
|
||||
BACKEND_PORT=8000
|
||||
FRONTEND_PORT=5173
|
||||
POSTGRES_PORT=5432
|
||||
REDIS_PORT=6379
|
||||
MINIO_API_PORT=9000
|
||||
MINIO_CONSOLE_PORT=9001
|
||||
Reference in New Issue
Block a user