@lobehub/chat 0.145.6 → 0.145.8

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,64 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.145.8](https://github.com/lobehub/lobe-chat/compare/v0.145.7...v0.145.8)
6
+
7
+ <sup>Released on **2024-04-02**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Refactor SSO providers.
12
+
13
+ #### 🐛 Bug Fixes
14
+
15
+ - **misc**: Fix plugins dropdown menu overflow.
16
+
17
+ <br/>
18
+
19
+ <details>
20
+ <summary><kbd>Improvements and Fixes</kbd></summary>
21
+
22
+ #### Code refactoring
23
+
24
+ - **misc**: Refactor SSO providers, closes [#1865](https://github.com/lobehub/lobe-chat/issues/1865) ([290d33b](https://github.com/lobehub/lobe-chat/commit/290d33b))
25
+
26
+ #### What's fixed
27
+
28
+ - **misc**: Fix plugins dropdown menu overflow, closes [#1855](https://github.com/lobehub/lobe-chat/issues/1855) ([00e9068](https://github.com/lobehub/lobe-chat/commit/00e9068))
29
+
30
+ </details>
31
+
32
+ <div align="right">
33
+
34
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
35
+
36
+ </div>
37
+
38
+ ### [Version 0.145.7](https://github.com/lobehub/lobe-chat/compare/v0.145.6...v0.145.7)
39
+
40
+ <sup>Released on **2024-04-02**</sup>
41
+
42
+ #### 🐛 Bug Fixes
43
+
44
+ - **misc**: Fix DraggablePanel bar interfere with the operation of the scrollbar.
45
+
46
+ <br/>
47
+
48
+ <details>
49
+ <summary><kbd>Improvements and Fixes</kbd></summary>
50
+
51
+ #### What's fixed
52
+
53
+ - **misc**: Fix DraggablePanel bar interfere with the operation of the scrollbar, closes [#1775](https://github.com/lobehub/lobe-chat/issues/1775) ([4b7b243](https://github.com/lobehub/lobe-chat/commit/4b7b243))
54
+
55
+ </details>
56
+
57
+ <div align="right">
58
+
59
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
60
+
61
+ </div>
62
+
5
63
  ### [Version 0.145.6](https://github.com/lobehub/lobe-chat/compare/v0.145.5...v0.145.6)
6
64
 
7
65
  <sup>Released on **2024-04-02**</sup>
package/README.md CHANGED
@@ -222,10 +222,10 @@ In addition, these plugins are not limited to news aggregation, but can also ext
222
222
 
223
223
  | Recent Submits | Description |
224
224
  | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
225
+ | [Social Search](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-04-02**</sup> | The Social Search provides access to tweets, users, followers, images, media and more.<br/>`social` `twitter` `x` `search` |
225
226
  | [Calendar Assistant](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **cc** on **2024-03-13**</sup> | A plugin to manage your calendar events # will auto generate i18n in workflow<br/>`calendar` `schedule` `will-auto-generate-i-18-n-in-workflow` |
226
227
  | [TokenInsights](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **feednews** on **2024-01-27**</sup> | Get realtime crypto price, BTC, ETH, BNB, and the latest insights.The latest coin news and airdrop opportunities.<br/>`crypto` `btc` `eth` `bnb` |
227
228
  | [Bilibili](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2024-01-27**</sup> | Dive into Bilibili's vast content with features like keyword video search, replay access, interactive danmaku, trending video recommendations, and hot-search insights, all at your fingertips.<br/>`video` `bilibili` `search` |
228
- | [Steam](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2024-01-27**</sup> | Obtain game information and user reviews from Steam.<br/>`steam` `game` |
229
229
 
230
230
  > 📊 Total plugins: [<kbd>**55**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
231
231
 
@@ -259,14 +259,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
259
259
 
260
260
  <!-- AGENT LIST -->
261
261
 
262
- | Recent Submits | Description |
263
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
264
- | [Blood Test Analyst](https://chat-preview.lobehub.com/market?agent=blood-analyst)<br/><sup>By **[SimoMay](https://github.com/SimoMay)** on **2024-03-27**</sup> | Skilled in analysing blood test results, providing clear feedback using emojis for easy understanding.<br/>`healthcare` `analysis` `results` `consulting` `summary` |
265
- | [High EQ Flattery Assistant](https://chat-preview.lobehub.com/market?agent=gpts-big-fart-chat)<br/><sup>By **[MapleEve](https://github.com/MapleEve)** on **2024-03-27**</sup> | An expert in precise chat compliments, providing suitable praise and flattery<br/>`compliments` `eq` `chat` |
266
- | [Suno.ai Music Creation Assistant](https://chat-preview.lobehub.com/market?agent=suno-music-creator)<br/><sup>By **[MapleEve](https://github.com/MapleEve)** on **2024-03-27**</sup> | Song creation and translation based on SunoAI<br/>`suno` `lyricist` `lyrics` `music-production` |
267
- | [Image Recognition Xiaohongshu Copywriting](https://chat-preview.lobehub.com/market?agent=xiaonghongshu-vision)<br/><sup>By **[HansKing98](https://github.com/HansKing98)** on **2024-03-27**</sup> | You can use this agent combined with a multimodal model to upload images and generate Xiaohongshu-style copywriting.<br/>`vision` |
262
+ | Recent Submits | Description |
263
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
264
+ | [CAN](https://chat-preview.lobehub.com/market?agent=code-anything-noproblem)<br/><sup>By **[HenryWu9998](https://github.com/HenryWu9998)** on **2024-03-31**</sup> | Experienced programmer skilled in multiple languages. Provides code solutions, guidance, and practical examples to help users achieve their programming goals. "I adore coding."<br/>`programming` `coding` `programming-assistance` `code-examples` `guidance` |
265
+ | [Blood Test Analyst](https://chat-preview.lobehub.com/market?agent=blood-analyst)<br/><sup>By **[SimoMay](https://github.com/SimoMay)** on **2024-03-27**</sup> | Skilled in analysing blood test results, providing clear feedback using emojis for easy understanding.<br/>`healthcare` `analysis` `results` `consulting` `summary` |
266
+ | [High EQ Flattery Assistant](https://chat-preview.lobehub.com/market?agent=gpts-big-fart-chat)<br/><sup>By **[MapleEve](https://github.com/MapleEve)** on **2024-03-27**</sup> | An expert in precise chat compliments, providing suitable praise and flattery<br/>`compliments` `eq` `chat` |
267
+ | [Suno.ai Music Creation Assistant](https://chat-preview.lobehub.com/market?agent=suno-music-creator)<br/><sup>By **[MapleEve](https://github.com/MapleEve)** on **2024-03-27**</sup> | Song creation and translation based on SunoAI<br/>`suno` `lyricist` `lyrics` `music-production` |
268
268
 
269
- > 📊 Total agents: [<kbd>**224**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
269
+ > 📊 Total agents: [<kbd>**225**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
270
270
 
271
271
  <!-- AGENT LIST -->
272
272
 
package/README.zh-CN.md CHANGED
@@ -214,10 +214,10 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
214
214
 
215
215
  | 最近新增 | 插件描述 |
216
216
  | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
217
+ | [社交搜索](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-04-02**</sup> | 社交搜索提供访问推文、用户、关注者、图片、媒体等功能。<br/>`社交` `推特` `x` `搜索` |
217
218
  | [日历助手](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **cc** on **2024-03-13**</sup> | 一个用于管理日历事件的插件 # 将自动生成工作流程中的 i18n<br/>`日历` `日程安排` `将自动生成工作流程中的-i-18-n` |
218
219
  | [TokenInsights](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **feednews** on **2024-01-27**</sup> | 获取实时加密货币价格,BTC,ETH,BNB 和最新见解。最新的币新闻和空投机会。<br/>`加密货币` `btc` `eth` `bnb` |
219
220
  | [哔哩哔哩](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2024-01-27**</sup> | 通过关键词视频搜索、回放访问、互动弹幕、热门视频推荐和热搜洞察等功能,深入体验哔哩哔哩丰富的内容,尽在您的指尖。<br/>`视频` `哔哩哔哩` `搜索` |
220
- | [Steam](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **LobeHub** on **2024-01-27**</sup> | 从 Steam 获取游戏信息和用户评论。<br/>`steam` `game` |
221
221
 
222
222
  > 📊 Total plugins: [<kbd>**55**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
223
223
 
@@ -247,14 +247,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
247
247
 
248
248
  <!-- AGENT LIST -->
249
249
 
250
- | 最近新增 | 助手说明 |
251
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
252
- | [血液检测分析师](https://chat-preview.lobehub.com/market?agent=blood-analyst)<br/><sup>By **[SimoMay](https://github.com/SimoMay)** on **2024-03-27**</sup> | 擅长分析血液检测结果,使用表情符号提供清晰反馈,便于理解。<br/>`医疗保健` `分析` `结果` `咨询` `摘要` |
253
- | [高情商马屁助手](https://chat-preview.lobehub.com/market?agent=gpts-big-fart-chat)<br/><sup>By **[MapleEve](https://github.com/MapleEve)** on **2024-03-27**</sup> | 精准的聊天夸赞专家,适宜的赞美和吹捧<br/>`夸赞` `情商` `聊天` |
254
- | [Suno.ai 音乐创作助手](https://chat-preview.lobehub.com/market?agent=suno-music-creator)<br/><sup>By **[MapleEve](https://github.com/MapleEve)** on **2024-03-27**</sup> | 基于 SunoAI 的歌曲创作与翻译<br/>`suno` `作词` `歌词` `音乐制作` |
255
- | [识图小红书文案](https://chat-preview.lobehub.com/market?agent=xiaonghongshu-vision)<br/><sup>By **[HansKing98](https://github.com/HansKing98)** on **2024-03-27**</sup> | 你可以用这么 agent 结合多模态的模型,进行上传图片,生成小红书格式文案。<br/>`vision` |
250
+ | 最近新增 | 助手说明 |
251
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
252
+ | [CAN](https://chat-preview.lobehub.com/market?agent=code-anything-noproblem)<br/><sup>By **[HenryWu9998](https://github.com/HenryWu9998)** on **2024-03-31**</sup> | 有经验的程序员,精通多种编程语言。提供代码解决方案、指导和实际示例,帮助用户实现他们的编程目标。"我热爱编程。"<br/>`programming` `coding` `programming-assistance` `code-examples` `guidance` |
253
+ | [血液检测分析师](https://chat-preview.lobehub.com/market?agent=blood-analyst)<br/><sup>By **[SimoMay](https://github.com/SimoMay)** on **2024-03-27**</sup> | 擅长分析血液检测结果,使用表情符号提供清晰反馈,便于理解。<br/>`医疗保健` `分析` `结果` `咨询` `摘要` |
254
+ | [高情商马屁助手](https://chat-preview.lobehub.com/market?agent=gpts-big-fart-chat)<br/><sup>By **[MapleEve](https://github.com/MapleEve)** on **2024-03-27**</sup> | 精准的聊天夸赞专家,适宜的赞美和吹捧<br/>`夸赞` `情商` `聊天` |
255
+ | [Suno.ai 音乐创作助手](https://chat-preview.lobehub.com/market?agent=suno-music-creator)<br/><sup>By **[MapleEve](https://github.com/MapleEve)** on **2024-03-27**</sup> | 基于 SunoAI 的歌曲创作与翻译<br/>`suno` `作词` `歌词` `音乐制作` |
256
256
 
257
- > 📊 Total agents: [<kbd>**224**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
257
+ > 📊 Total agents: [<kbd>**225**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
258
258
 
259
259
  <!-- AGENT LIST -->
260
260
 
@@ -7,6 +7,7 @@ Currently supported identity verification services include:
7
7
  - [Auth0](/en/self-hosting/advanced/sso-providers/auth0)
8
8
  - [Microsoft Entra ID](/en/self-hosting/advanced/sso-providers/microsoft-entra-id)
9
9
  - [Authentik](/en/self-hosting/advanced/sso-providers/authentik)
10
+ - [Github](/en/self-hosting/advanced/sso-providers/github
10
11
 
11
12
  Click on the links to view the corresponding platform's configuration documentation.
12
13
 
@@ -21,6 +22,7 @@ The order corresponds to the display order of the SSO providers.
21
22
  | Auth0 | `auth0` |
22
23
  | Microsoft Entra ID | `azure-ad` |
23
24
  | Authentik | `authentik` |
25
+ | Github | `github` |
24
26
 
25
27
  ## Other SSO Providers
26
28
 
@@ -7,6 +7,7 @@ LobeChat 支持配置外部身份验证服务,供企业 / 组织内部使用
7
7
  - [Auth0](/zh/self-hosting/advanced/sso-providers/auth0)
8
8
  - [Microsoft Entra ID](/zh/self-hosting/advanced/sso-providers/microsoft-entra-id)
9
9
  - [Authentik](/zh/self-hosting/advanced/sso-providers/authentik)
10
+ - [Github](/zh/self-hosting/advanced/sso-providers/github)
10
11
 
11
12
  点击链接可以查看对应平台的配置文档。
12
13
 
@@ -21,6 +22,7 @@ LobeChat 支持配置外部身份验证服务,供企业 / 组织内部使用
21
22
  | Auth0 | `auth0` |
22
23
  | Microsoft Entra ID | `azure-ad` |
23
24
  | Authentik | `authentik` |
25
+ | Github | `github` |
24
26
 
25
27
  ## 其他 SSO 提供商
26
28
 
@@ -0,0 +1,61 @@
1
+ # Configuring Github Authentication Service
2
+
3
+ ## Github Configuration Process
4
+
5
+ <Steps>
6
+ ### Create a Github Provider
7
+
8
+ Click [here][github-create-app] to create a new Github App.
9
+
10
+ Fill in the Github App name, Homepage URL, and Callback URL.
11
+
12
+ <Image alt="Create a Github Provider" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/2f919f99-2aaa-4fa7-9938-169d3ed09db7" />
13
+
14
+ Set the webhook callback URL according to your needs.
15
+
16
+ <Image alt="Fill in other fields" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/d7ef5ad1-b1a3-435e-b1bc-4436d2b6fecd" />
17
+
18
+ Set the permission to read email addresses.
19
+
20
+ <Image alt="Set required permissions" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/23131ca1-9e84-4a89-a840-ef79c4bc0251" />
21
+ <Image alt="Set permission to read email addresses" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/358bca8d-3d82-4e76-9a5e-90d16a39efde" />
22
+
23
+ Set whether it is accessible publicly or only accessible to yourself.
24
+
25
+ <Image alt="Set whether it is accessible publicly or only accessible to yourself" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/995780cb-9096-4a36-ab17-d422703ab970" />
26
+
27
+ Click "Create Github App".
28
+
29
+ After successful creation, click "Generate a new client secret" to create a client secret.
30
+
31
+ <Image alt="Create a new client secret" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/6d69bdca-7d18-4cbc-b3e0-220d8815cd29" />
32
+
33
+ After successful creation, save the `Client ID` and `Client Secret`.
34
+
35
+ <Image alt="Create a new client secret" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/c6108133-a918-48b0-ab1a-e3fa607572a4" />
36
+
37
+ ### Configure Environment Variables
38
+
39
+ When deploying LobeChat, you need to configure the following environment variables:
40
+
41
+ | Environment Variable | Type | Description |
42
+ | ---------------------- | ---- | ------------------------------------------------------------------------------------------ |
43
+ | `ENABLE_OAUTH_SSO` | Required | Enable Single Sign-On (SSO) for LobeChat. Set to `1` to enable SSO. |
44
+ | `NEXTAUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` |
45
+ | `SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. |
46
+ | `GITHUB_CLIENT_ID` | Required | Client ID in the Github App details page. |
47
+ | `GITHUB_CLIENT_SECRET` | Required | Client Secret in the Github App details page. |
48
+ | `ACCESS_CODE` | Required | Add a password for accessing this service. You can set a long random password to "disable" access code authorization. |
49
+ | `NEXTAUTH_URL` | Optional | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` |
50
+
51
+ <Callout type={'tip'}>
52
+ Go to [📘 Environment Variables](/en/self-hosting/environment-variable#Github) for detailed information on these variables.
53
+ </Callout>
54
+
55
+ </Steps>
56
+
57
+ <Callout type={'info'}>
58
+ After successful deployment, users will be able to authenticate with Github and use LobeChat.
59
+ </Callout>
60
+
61
+ [github-create-app]: https://github.com/settings/apps/new
@@ -0,0 +1,61 @@
1
+ # 配置 Github 身份验证服务
2
+
3
+ ## Github 配置流程
4
+
5
+ <Steps>
6
+ ### 创建 Github 提供应用
7
+
8
+ 点击[这里][github-create-app]创建一个新的Gituhb App。
9
+
10
+ 填写Github App name、Homepage URL、Callbak URL
11
+
12
+ <Image alt="创建 Github 提供程序" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/2f919f99-2aaa-4fa7-9938-169d3ed09db7" />
13
+
14
+ 按照自己所需设置Webhook回调地址
15
+
16
+ <Image alt="填写其他字段" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/d7ef5ad1-b1a3-435e-b1bc-4436d2b6fecd" />
17
+
18
+ 设置读取邮件地址权限
19
+
20
+ <Image alt="设置所需权限" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/23131ca1-9e84-4a89-a840-ef79c4bc0251" />
21
+ <Image alt="设置读取邮件地址权限" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/358bca8d-3d82-4e76-9a5e-90d16a39efde" />
22
+
23
+ 设置公开访问还是仅自己访问
24
+
25
+ <Image alt="设置公开访问还是仅自己访问" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/995780cb-9096-4a36-ab17-d422703ab970" />
26
+
27
+ 点击「Create Github App」
28
+
29
+ 创建成功后,点击「Generate a new client secret」创建客户端Secret
30
+
31
+ <Image alt="创建新的客户端密钥" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/6d69bdca-7d18-4cbc-b3e0-220d8815cd29" />
32
+
33
+ 创建成功后, 将 `客户端 ID` 和 `客户端 Secret` 保存下来。
34
+
35
+ <Image alt="创建新的客户端密钥" inStep src="https://github.com/lobehub/lobe-chat/assets/64475363/c6108133-a918-48b0-ab1a-e3fa607572a4" />
36
+
37
+ ### 配置环境变量
38
+
39
+ 在部署 LobeChat 时,你需要配置以下环境变量:
40
+
41
+ | 环境变量 | 类型 | 描述 |
42
+ | ------------------------ | -- | ------------------------------------------------------------------------------------------- |
43
+ | `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 |
44
+ | `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
45
+ | `SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 |
46
+ | `GITHUB_CLIENT_ID` | 必选 | Github App详情页的 客户端 ID |
47
+ | `GITHUB_CLIENT_SECRET` | 必选 | Github App详情页的 客户端 Secret |
48
+ | `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个足够长的随机密码以 “禁用” 访问码授权 |
49
+ | `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
50
+
51
+ <Callout type={'tip'}>
52
+ 前往 [📘 环境变量](/zh/self-hosting/environment-variable#Github) 可查阅相关变量详情。
53
+ </Callout>
54
+ </Steps>
55
+
56
+ <Callout type={'info'}>
57
+ 部署成功后,用户将可以通过Github身份认证并使用 LobeChat。
58
+ </Callout>
59
+
60
+
61
+ [github-create-app]: https://github.com/settings/apps/new
@@ -0,0 +1,124 @@
1
+ ## Authentication Service
2
+
3
+ LobeChat provides a complete authentication service capability when deployed. The following are the relevant environment variables. You can use these environment variables to easily define the identity verification services that need to be enabled in LobeChat.
4
+
5
+ ## General Settings
6
+
7
+ ### `ENABLE_OAUTH_SSO`
8
+
9
+ - Type: Required
10
+ - Description: Enable single sign-on (SSO) for LobeChat. Set to `1` to enable single sign-on.
11
+ - Default: `-`
12
+ - Example: `1`
13
+
14
+ ### `SSO_PROVIDERS`
15
+
16
+ - Type: Required
17
+ - Description: Select the single sign-on provider for LoboChat. For multiple SSO Providers separating them with commas, for example, `auth0,azure-ad,authentik`.
18
+ - Default: `auth0`
19
+ - Example: `auth0,azure-ad,authentik`
20
+
21
+ ### `NEXTAUTH_SECRET`
22
+
23
+ - Type: Required
24
+ - Description: Key used to encrypt the session tokens in Auth.js. You can generate the key using the following command: `openssl rand -base64 32`.
25
+ - Default: `-`
26
+ - Example: `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=`
27
+
28
+ ### `NEXTAUTH_URL`
29
+
30
+ - Type: Optional
31
+ - Description: This URL is used to specify the callback address for Auth.js during OAuth authentication. It does not need to be set when deploying on Vercel.
32
+ - Default: `-`
33
+ - Example: `https://example.com/api/auth`
34
+
35
+ ## Auth0
36
+
37
+ ### `AUTH0_CLIENT_ID`
38
+
39
+ - Type: Required
40
+ - Description: Client ID of the Auth0 application. You can access it [here](https://manage.auth0.com/dashboard) and navigate to the application settings to view.
41
+ - Default: `-`
42
+ - Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
43
+
44
+ ### `AUTH0_CLIENT_SECRET`
45
+
46
+ - Type: Required
47
+ - Description: Client Secret of the Auth0 application.
48
+ - Default: `-`
49
+ - Example: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
50
+
51
+ ### `AUTH0_ISSUER`
52
+
53
+ - Type: Required
54
+ - Description: Issuer/domain of the Auth0 application.
55
+ - Default: `-`
56
+ - Example: `https://example.auth0.com`
57
+
58
+ ## Microsoft Entra ID
59
+
60
+ ### `AZURE_AD_CLIENT_ID`
61
+
62
+ - Type: Required
63
+ - Description: Client ID of the Microsoft Entra ID application.
64
+ - Default: `-`
65
+ - Example: `be8f6da1-58c3-4f16-ff1b-78f5148e10df`
66
+
67
+ ### `AZURE_AD_CLIENT_SECRET`
68
+
69
+ - Type: Required
70
+ - Description: Client Secret of the Microsoft Entra ID application.
71
+ - Default: `-`
72
+ - Example: `~gI8Q.pTiN1vwB6Gl.E1yFT1ojcXABkdACfJXaNj`
73
+
74
+ ### `AZURE_AD_TENANT_ID`
75
+
76
+ - Type: Required
77
+ - Description: Tenant ID of the Microsoft Entra ID application.
78
+ - Default: `-`
79
+ - Example: `c8ae2f36-edf6-4cda-96b9-d3e198a47cba`
80
+
81
+ ## Authentik
82
+
83
+ ### `AUTHENTIK_CLIENT_ID`
84
+
85
+ - Type: Required
86
+ - Description: Client ID of the Authentik provider application. You can access it [here][auth0-client-page] and navigate to the application settings to view.
87
+ - Default: `-`
88
+ - Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
89
+
90
+ ### `AUTHENTIK_CLIENT_SECRET`
91
+
92
+ - Type: Required
93
+ - Description: Client Secret of the Authentik provider application.
94
+ - Default: `-`
95
+ - Example: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
96
+
97
+ ### `AUTHENTIK_ISSUER`
98
+
99
+ - Type: Required
100
+ - Description: Issuer/domain of the Authentik provider application.
101
+ - Default: `-`
102
+ - Example: `https://your-authentik-domain.com/application/o/slug/`
103
+
104
+ ## Github
105
+
106
+ ### `GITHUB_CLIENT_ID`
107
+
108
+ - Type: Required
109
+ - Description: Client ID of the Github application. You can access it [here](https://github.com/settings/apps) and navigate to the application settings to view.
110
+ - Default: `-`
111
+ - Example: `abd94200333283550508`
112
+
113
+ ### `GITHUB_CLIENT_SECRET`
114
+
115
+ - Type: Required
116
+ - Description: Client Secret of the Github application.
117
+ - Default: `-`
118
+ - Example: `dd262976ac0931d947e104891586a053f3d3750b`
119
+
120
+ <Callout>
121
+ Currently, we only support providers above. If you need to use other identity verification service
122
+ providers, you can submit a [feature
123
+ request](https://github.com/lobehub/lobe-chat/issues/new/choose) or Pull Request.
124
+ </Callout>
@@ -0,0 +1,124 @@
1
+ # 身份验证服务
2
+
3
+ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相关的环境变量,你可以使用这些环境变量轻松定义需要在 LobeChat 中开启的身份验证服务。
4
+
5
+ ## 通用设置
6
+
7
+ ### `ENABLE_OAUTH_SSO`
8
+
9
+ - 类型:必选
10
+ - 描述:为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。
11
+ - 默认值: `-`
12
+ - 示例: `1`
13
+
14
+ ### `SSO_PROVIDERS`
15
+
16
+ - Type: 必需
17
+ - 描述:选择 LoboChat 的单点登录提供商。如果有多个单点登录提供商,请用逗号分隔,例如 `auth0,azure-ad,authentik`
18
+ - 默认值: `auth0`
19
+ - 示例: `auth0,azure-ad,authentik`
20
+
21
+ ### `NEXTAUTH_SECRET`
22
+
23
+ - 类型:必选
24
+ - 描述:用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32`.
25
+ - 默认值: `-`
26
+ - 示例: `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=`
27
+
28
+ ### `NEXTAUTH_URL`
29
+
30
+ - 类型:可选
31
+ - 描述:该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,在 Vercel 上部署时无需设置。
32
+ - 默认值:`-`
33
+ - 示例:`https://example.com/api/auth`
34
+
35
+ ## Auth0
36
+
37
+ ### `AUTH0_CLIENT_ID`
38
+
39
+ - 类型:必选
40
+ - 描述: Auth0 应用程序的 Client ID,您可以访问[这里](https://manage.auth0.com/dashboard)并导航至应用程序设置来查看
41
+ - 默认值: `-`
42
+ - 示例: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
43
+
44
+ ### `AUTH0_CLIENT_SECRET`
45
+
46
+ - 类型:必选
47
+ - 描述: Auth0 应用程序的 Client Secret
48
+ - 默认值: `-`
49
+ - 示例: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
50
+
51
+ ### `AUTH0_ISSUER`
52
+
53
+ - 类型:必选
54
+ - 描述: Auth0 应用程序的签发人 / 域
55
+ - 默认值: `-`
56
+ - 示例: `https://example.auth0.com`
57
+
58
+ ## Microsoft Entra ID
59
+
60
+ ### `AZURE_AD_CLIENT_ID`
61
+
62
+ - 类型:必需
63
+ - 描述:Microsoft Entra ID 应用程序的客户端 ID。
64
+ - 默认值:`-`
65
+ - 示例:`be8f6da1-58c3-4f16-ff1b-78f5148e10df`
66
+
67
+ ### `AZURE_AD_CLIENT_SECRET`
68
+
69
+ - 类型:必需
70
+ - 描述:Microsoft Entra ID 应用程序的客户端密钥。
71
+ - 默认值:`-`
72
+ - 示例:`~gI8Q.pTiN1vwB6Gl.E1yFT1ojcXABkdACfJXaNj`
73
+
74
+ ### `AZURE_AD_TENANT_ID`
75
+
76
+ - 类型:必需
77
+ - 描述:Microsoft Entra ID 应用程序的租户 ID。
78
+ - 默认值:`-`
79
+ - 示例:`c8ae2f36-edf6-4cda-96b9-d3e198a47cba`
80
+
81
+ ## Authentik
82
+
83
+
84
+ ### `AUTHENTIK_CLIENT_ID`
85
+
86
+ - 类型:必选
87
+ - 描述: Authentik 提供程序的 Client ID
88
+ - 默认值: `-`
89
+ - 示例: `YNtbIRlYF8Kj66mTLue59nsGLlb7HNyx1qjPH6VS`
90
+
91
+ ### `AUTHENTIK_CLIENT_SECRET`
92
+
93
+ - 类型:必选
94
+ - 描述: Authentik 提供程序的 Client Secret
95
+ - 默认值: `-`
96
+ - 示例: `h3lMI1vPUzqyqqeIDUbH5UNNOxyQLXk35h89yETeaAwHk7qVXBG3sJQWeqHBU5pyggwhP9u0eaZ1eq6DHUddVPLoS4gncqD37yuCr8jI8dY66WAt45MStDsDcQm0Ygze`
97
+
98
+ ### `AUTHENTIK_ISSUER`
99
+
100
+ - 类型:必选
101
+ - 描述: Authentik 提供程序的 OpenID Connect 颁发者
102
+ - 默认值: `-`
103
+ - 示例: `https://your-authentik-domain.com/application/o/slug/`
104
+
105
+ ## Github
106
+
107
+ ### `GITHUB_CLIENT_ID`
108
+
109
+ - Type: Required
110
+ - Description: Github应用的客户端ID。您可以在[这里](https://github.com/settings/apps)访问,并导航到应用程序设置以查看。
111
+ - Default: `-`
112
+ - Example: `abd94200333283550508`
113
+
114
+ ### `GITHUB_CLIENT_SECRET`
115
+
116
+ - Type: Required
117
+ - Description: Github应用的客户端密钥。
118
+ - Default: `-`
119
+ - Example: `dd262976ac0931d947e104891586a053f3d3750b`
120
+
121
+ <Callout>
122
+ 如果您需要使用其他身份验证服务提供商,可以提交
123
+ [功能请求](https://github.com/lobehub/lobe-chat/issues/new/choose) 或 Pull Request。
124
+ </Callout>
@@ -49,124 +49,7 @@ The `DEFAULT_AGENT_CONFIG` is used to configure the default settings for the Lob
49
49
 
50
50
  Further reading:
51
51
 
52
- - [\[RFC\] 022 - Default Assistant Parameters Configuration via Environment Variables](https://github.com/lobehub/lobe-chat/discussions/913)
53
-
54
- ## Identity Verification Service
55
-
56
- ### General Settings
57
-
58
- #### `ENABLE_OAUTH_SSO`
59
-
60
- - Type: Required
61
- - Description: Enable single sign-on (SSO) for LobeChat. Set to `1` to enable single sign-on.
62
- - Default: `-`
63
- - Example: `1`
64
-
65
- #### `SSO_PROVIDERS`
66
-
67
- - Type: Required
68
- - Description: Select the single sign-on provider for LoboChat. For multiple SSO Providers separating them with commas, for example, `auth0,azure-ad,authentik`.
69
- - Default: `auth0`
70
- - Example: `auth0,azure-ad,authentik`
71
-
72
- #### `NEXTAUTH_SECRET`
73
-
74
- - Type: Required
75
- - Description: Key used to encrypt the session tokens in Auth.js. You can generate the key using the following command: `openssl rand -base64 32`.
76
- - Default: `-`
77
- - Example: `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=`
78
-
79
- #### `NEXTAUTH_URL`
80
-
81
- - Type: Optional
82
- - Description: This URL is used to specify the callback address for Auth.js during OAuth authentication. It does not need to be set when deploying on Vercel.
83
- - Default: `-`
84
- - Example: `https://example.com/api/auth`
85
-
86
- ### Auth0
87
-
88
- <Callout>
89
- Currently, we only support the Auth0, Microsoft Entra ID, Authentik identity verification service providers.
90
- If you need to use other identity verification service providers, you can submit a [feature request](https://github.com/lobehub/lobe-chat/issues/new/choose) or Pull Request.
91
- </Callout>
92
-
93
- #### `AUTH0_CLIENT_ID`
94
-
95
- - Type: Required
96
- - Description: Client ID of the Auth0 application. You can access it [here][auth0-client-page] and navigate to the application settings to view.
97
- - Default: `-`
98
- - Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
99
-
100
- #### `AUTH0_CLIENT_SECRET`
101
-
102
- - Type: Required
103
- - Description: Client Secret of the Auth0 application.
104
- - Default: `-`
105
- - Example: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
106
-
107
- #### `AUTH0_ISSUER`
108
-
109
- - Type: Required
110
- - Description: Issuer/domain of the Auth0 application.
111
- - Default: `-`
112
- - Example: `https://example.auth0.com`
113
-
114
- ### Microsoft Entra ID
115
-
116
- <Callout>
117
- Currently, we only support the Auth0, Microsoft Entra ID, Authentik identity verification service providers. If you need to use
118
- other identity verification service providers, you can submit a [feature request](https://github.com/lobehub/lobe-chat/issues/new/choose) or Pull Request.
119
- </Callout>
120
-
121
- #### `AZURE_AD_CLIENT_ID`
122
-
123
- - Type: Required
124
- - Description: Client ID of the Microsoft Entra ID application.
125
- - Default: `-`
126
- - Example: `be8f6da1-58c3-4f16-ff1b-78f5148e10df`
127
-
128
- #### `AZURE_AD_CLIENT_SECRET`
129
-
130
- - Type: Required
131
- - Description: Client Secret of the Microsoft Entra ID application.
132
- - Default: `-`
133
- - Example: `~gI8Q.pTiN1vwB6Gl.E1yFT1ojcXABkdACfJXaNj`
134
-
135
- #### `AZURE_AD_TENANT_ID`
136
-
137
- - Type: Required
138
- - Description: Tenant ID of the Microsoft Entra ID application.
139
- - Default: `-`
140
- - Example: `c8ae2f36-edf6-4cda-96b9-d3e198a47cba`
141
-
142
- ### Authentik
143
-
144
- <Callout>
145
- Currently, we only support the Auth0, Microsoft Entra ID, Authentik identity verification service providers. If you need to use
146
- other identity verification service providers, you can submit a [feature
147
- request](https://github.com/lobehub/lobe-chat/issues/new/choose) or Pull Request.
148
- </Callout>
149
-
150
- #### `AUTHENTIK_CLIENT_ID`
151
-
152
- - Type: Required
153
- - Description: Client ID of the Authentik provider application. You can access it [here][auth0-client-page] and navigate to the application settings to view.
154
- - Default: `-`
155
- - Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
156
-
157
- #### `AUTHENTIK_CLIENT_SECRET`
158
-
159
- - Type: Required
160
- - Description: Client Secret of the Authentik provider application.
161
- - Default: `-`
162
- - Example: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
163
-
164
- #### `AUTHENTIK_ISSUER`
165
-
166
- - Type: Required
167
- - Description: Issuer/domain of the Authentik provider application.
168
- - Default: `-`
169
- - Example: `https://your-authentik-domain.com/application/o/slug/`
52
+ - [[RFC] 022 - Default Assistant Parameters Configuration via Environment Variables](https://github.com/lobehub/lobe-chat/discussions/913)
170
53
 
171
54
  ## Plugin Service
172
55
 
@@ -204,5 +87,3 @@ The above example sets the `SERPAPI_API_KEY` of the `search-engine` plugin to `x
204
87
  - Type: Optional
205
88
  - Description: Index address of the LobeChat assistant market. If you have deployed the assistant market service on your own, you can use this variable to override the default market address.
206
89
  - Default: `https://chat-agents.lobehub.com`
207
-
208
- [auth0-client-page]: https://manage.auth0.com/dashboard
@@ -49,123 +49,7 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
49
49
 
50
50
  相关阅读:
51
51
 
52
- - [\[RFC\] 022 - 环境变量配置默认助手参数](https://github.com/lobehub/lobe-chat/discussions/913)
53
-
54
- ## 身份验证服务
55
-
56
- ### 通用设置
57
-
58
- #### `ENABLE_OAUTH_SSO`
59
-
60
- - 类型:必选
61
- - 描述:为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。
62
- - 默认值: `-`
63
- - 示例: `1`
64
-
65
- #### `SSO_PROVIDERS`
66
-
67
- - Type: 必需
68
- - 描述:选择 LoboChat 的单点登录提供商。如果有多个单点登录提供商,请用逗号分隔,例如 `auth0,azure-ad,authentik`
69
- - 默认值: `auth0`
70
- - 示例: `auth0,azure-ad,authentik`
71
-
72
- #### `NEXTAUTH_SECRET`
73
-
74
- - 类型:必选
75
- - 描述:用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32`.
76
- - 默认值: `-`
77
- - 示例: `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=`
78
-
79
- #### `NEXTAUTH_URL`
80
-
81
- - 类型:可选
82
- - 描述:该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,在 Vercel 上部署时无需设置。
83
- - 默认值:`-`
84
- - 示例:`https://example.com/api/auth`
85
-
86
- ### Auth0
87
-
88
- <Callout>
89
- 目前,我们仅支持 Auth0,Microsoft Entra ID,Authentik 作为身份验证服务提供商。
90
- 如果您需要使用其他身份验证服务提供商,可以提交 [功能请求](https://github.com/lobehub/lobe-chat/issues/new/choose) 或 Pull Request。
91
- </Callout>
92
-
93
- #### `AUTH0_CLIENT_ID`
94
-
95
- - 类型:必选
96
- - 描述: Auth0 应用程序的 Client ID,您可以访问[这里][auth0-client-page]并导航至应用程序设置来查看
97
- - 默认值: `-`
98
- - 示例: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
99
-
100
- #### `AUTH0_CLIENT_SECRET`
101
-
102
- - 类型:必选
103
- - 描述: Auth0 应用程序的 Client Secret
104
- - 默认值: `-`
105
- - 示例: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
106
-
107
- #### `AUTH0_ISSUER`
108
-
109
- - 类型:必选
110
- - 描述: Auth0 应用程序的签发人 / 域
111
- - 默认值: `-`
112
- - 示例: `https://example.auth0.com`
113
-
114
- ### Microsoft Entra ID
115
-
116
- <Callout>
117
- 目前,我们仅支持 Auth0,Microsoft Entra ID,Authentik 作为身份验证服务提供商。
118
- 如果您需要使用其他身份验证服务提供商,可以提交 [功能请求](https://github.com/lobehub/lobe-chat/issues/new/choose) 或 Pull Request。
119
- </Callout>
120
-
121
- #### `AZURE_AD_CLIENT_ID`
122
-
123
- - 类型:必需
124
- - 描述:Microsoft Entra ID 应用程序的客户端 ID。
125
- - 默认值:`-`
126
- - 示例:`be8f6da1-58c3-4f16-ff1b-78f5148e10df`
127
-
128
- #### `AZURE_AD_CLIENT_SECRET`
129
-
130
- - 类型:必需
131
- - 描述:Microsoft Entra ID 应用程序的客户端密钥。
132
- - 默认值:`-`
133
- - 示例:`~gI8Q.pTiN1vwB6Gl.E1yFT1ojcXABkdACfJXaNj`
134
-
135
- #### `AZURE_AD_TENANT_ID`
136
-
137
- - 类型:必需
138
- - 描述:Microsoft Entra ID 应用程序的租户 ID。
139
- - 默认值:`-`
140
- - 示例:`c8ae2f36-edf6-4cda-96b9-d3e198a47cba`
141
-
142
- ### Authentik
143
-
144
- <Callout>
145
- 目前,我们仅支持 Auth0,Microsoft Entra ID,Authentik 作为身份验证服务提供商。如果您需要使用其他身份验证服务提供商,可以提交
146
- [功能请求](https://github.com/lobehub/lobe-chat/issues/new/choose) 或 Pull Request。
147
- </Callout>
148
-
149
- #### `AUTHENTIK_CLIENT_ID`
150
-
151
- - 类型:必选
152
- - 描述: Authentik 提供程序的 Client ID
153
- - 默认值: `-`
154
- - 示例: `YNtbIRlYF8Kj66mTLue59nsGLlb7HNyx1qjPH6VS`
155
-
156
- #### `AUTHENTIK_CLIENT_SECRET`
157
-
158
- - 类型:必选
159
- - 描述: Authentik 提供程序的 Client Secret
160
- - 默认值: `-`
161
- - 示例: `h3lMI1vPUzqyqqeIDUbH5UNNOxyQLXk35h89yETeaAwHk7qVXBG3sJQWeqHBU5pyggwhP9u0eaZ1eq6DHUddVPLoS4gncqD37yuCr8jI8dY66WAt45MStDsDcQm0Ygze`
162
-
163
- #### `AUTHENTIK_ISSUER`
164
-
165
- - 类型:必选
166
- - 描述: Authentik 提供程序的 OpenID Connect 颁发者
167
- - 默认值: `-`
168
- - 示例: `https://your-authentik-domain.com/application/o/slug/`
52
+ - [[RFC] 022 - 环境变量配置默认助手参数](https://github.com/lobehub/lobe-chat/discussions/913)
169
53
 
170
54
  ## 插件服务
171
55
 
@@ -203,5 +87,3 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
203
87
  - 类型:可选
204
88
  - 描述:LobeChat 助手市场的索引地址,如果你自行部署了助手市场的服务,可以使用该变量来覆盖默认的市场地址
205
89
  - 默认值:`https://chat-agents.lobehub.com`
206
-
207
- [auth0-client-page]: https://manage.auth0.com/dashboard
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.145.6",
3
+ "version": "0.145.8",
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",
@@ -1,31 +1,22 @@
1
1
  import NextAuth from 'next-auth';
2
- import Auth0 from 'next-auth/providers/auth0';
3
- import Authentik from 'next-auth/providers/authentik';
4
- import AzureAd from 'next-auth/providers/azure-ad';
5
2
 
6
3
  import { getServerConfig } from '@/config/server';
7
4
 
8
- const {
9
- ENABLE_OAUTH_SSO,
10
- SSO_PROVIDERS,
11
- AUTH0_CLIENT_ID,
12
- AUTH0_CLIENT_SECRET,
13
- AUTH0_ISSUER,
14
- AZURE_AD_CLIENT_ID,
15
- AZURE_AD_CLIENT_SECRET,
16
- AZURE_AD_TENANT_ID,
17
- AUTHENTIK_CLIENT_ID,
18
- AUTHENTIK_CLIENT_SECRET,
19
- AUTHENTIK_ISSUER,
20
- NEXTAUTH_SECRET,
21
- } = getServerConfig();
5
+ import { ssoProviders } from './sso-providers';
22
6
 
23
- declare module '@auth/core/jwt' {
24
- // Returned by the `jwt` callback and `auth`, when using JWT sessions
25
- interface JWT {
26
- userId?: string;
27
- }
28
- }
7
+ const { NEXTAUTH_SECRET, ENABLE_OAUTH_SSO, SSO_PROVIDERS } = getServerConfig();
8
+
9
+ export const initSSOProviders = () => {
10
+ return ENABLE_OAUTH_SSO
11
+ ? SSO_PROVIDERS.split(/[,,]/).map((provider) => {
12
+ const validProvider = ssoProviders.find((item) => item.id === provider);
13
+
14
+ if (validProvider) return validProvider.provider;
15
+
16
+ throw new Error(`[NextAuth] provider ${provider} is not supported`);
17
+ })
18
+ : [];
19
+ };
29
20
 
30
21
  const nextAuth = NextAuth({
31
22
  callbacks: {
@@ -46,45 +37,7 @@ const nextAuth = NextAuth({
46
37
  return session;
47
38
  },
48
39
  },
49
- providers: ENABLE_OAUTH_SSO
50
- ? SSO_PROVIDERS.split(/[,,]/).map((provider) => {
51
- switch (provider) {
52
- case 'auth0': {
53
- return Auth0({
54
- // Specify auth scope, at least include 'openid email'
55
- // all scopes in Auth0 ref: https://auth0.com/docs/get-started/apis/scopes/openid-connect-scopes#standard-claims
56
- authorization: { params: { scope: 'openid email profile' } },
57
- clientId: AUTH0_CLIENT_ID,
58
- clientSecret: AUTH0_CLIENT_SECRET,
59
- issuer: AUTH0_ISSUER,
60
- });
61
- }
62
- case 'azure-ad': {
63
- return AzureAd({
64
- // Specify auth scope, at least include 'openid email'
65
- // all scopes in Azure AD ref: https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc#openid-connect-scopes
66
- authorization: { params: { scope: 'openid email profile' } },
67
- clientId: AZURE_AD_CLIENT_ID,
68
- clientSecret: AZURE_AD_CLIENT_SECRET,
69
- tenantId: AZURE_AD_TENANT_ID,
70
- });
71
- }
72
- case 'authentik': {
73
- return Authentik({
74
- // Specify auth scope, at least include 'openid email'
75
- // all scopes in Authentik ref: https://goauthentik.io/docs/providers/oauth2
76
- authorization: { params: { scope: 'openid email profile' } },
77
- clientId: AUTHENTIK_CLIENT_ID,
78
- clientSecret: AUTHENTIK_CLIENT_SECRET,
79
- issuer: AUTHENTIK_ISSUER,
80
- });
81
- }
82
- default: {
83
- throw new Error(`[NextAuth] provider ${provider} is not supported`);
84
- }
85
- }
86
- })
87
- : [],
40
+ providers: initSSOProviders(),
88
41
  secret: NEXTAUTH_SECRET,
89
42
  trustHost: true,
90
43
  });
@@ -93,3 +46,10 @@ export const {
93
46
  handlers: { GET, POST },
94
47
  auth,
95
48
  } = nextAuth;
49
+
50
+ declare module '@auth/core/jwt' {
51
+ // Returned by the `jwt` callback and `auth`, when using JWT sessions
52
+ interface JWT {
53
+ userId?: string;
54
+ }
55
+ }
@@ -0,0 +1,19 @@
1
+ import Auth0 from 'next-auth/providers/auth0';
2
+
3
+ import { getServerConfig } from '@/config/server';
4
+
5
+ const { AUTH0_CLIENT_ID, AUTH0_CLIENT_SECRET, AUTH0_ISSUER } = getServerConfig();
6
+
7
+ const provider = {
8
+ id: 'auth0',
9
+ provider: Auth0({
10
+ // Specify auth scope, at least include 'openid email'
11
+ // all scopes in Auth0 ref: https://auth0.com/docs/get-started/apis/scopes/openid-connect-scopes#standard-claims
12
+ authorization: { params: { scope: 'openid email profile' } },
13
+ clientId: AUTH0_CLIENT_ID,
14
+ clientSecret: AUTH0_CLIENT_SECRET,
15
+ issuer: AUTH0_ISSUER,
16
+ }),
17
+ };
18
+
19
+ export default provider;
@@ -0,0 +1,19 @@
1
+ import Authentik from 'next-auth/providers/authentik';
2
+
3
+ import { getServerConfig } from '@/config/server';
4
+
5
+ const { AUTHENTIK_CLIENT_ID, AUTHENTIK_CLIENT_SECRET, AUTHENTIK_ISSUER } = getServerConfig();
6
+
7
+ const provider = {
8
+ id: 'authentik',
9
+ provider: Authentik({
10
+ // Specify auth scope, at least include 'openid email'
11
+ // all scopes in Authentik ref: https://goauthentik.io/docs/providers/oauth2
12
+ authorization: { params: { scope: 'openid email profile' } },
13
+ clientId: AUTHENTIK_CLIENT_ID,
14
+ clientSecret: AUTHENTIK_CLIENT_SECRET,
15
+ issuer: AUTHENTIK_ISSUER,
16
+ }),
17
+ };
18
+
19
+ export default provider;
@@ -0,0 +1,19 @@
1
+ import AzureAD from 'next-auth/providers/azure-ad';
2
+
3
+ import { getServerConfig } from '@/config/server';
4
+
5
+ const { AZURE_AD_CLIENT_ID, AZURE_AD_CLIENT_SECRET, AZURE_AD_TENANT_ID } = getServerConfig();
6
+
7
+ const provider = {
8
+ id: 'azureAd',
9
+ provider: AzureAD({
10
+ // Specify auth scope, at least include 'openid email'
11
+ // all scopes in Azure AD ref: https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc#openid-connect-scopes
12
+ authorization: { params: { scope: 'openid email profile' } },
13
+ clientId: AZURE_AD_CLIENT_ID,
14
+ clientSecret: AZURE_AD_CLIENT_SECRET,
15
+ tenantId: AZURE_AD_TENANT_ID,
16
+ }),
17
+ };
18
+
19
+ export default provider;
@@ -0,0 +1,17 @@
1
+ import GitHub from 'next-auth/providers/github';
2
+
3
+ import { getServerConfig } from '@/config/server';
4
+
5
+ const { GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET } = getServerConfig();
6
+
7
+ const provider = {
8
+ id: 'github',
9
+ provider: GitHub({
10
+ // Specify auth scope, at least include 'openid email'
11
+ authorization: { params: { scope: 'read:user user:email' } },
12
+ clientId: GITHUB_CLIENT_ID,
13
+ clientSecret: GITHUB_CLIENT_SECRET,
14
+ }),
15
+ };
16
+
17
+ export default provider;
@@ -0,0 +1,6 @@
1
+ import Auth0 from './auth0';
2
+ import Authentik from './authentik';
3
+ import AzureAD from './azure-ad';
4
+ import Github from './github';
5
+
6
+ export const ssoProviders = [Auth0, Authentik, AzureAD, Github];
@@ -47,6 +47,7 @@ const Desktop = memo(() => {
47
47
  mode={'fixed'}
48
48
  onExpandChange={toggleConfig}
49
49
  placement={'right'}
50
+ showHandlerWideArea={false}
50
51
  >
51
52
  <DraggablePanelContainer
52
53
  style={{
@@ -55,6 +55,7 @@ const SideBar = memo(() => {
55
55
  mode={'fixed'}
56
56
  onExpandChange={handleExpandChange}
57
57
  placement={'right'}
58
+ showHandlerWideArea={false}
58
59
  >
59
60
  <DraggablePanelContainer
60
61
  style={{
@@ -62,6 +62,8 @@ export const getAppConfig = () => {
62
62
  AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID || '',
63
63
  AUTH0_CLIENT_SECRET: process.env.AUTH0_CLIENT_SECRET || '',
64
64
  AUTH0_ISSUER: process.env.AUTH0_ISSUER || '',
65
+ GITHUB_CLIENT_ID: process.env.GITHUB_CLIENT_ID || '',
66
+ GITHUB_CLIENT_SECRET: process.env.GITHUB_CLIENT_SECRET || '',
65
67
  AZURE_AD_CLIENT_ID: process.env.AZURE_AD_CLIENT_ID || '',
66
68
  AZURE_AD_CLIENT_SECRET: process.env.AZURE_AD_CLIENT_SECRET || '',
67
69
  AZURE_AD_TENANT_ID: process.env.AZURE_AD_TENANT_ID || '',
@@ -119,6 +119,10 @@ const Tools = memo(() => {
119
119
  onClick: (e) => {
120
120
  e.domEvent.preventDefault();
121
121
  },
122
+ style: {
123
+ maxHeight: 500,
124
+ overflowY: 'scroll',
125
+ },
122
126
  }}
123
127
  placement={'top'}
124
128
  trigger={['click']}