mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-13 19:20:04 +00:00
a28fd30719
* ✨ feat(cloud-sandbox): add Onlyboxes provider support for self-hosted sandbox (#15136) - Add `SANDBOX_PROVIDER` env var (market | onlyboxes) to select sandbox backend - Add Onlyboxes-specific env vars: `ONLYBOXES_BASE_URL`, `ONLYBOXES_API_TOKEN`, `ONLYBOXES_LEASE_TTL_SEC` - Create `SandboxService` abstraction layer with `MarketSandboxService` and `OnlyboxesSandboxService` implementations - Add `createSandboxService` factory that routes to configured provider - Migrate `execInSandbox` and `exportFile` t * ✨ feat(sandbox): improve Onlyboxes export flow * 🐛 fix(sandbox): pass presigned upload headers to Onlyboxes * ✅ test(sandbox): import tool runtime package * 🐛 fix(sandbox): preserve Market export errors * 🐛 fix(sandbox): allow empty docker env defaults * 🔒 fix: redact sandbox auth params in logs * 🐛 fix: address sandbox provider review comments * 🔐 feat: use onlyboxes jit tokens * 📝 docs: clarify cloud sandbox provider config * 🐛 fix: align cloud sandbox timeout defaults * 🐛 fix(sandbox): lower default Onlyboxes lease TTL to 15 minutes * 🐛 fix(sandbox): cap Onlyboxes task wait time * ♻️ refactor: split sandbox env config
97 lines
3.3 KiB
Plaintext
97 lines
3.3 KiB
Plaintext
---
|
|
title: LobeHub Environment Variables - Customizing Guide
|
|
description: >-
|
|
Learn how to customize LobeHub configuration using environment variables for
|
|
additional features and options.
|
|
tags:
|
|
- LobeHub
|
|
- Environment Variables
|
|
- Configuration
|
|
- Customization
|
|
---
|
|
|
|
# Environment Variables
|
|
|
|
LobeHub provides some additional configuration options when deployed, which can be customized using environment variables.
|
|
|
|
<Cards>
|
|
<Card href={'environment-variables/basic'} title={'Basic Environment Variables'} />
|
|
|
|
<Card href={'environment-variables/model-provider'} title={'Model Service Providers'} />
|
|
|
|
<Card href={'environment-variables/auth'} title={'Authentication'} />
|
|
|
|
<Card href={'environment-variables/s3'} title={'S3 Storage Service'} />
|
|
|
|
<Card href={'environment-variables/cloud-sandbox'} title={'Cloud Sandbox'} />
|
|
|
|
<Card href={'environment-variables/analytics'} title={'Data Analytics'} />
|
|
</Cards>
|
|
|
|
## Building a Custom Image with Overridden `NEXT_PUBLIC` Variables
|
|
|
|
If you need to override `NEXT_PUBLIC` environment variables, you can build a custom Docker image using GitHub Actions without forking the entire LobeHub repository. Here's a guide on how to do this:
|
|
|
|
1. Create a new GitHub repository for your custom build.
|
|
|
|
2. In your new repository, create a `.github/workflows` directory.
|
|
|
|
3. Inside the `.github/workflows` directory, create a file named `build-custom-lobe.yml`:
|
|
|
|
```yaml
|
|
name: Build Custom Image
|
|
|
|
on:
|
|
workflow_dispatch: # Manual trigger
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.repository_owner }}/lobehub # Name of your image
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: lobehub/lobehub
|
|
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: Dockerfile.database # Change dockerfile if needed
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
# List all variables you need to overwrite
|
|
build-args: |
|
|
NEXT_PUBLIC_BASE_PATH=${{ secrets.NEXT_PUBLIC_BASE_PATH }}
|
|
```
|
|
|
|
4. In your GitHub Repository settings > Secrets and variables > Actions > Repository secrets, add any `NEXT_PUBLIC` variables you want to override
|
|
|
|
5. Set "Read and write" permissions for workflows in Repository settings > Actions > General > Workflow permissions.
|
|
|
|
6. To build your custom image, go to the "Actions" tab in your GitHub repository and manually trigger the "Build Custom LobeHub Image" workflow.
|
|
|
|
This approach allows you to create a custom build with your desired `NEXT_PUBLIC` variables without maintaining a full fork of the LobeHub repository. You can trigger a new build whenever you need to update your custom image.
|