@lobehub/chat 1.12.6 → 1.12.7

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 CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.12.7](https://github.com/lobehub/lobe-chat/compare/v1.12.6...v1.12.7)
6
+
7
+ <sup>Released on **2024-08-22**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Logout button not shown on mobile view when using nextauth.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Logout button not shown on mobile view when using nextauth, closes [#3561](https://github.com/lobehub/lobe-chat/issues/3561) ([0c4efe4](https://github.com/lobehub/lobe-chat/commit/0c4efe4))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 1.12.6](https://github.com/lobehub/lobe-chat/compare/v1.12.5...v1.12.6)
6
31
 
7
32
  <sup>Released on **2024-08-22**</sup>
@@ -53,6 +53,26 @@ In this documentation, S3 refers to a compatible S3 storage solution, which supp
53
53
  Additionally, since this access domain is often a separate URL, it needs to be configured to allow cross-origin access to the site. Otherwise, cross-origin issues will occur in the browser.
54
54
  </Callout>
55
55
 
56
+ ### `S3_ENABLE_PATH_STYLE`
57
+
58
+ Whether to enable the `path-style` access mode of S3. This option is disabled by default. If your S3 service provider uses `path-style`, set `S3_ENABLE_PATH_STYLE` to `1` to enable it.
59
+
60
+ <Callout type={'info'}>
61
+
62
+ `path-style` and `virtual-host` are different ways to access buckets and objects in S3, with different URL structures and domain name resolutions.
63
+
64
+ Assuming the domain name of the S3 service provider is s3.example.net, the bucket is mybucket, and the object is config.env, the specific differences are as follows:
65
+ - path-style: `s3.example.net/mybucket/config.env`
66
+ - virtual-host: `mybucket.s3.example.net/config.env`
67
+
68
+ </Callout>
69
+
70
+ <Callout type={'tip'}>
71
+
72
+ Common S3 cloud service providers often default to the `virtual-host` mode, while self-deployed services like Minio default to using `path-style`. Therefore, if you use Minio as the S3 service, you need to set `S3_ENABLE_PATH_STYLE=1`.
73
+
74
+ </Callout>
75
+
56
76
  </Steps>
57
77
 
58
78
  ## S3 Configuration Guide
@@ -55,6 +55,28 @@ S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
55
55
 
56
56
  </Callout>
57
57
 
58
+ ### `S3_ENABLE_PATH_STYLE`
59
+
60
+ 是否启用 S3 的 `path-style` 访问模式。此选项默认禁用。如果您的 S3 服务提供商使用 `path-style`,请将 `S3_ENABLE_PATH_STYLE` 设置为 `1` 以启用它。
61
+
62
+ <Callout type={'info'}>
63
+
64
+ `path-style` 和 `virtual-host` 在 S3 中是访问 bucket 和 object 的不同方式,URL 的结构和域名解析不太一样
65
+
66
+ 假设 S3 服务商的域名是 s3.example.net ,bucket为mybucket,object为config.env,具体区别如下:
67
+ - path-style : `s3.example.net/mybucket/config.env`
68
+ - virtual-host : `mybucket.s3.example.net/config.env`
69
+
70
+ </Callout>
71
+
72
+ <Callout type={'tip'}>
73
+
74
+ 常见的 S3 Cloud 服务商往往默认采用 `virtual-host` 模式,而自部署服务 minio 则默认使用的是 `path-style`。 因此如果你使用了 minio 作为 S3 服务,你需要设置 `S3_ENABLE_PATH_STYLE=1` 。
75
+
76
+
77
+ </Callout>
78
+
79
+
58
80
  </Steps>
59
81
 
60
82
  ## S3 配置指南
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.12.6",
3
+ "version": "1.12.7",
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",
@@ -96,6 +96,7 @@ describe('useCategory', () => {
96
96
  expect(items.some((item) => item.key === 'docs')).toBe(true);
97
97
  expect(items.some((item) => item.key === 'feedback')).toBe(true);
98
98
  expect(items.some((item) => item.key === 'discord')).toBe(true);
99
+ expect(items.some((item) => item.key === 'nextauthSignout')).toBe(true);
99
100
  });
100
101
  });
101
102
 
@@ -114,6 +115,7 @@ describe('useCategory', () => {
114
115
  expect(items.some((item) => item.key === 'docs')).toBe(true);
115
116
  expect(items.some((item) => item.key === 'feedback')).toBe(true);
116
117
  expect(items.some((item) => item.key === 'discord')).toBe(true);
118
+ expect(items.some((item) => item.key === 'nextauthSignout')).toBe(false);
117
119
  });
118
120
  });
119
121
 
@@ -1,5 +1,13 @@
1
1
  import { DiscordIcon } from '@lobehub/ui';
2
- import { Book, CircleUserRound, Database, Download, Feather, Settings2 } from 'lucide-react';
2
+ import {
3
+ Book,
4
+ CircleUserRound,
5
+ Database,
6
+ Download,
7
+ Feather,
8
+ LogOut,
9
+ Settings2,
10
+ } from 'lucide-react';
3
11
  import { useRouter } from 'next/navigation';
4
12
  import { useTranslation } from 'react-i18next';
5
13
 
@@ -16,12 +24,15 @@ export const useCategory = () => {
16
24
  const router = useRouter();
17
25
  const { canInstall, install } = usePWAInstall();
18
26
  const { t } = useTranslation(['common', 'setting', 'auth']);
19
- const [isLogin, isLoginWithAuth, isLoginWithClerk, enableAuth] = useUserStore((s) => [
20
- authSelectors.isLogin(s),
21
- authSelectors.isLoginWithAuth(s),
22
- authSelectors.isLoginWithClerk(s),
23
- authSelectors.enabledAuth(s),
24
- ]);
27
+ const [isLogin, isLoginWithAuth, isLoginWithClerk, enableAuth, signOut, isLoginWithNextAuth] =
28
+ useUserStore((s) => [
29
+ authSelectors.isLogin(s),
30
+ authSelectors.isLoginWithAuth(s),
31
+ authSelectors.isLoginWithClerk(s),
32
+ authSelectors.enabledAuth(s),
33
+ s.logout,
34
+ authSelectors.isLoginWithNextAuth(s),
35
+ ]);
25
36
 
26
37
  const profile: CellProps[] = [
27
38
  {
@@ -100,6 +111,15 @@ export const useCategory = () => {
100
111
  },
101
112
  ];
102
113
 
114
+ const nextAuthSignOut: CellProps[] = [
115
+ {
116
+ icon: LogOut,
117
+ key: 'nextauthSignout',
118
+ label: t('auth:signout'),
119
+ onClick: signOut,
120
+ },
121
+ ];
122
+
103
123
  const mainItems = [
104
124
  {
105
125
  type: 'divider',
@@ -112,6 +132,7 @@ export const useCategory = () => {
112
132
  ...(canInstall ? pwa : []),
113
133
  ...(isLogin && !isServerMode ? data : []),
114
134
  ...helps,
135
+ ...(enableAuth && isLoginWithNextAuth ? nextAuthSignOut : []),
115
136
  ].filter(Boolean) as CellProps[];
116
137
 
117
138
  return mainItems;
@@ -47,4 +47,5 @@ export const authSelectors = {
47
47
  isLogin,
48
48
  isLoginWithAuth: (s: UserStore) => s.isSignedIn,
49
49
  isLoginWithClerk: (s: UserStore): boolean => (s.isSignedIn && enableClerk) || false,
50
+ isLoginWithNextAuth: (s: UserStore): boolean => (s.isSignedIn && !!s.enabledNextAuth) || false,
50
51
  };