Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ OPENAI_API_KEY=sk-xxxxxxxxx
# you need to config the clerk webhook secret key if you want to use the clerk with database
#CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx

# Clear allow origin https://clerk.com/docs/guides/dashboard/dns-domains/satellite-domains
# Authentication across different domains , use,to splite different origin
# NEXT_PUBLIC_CLERK_AUTH_ALLOW_ORIGINS='https://market.lobehub.com,https://lobehub.com'

# NextAuth related configurations
# NEXT_PUBLIC_ENABLE_NEXT_AUTH=1
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

# Changelog

## [Version 1.142.0](https://github.com/lobehub/lobe-chat/compare/v1.141.10...v1.142.0)

<sup>Released on **2025-10-24**</sup>

#### ✨ Features

- **misc**: Use env to control clerk allow origin feature.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's improved

- **misc**: Use env to control clerk allow origin feature, closes [#9863](https://github.com/lobehub/lobe-chat/issues/9863) ([490fee0](https://github.com/lobehub/lobe-chat/commit/490fee0))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.141.10](https://github.com/lobehub/lobe-chat/compare/v1.141.9...v1.141.10)

<sup>Released on **2025-10-23**</sup>
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ ENV \
# Anthropic
ANTHROPIC_API_KEY="" ANTHROPIC_MODEL_LIST="" ANTHROPIC_PROXY_URL="" \
# Amazon Bedrock
AWS_ACCESS_KEY_ID="" AWS_SECRET_ACCESS_KEY="" AWS_REGION="" AWS_BEDROCK_MODEL_LIST="" \
ENABLED_AWS_BEDROCK="" AWS_ACCESS_KEY_ID="" AWS_SECRET_ACCESS_KEY="" AWS_REGION="" AWS_BEDROCK_MODEL_LIST="" \
# Azure OpenAI
AZURE_API_KEY="" AZURE_API_VERSION="" AZURE_ENDPOINT="" AZURE_MODEL_LIST="" \
# Baichuan
Expand All @@ -166,7 +166,7 @@ ENV \
# Cohere
COHERE_API_KEY="" COHERE_MODEL_LIST="" COHERE_PROXY_URL="" \
# ComfyUI
COMFYUI_BASE_URL="" COMFYUI_AUTH_TYPE="" \
ENABLED_COMFYUI="" COMFYUI_BASE_URL="" COMFYUI_AUTH_TYPE="" \
COMFYUI_API_KEY="" COMFYUI_USERNAME="" COMFYUI_PASSWORD="" COMFYUI_CUSTOM_HEADERS="" \
# DeepSeek
DEEPSEEK_API_KEY="" DEEPSEEK_MODEL_LIST="" \
Expand Down Expand Up @@ -209,7 +209,7 @@ ENV \
# Ollama
ENABLED_OLLAMA="" OLLAMA_MODEL_LIST="" OLLAMA_PROXY_URL="" \
# OpenAI
OPENAI_API_KEY="" OPENAI_MODEL_LIST="" OPENAI_PROXY_URL="" \
ENABLED_OPENAI="" OPENAI_API_KEY="" OPENAI_MODEL_LIST="" OPENAI_PROXY_URL="" \
# OpenRouter
OPENROUTER_API_KEY="" OPENROUTER_MODEL_LIST="" \
# Perplexity
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.database
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ ENV \
# Anthropic
ANTHROPIC_API_KEY="" ANTHROPIC_MODEL_LIST="" ANTHROPIC_PROXY_URL="" \
# Amazon Bedrock
AWS_ACCESS_KEY_ID="" AWS_SECRET_ACCESS_KEY="" AWS_REGION="" AWS_BEDROCK_MODEL_LIST="" \
ENABLED_AWS_BEDROCK="" AWS_ACCESS_KEY_ID="" AWS_SECRET_ACCESS_KEY="" AWS_REGION="" AWS_BEDROCK_MODEL_LIST="" \
# Azure OpenAI
AZURE_API_KEY="" AZURE_API_VERSION="" AZURE_ENDPOINT="" AZURE_MODEL_LIST="" \
# Baichuan
Expand All @@ -219,7 +219,7 @@ ENV \
# Cohere
COHERE_API_KEY="" COHERE_MODEL_LIST="" COHERE_PROXY_URL="" \
# ComfyUI
COMFYUI_BASE_URL="" COMFYUI_AUTH_TYPE="" \
ENABLED_COMFYUI="" COMFYUI_BASE_URL="" COMFYUI_AUTH_TYPE="" \
COMFYUI_API_KEY="" COMFYUI_USERNAME="" COMFYUI_PASSWORD="" COMFYUI_CUSTOM_HEADERS="" \
# DeepSeek
DEEPSEEK_API_KEY="" DEEPSEEK_MODEL_LIST="" \
Expand Down Expand Up @@ -262,7 +262,7 @@ ENV \
# Ollama
ENABLED_OLLAMA="" OLLAMA_MODEL_LIST="" OLLAMA_PROXY_URL="" \
# OpenAI
OPENAI_API_KEY="" OPENAI_MODEL_LIST="" OPENAI_PROXY_URL="" \
ENABLED_OPENAI="" OPENAI_API_KEY="" OPENAI_MODEL_LIST="" OPENAI_PROXY_URL="" \
# OpenRouter
OPENROUTER_API_KEY="" OPENROUTER_MODEL_LIST="" \
# Perplexity
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.pglite
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ ENV \
# Anthropic
ANTHROPIC_API_KEY="" ANTHROPIC_MODEL_LIST="" ANTHROPIC_PROXY_URL="" \
# Amazon Bedrock
AWS_ACCESS_KEY_ID="" AWS_SECRET_ACCESS_KEY="" AWS_REGION="" AWS_BEDROCK_MODEL_LIST="" \
ENABLED_AWS_BEDROCK="" AWS_ACCESS_KEY_ID="" AWS_SECRET_ACCESS_KEY="" AWS_REGION="" AWS_BEDROCK_MODEL_LIST="" \
# Azure OpenAI
AZURE_API_KEY="" AZURE_API_VERSION="" AZURE_ENDPOINT="" AZURE_MODEL_LIST="" \
# Baichuan
Expand All @@ -168,7 +168,7 @@ ENV \
# Cohere
COHERE_API_KEY="" COHERE_MODEL_LIST="" COHERE_PROXY_URL="" \
# ComfyUI
COMFYUI_BASE_URL="" COMFYUI_AUTH_TYPE="" \
ENABLED_COMFYUI="" COMFYUI_BASE_URL="" COMFYUI_AUTH_TYPE="" \
COMFYUI_API_KEY="" COMFYUI_USERNAME="" COMFYUI_PASSWORD="" COMFYUI_CUSTOM_HEADERS="" \
# DeepSeek
DEEPSEEK_API_KEY="" DEEPSEEK_MODEL_LIST="" \
Expand Down Expand Up @@ -211,7 +211,7 @@ ENV \
# Ollama
ENABLED_OLLAMA="" OLLAMA_MODEL_LIST="" OLLAMA_PROXY_URL="" \
# OpenAI
OPENAI_API_KEY="" OPENAI_MODEL_LIST="" OPENAI_PROXY_URL="" \
ENABLED_OPENAI="" OPENAI_API_KEY="" OPENAI_MODEL_LIST="" OPENAI_PROXY_URL="" \
# OpenRouter
OPENROUTER_API_KEY="" OPENROUTER_MODEL_LIST="" \
# Perplexity
Expand Down
7 changes: 7 additions & 0 deletions changelog/v1.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[
{
"children": {
"features": ["Use env to control clerk allow origin feature."]
},
"date": "2025-10-24",
"version": "1.142.0"
},
{
"children": {
"fixes": ["Loadmore not work & navbar not show in pwa."]
Expand Down
11 changes: 11 additions & 0 deletions docs/self-hosting/advanced/model-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ For example: `+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turb

In the above example, it adds `qwen-7b-chat` and `glm-6b` to the model list, removes `gpt-3.5-turbo` from the list, and displays the model name of `gpt-4-0125-preview` as `gpt-4-turbo`. If you want to disable all models first and then enable specific models, you can use `-all,+gpt-3.5-turbo`, which means only enabling `gpt-3.5-turbo`.

### -all: Hide all models

- Description: `-all` means hiding all built-in models first. It’s usually combined with `+` to only enable the models you explicitly specify.
- Example:

```text
-all,+gpt-3.5-turbo,+gpt-4-0125-preview=gpt-4-turbo
```

This enables only gpt-3.5-turbo and gpt-4-turbo while hiding other models.

## Extension Capabilities

Considering the diversity of model capabilities, we started to add extension configuration in version `0.147.8`, with the following rules:
Expand Down
11 changes: 11 additions & 0 deletions docs/self-hosting/advanced/model-list.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ id->deploymentName=displayName<maxToken:vision:reasoning:search:fc:file:imageOut

上面示例表示增加 `qwen-7b-chat` 和 `glm-6b` 到模型列表,而从列表中删除 `gpt-3.5-turbo`,并将 `gpt-4-0125-preview` 模型名字展示为 `gpt-4-turbo`。如果你想先禁用所有模型,再启用指定模型,可以使用 `-all,+gpt-3.5-turbo`,则表示仅启用 `gpt-3.5-turbo`。

### -all:隐藏所有模型

- 描述:`-all` 表示先隐藏所有内置模型。通常与 `+` 组合使用,用于只启用你显式指定的模型。
- 示例:

```text
-all,+gpt-3.5-turbo,+gpt-4-0125-preview=gpt-4-turbo
```

仅启用 gpt-3.5-turbo 和 gpt-4-turbo,而其他模型都隐藏。

## 扩展能力

考虑到模型的能力多样性,我们在 `0.147.8` 版本开始增加扩展性配置,它的规则如下:
Expand Down
37 changes: 23 additions & 14 deletions docs/self-hosting/environment-variables/model-provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,13 @@ The above example disables all models first, then enables `fal-ai/flux/schnell`

## ComfyUI

### `ENABLED_COMFYUI`

- Type: Optional
- Description: Enables ComfyUI as a model provider by default. Set to `0` to disable the ComfyUI service.
- Default: `1`
- Example: `0`

### `COMFYUI_BASE_URL`

- Type: Optional
Expand Down Expand Up @@ -705,13 +712,6 @@ The above example disables all models first, then enables `fal-ai/flux/schnell`

## BFL

### `ENABLED_BFL`

- Type: Optional
- Description: Enables BFL as a model provider by default. Set to `0` to disable the BFL service.
- Default: `1`
- Example: `0`

### `BFL_API_KEY`

- Type: Required
Expand Down Expand Up @@ -748,13 +748,6 @@ NewAPI is a multi-provider model aggregation service that supports automatic mod

## Vercel AI Gateway

### `ENABLED_VERCELAIGATEWAY`

- Type: Optional
- Description: Enables Vercel AI Gateway as a model provider by default. Set to `0` to disable the Vercel AI Gateway service.
- Default: `1`
- Example: `0`

### `VERCELAIGATEWAY_API_KEY`

- Type: Required
Expand Down Expand Up @@ -785,4 +778,20 @@ NewAPI is a multi-provider model aggregation service that supports automatic mod
- Default: `-`
- Example: `-all,+cerebras-model-1,+cerebras-model-2=cerebras-special`

## AiHubMix

### `AIHUBMIX_API_KEY`

- Type: Required
- Description: This is the API key you applied for in the AiHubMix service.
- Default: -
- Example: `sk-xxxxxx...xxxxxx`

### `AIHUBMIX_MODEL_LIST`

- Type: Optional
- Description: Used to control the AiHubMix model list. Use `+` to add a model, `-` to hide a model, and `model_name=display_name` to customize the display name of a model. Separate multiple entries with commas. The definition syntax follows the same rules as other providers' model lists.
- Default: `-`
- Example: `-all,+claude-opus-4-1-20250805,+claude-opus-4-20250514=claude-opus-4`

[model-list]: /docs/self-hosting/advanced/model-list
37 changes: 23 additions & 14 deletions docs/self-hosting/environment-variables/model-provider.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,

## ComfyUI

### `ENABLED_COMFYUI`

- 类型:可选
- 描述:默认启用 ComfyUI 作为模型供应商,当设为 0 时关闭 ComfyUI 服务
- 默认值:`1`
- 示例:`0`

### `COMFYUI_BASE_URL`

- 类型:可选
Expand Down Expand Up @@ -703,13 +710,6 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,

## BFL

### `ENABLED_BFL`

- 类型:可选
- 描述:默认启用 BFL 作为模型供应商,当设为 0 时关闭 BFL 服务
- 默认值:`1`
- 示例:`0`

### `BFL_API_KEY`

- 类型:必选
Expand Down Expand Up @@ -751,13 +751,6 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,

## Vercel AI Gateway

### `ENABLED_VERCELAIGATEWAY`

- 类型:可选
- 描述:默认启用 Vercel AI Gateway 作为模型供应商,当设为 0 时关闭 Vercel AI Gateway 服务
- 默认值:`1`
- 示例:`0`

### `VERCELAIGATEWAY_API_KEY`

- 类型:必选
Expand Down Expand Up @@ -788,4 +781,20 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 默认值:`-`
- 示例:`-all,+cerebras-model-1,+cerebras-model-2=cerebras-special`

## AiHubMix

### `AIHUBMIX_API_KEY`

- 类型:必选
- 描述:这是你在 AiHubMix 服务中申请的 API 密钥
- 默认值:-
- 示例:`sk-xxxxxx...xxxxxx`

### `AIHUBMIX_MODEL_LIST`

- 类型:可选
- 描述:用来控制 AiHubMix 模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名` 来自定义模型的展示名,用英文逗号隔开。模型定义语法规则与其他 provider 保持一致。
- 默认值:`-`
- 示例:`-all,+claude-opus-4-1-20250805,+claude-opus-4-20250514=claude-opus-4`

[model-list]: /zh/docs/self-hosting/advanced/model-list
5 changes: 1 addition & 4 deletions docs/usage/providers/aihubmix.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ AiHubMix 是一个 AI 模型聚合平台,通过统一的 OpenAI 兼容 API 接
在您的 `.env` 文件中添加以下环境变量:

```bash
# 启用 AiHubMix 提供商
ENABLED_AIHUBMIX=1

# AiHubMix API 密钥(必需)
AIHUBMIX_API_KEY=your_aihubmix_api_key
```
Expand Down Expand Up @@ -97,5 +94,5 @@ AiHubMix 提供多种热门 AI 模型的访问,包括:
如需更多支持:

- 访问 [AiHubMix 文档](https://docs.aihubmix.com/)
- 查看 [模型列表](https://docs.aihubmix.com/cn/api/Model-List)
- 查看 [模型列表](https://aihubmix.com/models)
- 联系 AiHubMix 支持团队解决 API 相关问题
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lobehub/chat",
"version": "1.141.10",
"version": "1.142.0",
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
"keywords": [
"framework",
Expand Down
12 changes: 12 additions & 0 deletions src/layout/AuthProvider/Clerk/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ const Clerk = memo(({ children }: PropsWithChildren) => {
});
}, [count, setCount, isPending, startTransition]);

const allowedRedirectOrigins = useMemo(() => {
const rawOrigins = process.env.NEXT_PUBLIC_CLERK_AUTH_ALLOW_ORIGINS;
if (!rawOrigins) return undefined;

const origins = rawOrigins
.split(',')
.map((origin) => origin.trim())
.filter(Boolean);
return origins.length ? origins : undefined;
}, []);

const updatedAppearance = useMemo(
() => ({
...appearance,
Expand All @@ -43,6 +54,7 @@ const Clerk = memo(({ children }: PropsWithChildren) => {

return (
<ClerkProvider
allowedRedirectOrigins={allowedRedirectOrigins}
appearance={updatedAppearance}
localization={localization}
signUpUrl={!enableClerkSignUp ? '/login' : '/signup'} // Redirect sign-up to sign-in if disabled
Expand Down
Loading