@lobehub/chat 0.128.2 → 0.128.4

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.
Files changed (146) hide show
  1. package/.github/workflows/issue-close-require.yml +3 -3
  2. package/.github/workflows/issues-translate.yml +3 -3
  3. package/.github/workflows/wiki-sync.yml +2 -2
  4. package/.husky/commit-msg +0 -3
  5. package/.husky/pre-commit +0 -3
  6. package/.i18nrc.js +2 -2
  7. package/CHANGELOG.md +50 -0
  8. package/README.md +3 -3
  9. package/README.zh-CN.md +3 -3
  10. package/contributing/Basic/Feature-Development.md +713 -0
  11. package/{docs/Development → contributing/Basic}/Feature-Development.zh-CN.md +2 -2
  12. package/{docs/Development → contributing/Basic}/Intro.zh-CN.md +5 -5
  13. package/{docs → contributing}/Home.md +21 -30
  14. package/{docs/Development → contributing/Internationalization}/Internationalization-Implementation.zh-CN.md +1 -1
  15. package/{docs → contributing}/_Sidebar.md +19 -30
  16. package/docs/agents/concepts.mdx +18 -0
  17. package/docs/agents/concepts.zh-CN.mdx +17 -0
  18. package/docs/agents/custom-agent.mdx +34 -0
  19. package/docs/agents/custom-agent.zh-CN.mdx +31 -0
  20. package/docs/agents/model.mdx +68 -0
  21. package/docs/agents/model.zh-CN.mdx +64 -0
  22. package/docs/agents/prompt.mdx +96 -0
  23. package/docs/agents/prompt.zh-CN.mdx +97 -0
  24. package/docs/agents/topics.mdx +7 -0
  25. package/docs/agents/topics.zh-CN.mdx +6 -0
  26. package/docs/common-errors/no-v1-suffix.mdx +18 -0
  27. package/docs/common-errors/no-v1-suffix.zh-CN.mdx +17 -0
  28. package/docs/common-errors/proxy-with-unable-to-verify-leaf-signature.mdx +70 -0
  29. package/docs/{Deployment/Common-Error.zh-CN.md → common-errors/proxy-with-unable-to-verify-leaf-signature.zh-CN.mdx} +8 -26
  30. package/docs/environment-variables/common.mdx +215 -0
  31. package/docs/environment-variables/common.zh-CN.mdx +214 -0
  32. package/docs/environment-variables/model-provider.mdx +135 -0
  33. package/docs/environment-variables/model-provider.zh-CN.mdx +133 -0
  34. package/docs/package.json +5 -0
  35. package/docs/plugins/basic-usage.mdx +40 -0
  36. package/docs/{Usage/Plugins.zh-CN.md → plugins/basic-usage.zh-CN.mdx} +7 -21
  37. package/docs/plugins/custom-plugin.mdx +27 -0
  38. package/docs/plugins/custom-plugin.zh-CN.mdx +26 -0
  39. package/docs/plugins/plugin-development.mdx +262 -0
  40. package/docs/{Plugins/Plugin-Development.zh-CN.md → plugins/plugin-development.zh-CN.mdx} +9 -33
  41. package/docs/plugins/plugin-store.mdx +10 -0
  42. package/docs/plugins/plugin-store.zh-CN.mdx +9 -0
  43. package/docs/self-hosting/analytics.mdx +20 -0
  44. package/docs/{Deployment/Analytics.zh-CN.md → self-hosting/analytics.zh-CN.mdx} +5 -8
  45. package/docs/self-hosting/authentication.mdx +94 -0
  46. package/docs/self-hosting/authentication.zh-CN.mdx +90 -0
  47. package/docs/self-hosting/deploy-with-azure-openai.mdx +48 -0
  48. package/docs/{Deployment/Deploy-with-Azure-OpenAI.zh-CN.md → self-hosting/deploy-with-azure-openai.zh-CN.mdx} +16 -21
  49. package/docs/self-hosting/docker-compose.mdx +121 -0
  50. package/docs/self-hosting/docker-compose.zh-CN.mdx +121 -0
  51. package/docs/self-hosting/docker.mdx +152 -0
  52. package/docs/self-hosting/docker.zh-CN.mdx +149 -0
  53. package/docs/self-hosting/environment-variable.mdx +340 -0
  54. package/docs/{Deployment/Environment-Variable.zh-CN.md → self-hosting/environment-variable.zh-CN.mdx} +43 -57
  55. package/docs/self-hosting/upstream-sync.mdx +66 -0
  56. package/docs/{Deployment/Upstream-Sync.zh-CN.md → self-hosting/upstream-sync.zh-CN.mdx} +23 -21
  57. package/docs/self-hosting/vercel.mdx +39 -0
  58. package/docs/self-hosting/vercel.zh-CN.mdx +39 -0
  59. package/docs/usage/agent-market.mdx +35 -0
  60. package/docs/usage/agent-market.zh-CN.mdx +32 -0
  61. package/docs/usage/mobile.mdx +8 -0
  62. package/docs/usage/mobile.zh-CN.mdx +7 -0
  63. package/docs/usage/more.mdx +21 -0
  64. package/docs/usage/more.zh-CN.mdx +19 -0
  65. package/docs/usage/plugin-system.mdx +84 -0
  66. package/docs/usage/plugin-system.zh-CN.mdx +77 -0
  67. package/docs/usage/pwa.mdx +21 -0
  68. package/docs/usage/pwa.zh-CN.mdx +21 -0
  69. package/docs/usage/text-to-image.mdx +5 -0
  70. package/docs/usage/text-to-image.zh-CN.mdx +6 -0
  71. package/docs/usage/theme.mdx +17 -0
  72. package/docs/usage/theme.zh-CN.mdx +15 -0
  73. package/docs/usage/tts.mdx +26 -0
  74. package/docs/usage/tts.zh-CN.mdx +24 -0
  75. package/docs/usage/vision.mdx +8 -0
  76. package/docs/usage/vision.zh-CN.mdx +7 -0
  77. package/locales/ar/common.json +1 -0
  78. package/locales/de-DE/common.json +1 -0
  79. package/locales/en-US/common.json +1 -0
  80. package/locales/es-ES/common.json +1 -0
  81. package/locales/fr-FR/common.json +1 -0
  82. package/locales/it-IT/common.json +1 -0
  83. package/locales/ja-JP/common.json +1 -0
  84. package/locales/ko-KR/common.json +1 -0
  85. package/locales/nl-NL/common.json +1 -0
  86. package/locales/pl-PL/common.json +1 -0
  87. package/locales/pt-BR/common.json +1 -0
  88. package/locales/ru-RU/common.json +1 -0
  89. package/locales/tr-TR/common.json +1 -0
  90. package/locales/vi-VN/common.json +1 -0
  91. package/locales/zh-CN/common.json +1 -0
  92. package/locales/zh-TW/common.json +1 -0
  93. package/next.config.mjs +5 -0
  94. package/package.json +6 -5
  95. package/scripts/docsWorkflow/const.ts +1 -1
  96. package/scripts/docsWorkflow/toc.ts +6 -6
  97. package/src/app/welcome/(desktop)/features/Footer.tsx +5 -3
  98. package/src/config/client.ts +6 -0
  99. package/src/const/url.ts +10 -1
  100. package/src/features/PluginStore/OnlineList.tsx +2 -16
  101. package/src/features/SideBar/BottomActions.tsx +11 -10
  102. package/src/locales/default/common.ts +1 -0
  103. package/docs/Deployment/Analytics.md +0 -20
  104. package/docs/Deployment/Authentication.md +0 -80
  105. package/docs/Deployment/Authentication.zh-CN.md +0 -80
  106. package/docs/Deployment/Common-Error.md +0 -87
  107. package/docs/Deployment/Deploy-with-Azure-OpenAI.md +0 -54
  108. package/docs/Deployment/Docker-Deployment.md +0 -219
  109. package/docs/Deployment/Docker-Deployment.zh-CN.md +0 -217
  110. package/docs/Deployment/Environment-Variable.md +0 -362
  111. package/docs/Deployment/Upstream-Sync.md +0 -62
  112. package/docs/Plugins/Plugin-Development.md +0 -287
  113. package/docs/Usage/Plugins.md +0 -53
  114. package/docs/Usage/Usage-Agents.md +0 -201
  115. package/docs/Usage/Usage-Agents.zh-CN.md +0 -202
  116. package/docs/Usage/Usage-Topics.md +0 -31
  117. package/docs/Usage/Usage-Topics.zh-CN.md +0 -31
  118. /package/{docs/Development → contributing/Basic}/Add-New-Authentication-Providers.md +0 -0
  119. /package/{docs/Development → contributing/Basic}/Add-New-Authentication-Providers.zh-CN.md +0 -0
  120. /package/{docs/Development → contributing/Basic}/Architecture.md +0 -0
  121. /package/{docs/Development → contributing/Basic}/Architecture.zh-CN.md +0 -0
  122. /package/{docs/Development → contributing/Basic}/Chat-API.md +0 -0
  123. /package/{docs/Development → contributing/Basic}/Chat-API.zh-CN.md +0 -0
  124. /package/{docs/Development → contributing/Basic}/Contributing-Guidelines.md +0 -0
  125. /package/{docs/Development → contributing/Basic}/Contributing-Guidelines.zh-CN.md +0 -0
  126. /package/{docs/Development → contributing/Basic}/Feature-Development-Frontend.md +0 -0
  127. /package/{docs/Development → contributing/Basic}/Feature-Development-Frontend.zh-CN.md +0 -0
  128. /package/{docs/Development → contributing/Basic}/Folder-Structure.md +0 -0
  129. /package/{docs/Development → contributing/Basic}/Folder-Structure.zh-CN.md +0 -0
  130. /package/{docs/Development → contributing/Basic}/Intro.md +0 -0
  131. /package/{docs/Development → contributing/Basic}/Resources.md +0 -0
  132. /package/{docs/Development → contributing/Basic}/Resources.zh-CN.md +0 -0
  133. /package/{docs/Development → contributing/Basic}/Setup-Development.md +0 -0
  134. /package/{docs/Development → contributing/Basic}/Setup-Development.zh-CN.md +0 -0
  135. /package/{docs/Development → contributing/Basic}/Test.md +0 -0
  136. /package/{docs/Development → contributing/Basic}/Test.zh-CN.md +0 -0
  137. /package/{docs/Development → contributing/Internationalization}/Add-New-Locale.md +0 -0
  138. /package/{docs/Development → contributing/Internationalization}/Add-New-Locale.zh-CN.md +0 -0
  139. /package/{docs/Development → contributing/Internationalization}/Internationalization-Implementation.md +0 -0
  140. /package/{docs → contributing}/Others/Lighthouse.md +0 -0
  141. /package/{docs → contributing}/Others/Lighthouse.zh-CN.md +0 -0
  142. /package/{docs/Development → contributing/State-Management}/State-Management-Intro.md +0 -0
  143. /package/{docs/Development → contributing/State-Management}/State-Management-Intro.zh-CN.md +0 -0
  144. /package/{docs/Development → contributing/State-Management}/State-Management-Selectors.md +0 -0
  145. /package/{docs/Development → contributing/State-Management}/State-Management-Selectors.zh-CN.md +0 -0
  146. /package/{docs → contributing}/_Footer.md +0 -0
@@ -27,6 +27,7 @@
27
27
  "defaultAgent": "Standaard assistent",
28
28
  "defaultSession": "Standaard assistent",
29
29
  "delete": "Verwijderen",
30
+ "document": "Gebruiksaanwijzing",
30
31
  "duplicate": "Dupliceren",
31
32
  "edit": "Bewerken",
32
33
  "export": "Exporteren",
@@ -27,6 +27,7 @@
27
27
  "defaultAgent": "Domyślny asystent",
28
28
  "defaultSession": "Domyślna sesja",
29
29
  "delete": "Usuń",
30
+ "document": "Dokumentacja",
30
31
  "duplicate": "Utwórz kopię",
31
32
  "edit": "Edytuj",
32
33
  "export": "Eksportuj ustawienia",
@@ -27,6 +27,7 @@
27
27
  "defaultAgent": "Assistente padrão",
28
28
  "defaultSession": "Sessão padrão",
29
29
  "delete": "Excluir",
30
+ "document": "Documento de Uso",
30
31
  "duplicate": "Duplicar",
31
32
  "edit": "Editar",
32
33
  "export": "Exportar configuração",
@@ -27,6 +27,7 @@
27
27
  "defaultAgent": "Пользовательский агент",
28
28
  "defaultSession": "Пользовательский агент",
29
29
  "delete": "Удалить",
30
+ "document": "Документация",
30
31
  "duplicate": "Создать копию",
31
32
  "edit": "Редактировать",
32
33
  "export": "Экспорт настроек",
@@ -27,6 +27,7 @@
27
27
  "defaultAgent": "Varsayılan Asistan",
28
28
  "defaultSession": "Varsayılan Asistan",
29
29
  "delete": "Sil",
30
+ "document": "Belge",
30
31
  "duplicate": "Kopya oluştur",
31
32
  "edit": "Düzenle",
32
33
  "export": "Dışa Aktar",
@@ -27,6 +27,7 @@
27
27
  "defaultAgent": "Trợ lý mặc định",
28
28
  "defaultSession": "Phiên mặc định",
29
29
  "delete": "Xóa",
30
+ "document": "Tài Liệu Sử Dụng",
30
31
  "duplicate": "Tạo bản sao",
31
32
  "edit": "Chỉnh sửa",
32
33
  "export": "Xuất cấu hình",
@@ -27,6 +27,7 @@
27
27
  "defaultAgent": "自定义助手",
28
28
  "defaultSession": "自定义助手",
29
29
  "delete": "删除",
30
+ "document": "使用文档",
30
31
  "duplicate": "创建副本",
31
32
  "edit": "编辑",
32
33
  "export": "导出配置",
@@ -27,6 +27,7 @@
27
27
  "defaultAgent": "預設助手",
28
28
  "defaultSession": "預設助手",
29
29
  "delete": "刪除",
30
+ "document": "使用說明文件",
30
31
  "duplicate": "建立副本",
31
32
  "edit": "編輯",
32
33
  "export": "匯出設定",
package/next.config.mjs CHANGED
@@ -8,6 +8,7 @@ const buildWithDocker = process.env.DOCKER === 'true';
8
8
  const API_PROXY_ENDPOINT = process.env.API_PROXY_ENDPOINT || '';
9
9
 
10
10
  const basePath = process.env.NEXT_PUBLIC_BASE_PATH;
11
+ const docsBasePath = process.env.NEXT_PUBLIC_LOBE_CHAT_DOCS || '';
11
12
 
12
13
  const withBundleAnalyzer = analyzer({
13
14
  enabled: process.env.ANALYZE === 'true',
@@ -54,6 +55,10 @@ const nextConfig = {
54
55
  // due to google api not work correct in some countries
55
56
  // we need a proxy to bypass the restriction
56
57
  { source: '/api/chat/google', destination: `${API_PROXY_ENDPOINT}/api/chat/google` },
58
+ { source: '/docs', destination: `${docsBasePath}/docs` },
59
+ { source: '/docs/zh', destination: `${docsBasePath}/docs/zh` },
60
+ { source: '/docs/en', destination: `${docsBasePath}/docs/en` },
61
+ { source: '/docs/:path*', destination: `${docsBasePath}/docs/:path*` },
57
62
  ],
58
63
  reactStrictMode: true,
59
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.128.2",
3
+ "version": "0.128.4",
4
4
  "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.",
5
5
  "keywords": [
6
6
  "framework",
@@ -38,7 +38,7 @@
38
38
  "lint:md": "remark . --quiet --frail --output",
39
39
  "lint:style": "stylelint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
40
40
  "lint:ts": "eslint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
41
- "prepare": "husky install",
41
+ "prepare": "husky",
42
42
  "prettier": "prettier -c --write \"**/**\"",
43
43
  "pull": "git pull",
44
44
  "release": "semantic-release",
@@ -164,7 +164,7 @@
164
164
  "@types/ua-parser-js": "^0.7",
165
165
  "@types/uuid": "^9",
166
166
  "@umijs/lint": "^4",
167
- "@vitest/coverage-v8": "^1",
167
+ "@vitest/coverage-v8": "~1.2.2",
168
168
  "ajv-keywords": "^5.1.0",
169
169
  "commitlint": "^18",
170
170
  "consola": "^3",
@@ -172,7 +172,7 @@
172
172
  "eslint": "^8",
173
173
  "fake-indexeddb": "^5",
174
174
  "glob": "^10",
175
- "husky": "^8",
175
+ "husky": "^9",
176
176
  "jsdom": "^24.0.0",
177
177
  "just-diff": "^6",
178
178
  "lint-staged": "^15",
@@ -189,7 +189,8 @@
189
189
  "typescript": "^5",
190
190
  "unified": "^11",
191
191
  "unist-util-visit": "^5",
192
- "vitest": "^1",
192
+ "vite": "5.1.1",
193
+ "vitest": "~1.2.2",
193
194
  "vitest-canvas-mock": "^0.3"
194
195
  },
195
196
  "publishConfig": {
@@ -3,7 +3,7 @@ import { resolve } from 'node:path';
3
3
 
4
4
  export const WIKI_URL = 'https://github.com/lobehub/lobe-chat/wiki/';
5
5
  export const ROOT = resolve(__dirname, '../..');
6
- export const DOCS_DIR = resolve(ROOT, 'docs');
6
+ export const DOCS_DIR = resolve(ROOT, 'contributing');
7
7
  export const HOME_PATH = resolve(DOCS_DIR, 'Home.md');
8
8
  export const SIDEBAR_PATH = resolve(DOCS_DIR, '_Sidebar.md');
9
9
  export const docsFiles = globSync(resolve(DOCS_DIR, '**/*.md').replaceAll('\\', '/'), {
@@ -1,15 +1,15 @@
1
1
  export default [
2
2
  {
3
- dir: 'Usage',
4
- title: '🤯 Usage',
3
+ dir: 'Basic',
4
+ title: '🤯 Basic',
5
5
  },
6
6
  {
7
- dir: 'Deployment',
8
- title: '🛳 Self-Hosting',
7
+ dir: 'Internationalization',
8
+ title: '🌎 Internationalization',
9
9
  },
10
10
  {
11
- dir: 'Development',
12
- title: '⌨️ Development',
11
+ dir: 'State-Management',
12
+ title: '⌨️ State Management',
13
13
  },
14
14
  {
15
15
  dir: 'Agents',
@@ -4,12 +4,14 @@ import { ActionIcon, DiscordIcon } from '@lobehub/ui';
4
4
  import { useTheme } from 'antd-style';
5
5
  import { Book, Github } from 'lucide-react';
6
6
  import { memo } from 'react';
7
+ import { useTranslation } from 'react-i18next';
7
8
  import { Flexbox } from 'react-layout-kit';
8
9
 
9
- import { DISCORD, GITHUB, WIKI } from '@/const/url';
10
+ import { DISCORD, DOCUMENTS, GITHUB } from '@/const/url';
10
11
 
11
12
  const Footer = memo(() => {
12
13
  const theme = useTheme();
14
+ const { t } = useTranslation('common');
13
15
 
14
16
  return (
15
17
  <Flexbox align={'center'} horizontal justify={'space-between'} style={{ padding: 16 }}>
@@ -25,9 +27,9 @@ const Footer = memo(() => {
25
27
  />
26
28
  <ActionIcon
27
29
  icon={Book}
28
- onClick={() => window.open(WIKI, '__blank')}
30
+ onClick={() => window.open(DOCUMENTS, '__blank')}
29
31
  size={'site'}
30
- title={'Wiki'}
32
+ title={t('document')}
31
33
  />
32
34
  <ActionIcon
33
35
  icon={Github}
@@ -33,12 +33,18 @@ declare global {
33
33
  NEXT_PUBLIC_I18N_DEBUG_SERVER: string;
34
34
 
35
35
  NEXT_PUBLIC_DEVELOPER_DEBUG: string;
36
+
37
+ NEXT_PUBLIC_LOBE_CHAT_DOCS: string;
36
38
  }
37
39
  }
38
40
  }
39
41
 
40
42
  export const getClientConfig = () => ({
41
43
  BASE_PATH: process.env.NEXT_PUBLIC_BASE_PATH || '',
44
+
45
+ // docs
46
+ LOBE_CHAT_DOCS: process.env.NEXT_PUBLIC_LOBE_CHAT_DOCS,
47
+
42
48
  // Vercel Analytics
43
49
  ANALYTICS_VERCEL: process.env.NEXT_PUBLIC_ANALYTICS_VERCEL === '1',
44
50
  VERCEL_DEBUG: process.env.NEXT_PUBLIC_VERCEL_DEBUG === '1',
package/src/const/url.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import urlJoin from 'url-join';
2
2
 
3
+ import { getClientConfig } from '@/config/client';
3
4
  import { withBasePath } from '@/utils/basePath';
4
5
 
5
6
  import pkg from '../../package.json';
@@ -7,8 +8,16 @@ import { INBOX_SESSION_ID } from './session';
7
8
 
8
9
  export const GITHUB = pkg.homepage;
9
10
  export const CHANGELOG = urlJoin(GITHUB, 'blob/master/CHANGELOG.md');
10
- export const WIKI = urlJoin(GITHUB, 'wiki');
11
+
12
+ const { LOBE_CHAT_DOCS } = getClientConfig();
13
+
14
+ export const DOCUMENTS = !!LOBE_CHAT_DOCS
15
+ ? urlJoin(LOBE_CHAT_DOCS, '/docs')
16
+ : 'https://chat-docs.lobehub.com';
17
+
18
+ const WIKI = urlJoin(GITHUB, 'wiki');
11
19
  export const WIKI_PLUGIN_GUIDE = urlJoin(WIKI, 'Plugin-Development');
20
+
12
21
  export const ABOUT = pkg.homepage;
13
22
  export const FEEDBACK = pkg.bugs.url;
14
23
  export const DISCORD = 'https://discord.gg/AYFPHvv2jT';
@@ -1,5 +1,5 @@
1
1
  import { Icon, SearchBar } from '@lobehub/ui';
2
- import { Button, Empty } from 'antd';
2
+ import { Empty } from 'antd';
3
3
  import { useResponsive } from 'antd-style';
4
4
  import isEqual from 'fast-deep-equal';
5
5
  import { ServerCrash } from 'lucide-react';
@@ -24,15 +24,8 @@ export const OnlineList = memo(() => {
24
24
 
25
25
  return [...custom, ...store];
26
26
  }, isEqual);
27
- const storePluginIds = useToolStore(
28
- (s) => pluginStoreSelectors.onlinePluginStore(s).map((s) => s.identifier),
29
- isEqual,
30
- );
31
27
 
32
- const [useFetchPluginList, installPlugins] = useToolStore((s) => [
33
- s.useFetchPluginStore,
34
- s.installPlugins,
35
- ]);
28
+ const useFetchPluginList = useToolStore((s) => s.useFetchPluginStore);
36
29
 
37
30
  const { isLoading, error } = useFetchPluginList();
38
31
 
@@ -51,13 +44,6 @@ export const OnlineList = memo(() => {
51
44
  />
52
45
  </Flexbox>
53
46
  <AddPluginButton />
54
- <Button
55
- onClick={() => {
56
- installPlugins(storePluginIds);
57
- }}
58
- >
59
- {t('store.installAllPlugins')}
60
- </Button>
61
47
  </Flexbox>
62
48
 
63
49
  {isLoading ? (
@@ -16,7 +16,7 @@ import { memo } from 'react';
16
16
  import { useTranslation } from 'react-i18next';
17
17
  import { Flexbox } from 'react-layout-kit';
18
18
 
19
- import { ABOUT, CHANGELOG, DISCORD, FEEDBACK, GITHUB, WIKI } from '@/const/url';
19
+ import { ABOUT, CHANGELOG, DISCORD, DOCUMENTS, FEEDBACK, GITHUB } from '@/const/url';
20
20
  import DataImporter from '@/features/DataImporter';
21
21
  import { configService } from '@/services/config';
22
22
  import { GlobalStore, useGlobalStore } from '@/store/global';
@@ -89,10 +89,10 @@ const BottomActions = memo<BottomActionProps>(({ tab }) => {
89
89
  onClick: () => window.open(CHANGELOG, '__blank'),
90
90
  },
91
91
  {
92
- icon: <Icon icon={Book} />,
92
+ icon: <Icon icon={DiscordIcon} />,
93
93
  key: 'wiki',
94
- label: 'WIKI',
95
- onClick: () => window.open(WIKI, '__blank'),
94
+ label: 'Discord',
95
+ onClick: () => window.open(DISCORD, '__blank'),
96
96
  },
97
97
  {
98
98
  icon: <Icon icon={Heart} />,
@@ -120,17 +120,18 @@ const BottomActions = memo<BottomActionProps>(({ tab }) => {
120
120
  return (
121
121
  <>
122
122
  <ActionIcon
123
- icon={DiscordIcon}
124
- onClick={() => window.open(DISCORD, '__blank')}
123
+ icon={Github}
124
+ onClick={() => window.open(GITHUB)}
125
125
  placement={'right'}
126
- title={'Discord'}
126
+ title={'GitHub'}
127
127
  />
128
128
  <ActionIcon
129
- icon={Github}
130
- onClick={() => window.open(GITHUB, '__blank')}
129
+ icon={Book}
130
+ onClick={() => window.open(DOCUMENTS)}
131
131
  placement={'right'}
132
- title={'GitHub'}
132
+ title={t('document')}
133
133
  />
134
+
134
135
  <Dropdown arrow={false} menu={{ items }} trigger={['click']}>
135
136
  {hasNewVersion ? (
136
137
  <Flexbox>
@@ -27,6 +27,7 @@ export default {
27
27
  defaultAgent: '自定义助手',
28
28
  defaultSession: '自定义助手',
29
29
  delete: '删除',
30
+ document: '使用文档',
30
31
  duplicate: '创建副本',
31
32
  edit: '编辑',
32
33
  export: '导出配置',
@@ -1,20 +0,0 @@
1
- # Data Statistics
2
-
3
- To better analyze the usage of LobeChat users, we have integrated several free/open-source data statistics services in LobeChat for collecting user usage data, which you can enable as needed.
4
-
5
- #### TOC
6
-
7
- - [Vercel Analytics](#vercel-analytics)
8
- - [🚧 Posthog](#-posthog)
9
-
10
- ## Vercel Analytics
11
-
12
- [Vercel Analytics](https://vercel.com/analytics) is a data analysis service launched by Vercel, which can help you collect website visit information, including traffic, sources, and devices used for access.
13
-
14
- We have integrated Vercel Analytics into the code, and you can enable it by setting the environment variable `NEXT_PUBLIC_ANALYTICS_VERCEL=1`, and then open the Analytics tab in the Vercel deployment project to view your application's visit information.
15
-
16
- Vercel Analytics provides 2500 free Web Analytics Events per month (which can be understood as PV), which is generally sufficient for personal deployment and self-use products.
17
-
18
- If you need detailed instructions on using Vercel Analytics, please refer to [Vercel Web Analytics Quick Start](https://vercel.com/docs/analytics/quickstart).
19
-
20
- ## 🚧 Posthog
@@ -1,80 +0,0 @@
1
- # Authentication Service
2
-
3
- LobeChat supports configuring external identity verification services for internal use within enterprises/organizations, facilitating centralized management of user authorizations. Currently, [Auth0][auth0-client-page] is supported. This article will guide you through the process of setting up the identity verification service.
4
-
5
- ### TOC
6
-
7
- - [Creating an Auth0 Application](#creating-an-auth0-application)
8
- - [Adding Users](#adding-users)
9
- - [Configuring Environment Variables](#configuring-environment-variables)
10
- - [Advanced - Connecting to an Existing Single Sign-On Service](#advanced---connecting-to-an-existing-single-sign-on-service)
11
- - [Advanced - Configuring Social Login](#advanced---configuring-social-login)
12
-
13
- ## Creating an Auth0 Application
14
-
15
- To begin, register and log in to [Auth0][auth0-client-page]. Then, navigate to the **_Applications_** section in the left sidebar to access the application management interface. Click on **_Create Application_** in the top right corner to initiate the application creation process.
16
-
17
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/1b405347-f4c3-4c55-82f6-47116f2210d0)
18
-
19
- Next, fill in the desired application name to be displayed to organization users. You can choose any application type, then click on **_Create_**.
20
-
21
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/75c92f85-3ad3-4473-a9c6-e667e28d428d)
22
-
23
- Once the application is successfully created, click on the respective application to access its details page. Switch to the **_Settings_** tab to view the corresponding configuration information.
24
-
25
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/a1ed996b-95ef-4b7d-a50d-b4666eccfecb)
26
-
27
- On the application configuration page, you also need to configure the **_Allowed Callback URLs_** to be `http(s)://<your-domain>/api/auth/callback/auth0`
28
-
29
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/575f46aa-f485-49bd-8b90-dbb1ce1a5c1b)
30
-
31
- > \[!NOTE]
32
- >
33
- > You can fill in or modify the Allowed Callback URLs after deployment, but make sure the URLs are consistent with the deployed URLs!
34
-
35
- ## Adding Users
36
-
37
- Navigate to the **_Users Management_** section in the left sidebar to access the user management interface. You can create new users for your organization to log in to LobeChat.
38
-
39
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/3b8127ab-dc4f-4ff9-a4cb-dec3ef0295cc)
40
-
41
- ## Configuring Environment Variables
42
-
43
- When deploying LobeChat, you need to configure the following environment variables:
44
-
45
- | Environment Variable | Required | Description | Default Value | Example |
46
- | --------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------ |
47
- | `ENABLE_OAUTH_SSO` | Yes | Enable single sign-on (SSO) for LobeChat. Set this value to `1` to enable single sign-on. | - | `1` |
48
- | `NEXTAUTH_SECRET` | Yes | The key used to encrypt the session token in Auth.js. You can generate a key using the following command: `openssl rand -base64 32` | - | `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=` |
49
- | `AUTH0_CLIENT_ID` | Yes | Client ID of the Auth0 application | - | `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P` |
50
- | `AUTH0_CLIENT_SECRET` | Yes | Client Secret of the Auth0 application | - | `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm` |
51
- | `AUTH0_ISSUER` | Yes | Domain of the Auth0 application | - | `https://example.auth0.com` |
52
- | `ACCESS_CODE` | Yes | Add a password to access this service. You can set a long random password to "disable" accessed by the code | - | `awCT74` or `e3@09!` or `code1,code2,code3` |
53
-
54
- > \[!NOTE]
55
- >
56
- > After successful deployment, users will be able to authenticate and use LobeChat using the users configured in Auth0.
57
-
58
- ## Advanced - Connecting to an Existing Single Sign-On Service
59
-
60
- If your enterprise or organization already has an existing unified identity verification infrastructure, you can connect to an existing single sign-on service in **_Applications -> SSO Integrations_**.
61
-
62
- Auth0 supports single sign-on services such as Azure Active Directory, Slack, Google Workspace, Office 365, and Zoom. For a detailed list of supported services, refer to [this page][auth0-sso-integrations].
63
-
64
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/32650f4f-d0b0-4843-b26d-d35bad11d8a3)
65
-
66
- ## Advanced - Configuring Social Login
67
-
68
- If your enterprise or organization needs to support external personnel login, you can configure social login services in **_Authentication -> Social_**.
69
-
70
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/7b6f6a6c-2686-49d8-9dbd-0516053f1efa)
71
-
72
- > \[!NOTE]
73
- >
74
- > Configuring social login services will allow anyone to authenticate by default, which may lead to abuse of LobeChat by external personnel. If you need to restrict login personnel, be sure to configure a blocking policy.
75
- >
76
- > After enabling social login options, refer to [this article][auth0-login-actions-manual] to create an Action to set the deny/allow list.
77
-
78
- [auth0-client-page]: https://manage.auth0.com/dashboard
79
- [auth0-login-actions-manual]: https://auth0.com/blog/permit-or-deny-login-requests-using-auth0-actions/
80
- [auth0-sso-integrations]: https://marketplace.auth0.com/features/sso-integrations
@@ -1,80 +0,0 @@
1
- # 身份验证服务
2
-
3
- LobeChat 支持配置外部身份验证服务,供企业 / 组织内部使用,统一管理用户授权,目前支持 [Auth0][auth0-client-page],本文将介绍如何配置身份验证服务。
4
-
5
- ### TOC
6
-
7
- - [创建 Auth0 应用](#创建-auth0-应用)
8
- - [新增用户](#新增用户)
9
- - [配置环境变量](#配置环境变量)
10
- - [进阶 - 连接现有的单点登录服务](#进阶---连接现有的单点登录服务)
11
- - [进阶 - 配置社交登录](#进阶---配置社交登录)
12
-
13
- ## 创建 Auth0 应用
14
-
15
- 注册并登录 [Auth0][auth0-client-page],点击左侧导航栏的「Applications」,切换到应用管理界面,点击右上角「Create Application」以创建应用。
16
-
17
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/1b405347-f4c3-4c55-82f6-47116f2210d0)
18
-
19
- 填写你想向组织用户显示的应用名称,可选择任意应用类型,点击「Create」。
20
-
21
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/75c92f85-3ad3-4473-a9c6-e667e28d428d)
22
-
23
- 创建成功后,点击相应的应用,进入应用详情页,切换到「Settings」标签页,就可以看到相应的配置信息
24
-
25
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/a1ed996b-95ef-4b7d-a50d-b4666eccfecb)
26
-
27
- 在应用配置页面中,还需要配置 Allowed Callback URLs,在此处填写 `http(s)://<your-domain>/api/auth/callback/auth0`
28
-
29
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/575f46aa-f485-49bd-8b90-dbb1ce1a5c1b)
30
-
31
- > \[!NOTE]
32
- >
33
- > 可以在部署后再填写或修改 Allowed Callback URLs,但是务必保证填写的 URL 与部署的 URL 一致
34
-
35
- ## 新增用户
36
-
37
- 点击左侧导航栏的「Users Management」,进入用户管理界面,可以为你的组织新建用户,用以登录 LobeChat
38
-
39
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/3b8127ab-dc4f-4ff9-a4cb-dec3ef0295cc)
40
-
41
- ## 配置环境变量
42
-
43
- 在部署 LobeChat 时,你需要配置以下环境变量:
44
-
45
- | 环境变量 | 类型 | 描述 | 默认值 | 示例 |
46
- | --------------------- | ---- | --------------------------------------------------------------------------------------- | ------ | ------------------------------------------------------------------ |
47
- | `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 | - | `1` |
48
- | `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | - | `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=` |
49
- | `AUTH0_CLIENT_ID` | 必选 | Auth0 应用程序的 Client ID | - | `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P` |
50
- | `AUTH0_CLIENT_SECRET` | 必选 | Auth0 应用程序的 Client Secret | - | `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm` |
51
- | `AUTH0_ISSUER` | 必选 | Auth0 应用程序的 Domain | - | `https://example.auth0.com` |
52
- | `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个足够长的随机密码以 “禁用” 访问码授权 | - | `awCT74` 或 `e3@09!` or `code1,code2,code3` |
53
-
54
- > \[!NOTE]
55
- >
56
- > 部署成功后,用户将可以使用 Auth0 中配置的用户通过身份认证并使用 LobeChat。
57
-
58
- ## 进阶 - 连接现有的单点登录服务
59
-
60
- 如果你的企业或组织已有现有的统一身份认证设施,可在 Applications -> SSO Integrations 中,连接现有的单点登录服务。
61
-
62
- Auth0 支持 Azure Active Directory, Slack, Google Workspace, Office 365, Zoom 等单点登录服务,详细支持列表可参考 [这里][auth0-sso-integrations]
63
-
64
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/32650f4f-d0b0-4843-b26d-d35bad11d8a3)
65
-
66
- ## 进阶 - 配置社交登录
67
-
68
- 如果你的企业或组织需要支持外部人员登录,可以在 Authentication -> Social 中,配置社交登录服务。
69
-
70
- ![](https://github.com/CloudPassenger/lobe-chat/assets/30863298/7b6f6a6c-2686-49d8-9dbd-0516053f1efa)
71
-
72
- > \[!NOTE]
73
- >
74
- > 配置社交登录服务默认会允许所有人通过认证,这可能会导致 LobeChat 被外部人员滥用。如果你需要限制登录人员,务必配置阻止策略
75
- >
76
- > 请在打开社交登录选项后,参考 [这篇文章][auth0-login-actions-manual] 创建 Action 来设置阻止 / 允许 列表
77
-
78
- [auth0-client-page]: https://manage.auth0.com/dashboard
79
- [auth0-login-actions-manual]: https://auth0.com/blog/permit-or-deny-login-requests-using-auth0-actions/
80
- [auth0-sso-integrations]: https://marketplace.auth0.com/features/sso-integrations
@@ -1,87 +0,0 @@
1
- # Frequently Asked Questions
2
-
3
- ## Configuring the `OPENAI_PROXY_URL` Environment Variable but Receiving an Empty Response
4
-
5
- ### Problem Description
6
-
7
- After configuring the `OPENAI_PROXY_URL` environment variable, you may encounter a situation where the response from the AI is empty. This could be due to an incorrect configuration of the `OPENAI_PROXY_URL`.
8
-
9
- ### Solution
10
-
11
- Recheck and confirm if the `OPENAI_PROXY_URL` is set correctly, including the correct addition of the `/v1` suffix (if required).
12
-
13
- ### Related Discussion Links
14
-
15
- - [Why is the response blank after installing and configuring Docker and environment variables?](https://github.com/lobehub/lobe-chat/discussions/623)
16
- - [Reasons for errors when using third-party APIs](https://github.com/lobehub/lobe-chat/discussions/734)
17
- - [No response from the chat when the proxy server address is filled](https://github.com/lobehub/lobe-chat/discussions/1065)
18
-
19
- If the issue persists, it is recommended to raise the problem in the community with relevant logs and configuration information for other developers or maintainers to provide assistance.
20
-
21
- ## When using a proxy(e.g. Surge), I encounter the `UNABLE_TO_VERIFY_LEAF_SIGNATURE` error
22
-
23
- ### Problem Description
24
-
25
- When making network requests during private deployment, certificate validation errors may occur. The error messages may be as follows:
26
-
27
- ```
28
- [TypeError: fetch failed] {
29
- cause: [Error: unable to verify the first certificate] {
30
- code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
31
- }
32
- }
33
- ```
34
-
35
- Or:
36
-
37
- ```
38
- {
39
- "endpoint": "https://api.openai.com/v1",
40
- "error": {
41
- "cause": {
42
- "code": "UNABLE_TO_VERIFY_LEAF_SIGNATURE"
43
- }
44
- }
45
- }
46
- ```
47
-
48
- This problem typically occurs when using a proxy server with a self-signed certificate or a man-in-the-middle certificate that is not trusted by Node.js by default.
49
-
50
- ### Solution
51
-
52
- To resolve this issue, you can add an environment variable to bypass Node.js certificate validation when starting the application. The specific approach is to include `NODE_TLS_REJECT_UNAUTHORIZED=0` in the startup command. For example:
53
-
54
- ```bash
55
- NODE_TLS_REJECT_UNAUTHORIZED=0 npm run start
56
- ```
57
-
58
- Alternatively, when running in a Docker container, you can set the environment variable in the Dockerfile or docker-compose.yml:
59
-
60
- ```dockerfile
61
- # In the Dockerfile
62
- ENV NODE_TLS_REJECT_UNAUTHORIZED=0
63
- ```
64
-
65
- ```yaml
66
- # In the docker-compose.yml
67
- environment:
68
- - NODE_TLS_REJECT_UNAUTHORIZED=0
69
- ```
70
-
71
- Example Docker run command:
72
-
73
- ```bash
74
- docker run -e NODE_TLS_REJECT_UNAUTHORIZED=0 <other parameters> <image name>
75
- ```
76
-
77
- Please note that this method reduces security because it allows Node.js to accept unverified certificates. Therefore, it is only recommended for use in private deployments with fully trusted network environments, and the default certificate validation settings should be restored after resolving the certificate issue.
78
-
79
- ### More Secure Alternatives
80
-
81
- If possible, it is recommended to address certificate issues using the following methods:
82
-
83
- 1. Ensure that all man-in-the-middle certificates are correctly installed on the proxy server and the corresponding clients.
84
- 2. Replace self-signed or man-in-the-middle certificates with valid certificates issued by trusted certificate authorities.
85
- 3. Properly configure the certificate chain in the code to ensure that Node.js can validate to the root certificate.
86
-
87
- Implementing these methods can resolve certificate validation issues without sacrificing security.