This page provides detailed information on how to configure Bun Expo Updates Server, including environment variables, Redis configuration, object storage settings, and more.
Bun Expo Updates Server uses environment variables for configuration. You can set these variables using a .env file or directly in your environment. Here are all available environment variables:
| Environment Variable | Required | Description | Default Value |
|---|---|---|---|
port |
No | Port on which the server listens | 3000 |
DEBUG |
No | Enable debug logs | false |
LOG_LANGUAGE |
No | Log language, supports zh-CN or en-US |
en-US |
HOSTNAME |
Yes | Base URL for update resources | - |
| Environment Variable | Required | Description | Default Value |
|---|---|---|---|
REDIS_URL |
Yes | Redis connection URL, format: redis://[username]:[password]@host:port |
- |
| Environment Variable | Required | Description | Default Value |
|---|---|---|---|
CLIENT_PROJECT_PATH |
Yes | Local path to the client Expo project | - |
| Environment Variable | Required | Description | Default Value |
|---|---|---|---|
PRIVATE_KEY_PATH |
No | Path to the private key for code signing | code-sign-keys/private-key.pem |
| Environment Variable | Required | Description | Default Value |
|---|---|---|---|
OSS_PROVIDER |
Yes | OSS provider, supports dogecloud, qiniu, s3, or custom |
- |
OSS_ACCESS_KEY |
Yes | OSS access key | - |
OSS_SECRET_KEY |
Yes | OSS secret key | - |
OSS_FORCE_PATH_STYLE |
No | Force path style (0 false, 1 true) | 0 |
OSS_REGION |
Yes* | OSS region, required by some providers | - |
OSS_BUCKET |
Yes* | OSS bucket name, required by some providers | - |
OSS_ENDPOINT |
Yes* | OSS endpoint, required for S3 or custom providers | - |
*Note: Some variables may be required depending on the selected OSS provider.
Here's an example of a complete .env file:
Redis is used for caching update manifests and other server states. Ensure you have a Redis instance available and configured via the REDIS_URL environment variable.
Examples:
redis://localhost:6379 - Connect to local Redis with no passwordredis://:password123@redis-server:6379 - Connect to Redis server with passwordredis://username:password@redis-server:6379/1 - Using username, password, and specific databaseThe Expo Updates protocol supports code signing to verify update integrity. To enable code signing, you need to generate a key pair and configure the private key path:
Set the PRIVATE_KEY_PATH environment variable to the path of your private key:
In your Expo client configuration, add the public key configuration:
To get the Base64 encoded public key, you can run:
The server supports multiple object storage services for storing update files. Configure the required environment variables based on your chosen provider:
To use a custom OSS provider, see the OSS Adapters section for information on how to implement and register a custom adapter.
In a production environment, it is recommended to:
Disable debug logs:
Use secure Redis configuration, including password and TLS:
Ensure HOSTNAME uses HTTPS:
Consider using environment variable management tools like Docker Secrets or cloud platform environment variable management features instead of directly using .env files.
If you need to manage updates for multiple client projects, you can switch the CLIENT_PROJECT_PATH as needed:
For high-traffic scenarios, consider:
For more advanced configuration options, refer to the relevant module documentation in the server source code.