feat: Add function to use s3 storage instead of local file#73
Merged
ZhengZhenyu merged 3 commits intoopensourceways:mainfrom Feb 25, 2026
Merged
feat: Add function to use s3 storage instead of local file#73ZhengZhenyu merged 3 commits intoopensourceways:mainfrom
ZhengZhenyu merged 3 commits intoopensourceways:mainfrom
Conversation
- 新增活动类型选择(线上 / 线下 / 混合),支持创建和编辑 - 活动时长从"分钟"改为"小时"(保留 1 位小数),Alembic 迁移完成数据转换 - 移除"草稿"状态,默认状态改为"策划中";移除"已取消"状态 - 同步修复社区工作台因字段改名(duration_minutes→duration_hours)引发的 500 错误 - 修正登录页 Logo 拉伸变形(改用方形版本 openGecko-vertical.png) - 更新相关前端视图、API 类型定义、测试用例
存储层重构: - 新增 StorageService 抽象基类,支持 LocalStorage(本地,开发默认) 和 S3Storage(MinIO / AWS S3 / 华为 OBS 等,生产推荐)双后端 - upload.py 改用 StorageService,移除直接文件写入;markdown 内存解码, docx 使用 tempfile 临时解析后存入 StorageService - main.py 改为条件挂载 StaticFiles(仅本地模式下生效) 基础设施: - docker-compose.yml 新增 minio 服务(minio_data volume 持久化, 9001 端口为控制台,backend 依赖 MinIO 健康检查) - nginx.conf 将 /uploads/ 代理改为直连 minio:9000/opengecko/ (开发时由 FastAPI StaticFiles 接管,无需 nginx) 配置管理: - config.py 所有字段加 Field(description=...),配置说明写入代码本身 - 新增 GET /api/admin/config-schema 端点(仅 superuser 可访问), 返回 Pydantic 自动生成的 JSON Schema 及当前生效值(密钥脱敏) - 补充 .env.example 和 .env.prod.example 的 S3/MinIO 配置块 迁移工具: - 新增 backend/scripts/migrate_to_minio.py,一键将本地 uploads/ 目录 文件批量迁移至 MinIO,支持环境变量覆盖参数
Contributor
CLA Signature PassZhengZhenyu, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
Contributor
Linking Issue Notice@ZhengZhenyu , the pull request must be linked to at least one issue. |
Contributor
CLA Signature PassZhengZhenyu, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
Contributor
|
/lgtm |
Contributor
Review Code Feedback
Tips
|
Contributor
|
/approve |
Contributor
Review Code Feedback
Tips
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
feature: Add function to use s3 storage instead of local file
关联 Issue:#
Checklist
#74