mirror of
https://github.com/lobehub/lobehub.git
synced 2026-09-20 04:56:13 +08:00
191f3fe776
* 📝 docs: fix outdated content across the docs site Audited docs/ against the current codebase and fixed stale content that drifted after major refactors (Clerk/NextAuth → Better Auth, src/server → apps/server, src/{config,envs,locales} → packages/*, model-bank updates). - self-hosting/auth: mark removed NextAuth/Clerk pages with deprecation warnings; fix microsoft/zitadel alias claims and the Logto callback path - environment-variables & advanced: correct wrong defaults (S3_SET_ACL, AI_IMAGE_DEFAULT_IMAGE_NUM, index/proxy URLs), drop non-existent env vars and fictional feature flags, fix OIDC config guidance - development: update refactored paths, Better Auth, .mjs configs, remove the MSW section (msw is not a dependency) - providers & model examples: replace retired model ids with in-bank ones; fix comfyui frontmatter corruption - usage: rename Moderator→Orchestrator, GTD→Task, correct shortcut keys, channel capability tables, Feishu/Lark WebSocket mode - platform/migration: fix dead links, docker service name, npx/npm → bun EN and zh-CN pairs updated together. * 📝 docs: fix Logto callback path and AUTH_SECRET deprecation guidance - Revert Logto/Sealos callback URLs to /api/auth/callback/logto to match the runtime SSO redirectURI override - Narrow legacy auth Callout: AUTH_SECRET remains required for Better Auth; mark NEXT_AUTH_SECRET as deprecated in zh-CN * 📝 docs: refresh agent skills for locales, env, auth, and agentRun paths Align OSS agent guidance with post-refactor layout: - packages/locales/src/default + bun run i18n - packages/env/src for env schemas (@/envs alias) - spa-auth shell + src/routes/auth segments - chat agentRun/transports/hetero instead of aiChat * 📝 docs: document APP_URL as required for Better Auth base URL Self-hosted auth uses appEnv.APP_URL as baseURL, not request-header auto-detection. NEXT_PUBLIC_AUTH_URL remains deprecated. * 📝 docs: note self-host search provider setup for web search Built-in lobe-web-browsing needs no client plugin, but self-hosted servers still require SEARCH_PROVIDERS / SEARXNG_URL (default SearXNG). * 📝 docs: point feature guide welcome UI at AgentHome Opening message/questions on the agent chat page live in src/features/AgentHome, not Onboarding WelcomeMessage.
156 lines
5.6 KiB
Plaintext
156 lines
5.6 KiB
Plaintext
---
|
|
title: LobeHub Upstream Sync and Docker Deployment Guide
|
|
description: >-
|
|
Learn how to enable automatic updates for LobeHub Vercel deployments and
|
|
upgrade Docker deployment versions easily. Follow step-by-step instructions
|
|
for a seamless deployment process.
|
|
tags:
|
|
- Upstream Sync
|
|
- Vercel Deployment
|
|
- Docker Deployment
|
|
- Automatic Updates
|
|
- Redeploy Docker Container
|
|
---
|
|
|
|
# Upstream Sync
|
|
|
|
## `A` Vercel / Zeabur Deployment
|
|
|
|
If you deployed your project according to the one-click deployment steps in the README, you may have noticed that you are always prompted with "updates available." This is because Vercel defaults to creating a new project for you instead of forking the original project, which prevents accurate update detection. We recommend following these steps to redeploy:
|
|
|
|
- Delete the original repository;
|
|
- Use the <kbd>Fork</kbd> button in the top right corner of the page to fork the original project;
|
|
- Redeploy on `Vercel`.
|
|
|
|
### Enable Automatic Updates
|
|
|
|
<Callout>
|
|
If you encounter an error when executing `Upstream Sync`, please try executing it manually again
|
|
</Callout>
|
|
|
|
After forking the project, due to Github's limitations, you need to manually enable Workflows on the Actions page of your forked project and start the Upstream Sync Action. Once enabled, you can set up automatic updates to occur every hour.
|
|
|
|
<Image alt="Enable Automatic Updates S1" src="https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/266985117-4d48fe7b-0412-4667-8129-b25ebcf2c9de.png" />
|
|
|
|
<Image alt="Enable Automatic Updates S2" src="https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/266985177-7677b4ce-c348-4145-9f60-829d448d5be6.png" />
|
|
|
|
If you encounter a sync failure, you need to manually click "Update Branch" once.
|
|
|
|
<Image alt="GitHub Action Sync Failure" src="/blog/assets195200c7bc42360675e78a6bfa9fe320.webp" />
|
|
|
|
<Image alt="Manually Sync 'Update Branch'" src="/blog/assetsbeefe4dbe3e6f141e09c62064c6dc397.webp" />
|
|
|
|
## `B` Docker Deployment
|
|
|
|
Upgrading the Docker deployment version is very simple, you just need to redeploy the latest LobeHub image. Here are the commands required to perform these steps:
|
|
|
|
<Steps>
|
|
### Stop and Remove the Current Running LobeHub Container
|
|
|
|
Assuming the LobeHub container is named `lobehub`, use the following commands to stop and remove the currently running LobeHub container:
|
|
|
|
```fish
|
|
docker stop lobehub
|
|
docker rm lobehub
|
|
```
|
|
|
|
### Pull the Latest LobeHub Image
|
|
|
|
Use the following command to pull the latest Docker image for LobeHub:
|
|
|
|
```fish
|
|
docker pull lobehub/lobehub
|
|
```
|
|
|
|
### Restart the Docker Container
|
|
|
|
Redeploy the LobeHub container using the newly pulled image:
|
|
|
|
```fish
|
|
docker run -d -p 3210:3210 \
|
|
-e OPENAI_API_KEY=sk-xxxx \
|
|
-e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
|
|
--name lobehub \
|
|
lobehub/lobehub
|
|
```
|
|
</Steps>
|
|
|
|
Ensure that you have sufficient permissions to stop and remove the container before executing these commands, and that Docker has sufficient permissions to pull the new image.
|
|
|
|
<Callout type={'tip'}>
|
|
**If I redeploy, will I lose my local chat records?**
|
|
|
|
No need to worry, you won't. All of LobeHub's chat records are stored in your local browser. Therefore, when redeploying LobeHub using Docker, your chat records will not be lost.
|
|
</Callout>
|
|
|
|
If you wish to automate the above steps, you can follow the method below and use Crontab scheduling to complete it. The specific steps are as follows.
|
|
|
|
<Steps>
|
|
### Write automatic update scripts and configuration files
|
|
|
|
First, create a `lobe.env` configuration file with various environment variables, for example:
|
|
|
|
```env
|
|
OPENAI_API_KEY=sk-xxxx
|
|
OPENAI_PROXY_URL=https://api-proxy.com/v1
|
|
OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4.1=gpt-4-turbo,gpt-4o=gpt-4-vision
|
|
```
|
|
|
|
Then, you can use the following script to automate the update:
|
|
|
|
```bash
|
|
#!/bin/bash
|
|
# auto-update-lobehub.sh
|
|
|
|
# Set up proxy (optional)
|
|
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
|
|
|
|
# Pull the latest image and store the output in a variable
|
|
output=$(docker pull lobehub/lobehub:latest 2>&1)
|
|
|
|
# Check if the pull command was executed successfully
|
|
if [ $? -ne 0 ]; then
|
|
exit 1
|
|
fi
|
|
|
|
# Check if the output contains a specific string
|
|
echo "$output" | grep -q "Image is up to date for lobehub/lobehub:latest"
|
|
|
|
# If the image is already up to date, do nothing
|
|
if [ $? -eq 0 ]; then
|
|
exit 0
|
|
fi
|
|
|
|
echo "Detected lobehub update"
|
|
|
|
# Remove the old container
|
|
echo "Removed: $(docker rm -f lobehub)"
|
|
|
|
# Run the new container(Please change the path to the env file)
|
|
echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=lobehub --restart=always lobehub/lobehub)"
|
|
|
|
# Print the update time and version
|
|
echo "Update time: $(date)"
|
|
echo "Version: $(docker inspect lobehub/lobehub:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')"
|
|
|
|
# Clean up unused images
|
|
docker images | grep 'lobehub/lobehub' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1
|
|
echo "Removed old images."
|
|
```
|
|
|
|
<Callout type={'warning'}>
|
|
This script can be used in Crontab, but please ensure that your Crontab can find the correct
|
|
Docker command. It is recommended to use absolute paths.
|
|
</Callout>
|
|
|
|
Configure Crontab to execute the script every 5 minutes:
|
|
|
|
### Configure Crontab to automatically execute scripts
|
|
|
|
The following command configures Crontab to execute scripts every 5 minutes, or as often as you like:
|
|
|
|
```bash
|
|
*/5 * * * * /path/to/auto-update-lobehub.sh >> /path/to/auto-update-lobehub.log 2>&1
|
|
```
|
|
</Steps>
|