@lobehub/lobehub 2.0.0-next.18 → 2.0.0-next.19

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/.env.desktop CHANGED
@@ -4,6 +4,5 @@ FEATURE_FLAGS=-check_updates,+pin_list
4
4
  KEY_VAULTS_SECRET=oLXWIiR/AKF+rWaqy9lHkrYgzpATbW3CtJp3UfkVgpE=
5
5
  DATABASE_URL=postgresql://postgres@localhost:5432/postgres
6
6
  SEARCH_PROVIDERS=search1api
7
- NEXT_PUBLIC_SERVICE_MODE='server'
8
7
  NEXT_PUBLIC_IS_DESKTOP_APP=1
9
- NEXT_PUBLIC_ENABLE_NEXT_AUTH=0
8
+ NEXT_PUBLIC_ENABLE_NEXT_AUTH=0
package/.env.example CHANGED
@@ -273,9 +273,6 @@ OPENAI_API_KEY=sk-xxxxxxxxx
273
273
  ########## Server Database #############
274
274
  ########################################
275
275
 
276
- # Specify the service mode as server if you want to use the server database
277
- # NEXT_PUBLIC_SERVICE_MODE=server
278
-
279
276
  # Postgres database URL
280
277
  # DATABASE_URL=postgres://username:password@host:port/database
281
278
 
@@ -8,8 +8,6 @@ UNSAFE_SECRET="ww+0igxjGRAAR/eTNFQ55VmhQB5KE5trFZseuntThJs="
8
8
  UNSAFE_PASSWORD="CHANGE_THIS_PASSWORD_IN_PRODUCTION"
9
9
 
10
10
  # Core Server Configuration
11
- # Service mode - set to 'server' for server-side deployment
12
- NEXT_PUBLIC_SERVICE_MODE=server
13
11
 
14
12
  # Service Ports Configuration
15
13
  LOBE_PORT=3010
@@ -14,6 +14,17 @@ jobs:
14
14
  e2e:
15
15
  name: Test Web App
16
16
  runs-on: ubuntu-latest
17
+ services:
18
+ postgres:
19
+ image: paradedb/paradedb:latest
20
+ env:
21
+ POSTGRES_PASSWORD: postgres
22
+ options: >-
23
+ --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
24
+
25
+ ports:
26
+ - 5432:5432
27
+
17
28
  timeout-minutes: 25
18
29
  steps:
19
30
  - name: Checkout
@@ -33,6 +44,9 @@ jobs:
33
44
  - name: Run E2E tests
34
45
  env:
35
46
  PORT: 3010
47
+ DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres
48
+ DATABASE_DRIVER: node
49
+ KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
36
50
  run: bun run e2e
37
51
 
38
52
  - name: Upload Cucumber HTML report (on failure)
@@ -54,7 +54,6 @@ jobs:
54
54
  env:
55
55
  DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
56
56
  DATABASE_DRIVER: node
57
- NEXT_PUBLIC_SERVICE_MODE: server
58
57
  KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
59
58
  S3_PUBLIC_DOMAIN: https://example.com
60
59
  APP_URL: https://home.com
@@ -165,7 +165,6 @@ jobs:
165
165
  env:
166
166
  DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
167
167
  DATABASE_DRIVER: node
168
- NEXT_PUBLIC_SERVICE_MODE: server
169
168
  KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
170
169
  S3_PUBLIC_DOMAIN: https://example.com
171
170
  APP_URL: https://home.com
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 2.0.0-next.19](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.18...v2.0.0-next.19)
6
+
7
+ <sup>Released on **2025-11-03**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Remove `NEXT_PUBLIC_SERVICE_MODE` env and use server by default.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Code refactoring
19
+
20
+ - **misc**: Remove `NEXT_PUBLIC_SERVICE_MODE` env and use server by default, closes [#10017](https://github.com/lobehub/lobe-chat/issues/10017) ([f2ab2fc](https://github.com/lobehub/lobe-chat/commit/f2ab2fc))
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.0-next.18](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.17...v2.0.0-next.18)
6
31
 
7
32
  <sup>Released on **2025-11-03**</sup>
package/Dockerfile CHANGED
@@ -37,7 +37,6 @@ FROM base AS builder
37
37
 
38
38
  ARG USE_CN_MIRROR
39
39
  ARG NEXT_PUBLIC_BASE_PATH
40
- ARG NEXT_PUBLIC_SERVICE_MODE
41
40
  ARG NEXT_PUBLIC_ENABLE_NEXT_AUTH
42
41
  ARG NEXT_PUBLIC_ENABLE_CLERK_AUTH
43
42
  ARG NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
@@ -53,8 +52,7 @@ ARG FEATURE_FLAGS
53
52
  ENV NEXT_PUBLIC_BASE_PATH="${NEXT_PUBLIC_BASE_PATH}" \
54
53
  FEATURE_FLAGS="${FEATURE_FLAGS}"
55
54
 
56
- ENV NEXT_PUBLIC_SERVICE_MODE="${NEXT_PUBLIC_SERVICE_MODE:-server}" \
57
- NEXT_PUBLIC_ENABLE_NEXT_AUTH="${NEXT_PUBLIC_ENABLE_NEXT_AUTH:-1}" \
55
+ ENV NEXT_PUBLIC_ENABLE_NEXT_AUTH="${NEXT_PUBLIC_ENABLE_NEXT_AUTH:-1}" \
58
56
  NEXT_PUBLIC_ENABLE_CLERK_AUTH="${NEXT_PUBLIC_ENABLE_CLERK_AUTH:-0}" \
59
57
  NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="${NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY}" \
60
58
  CLERK_WEBHOOK_SECRET="whsec_xxx" \
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Remove NEXT_PUBLIC_SERVICE_MODE env and use server by default."
6
+ ]
7
+ },
8
+ "date": "2025-11-03",
9
+ "version": "2.0.0-next.19"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "improvements": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/lobehub",
3
- "version": "2.0.0-next.18",
3
+ "version": "2.0.0-next.19",
4
4
  "description": "LobeHub - an open-source,comprehensive AI Agent 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
  "build:analyze": "NODE_OPTIONS=--max-old-space-size=6144 ANALYZE=true next build --webpack",
39
39
  "build:docker": "npm run prebuild && NODE_OPTIONS=--max-old-space-size=6144 DOCKER=true next build --webpack && npm run build-sitemap",
40
40
  "prebuild:electron": "cross-env NEXT_PUBLIC_IS_DESKTOP_APP=1 tsx scripts/prebuild.mts",
41
- "build:electron": "cross-env NODE_OPTIONS=--max-old-space-size=6144 NEXT_PUBLIC_IS_DESKTOP_APP=1 NEXT_PUBLIC_SERVICE_MODE=server next build --webpack",
41
+ "build:electron": "cross-env NODE_OPTIONS=--max-old-space-size=6144 NEXT_PUBLIC_IS_DESKTOP_APP=1 next build --webpack",
42
42
  "clean:node_modules": "bash -lc 'set -e; echo \"Removing all node_modules...\"; rm -rf node_modules; pnpm -r exec rm -rf node_modules; rm -rf apps/desktop/node_modules; echo \"All node_modules removed.\"'",
43
43
  "db:generate": "drizzle-kit generate && npm run db:generate-client && npm run workflow:dbml",
44
44
  "db:generate-client": "tsx ./scripts/migrateClientDB/compile-migrations.ts",
@@ -10,7 +10,8 @@ import * as schema from '../schemas';
10
10
  import { LobeChatDatabase } from '../type';
11
11
 
12
12
  export const getDBInstance = (): LobeChatDatabase => {
13
- if (!(process.env.NEXT_PUBLIC_SERVICE_MODE === 'server')) return {} as any;
13
+ // In test environment, return a mock instance to avoid initialization errors
14
+ if (process.env.NODE_ENV === 'test') return {} as LobeChatDatabase;
14
15
 
15
16
  if (!serverDBEnv.KEY_VAULTS_SECRET) {
16
17
  throw new Error(
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "@lobechat/model-runtime": "workspace:*",
11
11
  "@lobechat/prompts": "workspace:*",
12
- "dotenv": "^16.4.7",
12
+ "dotenv": "^17.2.3",
13
13
  "ora": "^8.2.0"
14
14
  },
15
15
  "devDependencies": {
@@ -15,13 +15,7 @@ if you have any other question, please open issue here: https://github.com/lobeh
15
15
  const DB_FAIL_INIT_HINT = `------------------------------------------------------------------------------------------
16
16
  ⚠️ Database migrate failed due to not find the db instance.
17
17
 
18
- 1) You might not switch to server db mode, please set the env blow and try again:
19
-
20
- \`\`\`
21
- NEXT_PUBLIC_SERVICE_MODE=server
22
- \`\`\`
23
-
24
- 2) if you are using docker postgres image, you may need to set DATABASE_DRIVER to node
18
+ if you are using docker postgres image, you may need to set DATABASE_DRIVER to node
25
19
 
26
20
  \`\`\`
27
21
  DATABASE_DRIVER=node
@@ -32,9 +32,6 @@ const TopActions = memo<TopActionProps>(({ tab, isPinned }) => {
32
32
  useServerConfigStore(featureFlagsSelectors);
33
33
  const hotkey = useUserStore(settingsSelectors.getHotkeyById(HotkeyEnum.NavigateToChat));
34
34
 
35
- // Check if server mode is enabled
36
- const isServerMode = process.env.NEXT_PUBLIC_SERVICE_MODE === 'server';
37
-
38
35
  const isChatActive = tab === SidebarTabKey.Chat && !isPinned;
39
36
  const isFilesActive = tab === SidebarTabKey.Files;
40
37
  const isDiscoverActive = tab === SidebarTabKey.Discover;
@@ -69,7 +66,7 @@ const TopActions = memo<TopActionProps>(({ tab, isPinned }) => {
69
66
  tooltipProps={{ placement: 'right' }}
70
67
  />
71
68
  </Link>
72
- {enableKnowledgeBase && isServerMode && (
69
+ {enableKnowledgeBase && (
73
70
  <Link aria-label={t('tab.knowledgeBase')} href={'/knowledge'}>
74
71
  <ActionIcon
75
72
  active={isFilesActive}
package/src/config/db.ts CHANGED
@@ -3,9 +3,6 @@ import { z } from 'zod';
3
3
 
4
4
  export const getServerDBConfig = () => {
5
5
  return createEnv({
6
- client: {
7
- NEXT_PUBLIC_ENABLED_SERVER_SERVICE: z.boolean(),
8
- },
9
6
  runtimeEnv: {
10
7
  DATABASE_DRIVER: process.env.DATABASE_DRIVER || 'neon',
11
8
  DATABASE_TEST_URL: process.env.DATABASE_TEST_URL,
@@ -13,8 +10,6 @@ export const getServerDBConfig = () => {
13
10
 
14
11
  KEY_VAULTS_SECRET: process.env.KEY_VAULTS_SECRET,
15
12
 
16
- NEXT_PUBLIC_ENABLED_SERVER_SERVICE: process.env.NEXT_PUBLIC_SERVICE_MODE === 'server',
17
-
18
13
  REMOVE_GLOBAL_FILE: process.env.DISABLE_REMOVE_GLOBAL_FILE !== '0',
19
14
  },
20
15
  server: {
@@ -1,6 +1,5 @@
1
1
  import type { NextAuthConfig } from 'next-auth';
2
2
 
3
- import { getServerDBConfig } from '@/config/db';
4
3
  import { getAuthConfig } from '@/envs/auth';
5
4
 
6
5
  import { LobeNextAuthDbAdapter } from './adapter';
@@ -14,8 +13,6 @@ const {
14
13
  NEXT_PUBLIC_ENABLE_NEXT_AUTH,
15
14
  } = getAuthConfig();
16
15
 
17
- const { NEXT_PUBLIC_ENABLED_SERVER_SERVICE } = getServerDBConfig();
18
-
19
16
  export const initSSOProviders = () => {
20
17
  return NEXT_PUBLIC_ENABLE_NEXT_AUTH
21
18
  ? NEXT_AUTH_SSO_PROVIDERS.split(/[,,]/).map((provider) => {
@@ -30,7 +27,7 @@ export const initSSOProviders = () => {
30
27
 
31
28
  // Notice this is only an object, not a full Auth.js instance
32
29
  export default {
33
- adapter: NEXT_PUBLIC_ENABLED_SERVER_SERVICE ? LobeNextAuthDbAdapter() : undefined,
30
+ adapter: NEXT_PUBLIC_ENABLE_NEXT_AUTH ? LobeNextAuthDbAdapter() : undefined,
34
31
  callbacks: {
35
32
  // Note: Data processing order of callback: authorize --> jwt --> session
36
33
  async jwt({ token, user }) {
@@ -61,7 +58,7 @@ export default {
61
58
  secret: NEXT_AUTH_SECRET ?? process.env.AUTH_SECRET,
62
59
  session: {
63
60
  // Force use JWT if server service is disabled
64
- strategy: NEXT_PUBLIC_ENABLED_SERVER_SERVICE ? NEXT_AUTH_SSO_SESSION_STRATEGY : 'jwt',
61
+ strategy: NEXT_AUTH_SSO_SESSION_STRATEGY,
65
62
  },
66
63
  trustHost: process.env?.AUTH_TRUST_HOST ? process.env.AUTH_TRUST_HOST === 'true' : true,
67
64
  } satisfies NextAuthConfig;