Branch | CircleCI | FOSSA Status |
---|---|---|
Master |
An emulator for the Backblaze B2 Cloud Storage service. The goal of the project is to mimic the B2 API to provide a tool that can be used to test applications built to use B2.
Note: This project is currently in an early state. There is little coverage of the B2 API.
- b2_upload_file - "fileInfo" ignored, error codes don't match B2 API
- b2_download_file_by_id - "fileInfo" ignored, error codes don't match B2 API
The latest version is published at the mwelke/b2-emulator Docker repository.
To run the image locally:
docker run --name my-b2-emulator -p 5000:5000 mwelke/b2-emulator:latest
Set the PROVIDER
environment variable to choose which provider is loaded at runtime. Options are:
- MEMORY - An in memory provider. Stores the files in a concurrent dictionary data structure in memory until the process exits. Warning: Files will not be persisted once process exits
- The .NET SDK must be installed.
- Run
dotnet build
from the project/solution directory.
- Run
dotnet test
from thetest/B2Emulator.Tests
subdirectory.
From the src/B2Emulator
subdirectory, run dotnet run
with the following environment variables set:
ASPNETCORE_ENVIRONMENT
- DevelopmentASPNETCORE_URLS
- http://0.0.0.0:DESIRED_PORTB2_CLOUD_STORAGE_ACCOUNT_ID
- ACCOUNT_IDB2_CLOUD_STORAGE_BUCKET_ID
- BUCKET_ID
Note that the B2 credentials are used to fake authorization endpoints and bucket behavior. They are not transmitted.