@lobehub/lobehub 2.0.3 → 2.0.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 (86) hide show
  1. package/.github/ISSUE_TEMPLATE/1_bug_report.yml +0 -11
  2. package/CHANGELOG.md +25 -0
  3. package/README.md +9 -13
  4. package/README.zh-CN.md +6 -8
  5. package/apps/desktop/Development.md +1 -1
  6. package/changelog/v2.json +9 -0
  7. package/docker-compose/local/docker-compose.yml +2 -2
  8. package/docker-compose/local/grafana/docker-compose.yml +3 -3
  9. package/docker-compose/local/logto/docker-compose.yml +3 -4
  10. package/docker-compose/local/zitadel/.env.example +3 -4
  11. package/docker-compose/local/zitadel/.env.zh-CN.example +1 -2
  12. package/docker-compose/local/zitadel/docker-compose.yml +3 -3
  13. package/docker-compose/production/grafana/docker-compose.yml +3 -3
  14. package/docker-compose/production/logto/.env.example +7 -9
  15. package/docker-compose/production/logto/.env.zh-CN.example +7 -9
  16. package/docker-compose/production/logto/docker-compose.yml +3 -3
  17. package/docker-compose/production/zitadel/.env.example +4 -6
  18. package/docker-compose/production/zitadel/.env.zh-CN.example +3 -5
  19. package/docker-compose/production/zitadel/docker-compose.yml +3 -3
  20. package/docs/development/basic/folder-structure.mdx +1 -2
  21. package/docs/development/basic/folder-structure.zh-CN.mdx +1 -2
  22. package/docs/self-hosting/advanced/auth/legacy.mdx +1 -1
  23. package/docs/self-hosting/advanced/auth/legacy.zh-CN.mdx +1 -1
  24. package/docs/self-hosting/advanced/auth/nextauth-to-betterauth.mdx +4 -0
  25. package/docs/self-hosting/advanced/auth/nextauth-to-betterauth.zh-CN.mdx +4 -0
  26. package/docs/self-hosting/advanced/auth/providers/casdoor.mdx +8 -0
  27. package/docs/self-hosting/advanced/auth/providers/casdoor.zh-CN.mdx +8 -0
  28. package/docs/self-hosting/advanced/auth.mdx +28 -1
  29. package/docs/self-hosting/advanced/auth.zh-CN.mdx +29 -2
  30. package/docs/self-hosting/advanced/upstream-sync.mdx +5 -5
  31. package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +5 -5
  32. package/docs/self-hosting/environment-variables/auth.mdx +2 -334
  33. package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +2 -307
  34. package/docs/self-hosting/environment-variables/basic.mdx +1 -1
  35. package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +1 -1
  36. package/docs/self-hosting/environment-variables.mdx +1 -1
  37. package/docs/self-hosting/platform/docker-compose.mdx +837 -90
  38. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +809 -84
  39. package/docs/self-hosting/platform/docker.mdx +110 -111
  40. package/docs/self-hosting/platform/docker.zh-CN.mdx +103 -151
  41. package/docs/self-hosting/{server-database → platform}/dokploy.mdx +2 -2
  42. package/docs/self-hosting/{server-database → platform}/dokploy.zh-CN.mdx +2 -2
  43. package/docs/self-hosting/platform/repocloud.mdx +11 -10
  44. package/docs/self-hosting/platform/repocloud.zh-CN.mdx +13 -11
  45. package/docs/self-hosting/platform/sealos.mdx +79 -13
  46. package/docs/self-hosting/platform/sealos.zh-CN.mdx +92 -11
  47. package/docs/self-hosting/platform/vercel.mdx +323 -19
  48. package/docs/self-hosting/platform/vercel.zh-CN.mdx +318 -24
  49. package/docs/self-hosting/platform/zeabur.mdx +41 -37
  50. package/docs/self-hosting/platform/zeabur.zh-CN.mdx +34 -39
  51. package/docs/self-hosting/server-database.mdx +6 -6
  52. package/docs/self-hosting/server-database.zh-CN.mdx +5 -5
  53. package/package.json +1 -1
  54. package/packages/types/src/user/preference.ts +2 -2
  55. package/scripts/_shared/checkDeprecatedAuth.js +16 -0
  56. package/src/libs/next/proxy/createRouteMatcher.test.ts +0 -8
  57. package/src/libs/trpc/middleware/userAuth.test.ts +0 -6
  58. package/src/proxy.ts +0 -1
  59. package/src/server/routers/async/__tests__/caller.test.ts +2 -2
  60. package/src/server/routers/lambda/config/index.test.ts +0 -6
  61. package/docs/self-hosting/platform/alibaba-cloud.mdx +0 -28
  62. package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +0 -25
  63. package/docs/self-hosting/platform/btpanel.mdx +0 -48
  64. package/docs/self-hosting/platform/btpanel.zh-CN.mdx +0 -51
  65. package/docs/self-hosting/platform/netlify.mdx +0 -91
  66. package/docs/self-hosting/platform/netlify.zh-CN.mdx +0 -86
  67. package/docs/self-hosting/platform/railway.mdx +0 -29
  68. package/docs/self-hosting/platform/railway.zh-CN.mdx +0 -29
  69. package/docs/self-hosting/platform/tencentcloud-lighthouse.mdx +0 -29
  70. package/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx +0 -26
  71. package/docs/self-hosting/server-database/docker-compose.mdx +0 -879
  72. package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +0 -854
  73. package/docs/self-hosting/server-database/docker.mdx +0 -154
  74. package/docs/self-hosting/server-database/docker.zh-CN.mdx +0 -153
  75. package/docs/self-hosting/server-database/netlify.mdx +0 -13
  76. package/docs/self-hosting/server-database/netlify.zh-CN.mdx +0 -16
  77. package/docs/self-hosting/server-database/railway.mdx +0 -13
  78. package/docs/self-hosting/server-database/railway.zh-CN.mdx +0 -15
  79. package/docs/self-hosting/server-database/repocloud.mdx +0 -33
  80. package/docs/self-hosting/server-database/repocloud.zh-CN.mdx +0 -32
  81. package/docs/self-hosting/server-database/sealos.mdx +0 -97
  82. package/docs/self-hosting/server-database/sealos.zh-CN.mdx +0 -112
  83. package/docs/self-hosting/server-database/vercel.mdx +0 -344
  84. package/docs/self-hosting/server-database/vercel.zh-CN.mdx +0 -337
  85. package/docs/self-hosting/server-database/zeabur.mdx +0 -76
  86. package/docs/self-hosting/server-database/zeabur.zh-CN.mdx +0 -67
@@ -47,17 +47,6 @@ body:
47
47
  validations:
48
48
  required: false
49
49
 
50
- - type: dropdown
51
- attributes:
52
- label: '🔧 Deployment Mode'
53
- multiple: true
54
- options:
55
- - 'client db (lobe-chat image)'
56
- - 'client pgelite db (lobe-chat-pglite image)'
57
- - 'server db (lobe-chat-database image)'
58
- validations:
59
- required: true
60
-
61
50
  - type: input
62
51
  attributes:
63
52
  label: '📌 Version'
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 2.0.4](https://github.com/lobehub/lobe-chat/compare/v2.0.3...v2.0.4)
6
+
7
+ <sup>Released on **2026-01-27**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Rename docker image and update docs for v2.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Rename docker image and update docs for v2, closes [#11911](https://github.com/lobehub/lobe-chat/issues/11911) ([e6cb6cb](https://github.com/lobehub/lobe-chat/commit/e6cb6cb))
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 2.0.3](https://github.com/lobehub/lobe-chat/compare/v2.0.2...v2.0.3)
6
31
 
7
32
  <sup>Released on **2026-01-27**</sup>
package/README.md CHANGED
@@ -479,13 +479,9 @@ Regardless of which database you choose, LobeHub can provide you with an excelle
479
479
 
480
480
  ### [Support Multi-User Management][docs-feat-auth]
481
481
 
482
- LobeHub supports multi-user management and provides two main user authentication and management solutions to meet different needs:
482
+ LobeHub supports multi-user management and provides flexible user authentication solutions:
483
483
 
484
- - **next-auth**: LobeHub integrates `next-auth`, a flexible and powerful identity verification library that supports multiple authentication methods, including OAuth, email login, credential login, etc. With `next-auth`, you can easily implement user registration, login, session management, social login, and other functions to ensure the security and privacy of user data.
485
-
486
- - [**Clerk**](https://go.clerk.com/exgqLG0): For users who need more advanced user management features, LobeHub also supports `Clerk`, a modern user management platform. `Clerk` provides richer functions, such as multi-factor authentication (MFA), user profile management, login activity monitoring, etc. With `Clerk`, you can get higher security and flexibility, and easily cope with complex user management needs.
487
-
488
- Regardless of which user management solution you choose, LobeHub can provide you with an excellent user experience and powerful functional support.
484
+ - **Better Auth**: LobeHub integrates `Better Auth`, a modern and flexible authentication library that supports multiple authentication methods, including OAuth, email login, credential login, magic links, and more. With `Better Auth`, you can easily implement user registration, login, session management, social login, multi-factor authentication (MFA), and other functions to ensure the security and privacy of user data.
489
485
 
490
486
  <div align="right">
491
487
 
@@ -845,12 +841,12 @@ This project is [LobeHub Community License](./LICENSE) licensed.
845
841
  [discord-link]: https://discord.gg/AYFPHvv2jT
846
842
  [discord-shield]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=flat-square
847
843
  [discord-shield-badge]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=for-the-badge
848
- [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat-database
849
- [docker-pulls-shield]: https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11&labelColor=black&style=flat-square&sort=semver
850
- [docker-release-link]: https://hub.docker.com/r/lobehub/lobe-chat-database
851
- [docker-release-shield]: https://img.shields.io/docker/v/lobehub/lobe-chat-database?color=369eff&label=docker&labelColor=black&logo=docker&logoColor=white&style=flat-square&sort=semver
852
- [docker-size-link]: https://hub.docker.com/r/lobehub/lobe-chat-database
853
- [docker-size-shield]: https://img.shields.io/docker/image-size/lobehub/lobe-chat-database?color=369eff&labelColor=black&style=flat-square&sort=semver
844
+ [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobehub
845
+ [docker-pulls-shield]: https://img.shields.io/docker/pulls/lobehub/lobehub?color=45cc11&labelColor=black&style=flat-square&sort=semver
846
+ [docker-release-link]: https://hub.docker.com/r/lobehub/lobehub
847
+ [docker-release-shield]: https://img.shields.io/docker/v/lobehub/lobehub?color=369eff&label=docker&labelColor=black&logo=docker&logoColor=white&style=flat-square&sort=semver
848
+ [docker-size-link]: https://hub.docker.com/r/lobehub/lobehub
849
+ [docker-size-shield]: https://img.shields.io/docker/image-size/lobehub/lobehub?color=369eff&labelColor=black&style=flat-square&sort=semver
854
850
  [docs]: https://lobehub.com/docs/usage/start
855
851
  [docs-dev-guide]: https://lobehub.com/docs/development/start
856
852
  [docs-docker]: https://lobehub.com/docs/self-hosting/server-database/docker-compose
@@ -964,5 +960,5 @@ This project is [LobeHub Community License](./LICENSE) licensed.
964
960
  [submit-agents-shield]: https://img.shields.io/badge/🤖/🏪_submit_agent-%E2%86%92-c4f042?labelColor=black&style=for-the-badge
965
961
  [submit-plugin-link]: https://github.com/lobehub/lobe-chat-plugins
966
962
  [submit-plugin-shield]: https://img.shields.io/badge/🧩/🏪_submit_plugin-%E2%86%92-95f3d9?labelColor=black&style=for-the-badge
967
- [vercel-link]: https://chat-preview.lobehub.com
963
+ [vercel-link]: https://app.lobehub.com
968
964
  [vercel-shield]: https://img.shields.io/badge/vercel-online-55b467?labelColor=black&logo=vercel&style=flat-square
package/README.zh-CN.md CHANGED
@@ -461,8 +461,6 @@ LobeHub 支持多用户管理,提供了灵活的用户认证方案:
461
461
 
462
462
  - **Better Auth**:LobeHub 集成了 `Better Auth`,一个现代化且灵活的身份验证库,支持多种身份验证方式,包括 OAuth、邮件登录、凭证登录、魔法链接等。通过 `Better Auth`,您可以轻松实现用户的注册、登录、会话管理、社交登录、多因素认证 (MFA) 等功能,确保用户数据的安全性和隐私性。
463
463
 
464
- - **next-auth**:LobeHub 还支持 `next-auth`,一个广泛使用的身份验证库,具有丰富的 OAuth 提供商支持和灵活的会话管理选项。
465
-
466
464
  <div align="right">
467
465
 
468
466
  [![][back-to-top]](#readme-top)
@@ -855,12 +853,12 @@ This project is [LobeHub Community License](./LICENSE) licensed.
855
853
  [discord-link]: https://discord.gg/AYFPHvv2jT
856
854
  [discord-shield]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=flat-square
857
855
  [discord-shield-badge]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=for-the-badge
858
- [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat-database
859
- [docker-pulls-shield]: https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11&labelColor=black&style=flat-square&sort=semver
860
- [docker-release-link]: https://hub.docker.com/r/lobehub/lobe-chat-database
861
- [docker-release-shield]: https://img.shields.io/docker/v/lobehub/lobe-chat-database?color=369eff&label=docker&labelColor=black&logo=docker&logoColor=white&style=flat-square&sort=semver
862
- [docker-size-link]: https://hub.docker.com/r/lobehub/lobe-chat-database
863
- [docker-size-shield]: https://img.shields.io/docker/image-size/lobehub/lobe-chat-database?color=369eff&labelColor=black&style=flat-square&sort=semver
856
+ [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobehub
857
+ [docker-pulls-shield]: https://img.shields.io/docker/pulls/lobehub/lobehub?color=45cc11&labelColor=black&style=flat-square&sort=semver
858
+ [docker-release-link]: https://hub.docker.com/r/lobehub/lobehub
859
+ [docker-release-shield]: https://img.shields.io/docker/v/lobehub/lobehub?color=369eff&label=docker&labelColor=black&logo=docker&logoColor=white&style=flat-square&sort=semver
860
+ [docker-size-link]: https://hub.docker.com/r/lobehub/lobehub
861
+ [docker-size-shield]: https://img.shields.io/docker/image-size/lobehub/lobehub?color=369eff&labelColor=black&style=flat-square&sort=semver
864
862
  [docs]: https://lobehub.com/zh/docs/usage/start
865
863
  [docs-dev-guide]: https://lobehub.com/docs/development/start
866
864
  [docs-docker]: https://lobehub.com/zh/docs/self-hosting/server-database/docker-compose
@@ -181,7 +181,7 @@ export default class AuthCtr extends ControllerModule {
181
181
 
182
182
  2. **桌面端特定认证**:
183
183
  - 在桌面应用中使用固定的用户 ID
184
- - 支持与 Clerk NextAuth 等认证系统集成
184
+ - 支持与 Better Auth 认证系统集成
185
185
 
186
186
  ### 存储模块 (Store)
187
187
 
package/changelog/v2.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Rename docker image and update docs for v2."
6
+ ]
7
+ },
8
+ "date": "2026-01-27",
9
+ "version": "2.0.4"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "fixes": [
@@ -1,4 +1,4 @@
1
- name: lobe-chat-database
1
+ name: lobehub
2
2
  services:
3
3
  network-service:
4
4
  image: alpine
@@ -128,7 +128,7 @@ services:
128
128
 
129
129
  lobe:
130
130
  image: lobehub/lobehub
131
- container_name: lobe-chat
131
+ container_name: lobehub
132
132
  network_mode: 'service:network-service'
133
133
  depends_on:
134
134
  postgresql:
@@ -1,4 +1,4 @@
1
- name: lobe-chat-database
1
+ name: lobehub
2
2
  services:
3
3
  network-service:
4
4
  image: alpine
@@ -159,8 +159,8 @@ services:
159
159
  - ENDPOINT=127.0.0.1:4317
160
160
 
161
161
  lobe:
162
- image: lobehub/lobe-chat-database
163
- container_name: lobe-chat
162
+ image: lobehub/lobehub
163
+ container_name: lobehub
164
164
  network_mode: 'service:network-service'
165
165
  depends_on:
166
166
  postgresql:
@@ -1,4 +1,4 @@
1
- name: lobe-chat-database
1
+ name: lobehub
2
2
  services:
3
3
  network-service:
4
4
  image: alpine
@@ -79,8 +79,8 @@ services:
79
79
  entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']
80
80
 
81
81
  lobe:
82
- image: lobehub/lobe-chat-database
83
- container_name: lobe-chat
82
+ image: lobehub/lobehub
83
+ container_name: lobehub
84
84
  network_mode: 'service:network-service'
85
85
  depends_on:
86
86
  postgresql:
@@ -99,7 +99,6 @@ services:
99
99
  - 'AUTH_SSO_PROVIDERS=logto'
100
100
  - 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ='
101
101
  - 'AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg'
102
- - 'NEXTAUTH_URL=http://localhost:${LOBE_PORT}/api/auth'
103
102
  - 'AUTH_LOGTO_ISSUER=http://localhost:${LOGTO_PORT}/oidc'
104
103
  - 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}'
105
104
  - 'S3_ENDPOINT=http://localhost:${MINIO_PORT}'
@@ -1,5 +1,5 @@
1
1
  # Required: LobeChat domain for tRPC calls
2
- # Ensure this domain is whitelisted in your NextAuth providers and S3 service CORS settings
2
+ # Ensure this domain is whitelisted in your SSO providers and S3 service CORS settings
3
3
  APP_URL=http://localhost:3210
4
4
 
5
5
  # Postgres related environment variables
@@ -8,12 +8,11 @@ KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
8
8
  # Required: Postgres database connection string
9
9
  DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobechat
10
10
 
11
- # NEXT_AUTH related environment variables
12
- NEXTAUTH_URL=http://localhost:3210/api/auth
11
+ # Authentication related environment variables
13
12
  AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
14
13
  AUTH_SSO_PROVIDERS=zitadel
15
14
  # ZiTADEL provider configuration
16
- # Please refer to:https://lobehub.com/zh/docs/self-hosting/advanced/auth/next-auth/zitadel
15
+ # Please refer to:https://lobehub.com/zh/docs/self-hosting/advanced/auth/providers/zitadel
17
16
  AUTH_ZITADEL_ID=285945938244075523
18
17
  AUTH_ZITADEL_SECRET=hkbtzHLaCEIeHeFThym14UcydpmQiEB5JtAX08HSqSoJxhAlVVkyovTuNUZ5TNrT
19
18
  AUTH_ZITADEL_ISSUER=http://localhost:8080
@@ -7,8 +7,7 @@ KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
7
7
  # Postgres 数据库连接字符串
8
8
  DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobechat
9
9
 
10
- # NEXT_AUTH 相关
11
- NEXTAUTH_URL=http://localhost:3210/api/auth
10
+ # 鉴权相关
12
11
  AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
13
12
  AUTH_SSO_PROVIDERS=zitadel
14
13
  # ZiTADEL 鉴权服务提供商部分
@@ -1,4 +1,4 @@
1
- name: lobe-chat-database
1
+ name: lobehub
2
2
  services:
3
3
  network-service:
4
4
  image: alpine
@@ -60,8 +60,8 @@ services:
60
60
  condition: service_healthy
61
61
 
62
62
  lobe:
63
- image: lobehub/lobe-chat-database
64
- container_name: lobe-chat
63
+ image: lobehub/lobehub
64
+ container_name: lobehub
65
65
  network_mode: 'service:network-service'
66
66
  depends_on:
67
67
  postgresql:
@@ -1,4 +1,4 @@
1
- name: lobe-chat-database
1
+ name: lobehub
2
2
  services:
3
3
  network-service:
4
4
  image: alpine
@@ -157,8 +157,8 @@ services:
157
157
  - ENDPOINT=127.0.0.1:4317
158
158
 
159
159
  lobe:
160
- image: lobehub/lobe-chat-database
161
- container_name: lobe-chat
160
+ image: lobehub/lobehub
161
+ container_name: lobehub
162
162
  network_mode: 'service:network-service'
163
163
  depends_on:
164
164
  postgresql:
@@ -1,5 +1,5 @@
1
1
  # Required: LobeChat domain for tRPC calls
2
- # Ensure this domain is whitelisted in your NextAuth providers and S3 service CORS settings
2
+ # Ensure this domain is whitelisted in your SSO providers and S3 service CORS settings
3
3
  APP_URL=https://lobe.example.com/
4
4
 
5
5
  # Postgres related environment variables
@@ -10,18 +10,16 @@ KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
10
10
  # If using Docker, you can use the container name as the host
11
11
  DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobe
12
12
 
13
- # NEXT_AUTH related environment variables
14
- # Supports auth0, Azure AD, GitHub, Authentik, Zitadel, Logto, etc.
15
- # For supported providers, see: https://lobehub.com/docs/self-hosting/advanced/auth#next-auth
16
- # If you have ACCESS_CODE, please remove it. We use NEXT_AUTH as the sole authentication source
17
- # Required: NextAuth secret key. Generate with: openssl rand -base64 32
13
+ # Authentication related environment variables
14
+ # Supports Auth0, Azure AD, GitHub, Authentik, Zitadel, Logto, etc.
15
+ # For supported providers, see: https://lobehub.com/docs/self-hosting/advanced/auth
16
+ # If you have ACCESS_CODE, please remove it. We use Better Auth as the sole authentication source
17
+ # Required: Auth secret key. Generate with: openssl rand -base64 32
18
18
  AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
19
19
  # Required: Specify the authentication provider (e.g., Logto)
20
20
  AUTH_SSO_PROVIDERS=logto
21
- # Required: NextAuth URL for callbacks
22
- NEXTAUTH_URL=https://lobe.example.com/api/auth
23
21
 
24
- # NextAuth providers configuration (example using Logto)
22
+ # SSO providers configuration (example using Logto)
25
23
  # For other providers, see: https://lobehub.com/docs/self-hosting/environment-variables/auth
26
24
  AUTH_LOGTO_ID=YOUR_LOGTO_ID
27
25
  AUTH_LOGTO_SECRET=YOUR_LOGTO_SECRET
@@ -1,5 +1,5 @@
1
1
  # 必填,LobeChat 域名,用于 tRPC 调用
2
- # 请保证此域名在你的 NextAuth 鉴权服务提供商、S3 服务商的 CORS 白名单中
2
+ # 请保证此域名在你的 SSO 鉴权服务提供商、S3 服务商的 CORS 白名单中
3
3
  APP_URL=https://lobe.example.com/
4
4
 
5
5
  # Postgres 相关,也即 DB 必需的环境变量
@@ -9,18 +9,16 @@ KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
9
9
  # 格式:postgresql://username:password@host:port/dbname,如果你的 pg 实例为 Docker 容器且位于同一 docker-compose 文件中,亦可使用容器名作为 host
10
10
  DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobe
11
11
 
12
- # NEXT_AUTH 相关,也即鉴权服务必需的环境变量
13
- # 可以使用 auth0、Azure AD、GitHub、Authentik、Zitadel、Logto 等,如有其他接入诉求欢迎提 PR
14
- # 目前支持的鉴权服务提供商请参考:https://lobehub.com/zh/docs/self-hosting/advanced/auth#next-auth
15
- # 如果你有 ACCESS_CODE,请务必清空,我们以 NEXT_AUTH 作为唯一鉴权来源
16
- # 必填,用于 NextAuth 的密钥,可以使用 openssl rand -base64 32 生成
12
+ # 鉴权服务必需的环境变量
13
+ # 可以使用 Auth0、Azure AD、GitHub、Authentik、Zitadel、Logto 等,如有其他接入诉求欢迎提 PR
14
+ # 目前支持的鉴权服务提供商请参考:https://lobehub.com/zh/docs/self-hosting/advanced/auth
15
+ # 如果你有 ACCESS_CODE,请务必清空,我们以 Better Auth 作为唯一鉴权来源
16
+ # 必填,用于鉴权的密钥,可以使用 openssl rand -base64 32 生成
17
17
  AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
18
18
  # 必填,指定鉴权服务提供商,这里以 Logto 为例
19
19
  AUTH_SSO_PROVIDERS=logto
20
- # 必填,NextAuth 的 URL,用于 NextAuth 的回调
21
- NEXTAUTH_URL=https://lobe.example.com/api/auth
22
20
 
23
- # NextAuth 鉴权服务提供商部分,以 Logto 为例
21
+ # SSO 鉴权服务提供商部分,以 Logto 为例
24
22
  # 其他鉴权服务提供商所需的环境变量,请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/auth
25
23
  AUTH_LOGTO_ID=YOUR_LOGTO_ID
26
24
  AUTH_LOGTO_SECRET=YOUR_LOGTO_SECRET
@@ -1,4 +1,4 @@
1
- name: lobe-chat-database
1
+ name: lobehub
2
2
  services:
3
3
  postgresql:
4
4
  image: pgvector/pgvector:pg16
@@ -52,8 +52,8 @@ services:
52
52
  entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start']
53
53
 
54
54
  lobe:
55
- image: lobehub/lobe-chat-database
56
- container_name: lobe-chat
55
+ image: lobehub/lobehub
56
+ container_name: lobehub
57
57
  ports:
58
58
  - '3210:3210'
59
59
  depends_on:
@@ -1,5 +1,5 @@
1
1
  # Required: LobeChat domain for tRPC calls
2
- # Ensure this domain is whitelisted in your NextAuth providers and S3 service CORS settings
2
+ # Ensure this domain is whitelisted in your SSO providers and S3 service CORS settings
3
3
  APP_URL=https://lobe.example.com/
4
4
 
5
5
  # Postgres related environment variables
@@ -10,16 +10,14 @@ KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
10
10
  # If using Docker, you can use the container name as the host
11
11
  DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobe
12
12
 
13
- # NEXT_AUTH related environment variables
14
- # Required: NextAuth URL for callbacks
15
- NEXTAUTH_URL=https://lobe.example.com/api/auth
16
- # Required: NextAuth secret key. Generate with: openssl rand -base64 32
13
+ # Authentication related environment variables
14
+ # Required: Auth secret key. Generate with: openssl rand -base64 32
17
15
  AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
18
16
  # Required: Specify the authentication provider
19
17
  AUTH_SSO_PROVIDERS=zitadel
20
18
 
21
19
  # ZiTADEL provider configuration
22
- # Please refer to:https://lobehub.com/zh/docs/self-hosting/advanced/auth/next-auth/zitadel
20
+ # Please refer to:https://lobehub.com/zh/docs/self-hosting/advanced/auth/providers/zitadel
23
21
  AUTH_ZITADEL_ID=285934220675723622
24
22
  AUTH_ZITADEL_SECRET=pe7Nh3lopXkZkfqh5YEDYI2xsbIz08eZKqInOUZxssd3refRia518Apbv3DZ
25
23
  AUTH_ZITADEL_ISSUER=https://zitadel.example.com
@@ -1,5 +1,5 @@
1
1
  # 必填,LobeChat 域名,用于 tRPC 调用
2
- # 请保证此域名在你的 NextAuth 鉴权服务提供商、S3 服务商的 CORS 白名单中
2
+ # 请保证此域名在你的 SSO 鉴权服务提供商、S3 服务商的 CORS 白名单中
3
3
  APP_URL=https://lobe.example.com/
4
4
 
5
5
  # Postgres 相关,也即 DB 必需的环境变量
@@ -9,10 +9,8 @@ KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=
9
9
  # 格式:postgresql://username:password@host:port/dbname,如果你的 pg 实例为 Docker 容器且位于同一 docker-compose 文件中,亦可使用容器名作为 host
10
10
  DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobe
11
11
 
12
- # NEXT_AUTH 相关,也即鉴权服务必需的环境变量
13
- # 必填,NextAuth URL,用于 NextAuth 的回调
14
- NEXTAUTH_URL=https://lobe.example.com/api/auth
15
- # 必填,用于 NextAuth 的密钥,可以使用 openssl rand -base64 32 生成
12
+ # 鉴权服务必需的环境变量
13
+ # 必填,用于鉴权的密钥,可以使用 openssl rand -base64 32 生成
16
14
  AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg
17
15
  # 必填,指定鉴权服务提供商
18
16
  AUTH_SSO_PROVIDERS=zitadel
@@ -1,4 +1,4 @@
1
- name: lobe-chat-database
1
+ name: lobehub
2
2
  services:
3
3
  postgresql:
4
4
  image: pgvector/pgvector:pg16
@@ -50,8 +50,8 @@ services:
50
50
  condition: service_healthy
51
51
 
52
52
  lobe:
53
- image: lobehub/lobe-chat-database
54
- container_name: lobe-chat
53
+ image: lobehub/lobehub
54
+ container_name: lobehub
55
55
  ports:
56
56
  - '3210:3210'
57
57
  depends_on:
@@ -59,8 +59,7 @@ app
59
59
  ├── [variants]/ # Platform and device variants
60
60
  │ ├── (auth)/ # Authentication pages
61
61
  │ │ ├── login/
62
- │ │ ├── signup/
63
- │ │ └── next-auth/
62
+ │ │ └── signup/
64
63
  │ ├── (main)/ # Main application routes
65
64
  │ │ ├── (mobile)/ # Mobile-specific routes
66
65
  │ │ │ └── me/ # Mobile profile pages
@@ -57,8 +57,7 @@ app
57
57
  ├── [variants]/ # 平台和设备变体
58
58
  │ ├── (auth)/ # 身份验证页面
59
59
  │ │ ├── login/
60
- │ │ ├── signup/
61
- │ │ └── next-auth/
60
+ │ │ └── signup/
62
61
  │ ├── (main)/ # 主应用路由
63
62
  │ │ ├── (mobile)/ # 移动端专用路由
64
63
  │ │ │ └── me/ # 移动端个人资料页面
@@ -44,7 +44,7 @@ Before using NextAuth, please set the following variables in LobeChat's environm
44
44
 
45
45
  | Environment Variable | Type | Description |
46
46
  | -------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
47
- | `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | Required | This is used to enable the NextAuth service. Set it to `1` to enable it; changing this setting requires recompiling the application. Users deploying with the `lobehub/lobe-chat-database` image have this configuration added by default. |
47
+ | `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | Required | This is used to enable the NextAuth service. Set it to `1` to enable it; changing this setting requires recompiling the application. Users deploying with the `lobehub/lobehub` image have this configuration added by default. |
48
48
  | `AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can use the following command: `openssl rand -base64 32`, or visit `https://generate-secret.vercel.app/32` to generate the key. |
49
49
  | `AUTH_URL` | Required | This URL specifies the callback address for Auth.js when performing OAuth verification. Set this only if the default generated redirect address is incorrect. `https://example.com/api/auth` |
50
50
  | `NEXT_AUTH_SSO_PROVIDERS` | Optional | This environment variable is used to enable multiple identity verification sources simultaneously, separated by commas, for example, `auth0,microsoft-entra-id,authentik`. |
@@ -42,7 +42,7 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供安全、便捷的
42
42
 
43
43
  | 环境变量 | 类型 | 描述 |
44
44
  | -------------------------------- | -- | ------------------------------------------------------------------------------------------------------------ |
45
- | `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | 必选 | 用于启用 NextAuth 服务,设置为 `1` 以启用,更改此项需要重新编译应用。使用 `lobehub/lobe-chat-database` 镜像部署的用户已经默认添加了该项配置。 |
45
+ | `NEXT_PUBLIC_ENABLE_NEXT_AUTH` | 必选 | 用于启用 NextAuth 服务,设置为 `1` 以启用,更改此项需要重新编译应用。使用 `lobehub/lobehub` 镜像部署的用户已经默认添加了该项配置。 |
46
46
  | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 |
47
47
  | `AUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
48
48
  | `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。 |
@@ -351,6 +351,10 @@ When configuring SSO connections (e.g., GitHub in Auth0), make sure to enable **
351
351
 
352
352
  For identity providers like Casdoor or Logto, users may not have an email configured.
353
353
 
354
+ <Callout type={'warning'}>
355
+ **Note for Casdoor Users**: Casdoor does not require users to have an email configured, but LobeChat strongly depends on email for authentication. If you find migration difficult due to many users without email addresses, we recommend staying on [v2.0.0-next.344](https://github.com/lobehub/lobe-chat/releases/tag/v2.0.0-next.344) for now. We plan to provide a self-service migration feature in the future, where users without email will be redirected to a bind-email page when they log in.
356
+ </Callout>
357
+
354
358
  Solution:
355
359
 
356
360
  1. First configure the Webhook in LobeChat to sync user data from the identity provider:
@@ -345,6 +345,10 @@ npx tsx scripts/nextauth-to-betterauth/verify.ts
345
345
 
346
346
  对于 Casdoor、Logto 等身份提供商,用户可能没有配置邮箱。
347
347
 
348
+ <Callout type={'warning'}>
349
+ **Casdoor 用户注意**:Casdoor 不要求用户必须配置邮箱,但 LobeChat 强依赖邮箱进行身份认证。如果因为大量用户没有邮箱而感觉迁移困难,建议暂时停留在 [v2.0.0-next.344](https://github.com/lobehub/lobe-chat/releases/tag/v2.0.0-next.344) 版本。后续官方计划提供用户端自助迁移功能,届时没有邮箱的用户登录时会被重定向到绑定邮箱页面。
350
+ </Callout>
351
+
348
352
  解决方案:
349
353
 
350
354
  1. 先在 LobeChat 中配置身份提供商的 Webhook 以同步用户数据:
@@ -58,6 +58,14 @@ tags:
58
58
 
59
59
  Configure Casdoor [Webhook](https://www.casdoor.org/docs/webhooks/overview#setting-up-a-webhook) to sync user data updates to LobeChat.
60
60
 
61
+ **Synced data fields**:
62
+
63
+ - Avatar (`avatar`)
64
+ - Email (`email`)
65
+ - Display name (`displayName`)
66
+
67
+ **Configuration steps**:
68
+
61
69
  1. Go to **Admin Tools** -> **Webhooks** and create a Webhook
62
70
  2. Fill in the following fields:
63
71
  - URL: `https://your-domain.com/api/webhooks/casdoor`
@@ -56,6 +56,14 @@ tags:
56
56
 
57
57
  配置 Casdoor 的 [Webhook](https://www.casdoor.org/docs/webhooks/overview#setting-up-a-webhook) 以便在用户信息更新时同步到 LobeChat。
58
58
 
59
+ **同步的数据字段**:
60
+
61
+ - 头像 (`avatar`)
62
+ - 邮箱 (`email`)
63
+ - 显示名称 (`displayName`)
64
+
65
+ **配置步骤**:
66
+
59
67
  1. 前往 `管理工具` -> `Webhooks`,创建一个 Webhook
60
68
  2. 填写以下字段:
61
69
  - 链接:`https://your-domain.com/api/webhooks/casdoor`
@@ -152,7 +152,19 @@ Send emails via SMTP protocol, suitable for users with existing email services.
152
152
 
153
153
  ### Common Configuration
154
154
 
155
- Before using NextAuth, please set the following variables in LobeHub's environment variables:
155
+ Before using Better Auth, please set the following variables in LobeHub's environment variables:
156
+
157
+ ## Email Verification
158
+
159
+ Enable email verification to ensure users own the email addresses they register with (off by default):
160
+
161
+ | Environment Variable | Type | Description |
162
+ | ------------------------- | -------- | ----------------------------------------------------------- |
163
+ | `AUTH_EMAIL_VERIFICATION` | Optional | Set to `1` to require email verification after registration |
164
+
165
+ <Callout type={'info'}>
166
+ Email verification requires a working email service (SMTP or Resend) configured above. When enabled, users must verify their email address before they can sign in.
167
+ </Callout>
156
168
 
157
169
  ## Magic Link (Passwordless) Login
158
170
 
@@ -193,6 +205,17 @@ Set the `AUTH_SSO_PROVIDERS` environment variable with a comma-separated list, e
193
205
 
194
206
  The current authentication system requires email. Please configure a valid email address for users in Casdoor. Using a real, valid email is strongly recommended, otherwise features like password reset and magic link login will not work.
195
207
 
208
+ ### Can I use fake or random email addresses?
209
+
210
+ **Strongly not recommended.** You should always use valid, real email addresses. Using fake emails will cause the following issues:
211
+
212
+ - Password reset functionality will not work
213
+ - Magic link login will not work
214
+ - Email verification will fail
215
+ - You may lose access to your account if you forget your password
216
+
217
+ This applies to all authentication methods, including SSO providers like Casdoor. Always ensure users have valid email addresses configured.
218
+
196
219
  ### How do I restrict registration to specific emails or domains?
197
220
 
198
221
  Set the `AUTH_ALLOWED_EMAILS` environment variable with a comma-separated list of allowed emails or domains. For example:
@@ -200,6 +223,10 @@ Set the `AUTH_ALLOWED_EMAILS` environment variable with a comma-separated list o
200
223
  - Allow only `example.com` domain: `AUTH_ALLOWED_EMAILS=example.com`
201
224
  - Allow multiple domains and specific emails: `AUTH_ALLOWED_EMAILS=example.com,company.org,admin@other.com`
202
225
 
226
+ <Callout type={'info'}>
227
+ Note: `AUTH_ALLOWED_EMAILS` only restricts which email addresses can register, but does not verify email ownership. If you need to ensure users actually own the email address they register with, set `AUTH_EMAIL_VERIFICATION=1` to require email verification. This requires configuring an email service (SMTP).
228
+ </Callout>
229
+
203
230
  ## Additional Features
204
231
 
205
232
  ### Webhook Support
@@ -152,7 +152,19 @@ LobeHub 与 Clerk 做了深度集成,能够为用户提供一个更加安全
152
152
 
153
153
  ### 通用配置
154
154
 
155
- 在使用 NextAuth 之前,请先在 LobeHub 的环境变量中设置以下变量:
155
+ 在使用 Better Auth 之前,请先在 LobeHub 的环境变量中设置以下变量:
156
+
157
+ ## 邮箱验证
158
+
159
+ 启用邮箱验证以确保用户拥有其注册的邮箱地址(默认关闭):
160
+
161
+ | 环境变量 | 类型 | 描述 |
162
+ | ------------------------- | -- | -------------------- |
163
+ | `AUTH_EMAIL_VERIFICATION` | 可选 | 设置为 `1` 以要求注册后进行邮箱验证 |
164
+
165
+ <Callout type={'info'}>
166
+ 邮箱验证需要上方已配置好的邮件服务(SMTP 或 Resend)。启用后,用户必须验证其邮箱地址才能登录。
167
+ </Callout>
156
168
 
157
169
  ## 魔法链接(免密)登录
158
170
 
@@ -194,6 +206,17 @@ Better Auth 支持内置提供商(Google、GitHub、Microsoft、Apple、AWS Co
194
206
  当前身份验证方案强依赖 email。请在 Casdoor 中为用户配置有效的 email 地址。
195
207
  强烈建议使用真实有效的邮箱,否则密码重置、魔法链接登录等功能将无法使用。
196
208
 
209
+ ### 邮箱可以随便乱填吗?
210
+
211
+ **强烈不建议**。请务必填写真实有效的邮箱地址。使用虚假邮箱会导致以下问题:
212
+
213
+ - 密码重置功能无法使用
214
+ - 魔法链接登录无法使用
215
+ - 邮箱验证无法通过
216
+ - 忘记密码时可能无法找回账户
217
+
218
+ 这适用于所有身份验证方式,包括 Casdoor 等 SSO 提供商。请确保用户配置了有效的邮箱地址。
219
+
197
220
  ### 如何限制只允许特定邮箱或域名注册?
198
221
 
199
222
  设置 `AUTH_ALLOWED_EMAILS` 环境变量,支持完整邮箱地址或域名,以逗号分隔。例如:
@@ -201,6 +224,10 @@ Better Auth 支持内置提供商(Google、GitHub、Microsoft、Apple、AWS Co
201
224
  - 只允许 `example.com` 域名:`AUTH_ALLOWED_EMAILS=example.com`
202
225
  - 允许多个域名和特定邮箱:`AUTH_ALLOWED_EMAILS=example.com,company.org,admin@other.com`
203
226
 
227
+ <Callout type={'info'}>
228
+ 注意:`AUTH_ALLOWED_EMAILS` 仅限制哪些邮箱地址可以注册,但不会验证邮箱所有权。如果需要确保用户确实拥有其注册的邮箱地址,请设置 `AUTH_EMAIL_VERIFICATION=1` 以启用邮箱验证。这需要配置邮件服务(SMTP)。
229
+ </Callout>
230
+
204
231
  ### Webhook 支持
205
232
 
206
233
  允许 LobeHub 在身份提供商中用户信息更新时接收通知。支持的提供商包括 Casdoor 和 Logto。请参考具体提供商文档进行配置。
@@ -211,4 +238,4 @@ Better Auth 支持内置提供商(Google、GitHub、Microsoft、Apple、AWS Co
211
238
 
212
239
  ## 其他 SSO 提供商
213
240
 
214
- 请参考 [NextAuth.js](https://next-auth.js.org/providers) 文档,欢迎提交 Pull Request。
241
+ 请参考 [Auth.js](https://authjs.dev/getting-started/authentication/oauth) 文档,欢迎提交 Pull Request。