| title | Legacy: Storage Adapters |
|---|---|
| slug | legacy/guides/storage-adapters |
OpenCodeHub supports a pluggable storage system, allowing you to store repository data (git objects, LFS files, artifacts) on various backends.
- Local Filesystem: Default, stores data on the server's disk.
- S3 Compatible: AWS S3, MinIO, Cloudflare R2, DigitalOcean Spaces.
- Google Drive: Ideal for personal/low-cost deployments.
- Azure Blob Storage: Microsoft Azure storage.
Data is stored in the data/ directory relative to the application root.
Configuration:
STORAGE_TYPE=local
STORAGE_PATH=./data/storage # Optional, default is ./dataStore data in any S3-compatible bucket. This is recommended for production scalablity.
Configuration:
STORAGE_TYPE=s3
STORAGE_BUCKET=my-opencodehub-bucket
STORAGE_REGION=us-east-1 # or auto
STORAGE_ENDPOINT=https://s3.amazonaws.com # or your custom endpoint
S3_ACCESS_KEY=your-access-key
S3_SECRET_KEY=your-secret-keyMinIO (Self-hosted):
STORAGE_ENDPOINT=http://minio:9000
STORAGE_REGION=us-east-1
S3_FORCE_PATH_STYLE=trueCloudflare R2:
STORAGE_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com
STORAGE_REGION=autoThis stack is ideal for cost-effective, serverless-style deployments where you want to minimize persistent volume usage.
- Google Cloud Project: Enable Google Drive API.
- OAuth Credentials: Create "Web Application" credentials.
- Refresh Token: Obtain a long-lived refresh token (e.g., via OAuth Playground).
STORAGE_TYPE=gdrive
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REFRESH_TOKEN=your-refresh-token
GOOGLE_FOLDER_ID=your-folder-idHow to get Credentials:
- Go to Google Cloud Console.
- Create a project -> Enable Google Drive API.
- Create OAuth Client ID.
- Get Refresh Token via OAuth Playground with scope
https://www.googleapis.com/auth/drive.file.
Configuration:
STORAGE_TYPE=azure
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=...
AZURE_CONTAINER_NAME=opencodehub