@lobehub/lobehub 2.0.0-next.331 → 2.0.0-next.333
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/apps/desktop/src/main/const/dir.ts +3 -0
- package/apps/desktop/src/main/controllers/SystemCtr.ts +19 -0
- package/apps/desktop/src/main/controllers/__tests__/SystemCtr.test.ts +1 -0
- package/apps/desktop/src/main/menus/impls/macOS.test.ts +1 -0
- package/changelog/v1.json +21 -0
- package/docs/changelog/2023-09-09-plugin-system.mdx +3 -2
- package/docs/changelog/2023-11-14-gpt4-vision.mdx +6 -4
- package/docs/changelog/2023-11-19-tts-stt.mdx +3 -2
- package/docs/changelog/2023-12-22-dalle-3.mdx +5 -2
- package/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx +2 -2
- package/docs/changelog/2024-02-08-sso-oauth.mdx +2 -2
- package/docs/changelog/2024-06-19-lobe-chat-v1.mdx +3 -2
- package/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx +2 -2
- package/docs/changelog/2024-07-19-gpt-4o-mini.mdx +3 -2
- package/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx +2 -2
- package/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx +3 -2
- package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx +5 -4
- package/docs/changelog/2024-09-13-openai-o1-models.mdx +2 -2
- package/docs/changelog/2024-09-20-artifacts.mdx +3 -2
- package/docs/changelog/2024-09-20-artifacts.zh-CN.mdx +2 -2
- package/docs/changelog/2024-10-27-pin-assistant.mdx +3 -2
- package/docs/changelog/2024-11-06-share-text-json.mdx +4 -2
- package/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx +2 -2
- package/docs/changelog/2024-11-25-november-providers.mdx +2 -2
- package/docs/changelog/2024-11-27-forkable-chat.mdx +2 -2
- package/docs/changelog/2025-01-03-user-profile.mdx +2 -2
- package/docs/changelog/2025-01-22-new-ai-provider.mdx +2 -2
- package/docs/changelog/2025-02-02-deepseek-r1.mdx +4 -4
- package/docs/development/basic/add-new-authentication-providers.mdx +4 -0
- package/docs/development/basic/add-new-authentication-providers.zh-CN.mdx +4 -0
- package/docs/development/basic/add-new-image-model.mdx +4 -0
- package/docs/development/basic/add-new-image-model.zh-CN.mdx +4 -0
- package/docs/development/basic/architecture.mdx +4 -0
- package/docs/development/basic/architecture.zh-CN.mdx +4 -0
- package/docs/development/basic/chat-api.mdx +4 -0
- package/docs/development/basic/chat-api.zh-CN.mdx +4 -0
- package/docs/development/basic/comfyui-development.mdx +3 -1
- package/docs/development/basic/contributing-guidelines.mdx +4 -0
- package/docs/development/basic/contributing-guidelines.zh-CN.mdx +4 -0
- package/docs/development/basic/feature-development-frontend.mdx +11 -3
- package/docs/development/basic/feature-development-frontend.zh-CN.mdx +11 -3
- package/docs/development/basic/feature-development.mdx +14 -5
- package/docs/development/basic/feature-development.zh-CN.mdx +14 -5
- package/docs/development/basic/folder-structure.mdx +7 -0
- package/docs/development/basic/folder-structure.zh-CN.mdx +7 -0
- package/docs/development/basic/resources.mdx +4 -0
- package/docs/development/basic/resources.zh-CN.mdx +4 -0
- package/docs/development/basic/setup-development.mdx +4 -0
- package/docs/development/basic/setup-development.zh-CN.mdx +4 -0
- package/docs/development/basic/test.mdx +4 -0
- package/docs/development/basic/test.zh-CN.mdx +4 -0
- package/docs/development/basic/work-with-server-side-database.mdx +5 -5
- package/docs/development/basic/work-with-server-side-database.zh-CN.mdx +5 -5
- package/docs/development/internationalization/add-new-locale.mdx +4 -0
- package/docs/development/internationalization/add-new-locale.zh-CN.mdx +4 -0
- package/docs/development/internationalization/internationalization-implementation.mdx +4 -0
- package/docs/development/internationalization/internationalization-implementation.zh-CN.mdx +4 -0
- package/docs/development/others/lighthouse.mdx +4 -0
- package/docs/development/others/lighthouse.zh-CN.mdx +4 -0
- package/docs/development/start.mdx +4 -0
- package/docs/development/start.zh-CN.mdx +4 -0
- package/docs/development/state-management/state-management-intro.mdx +4 -2
- package/docs/development/state-management/state-management-intro.zh-CN.mdx +4 -2
- package/docs/development/state-management/state-management-selectors.mdx +6 -1
- package/docs/development/state-management/state-management-selectors.zh-CN.mdx +6 -1
- package/docs/development/tests/integration-testing.zh-CN.mdx +4 -0
- package/docs/self-hosting/advanced/analytics.mdx +2 -2
- package/docs/self-hosting/advanced/auth/better-auth/apple.mdx +132 -0
- package/docs/self-hosting/advanced/auth/better-auth/apple.zh-CN.mdx +127 -0
- package/docs/self-hosting/advanced/auth/better-auth/auth0.mdx +111 -0
- package/docs/self-hosting/advanced/auth/better-auth/auth0.zh-CN.mdx +107 -0
- package/docs/self-hosting/advanced/auth/better-auth/authelia.mdx +66 -0
- package/docs/self-hosting/advanced/auth/better-auth/authelia.zh-CN.mdx +62 -0
- package/docs/self-hosting/advanced/auth/better-auth/authentik.mdx +67 -0
- package/docs/self-hosting/advanced/auth/better-auth/authentik.zh-CN.mdx +63 -0
- package/docs/self-hosting/advanced/auth/better-auth/casdoor.mdx +62 -0
- package/docs/self-hosting/advanced/auth/better-auth/casdoor.zh-CN.mdx +58 -0
- package/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.mdx +59 -0
- package/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.zh-CN.mdx +55 -0
- package/docs/self-hosting/advanced/auth/better-auth/cognito.mdx +88 -0
- package/docs/self-hosting/advanced/auth/better-auth/cognito.zh-CN.mdx +85 -0
- package/docs/self-hosting/advanced/auth/better-auth/feishu.mdx +73 -0
- package/docs/self-hosting/advanced/auth/better-auth/feishu.zh-CN.mdx +69 -0
- package/docs/self-hosting/advanced/auth/better-auth/generic-oidc.mdx +86 -0
- package/docs/self-hosting/advanced/auth/better-auth/generic-oidc.zh-CN.mdx +83 -0
- package/docs/self-hosting/advanced/auth/better-auth/github.mdx +93 -0
- package/docs/self-hosting/advanced/auth/better-auth/github.zh-CN.mdx +90 -0
- package/docs/self-hosting/advanced/auth/better-auth/google.mdx +80 -0
- package/docs/self-hosting/advanced/auth/better-auth/google.zh-CN.mdx +77 -0
- package/docs/self-hosting/advanced/auth/better-auth/keycloak.mdx +77 -0
- package/docs/self-hosting/advanced/auth/better-auth/keycloak.zh-CN.mdx +74 -0
- package/docs/self-hosting/advanced/auth/better-auth/logto.mdx +64 -0
- package/docs/self-hosting/advanced/auth/better-auth/logto.zh-CN.mdx +60 -0
- package/docs/self-hosting/advanced/auth/better-auth/microsoft.mdx +113 -0
- package/docs/self-hosting/advanced/auth/better-auth/microsoft.zh-CN.mdx +109 -0
- package/docs/self-hosting/advanced/auth/better-auth/okta.mdx +67 -0
- package/docs/self-hosting/advanced/auth/better-auth/okta.zh-CN.mdx +63 -0
- package/docs/self-hosting/advanced/auth/better-auth/wechat.mdx +77 -0
- package/docs/self-hosting/advanced/auth/better-auth/wechat.zh-CN.mdx +72 -0
- package/docs/self-hosting/advanced/auth/better-auth/zitadel.mdx +73 -0
- package/docs/self-hosting/advanced/auth/better-auth/zitadel.zh-CN.mdx +69 -0
- package/docs/self-hosting/advanced/auth/clerk.mdx +2 -2
- package/docs/self-hosting/advanced/auth/legacy.mdx +106 -0
- package/docs/self-hosting/advanced/auth/legacy.zh-CN.mdx +101 -0
- package/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +5 -2
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +2 -0
- package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +2 -2
- package/docs/self-hosting/advanced/auth/next-auth/github.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/google.mdx +10 -12
- package/docs/self-hosting/advanced/auth/next-auth/keycloak.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +2 -2
- package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/okta.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/okta.zh-CN.mdx +1 -3
- package/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +2 -2
- package/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +3 -2
- package/docs/self-hosting/advanced/auth.mdx +86 -139
- package/docs/self-hosting/advanced/auth.zh-CN.mdx +84 -135
- package/docs/self-hosting/advanced/desktop.mdx +9 -3
- package/docs/self-hosting/advanced/desktop.zh-CN.mdx +9 -3
- package/docs/self-hosting/advanced/feature-flags.mdx +3 -2
- package/docs/self-hosting/advanced/knowledge-base.mdx +2 -2
- package/docs/self-hosting/advanced/model-list.mdx +2 -2
- package/docs/self-hosting/advanced/observability/grafana.mdx +4 -2
- package/docs/self-hosting/advanced/observability/grafana.zh-CN.mdx +2 -1
- package/docs/self-hosting/advanced/observability/langfuse.mdx +3 -2
- package/docs/self-hosting/advanced/online-search.mdx +4 -6
- package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +2 -2
- package/docs/self-hosting/advanced/settings-url-share.mdx +3 -2
- package/docs/self-hosting/advanced/upstream-sync.mdx +3 -4
- package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +0 -2
- package/docs/self-hosting/environment-variables/analytics.mdx +3 -2
- package/docs/self-hosting/environment-variables/auth.mdx +5 -12
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +2 -9
- package/docs/self-hosting/environment-variables/basic.mdx +3 -10
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +0 -7
- package/docs/self-hosting/environment-variables/model-provider.mdx +3 -4
- package/docs/self-hosting/environment-variables/s3.mdx +2 -2
- package/docs/self-hosting/environment-variables.mdx +2 -3
- package/docs/self-hosting/examples/azure-openai.mdx +2 -3
- package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +0 -1
- package/docs/self-hosting/examples/ollama.mdx +3 -2
- package/docs/self-hosting/faq/no-v1-suffix.mdx +4 -4
- package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +3 -2
- package/docs/self-hosting/faq/vercel-ai-image-timeout.mdx +2 -2
- package/docs/self-hosting/migration/v2/breaking-changes.mdx +73 -0
- package/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdx +71 -0
- package/docs/self-hosting/platform/alibaba-cloud.mdx +2 -7
- package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +1 -6
- package/docs/self-hosting/platform/btpanel.mdx +4 -2
- package/docs/self-hosting/platform/btpanel.zh-CN.mdx +2 -2
- package/docs/self-hosting/platform/docker-compose.mdx +3 -3
- package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +0 -1
- package/docs/self-hosting/platform/docker.mdx +2 -11
- package/docs/self-hosting/platform/docker.zh-CN.mdx +0 -8
- package/docs/self-hosting/platform/netlify.mdx +5 -17
- package/docs/self-hosting/platform/netlify.zh-CN.mdx +3 -17
- package/docs/self-hosting/platform/railway.mdx +3 -7
- package/docs/self-hosting/platform/railway.zh-CN.mdx +1 -7
- package/docs/self-hosting/platform/repocloud.mdx +3 -7
- package/docs/self-hosting/platform/repocloud.zh-CN.mdx +1 -6
- package/docs/self-hosting/platform/sealos.mdx +2 -7
- package/docs/self-hosting/platform/sealos.zh-CN.mdx +1 -6
- package/docs/self-hosting/platform/tencentcloud-lighthouse.mdx +2 -7
- package/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx +1 -6
- package/docs/self-hosting/platform/vercel.mdx +4 -9
- package/docs/self-hosting/platform/vercel.zh-CN.mdx +3 -8
- package/docs/self-hosting/platform/zeabur.mdx +2 -11
- package/docs/self-hosting/platform/zeabur.zh-CN.mdx +1 -10
- package/docs/self-hosting/server-database/docker-compose.mdx +11 -19
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +12 -21
- package/docs/self-hosting/server-database/docker.mdx +9 -24
- package/docs/self-hosting/server-database/docker.zh-CN.mdx +7 -24
- package/docs/self-hosting/server-database/dokploy.mdx +27 -25
- package/docs/self-hosting/server-database/dokploy.zh-CN.mdx +23 -21
- package/docs/self-hosting/server-database/netlify.mdx +2 -2
- package/docs/self-hosting/server-database/netlify.zh-CN.mdx +2 -2
- package/docs/self-hosting/server-database/railway.mdx +2 -2
- package/docs/self-hosting/server-database/repocloud.mdx +2 -2
- package/docs/self-hosting/server-database/sealos.mdx +2 -2
- package/docs/self-hosting/server-database/vercel.mdx +19 -72
- package/docs/self-hosting/server-database/vercel.zh-CN.mdx +17 -68
- package/docs/self-hosting/server-database/zeabur.mdx +2 -2
- package/docs/self-hosting/server-database.mdx +1 -19
- package/docs/self-hosting/server-database.zh-CN.mdx +0 -17
- package/docs/self-hosting/start.mdx +2 -2
- package/docs/self-hosting/start.zh-CN.mdx +2 -2
- package/e2e/src/support/webServer.ts +95 -43
- package/locales/ar/chat.json +5 -0
- package/locales/ar/desktop-onboarding.json +5 -0
- package/locales/ar/discover.json +15 -0
- package/locales/ar/models.json +35 -0
- package/locales/bg-BG/chat.json +5 -0
- package/locales/bg-BG/desktop-onboarding.json +5 -0
- package/locales/bg-BG/discover.json +15 -0
- package/locales/bg-BG/models.json +30 -0
- package/locales/de-DE/chat.json +5 -0
- package/locales/de-DE/desktop-onboarding.json +5 -0
- package/locales/de-DE/discover.json +15 -0
- package/locales/de-DE/models.json +38 -0
- package/locales/en-US/desktop-onboarding.json +6 -0
- package/locales/en-US/discover.json +14 -0
- package/locales/es-ES/chat.json +5 -0
- package/locales/es-ES/desktop-onboarding.json +5 -0
- package/locales/es-ES/discover.json +15 -0
- package/locales/es-ES/models.json +38 -0
- package/locales/fa-IR/chat.json +5 -0
- package/locales/fa-IR/desktop-onboarding.json +5 -0
- package/locales/fa-IR/discover.json +15 -0
- package/locales/fa-IR/models.json +11 -0
- package/locales/fr-FR/chat.json +5 -0
- package/locales/fr-FR/desktop-onboarding.json +5 -0
- package/locales/fr-FR/discover.json +15 -0
- package/locales/fr-FR/models.json +36 -0
- package/locales/it-IT/chat.json +5 -0
- package/locales/it-IT/desktop-onboarding.json +5 -0
- package/locales/it-IT/discover.json +15 -0
- package/locales/it-IT/models.json +32 -0
- package/locales/ja-JP/chat.json +5 -0
- package/locales/ja-JP/desktop-onboarding.json +5 -0
- package/locales/ja-JP/discover.json +15 -0
- package/locales/ja-JP/models.json +42 -0
- package/locales/ko-KR/chat.json +5 -0
- package/locales/ko-KR/desktop-onboarding.json +5 -0
- package/locales/ko-KR/discover.json +15 -0
- package/locales/ko-KR/models.json +55 -0
- package/locales/nl-NL/chat.json +5 -0
- package/locales/nl-NL/desktop-onboarding.json +5 -0
- package/locales/nl-NL/discover.json +15 -0
- package/locales/nl-NL/models.json +34 -0
- package/locales/pl-PL/chat.json +5 -0
- package/locales/pl-PL/desktop-onboarding.json +5 -0
- package/locales/pl-PL/discover.json +15 -0
- package/locales/pl-PL/models.json +31 -0
- package/locales/pt-BR/chat.json +5 -0
- package/locales/pt-BR/desktop-onboarding.json +5 -0
- package/locales/pt-BR/discover.json +15 -0
- package/locales/pt-BR/models.json +42 -0
- package/locales/ru-RU/chat.json +5 -0
- package/locales/ru-RU/desktop-onboarding.json +5 -0
- package/locales/ru-RU/discover.json +15 -0
- package/locales/ru-RU/models.json +32 -0
- package/locales/tr-TR/chat.json +5 -0
- package/locales/tr-TR/desktop-onboarding.json +5 -0
- package/locales/tr-TR/discover.json +15 -0
- package/locales/tr-TR/models.json +48 -0
- package/locales/vi-VN/chat.json +5 -0
- package/locales/vi-VN/desktop-onboarding.json +5 -0
- package/locales/vi-VN/discover.json +15 -0
- package/locales/vi-VN/models.json +36 -0
- package/locales/zh-CN/desktop-onboarding.json +4 -3
- package/locales/zh-CN/discover.json +14 -0
- package/locales/zh-CN/models.json +1 -0
- package/locales/zh-TW/chat.json +5 -0
- package/locales/zh-TW/desktop-onboarding.json +5 -0
- package/locales/zh-TW/discover.json +15 -0
- package/locales/zh-TW/models.json +42 -0
- package/package.json +2 -2
- package/packages/builtin-tool-cloud-sandbox/src/systemRole.ts +62 -2
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/index.ts +2 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/multi-tasks-with-summary.json +234 -0
- package/packages/conversation-flow/src/__tests__/parse.test.ts +25 -0
- package/packages/conversation-flow/src/transformation/ContextTreeBuilder.ts +15 -0
- package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +20 -0
- package/packages/types/src/serverConfig.ts +0 -1
- package/src/app/[variants]/(desktop)/desktop-onboarding/features/LoginStep.tsx +39 -1
- package/src/app/[variants]/(main)/settings/common/features/Common/Common.tsx +34 -14
- package/src/envs/app.ts +0 -13
- package/src/locales/default/desktop-onboarding.ts +1 -0
- package/src/server/globalConfig/index.ts +1 -2
- package/src/services/electron/system.ts +4 -0
- package/src/store/serverConfig/selectors.ts +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Deploy LobeChat with database on Vercel
|
|
3
3
|
description: >-
|
|
4
|
-
Learn how to deploy LobeChat with database on Vercel with ease, including:
|
|
5
|
-
|
|
4
|
+
Learn how to deploy LobeChat with database on Vercel with ease, including:
|
|
5
|
+
database, authentication and S3 storage service.
|
|
6
6
|
tags:
|
|
7
7
|
- Deploy LobeChat
|
|
8
8
|
- Vercel Deployment
|
|
9
|
-
-
|
|
10
|
-
-
|
|
9
|
+
- Better Auth
|
|
10
|
+
- S3 Storage
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
# Deploying Server Database Version on Vercel
|
|
@@ -18,7 +18,6 @@ This article will detail how to deploy the server database version of LobeChat o
|
|
|
18
18
|
Before proceeding, please make sure of the following:
|
|
19
19
|
|
|
20
20
|
- Export all data, as after deploying the server-side database, existing user data cannot be automatically migrated and can only be manually imported after backup!
|
|
21
|
-
- The `ACCESS_CODE` in the environment variables is either unset or cleared!
|
|
22
21
|
- When configuring the environment variables required for the server-side database, make sure to fill in all of them before deployment, otherwise you may encounter database migration issues!
|
|
23
22
|
</Callout>
|
|
24
23
|
|
|
@@ -50,9 +49,6 @@ This article will detail how to deploy the server database version of LobeChat o
|
|
|
50
49
|
```shell
|
|
51
50
|
# Serverless Postgres DB Url
|
|
52
51
|
DATABASE_URL=
|
|
53
|
-
|
|
54
|
-
# Specify service mode as server, otherwise it will not enter the server-side database
|
|
55
|
-
NEXT_PUBLIC_SERVICE_MODE=server
|
|
56
52
|
```
|
|
57
53
|
|
|
58
54
|
An example of filling in Vercel is as follows:
|
|
@@ -69,9 +65,6 @@ This article will detail how to deploy the server database version of LobeChat o
|
|
|
69
65
|
|
|
70
66
|
# Specify Postgres database driver as node
|
|
71
67
|
DATABASE_DRIVER=node
|
|
72
|
-
|
|
73
|
-
# Specify service mode as server, otherwise it will not enter the server-side database
|
|
74
|
-
NEXT_PUBLIC_SERVICE_MODE=server
|
|
75
68
|
```
|
|
76
69
|
|
|
77
70
|
An example of filling in Vercel is as follows:
|
|
@@ -88,11 +81,9 @@ This article will detail how to deploy the server database version of LobeChat o
|
|
|
88
81
|
|
|
89
82
|
### Add the `KEY_VAULTS_SECRET` Environment Variable
|
|
90
83
|
|
|
91
|
-
After adding the `DATABASE_URL` environment variable for the database, you need to add a `KEY_VAULTS_SECRET` environment variable. This variable is used to encrypt sensitive information such as apikeys stored by users.
|
|
84
|
+
After adding the `DATABASE_URL` environment variable for the database, you need to add a `KEY_VAULTS_SECRET` environment variable. This variable is used to encrypt sensitive information such as apikeys stored by users. Click the button below to generate:
|
|
92
85
|
|
|
93
|
-
|
|
94
|
-
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
|
95
|
-
```
|
|
86
|
+
<GenerateSecret envName="KEY_VAULTS_SECRET" />
|
|
96
87
|
|
|
97
88
|
Make sure to add this to the Vercel environment variables as well.
|
|
98
89
|
|
|
@@ -106,66 +97,26 @@ This article will detail how to deploy the server database version of LobeChat o
|
|
|
106
97
|
The server-side database needs to be paired with a user authentication service to function properly. Therefore, the corresponding authentication service needs to be configured.
|
|
107
98
|
|
|
108
99
|
<Steps>
|
|
109
|
-
###
|
|
110
|
-
|
|
111
|
-
Go to [Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) to register and create an application to obtain the corresponding Public Key and Secret Key.
|
|
112
|
-
|
|
113
|
-
<Callout type={'info'}>
|
|
114
|
-
If you are not familiar with Clerk, you can refer to [Authentication
|
|
115
|
-
Service-Clerk](/en/docs/self-hosting/advanced/authentication#clerk) for details on using Clerk.
|
|
116
|
-
</Callout>
|
|
117
|
-
|
|
118
|
-
### Add Public and Private Key Environment Variables in Vercel
|
|
119
|
-
|
|
120
|
-
In Vercel's deployment environment variables, add the `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on "API Keys" in the menu, then copy the corresponding values and paste them into Vercel's environment variables.
|
|
121
|
-
|
|
122
|
-
<Image alt={'Find the corresponding public and private key environment variables in Clerk'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'} />
|
|
123
|
-
|
|
124
|
-
The environment variables required for this step are as follows:
|
|
125
|
-
|
|
126
|
-
```shell
|
|
127
|
-
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
|
128
|
-
CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Add the above variables to Vercel:
|
|
100
|
+
### Add Authentication Environment Variables
|
|
132
101
|
|
|
133
|
-
|
|
102
|
+
In Vercel's deployment environment variables, add the following environment variables to enable authentication (powered by [Better Auth](https://www.better-auth.com)):
|
|
134
103
|
|
|
135
|
-
|
|
104
|
+
Click the button below to generate `AUTH_SECRET` (session encryption key):
|
|
136
105
|
|
|
137
|
-
|
|
106
|
+
<GenerateSecret envName="AUTH_SECRET" />
|
|
138
107
|
|
|
139
|
-
|
|
108
|
+
You also need to configure the `JWKS_KEY` environment variable for signing and verifying JWTs. Click the button below to generate:
|
|
140
109
|
|
|
141
|
-
<
|
|
110
|
+
<GenerateJWKSKey />
|
|
142
111
|
|
|
143
|
-
|
|
112
|
+
With these variables, users can register and login with email and password.
|
|
144
113
|
|
|
145
|
-
<Callout type={'
|
|
146
|
-
|
|
114
|
+
<Callout type={'info'}>
|
|
115
|
+
For advanced features like SSO providers, magic link login, and email verification, see [Authentication Service](/docs/self-hosting/advanced/auth).
|
|
147
116
|
</Callout>
|
|
148
|
-
|
|
149
|
-
<Image alt={'Configure URL and user events when adding Clerk Webhooks'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'} />
|
|
150
|
-
|
|
151
|
-
### Add Webhook Secret to Vercel Environment Variables
|
|
152
|
-
|
|
153
|
-
After creation, you can find the secret of this Webhook in the bottom right corner:
|
|
154
|
-
|
|
155
|
-
<Image alt={'View Clerk Webhooks secret'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'} />
|
|
156
|
-
|
|
157
|
-
The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`:
|
|
158
|
-
|
|
159
|
-
```shell
|
|
160
|
-
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
Add it to Vercel's environment variables:
|
|
164
|
-
|
|
165
|
-
<Image alt={'Add Clerk Webhooks secret in Vercel'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'} />
|
|
166
117
|
</Steps>
|
|
167
118
|
|
|
168
|
-
By completing these steps, you have successfully configured the
|
|
119
|
+
By completing these steps, you have successfully configured the authentication service. Next, we will configure the S3 storage service.
|
|
169
120
|
|
|
170
121
|
## 3. Configure S3 Storage Service
|
|
171
122
|
|
|
@@ -320,17 +271,13 @@ For easy copying, here is a summary of the environment variables required to con
|
|
|
320
271
|
```shell
|
|
321
272
|
APP_URL=https://your-project.com
|
|
322
273
|
|
|
323
|
-
# Specify the service mode as server
|
|
324
|
-
NEXT_PUBLIC_SERVICE_MODE=server
|
|
325
|
-
|
|
326
274
|
# Postgres database URL
|
|
327
275
|
DATABASE_URL=
|
|
328
276
|
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
|
329
277
|
|
|
330
|
-
#
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
|
278
|
+
# Authentication
|
|
279
|
+
AUTH_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
|
280
|
+
JWKS_KEY='{"keys":[...]}'
|
|
334
281
|
|
|
335
282
|
# S3 related configurations
|
|
336
283
|
# S3 keys
|
|
@@ -4,7 +4,7 @@ description: 本文详细介绍如何在 Vercel 中部署服务端数据库版 L
|
|
|
4
4
|
tags:
|
|
5
5
|
- 服务端数据库
|
|
6
6
|
- Postgres
|
|
7
|
-
-
|
|
7
|
+
- Better Auth
|
|
8
8
|
- S3存储服务
|
|
9
9
|
- Vercel部署
|
|
10
10
|
- 数据库配置
|
|
@@ -20,7 +20,6 @@ tags:
|
|
|
20
20
|
进行后续操作前,请务必确认以下事项:
|
|
21
21
|
|
|
22
22
|
- 导出所有数据,部署服务端数据库后,原有用户数据无法自动迁移,只能提前备份后进行手动导入!
|
|
23
|
-
- 环境变量中的`ACCESS_CODE`未设置或已清除!
|
|
24
23
|
- 配置服务端数据库所需要的环境变量时,需全部填入后再进行部署,否则可能遭遇数据库迁移问题!
|
|
25
24
|
</Callout>
|
|
26
25
|
|
|
@@ -51,9 +50,6 @@ tags:
|
|
|
51
50
|
```shell
|
|
52
51
|
# Serverless Postgres DB Url
|
|
53
52
|
DATABASE_URL=
|
|
54
|
-
|
|
55
|
-
# 指定 service mode 为 server,否则不会进入服务端数据库
|
|
56
|
-
NEXT_PUBLIC_SERVICE_MODE=server
|
|
57
53
|
```
|
|
58
54
|
|
|
59
55
|
在 Vercel 中填写的示例如下:
|
|
@@ -70,9 +66,6 @@ tags:
|
|
|
70
66
|
|
|
71
67
|
# 指定 Postgres database driver 为 node
|
|
72
68
|
DATABASE_DRIVER=node
|
|
73
|
-
|
|
74
|
-
# 指定 service mode 为 server,否则不会进入服务端数据库
|
|
75
|
-
NEXT_PUBLIC_SERVICE_MODE=server
|
|
76
69
|
```
|
|
77
70
|
|
|
78
71
|
在 Vercel 中填写的示例如下:
|
|
@@ -88,11 +81,9 @@ tags:
|
|
|
88
81
|
|
|
89
82
|
### 添加 `KEY_VAULTS_SECRET` 环境变量
|
|
90
83
|
|
|
91
|
-
在完成数据库 `DATABASE_URL` 环境变量添加后,需要添加一个 `KEY_VAULTS_SECRET` 环境变量。该变量用于加密用户存储的 apikey
|
|
84
|
+
在完成数据库 `DATABASE_URL` 环境变量添加后,需要添加一个 `KEY_VAULTS_SECRET` 环境变量。该变量用于加密用户存储的 apikey 等敏感信息。点击下方按钮一键生成:
|
|
92
85
|
|
|
93
|
-
|
|
94
|
-
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
|
95
|
-
```
|
|
86
|
+
<GenerateSecret envName="KEY_VAULTS_SECRET" />
|
|
96
87
|
|
|
97
88
|
同样需要将其添加到 Vercel 环境变量中。
|
|
98
89
|
|
|
@@ -106,64 +97,26 @@ tags:
|
|
|
106
97
|
服务端数据库需要搭配用户身份验证服务才可以正常使用。因此需要配置对应的身份验证服务。
|
|
107
98
|
|
|
108
99
|
<Steps>
|
|
109
|
-
###
|
|
110
|
-
|
|
111
|
-
前往 [Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) 注册并创建应用,获取相应的 Public Key 和 Secret Key。
|
|
112
|
-
|
|
113
|
-
<Callout type={'info'}>
|
|
114
|
-
如果对 Clerk 不太了解,可以查阅 [身份验证服务 -
|
|
115
|
-
Clerk](/zh/docs/self-hosting/advanced/authentication#clerk) 了解 Clerk 的使用详情。
|
|
116
|
-
</Callout>
|
|
117
|
-
|
|
118
|
-
### 在 Vercel 中添加公、私钥环境变量
|
|
119
|
-
|
|
120
|
-
在 Vercel 的部署环境变量中,添加 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY` 环境变量。你可以在菜单中点击「API Keys」,然后复制对应的值填入 Vercel 的环境变量中。
|
|
121
|
-
|
|
122
|
-
<Image alt={'在 Clerk 中找到对应的公私钥环境变量'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'} />
|
|
123
|
-
|
|
124
|
-
此步骤所需的环境变量如下:
|
|
125
|
-
|
|
126
|
-
```shell
|
|
127
|
-
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
|
128
|
-
CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
|
129
|
-
```
|
|
100
|
+
### 添加身份验证环境变量
|
|
130
101
|
|
|
131
|
-
|
|
102
|
+
在 Vercel 的部署环境变量中,添加以下环境变量以启用身份验证(基于 [Better Auth](https://www.better-auth.com)):
|
|
132
103
|
|
|
133
|
-
|
|
104
|
+
点击下方按钮一键生成 `AUTH_SECRET`(会话加密密钥):
|
|
134
105
|
|
|
135
|
-
|
|
106
|
+
<GenerateSecret envName="AUTH_SECRET" />
|
|
136
107
|
|
|
137
|
-
|
|
108
|
+
同时需要配置 `JWKS_KEY` 环境变量,用于签名和验证 JWT。点击下方按钮一键生成:
|
|
138
109
|
|
|
139
|
-
|
|
110
|
+
<GenerateJWKSKey />
|
|
140
111
|
|
|
141
|
-
|
|
112
|
+
配置这些变量后,用户即可使用邮箱和密码注册登录。
|
|
142
113
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<Image alt={'添加 Clerk Webhooks 时,配置 URL 和用户事件'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'} />
|
|
148
|
-
|
|
149
|
-
### 将 Webhook 秘钥添加到 Vercel 环境变量
|
|
150
|
-
|
|
151
|
-
创建完毕后,可以在右下角找到该 Webhook 的秘钥:
|
|
152
|
-
|
|
153
|
-
<Image alt={'查看 Clerk Webhooks 秘钥'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'} />
|
|
154
|
-
|
|
155
|
-
这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`:
|
|
156
|
-
|
|
157
|
-
```shell
|
|
158
|
-
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
将其添加到 Vercel 的环境变量中:
|
|
162
|
-
|
|
163
|
-
<Image alt={'在 Vercel 中 添加 Clerk Webhooks 秘钥'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'} />
|
|
114
|
+
<Callout type={'info'}>
|
|
115
|
+
如需 SSO 登录、魔法链接登录、邮箱验证等高级功能,请参阅 [身份验证服务](/zh/docs/self-hosting/advanced/auth)。
|
|
116
|
+
</Callout>
|
|
164
117
|
</Steps>
|
|
165
118
|
|
|
166
|
-
|
|
119
|
+
这样,你已经成功配置了身份验证服务。接下来我们将配置 S3 存储服务。
|
|
167
120
|
|
|
168
121
|
## 三、 配置 S3 存储服务
|
|
169
122
|
|
|
@@ -313,17 +266,13 @@ tags:
|
|
|
313
266
|
```shell
|
|
314
267
|
APP_URL=https://your-project.com
|
|
315
268
|
|
|
316
|
-
# 指定服务模式为 server
|
|
317
|
-
NEXT_PUBLIC_SERVICE_MODE=server
|
|
318
|
-
|
|
319
269
|
# Postgres 数据库 URL
|
|
320
270
|
DATABASE_URL=
|
|
321
271
|
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
|
322
272
|
|
|
323
|
-
#
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
|
273
|
+
# 身份验证
|
|
274
|
+
AUTH_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
|
275
|
+
JWKS_KEY='{"keys":[...]}'
|
|
327
276
|
|
|
328
277
|
# S3 相关配置
|
|
329
278
|
# S3 秘钥
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Deploying LobeChat Database on Zeabur
|
|
3
3
|
description: >-
|
|
4
|
-
Learn how to deploy LobeChat on Zeabur with ease. Follow the provided steps to
|
|
5
|
-
|
|
4
|
+
Learn how to deploy LobeChat on Zeabur with ease. Follow the provided steps to
|
|
5
|
+
set up your chat application seamlessly.
|
|
6
6
|
tags:
|
|
7
7
|
- Deploy LobeChat
|
|
8
8
|
- Zeabur Deployment
|
|
@@ -47,24 +47,6 @@ Before deployment, make sure you have a Postgres database instance ready. You ca
|
|
|
47
47
|
Since we support file-based conversations/knowledge base conversations, we need to install the `pgvector` plugin for Postgres. This plugin provides vector search capabilities and is a key component for LobeChat to implement RAG.
|
|
48
48
|
|
|
49
49
|
<Steps>
|
|
50
|
-
### `NEXT_PUBLIC_SERVICE_MODE`
|
|
51
|
-
|
|
52
|
-
LobeChat supports both client-side and server-side databases, so we provide an environment variable for switching modes, which is `NEXT_PUBLIC_SERVICE_MODE`, with a default value of `client`.
|
|
53
|
-
|
|
54
|
-
For server-side database deployment scenarios, you need to set `NEXT_PUBLIC_SERVICE_MODE` to `server`.
|
|
55
|
-
|
|
56
|
-
<Callout type={'info'}>
|
|
57
|
-
In the official `lobe-chat-database` Docker image, this environment variable is already set to
|
|
58
|
-
`server` by default. Therefore, if you deploy using the Docker image, you do not need to configure
|
|
59
|
-
this environment variable again.
|
|
60
|
-
</Callout>
|
|
61
|
-
|
|
62
|
-
<Callout type={'tip'}>
|
|
63
|
-
Since environment variables starting with `NEXT_PUBLIC` take effect in the front-end code, they cannot be modified through container runtime injection. (Refer to the `next.js` documentation [Configuring: Environment Variables | Next.js (nextjs.org)](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables)). This is why we chose to create a separate DB version image.
|
|
64
|
-
|
|
65
|
-
If you need to modify variables with the `NEXT_PUBLIC` prefix in a Docker deployment, you must build the image yourself and inject your own `NEXT_PUBLIC` prefixed environment variables during the build.
|
|
66
|
-
</Callout>
|
|
67
|
-
|
|
68
50
|
### `DATABASE_URL`
|
|
69
51
|
|
|
70
52
|
The core of configuring the database is to add the `DATABASE_URL` environment variable and fill in the Postgres database connection URL you have prepared. The typical format of the database connection URL is `postgres://username:password@host:port/database`.
|
|
@@ -95,7 +77,7 @@ Since we support file-based conversations/knowledge base conversations, we need
|
|
|
95
77
|
|
|
96
78
|
<Callout type={'info'}>
|
|
97
79
|
You can generate a random 32-character string as the value of `KEY_VAULTS_SECRET` using `openssl
|
|
98
|
-
|
|
80
|
+
rand -base64 32`.
|
|
99
81
|
</Callout>
|
|
100
82
|
</Steps>
|
|
101
83
|
|
|
@@ -45,23 +45,6 @@ LobeChat 默认使用客户端数据库(IndexedDB),同时也支持使用
|
|
|
45
45
|
同时,由于我们支持了文件对话 / 知识库对话的能力,因此我们需要为 Postgres 安装 `pgvector` 插件,该插件提供了向量搜索的能力,是 LobeChat 实现 RAG 的重要构件之一。
|
|
46
46
|
|
|
47
47
|
<Steps>
|
|
48
|
-
### `NEXT_PUBLIC_SERVICE_MODE`
|
|
49
|
-
|
|
50
|
-
LobeChat 同时支持了客户端数据库和服务端数据库,因此我们提供了一个环境变量用于切换模式,这个变量为 `NEXT_PUBLIC_SERVICE_MODE`,该值默认为 `client`。
|
|
51
|
-
|
|
52
|
-
针对服务端数据库部署场景,你需要将 `NEXT_PUBLIC_SERVICE_MODE` 设置为 `server`。
|
|
53
|
-
|
|
54
|
-
<Callout type={'info'}>
|
|
55
|
-
在官方的 `lobe-chat-database` Docker 镜像中,已经默认将该环境变量设为 `server`,因此如果你使用
|
|
56
|
-
Docker 镜像部署,则无需再配置该环境变量。
|
|
57
|
-
</Callout>
|
|
58
|
-
|
|
59
|
-
<Callout type={'tip'}>
|
|
60
|
-
由于 `NEXT_PUBLIC` 开头的环境变量是在前端代码中生效的,而因此无法通过容器运行时注入进行修改。 (`next.js`的参考文档 [Configuring: Environment Variables | Next.js (nextjs.org)](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables) ) 这也是为什么我们选择再打一个 DB 版镜像的原因。
|
|
61
|
-
|
|
62
|
-
如果你需要在 Docker 部署中修改 `NEXT_PUBLIC` 前缀的变量,你必须自行构建镜像,在 build 时就把自己的 `NEXT_PUBLIC` 开头的环境变量打进去。
|
|
63
|
-
</Callout>
|
|
64
|
-
|
|
65
48
|
### `DATABASE_URL`
|
|
66
49
|
|
|
67
50
|
配置数据库,核心是添加 `DATABASE_URL` 环境变量,将你准备好的 Postgres 数据库连接 URL 填入其中。数据库连接 URL 的通常格式为 `postgres://username:password@host:port/database`。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Build Your Own LobeChat - Choose Your Deployment Platform
|
|
3
3
|
description: >-
|
|
4
|
-
Explore multiple deployment platforms like Vercel, Docker, Docker Compose, and
|
|
5
|
-
|
|
4
|
+
Explore multiple deployment platforms like Vercel, Docker, Docker Compose, and
|
|
5
|
+
more to deploy LobeChat. Choose the platform that best suits your needs.
|
|
6
6
|
tags:
|
|
7
7
|
- Lobe Chat
|
|
8
8
|
- Deployment Platform
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: 构建属于自己的 LobeChat - 自选部署平台
|
|
3
3
|
description: >-
|
|
4
|
-
选择适合自己的部署平台,构建个性化的 Lobe Chat。支持 Docker、Docker
|
|
5
|
-
|
|
4
|
+
选择适合自己的部署平台,构建个性化的 Lobe Chat。支持 Docker、Docker
|
|
5
|
+
Compose、Netlify、Railway、Repocloud、Sealos、Vercel 和 Zeabur 部署。
|
|
6
6
|
tags:
|
|
7
7
|
- Lobe Chat
|
|
8
8
|
- 部署平台
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type ChildProcess,
|
|
1
|
+
import { type ChildProcess, spawn } from 'node:child_process';
|
|
2
2
|
import { existsSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { connect } from 'node:net';
|
|
3
4
|
import { resolve } from 'node:path';
|
|
4
5
|
|
|
5
6
|
let serverProcess: ChildProcess | null = null;
|
|
@@ -8,6 +9,21 @@ let serverStartPromise: Promise<void> | null = null;
|
|
|
8
9
|
// File-based lock to coordinate between parallel workers
|
|
9
10
|
const LOCK_FILE = resolve(__dirname, '../../.server-starting.lock');
|
|
10
11
|
|
|
12
|
+
export async function stopWebServer(): Promise<void> {
|
|
13
|
+
if (serverProcess) {
|
|
14
|
+
console.log('🛑 Stopping web server...');
|
|
15
|
+
serverProcess.kill();
|
|
16
|
+
serverProcess = null;
|
|
17
|
+
serverStartPromise = null;
|
|
18
|
+
}
|
|
19
|
+
// Clean up lock file
|
|
20
|
+
try {
|
|
21
|
+
unlinkSync(LOCK_FILE);
|
|
22
|
+
} catch {
|
|
23
|
+
// Ignore if file doesn't exist
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
11
27
|
interface WebServerOptions {
|
|
12
28
|
command: string;
|
|
13
29
|
env?: Record<string, string>;
|
|
@@ -16,15 +32,36 @@ interface WebServerOptions {
|
|
|
16
32
|
timeout?: number;
|
|
17
33
|
}
|
|
18
34
|
|
|
19
|
-
async function isServerRunning(port: number): Promise<boolean> {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
async function isServerRunning(port: number, timeoutMs = 2000): Promise<boolean> {
|
|
36
|
+
const hosts = new Set(['127.0.0.1', '::1', 'localhost']);
|
|
37
|
+
const envHost = process.env.HOST?.trim();
|
|
38
|
+
if (envHost && envHost !== '0.0.0.0' && envHost !== '::') {
|
|
39
|
+
hosts.add(envHost);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const tryConnect = (host: string) =>
|
|
43
|
+
new Promise<boolean>((resolve) => {
|
|
44
|
+
const socket = connect({ host, port });
|
|
45
|
+
const timeoutId = setTimeout(() => {
|
|
46
|
+
socket.destroy();
|
|
47
|
+
resolve(false);
|
|
48
|
+
}, timeoutMs);
|
|
49
|
+
|
|
50
|
+
const finish = (result: boolean) => {
|
|
51
|
+
clearTimeout(timeoutId);
|
|
52
|
+
socket.destroy();
|
|
53
|
+
resolve(result);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
socket.once('connect', () => finish(true));
|
|
57
|
+
socket.once('error', () => finish(false));
|
|
23
58
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return
|
|
59
|
+
|
|
60
|
+
for (const host of hosts) {
|
|
61
|
+
if (await tryConnect(host)) return true;
|
|
27
62
|
}
|
|
63
|
+
|
|
64
|
+
return false;
|
|
28
65
|
}
|
|
29
66
|
|
|
30
67
|
export async function startWebServer(options: WebServerOptions): Promise<void> {
|
|
@@ -94,27 +131,41 @@ export async function startWebServer(options: WebServerOptions): Promise<void> {
|
|
|
94
131
|
// Get the project root directory (parent of e2e folder)
|
|
95
132
|
const projectRoot = resolve(__dirname, '../../..');
|
|
96
133
|
|
|
97
|
-
|
|
98
|
-
|
|
134
|
+
const serverEnv = {
|
|
135
|
+
...process.env,
|
|
136
|
+
// E2E test secret keys
|
|
137
|
+
BETTER_AUTH_SECRET: 'e2e-test-secret-key-for-better-auth-32chars!',
|
|
138
|
+
KEY_VAULTS_SECRET: 'LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=',
|
|
139
|
+
// Disable email verification for e2e
|
|
140
|
+
NEXT_PUBLIC_AUTH_EMAIL_VERIFICATION: '0',
|
|
141
|
+
// Enable Better Auth for e2e tests with real authentication
|
|
142
|
+
NEXT_PUBLIC_ENABLE_BETTER_AUTH: '1',
|
|
143
|
+
NODE_OPTIONS: '--max-old-space-size=6144',
|
|
144
|
+
PORT: String(port),
|
|
145
|
+
// Mock S3 env vars to prevent initialization errors
|
|
146
|
+
S3_ACCESS_KEY_ID: 'e2e-mock-access-key',
|
|
147
|
+
S3_BUCKET: 'e2e-mock-bucket',
|
|
148
|
+
S3_ENDPOINT: 'https://e2e-mock-s3.localhost',
|
|
149
|
+
S3_SECRET_ACCESS_KEY: 'e2e-mock-secret-key',
|
|
150
|
+
...env,
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
// Start the server process (spawn avoids maxBuffer limits)
|
|
154
|
+
serverProcess = spawn(command, {
|
|
99
155
|
cwd: projectRoot,
|
|
100
|
-
env:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
S3_BUCKET: 'e2e-mock-bucket',
|
|
114
|
-
S3_ENDPOINT: 'https://e2e-mock-s3.localhost',
|
|
115
|
-
S3_SECRET_ACCESS_KEY: 'e2e-mock-secret-key',
|
|
116
|
-
...env,
|
|
117
|
-
},
|
|
156
|
+
env: serverEnv,
|
|
157
|
+
shell: true,
|
|
158
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
let startupError: Error | null = null;
|
|
162
|
+
serverProcess.once('error', (error) => {
|
|
163
|
+
startupError = error;
|
|
164
|
+
});
|
|
165
|
+
serverProcess.once('exit', (code, signal) => {
|
|
166
|
+
startupError = new Error(
|
|
167
|
+
`Server exited before ready (code: ${code ?? 'unknown'}, signal: ${signal ?? 'none'})`,
|
|
168
|
+
);
|
|
118
169
|
});
|
|
119
170
|
|
|
120
171
|
// Forward server output to console for debugging
|
|
@@ -129,6 +180,9 @@ export async function startWebServer(options: WebServerOptions): Promise<void> {
|
|
|
129
180
|
// Wait for server to be ready
|
|
130
181
|
const startTime = Date.now();
|
|
131
182
|
while (!(await isServerRunning(port))) {
|
|
183
|
+
if (startupError) {
|
|
184
|
+
throw startupError;
|
|
185
|
+
}
|
|
132
186
|
if (Date.now() - startTime > timeout) {
|
|
133
187
|
throw new Error(`Server failed to start within ${timeout}ms`);
|
|
134
188
|
}
|
|
@@ -138,22 +192,20 @@ export async function startWebServer(options: WebServerOptions): Promise<void> {
|
|
|
138
192
|
}
|
|
139
193
|
|
|
140
194
|
console.log(`✅ Web server is ready on port ${port}`);
|
|
141
|
-
})()
|
|
195
|
+
})().catch(async (error) => {
|
|
196
|
+
serverStartPromise = null;
|
|
197
|
+
try {
|
|
198
|
+
unlinkSync(LOCK_FILE);
|
|
199
|
+
await stopWebServer();
|
|
200
|
+
} catch {
|
|
201
|
+
// Ignore if file doesn't exist
|
|
202
|
+
}
|
|
203
|
+
throw error;
|
|
204
|
+
});
|
|
142
205
|
|
|
143
206
|
return serverStartPromise;
|
|
144
207
|
}
|
|
145
208
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
serverProcess.kill();
|
|
150
|
-
serverProcess = null;
|
|
151
|
-
serverStartPromise = null;
|
|
152
|
-
}
|
|
153
|
-
// Clean up lock file
|
|
154
|
-
try {
|
|
155
|
-
unlinkSync(LOCK_FILE);
|
|
156
|
-
} catch {
|
|
157
|
-
// Ignore if file doesn't exist
|
|
158
|
-
}
|
|
159
|
-
}
|
|
209
|
+
process.on('exit', () => {
|
|
210
|
+
void stopWebServer();
|
|
211
|
+
});
|
package/locales/ar/chat.json
CHANGED
|
@@ -204,6 +204,7 @@
|
|
|
204
204
|
"noSelectedAgents": "لم يتم تحديد أي أعضاء بعد",
|
|
205
205
|
"openInNewWindow": "فتح في نافذة جديدة",
|
|
206
206
|
"operation.execAgentRuntime": "جارٍ تحضير الرد",
|
|
207
|
+
"operation.execClientTask": "تنفيذ المهمة",
|
|
207
208
|
"operation.sendMessage": "جارٍ إرسال الرسالة",
|
|
208
209
|
"owner": "مالك المجموعة",
|
|
209
210
|
"pageCopilot.title": "وكيل الصفحة",
|
|
@@ -322,11 +323,15 @@
|
|
|
322
323
|
"tab.profile": "ملف الوكيل",
|
|
323
324
|
"tab.search": "بحث",
|
|
324
325
|
"task.activity.calling": "جارٍ استدعاء المهارة...",
|
|
326
|
+
"task.activity.clientExecuting": "يتم التنفيذ محليًا...",
|
|
325
327
|
"task.activity.generating": "جارٍ توليد الرد...",
|
|
326
328
|
"task.activity.gotResult": "تم استلام نتيجة الأداة",
|
|
327
329
|
"task.activity.toolCalling": "جارٍ استدعاء {{toolName}}...",
|
|
328
330
|
"task.activity.toolResult": "تم استلام نتيجة {{toolName}}",
|
|
329
331
|
"task.batchTasks": "{{count}} مهمة فرعية مجمعة",
|
|
332
|
+
"task.instruction": "تعليمات المهمة",
|
|
333
|
+
"task.intermediateSteps": "{{count}} خطوة وسيطة",
|
|
334
|
+
"task.metrics.duration": "(استغرق {{duration}})",
|
|
330
335
|
"task.metrics.stepsShort": "خطوات",
|
|
331
336
|
"task.metrics.toolCallsShort": "استخدامات الأداة",
|
|
332
337
|
"task.status.cancelled": "تم إلغاء المهمة",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"screen4.title": "كيف تود مشاركة البيانات؟",
|
|
59
59
|
"screen4.title2": "اختيارك يساعدنا على التحسين",
|
|
60
60
|
"screen4.title3": "يمكنك تغيير ذلك في أي وقت من الإعدادات",
|
|
61
|
+
"screen5.actions.cancel": "إلغاء",
|
|
61
62
|
"screen5.actions.connectToServer": "الاتصال بالخادم",
|
|
62
63
|
"screen5.actions.connecting": "جارٍ الاتصال...",
|
|
63
64
|
"screen5.actions.signInCloud": "تسجيل الدخول إلى LobeHub Cloud",
|
|
@@ -65,6 +66,10 @@
|
|
|
65
66
|
"screen5.actions.signingIn": "جارٍ تسجيل الدخول...",
|
|
66
67
|
"screen5.actions.signingOut": "جارٍ تسجيل الخروج...",
|
|
67
68
|
"screen5.actions.tryAgain": "حاول مرة أخرى",
|
|
69
|
+
"screen5.auth.phase.browserOpened": "تم فتح المتصفح، يرجى تسجيل الدخول...",
|
|
70
|
+
"screen5.auth.phase.verifying": "جارٍ التحقق من بيانات الاعتماد...",
|
|
71
|
+
"screen5.auth.phase.waitingForAuth": "في انتظار التفويض...",
|
|
72
|
+
"screen5.auth.remaining": "المتبقي: {{time}}ث",
|
|
68
73
|
"screen5.badge": "تسجيل الدخول",
|
|
69
74
|
"screen5.description": "سجّل الدخول لمزامنة الوكلاء والمجموعات والإعدادات والسياق عبر جميع الأجهزة.",
|
|
70
75
|
"screen5.errors.desktopOnlyOidc": "تفويض OIDC متاح فقط في تطبيق سطح المكتب.",
|