Storage
Expo Open OTA supports two storage solutions for hosting your update assets: Amazon S3 and Local File System. This guide will help you set up your storage solution and configure your server to use it.
The environment variables required for each storage solution are listed below, you can set them in a .env
file in the root of the project or keep them in a safe place to prepare for deployment.
- Amazon S3
- Local File System
To enable Amazon S3 as your storage solution, you need to set the following environment variables:
STORAGE_MODE=s3
AWS_REGION=your-region
S3_BUCKET_NAME=your-bucket-name
If your are not using AWS IAM roles, you also need to set the following environment variables:
AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
You don't need to allow public read access to the assets, as the server will generate pre-signed URLs for the assets for CDN if configured. If CDN is not configured, the server will return the asset directly.
This storage solution is not recommended for production use. It is intended for development and testing purposes only. If you really want to use it in production, make sure to not have multiple instances of the server running, as the assets are stored locally and not shared between instances.
To use the local file system as your storage solution, you need to set the STORAGE_MODE
and LOCAL_BUCKET_BASE_PATH
environment variable to the path where you want to store your assets. The server will create the necessary directories and store the assets in the specified location.
STORAGE_MODE=local
LOCAL_BUCKET_BASE_PATH=/path/to/your/assets