mirror of
https://github.com/RhenCloud/Cloud-Index.git
synced 2025-12-06 15:26:10 +08:00
feat: 添加对 Microsoft Onedrive 储存支持的 TODO 项目
refactor: 优化 STORAGE_TYPE 环境变量的处理逻辑
This commit is contained in:
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
- [x] Github Repo 储存支持
|
- [x] Github Repo 储存支持
|
||||||
- [ ] Github Release 储存支持
|
- [ ] Github Release 储存支持
|
||||||
|
- [ ] Microsoft Onedrive 储存支持
|
||||||
- [ ] 基于数据库的用户/权限管理
|
- [ ] 基于数据库的用户/权限管理
|
||||||
- [ ] 操作日志记录
|
- [ ] 操作日志记录
|
||||||
- [ ] Office Documents 预览支持
|
- [ ] Office Documents 预览支持
|
||||||
|
|||||||
@@ -29,9 +29,15 @@ class StorageFactory:
|
|||||||
if cls._instance is not None:
|
if cls._instance is not None:
|
||||||
return cls._instance
|
return cls._instance
|
||||||
|
|
||||||
storage_type = os.getenv(
|
storage_type = os.getenv("STORAGE_TYPE")
|
||||||
"STORAGE_TYPE",
|
|
||||||
).lower()
|
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":
|
if storage_type == "r2":
|
||||||
cls._instance = R2Storage()
|
cls._instance = R2Storage()
|
||||||
|
|||||||
Reference in New Issue
Block a user