feat: 添加对 Microsoft Onedrive 储存支持的 TODO 项目

refactor: 优化 STORAGE_TYPE 环境变量的处理逻辑
This commit is contained in:
2025-11-09 22:26:06 +08:00
parent 34b15ee046
commit 8d73219761
2 changed files with 10 additions and 3 deletions

View File

@@ -35,6 +35,7 @@
- [x] Github Repo 储存支持
- [ ] Github Release 储存支持
- [ ] Microsoft Onedrive 储存支持
- [ ] 基于数据库的用户/权限管理
- [ ] 操作日志记录
- [ ] Office Documents 预览支持

View File

@@ -29,9 +29,15 @@ class StorageFactory:
if cls._instance is not None:
return cls._instance
storage_type = os.getenv(
"STORAGE_TYPE",
).lower()
storage_type = os.getenv("STORAGE_TYPE")
if not storage_type:
raise RuntimeError(
"STORAGE_TYPE environment variable is not set. "
"Supported types: r2, github"
)
storage_type = storage_type.lower()
if storage_type == "r2":
cls._instance = R2Storage()