diff --git a/README.md b/README.md index e18dc52..2408757 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ - [x] Github Repo 储存支持 - [ ] Github Release 储存支持 +- [ ] Microsoft Onedrive 储存支持 - [ ] 基于数据库的用户/权限管理 - [ ] 操作日志记录 - [ ] Office Documents 预览支持 diff --git a/storages/factory.py b/storages/factory.py index b992859..eef33d5 100644 --- a/storages/factory.py +++ b/storages/factory.py @@ -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()