@lobehub/lobehub 2.0.0-next.375 → 2.0.0-next.377
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/.github/workflows/claude-migration-support.yml +1 -1
- package/.github/workflows/revalidate-docs.yml +25 -0
- package/CHANGELOG.md +67 -0
- package/apps/desktop/src/main/controllers/LocalFileCtr.ts +7 -1
- package/apps/desktop/src/main/controllers/ShellCommandCtr.ts +23 -10
- package/apps/desktop/src/main/controllers/__tests__/LocalFileCtr.test.ts +261 -0
- package/apps/desktop/src/main/controllers/__tests__/ShellCommandCtr.test.ts +36 -0
- package/apps/desktop/src/main/core/infrastructure/BackendProxyProtocolManager.ts +2 -1
- package/changelog/v1.json +21 -0
- package/docs/development/database-schema.dbml +89 -0
- package/docs/self-hosting/advanced/auth/nextauth-to-betterauth.mdx +6 -0
- package/docs/self-hosting/advanced/auth/nextauth-to-betterauth.zh-CN.mdx +5 -0
- package/docs/self-hosting/advanced/auth/providers/casdoor.mdx +1 -1
- package/docs/self-hosting/advanced/auth/providers/casdoor.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/auth/providers/logto.mdx +1 -1
- package/docs/self-hosting/advanced/auth/providers/logto.zh-CN.mdx +1 -1
- package/docs/usage/features/auth.mdx +54 -33
- package/docs/usage/features/auth.zh-CN.mdx +56 -33
- package/locales/en-US/common.json +24 -0
- package/locales/en-US/setting.json +19 -0
- package/locales/zh-CN/authError.json +2 -0
- package/locales/zh-CN/common.json +24 -0
- package/locales/zh-CN/setting.json +19 -0
- package/package.json +2 -2
- package/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx +1 -11
- package/packages/builtin-tool-local-system/src/client/Render/ListFiles/index.tsx +6 -11
- package/packages/database/migrations/0074_add_fk_indexes_for_cascade_delete.sql +56 -0
- package/packages/database/migrations/meta/0074_snapshot.json +10901 -0
- package/packages/database/migrations/meta/_journal.json +7 -0
- package/packages/database/src/models/message.ts +84 -81
- package/packages/database/src/repositories/search/index.ts +330 -570
- package/packages/database/src/schemas/agent.ts +4 -0
- package/packages/database/src/schemas/chatGroup.ts +2 -0
- package/packages/database/src/schemas/file.ts +4 -0
- package/packages/database/src/schemas/generation.ts +1 -0
- package/packages/database/src/schemas/message.ts +16 -0
- package/packages/database/src/schemas/nextauth.ts +15 -8
- package/packages/database/src/schemas/oidc.ts +104 -68
- package/packages/database/src/schemas/rag.ts +4 -0
- package/packages/database/src/schemas/ragEvals.ts +97 -73
- package/packages/database/src/schemas/relations.ts +7 -0
- package/packages/database/src/schemas/session.ts +1 -0
- package/packages/database/src/schemas/topic.ts +8 -1
- package/packages/desktop-bridge/src/index.ts +17 -0
- package/scripts/_shared/checkDeprecatedAuth.js +70 -14
- package/scripts/_shared/checkDeprecatedAuth.test.ts +180 -0
- package/src/app/(backend)/api/webhooks/casdoor/route.ts +1 -2
- package/src/app/(backend)/api/webhooks/logto/route.ts +2 -3
- package/src/app/(backend)/trpc/async/[trpc]/route.ts +3 -2
- package/src/app/(backend)/trpc/lambda/[trpc]/route.ts +2 -5
- package/src/app/(backend)/trpc/mobile/[trpc]/route.ts +3 -7
- package/src/app/(backend)/trpc/tools/[trpc]/route.ts +2 -0
- package/src/app/[variants]/(auth)/signup/[[...signup]]/useSignUp.tsx +7 -4
- package/src/app/[variants]/(main)/agent/features/Conversation/AgentWelcome/index.tsx +3 -23
- package/src/app/[variants]/(main)/group/features/Conversation/AgentWelcome/index.tsx +3 -23
- package/src/app/[variants]/(main)/resource/(home)/index.tsx +4 -1
- package/src/app/[variants]/(main)/resource/library/_layout/Header/LibraryHead.tsx +3 -0
- package/src/app/[variants]/(main)/resource/library/_layout/Header/index.tsx +2 -1
- package/src/app/[variants]/(main)/settings/storage/features/Advanced.tsx +19 -12
- package/src/app/[variants]/(main)/settings/storage/index.tsx +19 -1
- package/src/business/client/features/AccountDeletion/index.tsx +3 -0
- package/src/business/server/lambda-routers/accountDeletion.ts +3 -0
- package/src/components/DragUpload/index.tsx +1 -1
- package/src/components/FileParsingStatus/EmbeddingStatus.tsx +3 -16
- package/src/components/FileParsingStatus/index.tsx +2 -15
- package/src/config/routes/index.ts +9 -1
- package/src/features/CommandMenu/ContextCommands.tsx +10 -2
- package/src/features/CommandMenu/MainMenu.tsx +29 -22
- package/src/features/CommandMenu/SearchResults.tsx +19 -0
- package/src/features/CommandMenu/components/CommandInput.tsx +1 -0
- package/src/features/CommandMenu/index.tsx +25 -3
- package/src/features/CommandMenu/styles.ts +1 -0
- package/src/features/CommandMenu/useCommandMenu.ts +8 -2
- package/src/features/CommandMenu/utils/contextCommands.ts +17 -2
- package/src/features/CommandMenu/utils/queryParser.ts +1 -0
- package/src/features/Conversation/ChatItem/components/Title.tsx +6 -2
- package/src/features/Conversation/Messages/AssistantGroup/index.tsx +6 -1
- package/src/features/Electron/connection/Connection.tsx +20 -15
- package/src/features/FileViewer/index.tsx +28 -5
- package/src/features/ModelSwitchPanel/components/List/ListItemRenderer.tsx +10 -9
- package/src/features/ModelSwitchPanel/components/List/MultipleProvidersModelItem.tsx +1 -0
- package/src/features/ModelSwitchPanel/components/Toolbar.tsx +1 -1
- package/src/features/ResourceManager/components/Editor/index.tsx +7 -4
- package/src/features/ResourceManager/components/Explorer/Header/index.tsx +1 -1
- package/src/features/ResourceManager/components/Explorer/ItemDropdown/useFileItemDropdown.tsx +12 -1
- package/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx +23 -43
- package/src/features/ResourceManager/components/Explorer/MasonryView/MasonryFileItem/ImageFileItem.tsx +1 -0
- package/src/features/ResourceManager/components/Explorer/MasonryView/MasonryFileItem/index.tsx +24 -44
- package/src/features/ResourceManager/components/Explorer/hooks/useFileItemClick.ts +78 -0
- package/src/features/ResourceManager/components/Header/AddButton.tsx +0 -5
- package/src/features/ResourceManager/index.tsx +38 -24
- package/src/libs/better-auth/define-config.ts +17 -0
- package/src/libs/better-auth/plugins/email-whitelist.ts +4 -1
- package/src/libs/next/config/define-config.ts +0 -3
- package/src/libs/redis/manager.ts +5 -9
- package/src/libs/trpc/utils/responseMeta.test.ts +82 -0
- package/src/libs/trpc/utils/responseMeta.ts +41 -0
- package/src/locales/default/authError.ts +3 -0
- package/src/locales/default/common.ts +82 -4
- package/src/locales/default/setting.ts +23 -1
- package/src/server/modules/AgentRuntime/redis.ts +3 -0
- package/src/server/routers/lambda/agent.ts +1 -2
- package/src/server/routers/lambda/index.ts +2 -0
- package/src/server/routers/lambda/search.ts +3 -2
- package/src/server/services/user/index.ts +1 -2
- package/src/server/services/webhookUser/index.test.ts +290 -0
- package/src/server/services/webhookUser/index.ts +29 -12
- package/src/utils/errorResponse.ts +2 -1
- package/src/app/[variants]/(main)/agent/features/Conversation/AgentWelcome/AddButton.tsx +0 -37
- package/src/app/[variants]/(main)/group/features/Conversation/AgentWelcome/AddButton.tsx +0 -32
- package/src/libs/logger/index.ts +0 -5
|
@@ -49,6 +49,8 @@ table agents_files {
|
|
|
49
49
|
indexes {
|
|
50
50
|
(file_id, agent_id, user_id) [pk]
|
|
51
51
|
agent_id [name: 'agents_files_agent_id_idx']
|
|
52
|
+
file_id [name: 'agents_files_file_id_idx']
|
|
53
|
+
user_id [name: 'agents_files_user_id_idx']
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
|
|
@@ -64,6 +66,8 @@ table agents_knowledge_bases {
|
|
|
64
66
|
indexes {
|
|
65
67
|
(agent_id, knowledge_base_id) [pk]
|
|
66
68
|
agent_id [name: 'agents_knowledge_bases_agent_id_idx']
|
|
69
|
+
knowledge_base_id [name: 'agents_knowledge_bases_knowledge_base_id_idx']
|
|
70
|
+
user_id [name: 'agents_knowledge_bases_user_id_idx']
|
|
67
71
|
}
|
|
68
72
|
}
|
|
69
73
|
|
|
@@ -288,6 +292,7 @@ table chat_groups {
|
|
|
288
292
|
|
|
289
293
|
indexes {
|
|
290
294
|
(client_id, user_id) [name: 'chat_groups_client_id_user_id_unique', unique]
|
|
295
|
+
user_id [name: 'chat_groups_user_id_idx']
|
|
291
296
|
group_id [name: 'chat_groups_group_id_idx']
|
|
292
297
|
}
|
|
293
298
|
}
|
|
@@ -305,6 +310,7 @@ table chat_groups_agents {
|
|
|
305
310
|
|
|
306
311
|
indexes {
|
|
307
312
|
(chat_group_id, agent_id) [pk]
|
|
313
|
+
user_id [name: 'chat_groups_agents_user_id_idx']
|
|
308
314
|
}
|
|
309
315
|
}
|
|
310
316
|
|
|
@@ -367,6 +373,8 @@ table files {
|
|
|
367
373
|
file_hash [name: 'file_hash_idx']
|
|
368
374
|
user_id [name: 'files_user_id_idx']
|
|
369
375
|
parent_id [name: 'files_parent_id_idx']
|
|
376
|
+
chunk_task_id [name: 'files_chunk_task_id_idx']
|
|
377
|
+
embedding_task_id [name: 'files_embedding_task_id_idx']
|
|
370
378
|
(client_id, user_id) [name: 'files_client_id_user_id_unique', unique]
|
|
371
379
|
}
|
|
372
380
|
}
|
|
@@ -395,6 +403,8 @@ table knowledge_base_files {
|
|
|
395
403
|
indexes {
|
|
396
404
|
(knowledge_base_id, file_id) [pk]
|
|
397
405
|
knowledge_base_id [name: 'knowledge_base_files_kb_id_idx']
|
|
406
|
+
user_id [name: 'knowledge_base_files_user_id_idx']
|
|
407
|
+
file_id [name: 'knowledge_base_files_file_id_idx']
|
|
398
408
|
}
|
|
399
409
|
}
|
|
400
410
|
|
|
@@ -468,6 +478,7 @@ table generations {
|
|
|
468
478
|
indexes {
|
|
469
479
|
user_id [name: 'generations_user_id_idx']
|
|
470
480
|
generation_batch_id [name: 'generations_batch_id_idx']
|
|
481
|
+
file_id [name: 'generations_file_id_idx']
|
|
471
482
|
}
|
|
472
483
|
}
|
|
473
484
|
|
|
@@ -478,6 +489,8 @@ table message_chunks {
|
|
|
478
489
|
|
|
479
490
|
indexes {
|
|
480
491
|
(chunk_id, message_id) [pk]
|
|
492
|
+
user_id [name: 'message_chunks_user_id_idx']
|
|
493
|
+
message_id [name: 'message_chunks_message_id_idx']
|
|
481
494
|
}
|
|
482
495
|
}
|
|
483
496
|
|
|
@@ -500,8 +513,11 @@ table message_groups {
|
|
|
500
513
|
|
|
501
514
|
indexes {
|
|
502
515
|
(client_id, user_id) [name: 'message_groups_client_id_user_id_unique', unique]
|
|
516
|
+
user_id [name: 'message_groups_user_id_idx']
|
|
503
517
|
topic_id [name: 'message_groups_topic_id_idx']
|
|
504
518
|
type [name: 'message_groups_type_idx']
|
|
519
|
+
parent_group_id [name: 'message_groups_parent_group_id_idx']
|
|
520
|
+
parent_message_id [name: 'message_groups_parent_message_id_idx']
|
|
505
521
|
}
|
|
506
522
|
}
|
|
507
523
|
|
|
@@ -520,6 +536,7 @@ table message_plugins {
|
|
|
520
536
|
|
|
521
537
|
indexes {
|
|
522
538
|
(client_id, user_id) [name: 'message_plugins_client_id_user_id_unique', unique]
|
|
539
|
+
user_id [name: 'message_plugins_user_id_idx']
|
|
523
540
|
tool_call_id [name: 'message_plugins_tool_call_id_idx']
|
|
524
541
|
}
|
|
525
542
|
}
|
|
@@ -535,6 +552,9 @@ table message_queries {
|
|
|
535
552
|
|
|
536
553
|
indexes {
|
|
537
554
|
(client_id, user_id) [name: 'message_queries_client_id_user_id_unique', unique]
|
|
555
|
+
user_id [name: 'message_queries_user_id_idx']
|
|
556
|
+
message_id [name: 'message_queries_message_id_idx']
|
|
557
|
+
embeddings_id [name: 'message_queries_embeddings_id_idx']
|
|
538
558
|
}
|
|
539
559
|
}
|
|
540
560
|
|
|
@@ -547,6 +567,9 @@ table message_query_chunks {
|
|
|
547
567
|
|
|
548
568
|
indexes {
|
|
549
569
|
(chunk_id, id, query_id) [pk]
|
|
570
|
+
user_id [name: 'message_query_chunks_user_id_idx']
|
|
571
|
+
id [name: 'message_query_chunks_message_id_idx']
|
|
572
|
+
query_id [name: 'message_query_chunks_query_id_idx']
|
|
550
573
|
}
|
|
551
574
|
}
|
|
552
575
|
|
|
@@ -560,6 +583,7 @@ table message_tts {
|
|
|
560
583
|
|
|
561
584
|
indexes {
|
|
562
585
|
(client_id, user_id) [name: 'message_tts_client_id_user_id_unique', unique]
|
|
586
|
+
user_id [name: 'message_tts_user_id_idx']
|
|
563
587
|
}
|
|
564
588
|
}
|
|
565
589
|
|
|
@@ -573,6 +597,7 @@ table message_translates {
|
|
|
573
597
|
|
|
574
598
|
indexes {
|
|
575
599
|
(client_id, user_id) [name: 'message_translates_client_id_user_id_unique', unique]
|
|
600
|
+
user_id [name: 'message_translates_user_id_idx']
|
|
576
601
|
}
|
|
577
602
|
}
|
|
578
603
|
|
|
@@ -628,6 +653,8 @@ table messages_files {
|
|
|
628
653
|
|
|
629
654
|
indexes {
|
|
630
655
|
(file_id, message_id) [pk]
|
|
656
|
+
user_id [name: 'messages_files_user_id_idx']
|
|
657
|
+
message_id [name: 'messages_files_message_id_idx']
|
|
631
658
|
}
|
|
632
659
|
}
|
|
633
660
|
|
|
@@ -646,6 +673,7 @@ table nextauth_accounts {
|
|
|
646
673
|
|
|
647
674
|
indexes {
|
|
648
675
|
(provider, providerAccountId) [pk]
|
|
676
|
+
user_id [name: 'nextauth_accounts_user_id_idx']
|
|
649
677
|
}
|
|
650
678
|
}
|
|
651
679
|
|
|
@@ -668,6 +696,10 @@ table nextauth_sessions {
|
|
|
668
696
|
expires timestamp [not null]
|
|
669
697
|
sessionToken text [pk, not null]
|
|
670
698
|
user_id text [not null]
|
|
699
|
+
|
|
700
|
+
indexes {
|
|
701
|
+
user_id [name: 'nextauth_sessions_user_id_idx']
|
|
702
|
+
}
|
|
671
703
|
}
|
|
672
704
|
|
|
673
705
|
table nextauth_verificationtokens {
|
|
@@ -700,6 +732,10 @@ table oidc_access_tokens {
|
|
|
700
732
|
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
701
733
|
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
702
734
|
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
735
|
+
|
|
736
|
+
indexes {
|
|
737
|
+
user_id [name: 'oidc_access_tokens_user_id_idx']
|
|
738
|
+
}
|
|
703
739
|
}
|
|
704
740
|
|
|
705
741
|
table oidc_authorization_codes {
|
|
@@ -713,6 +749,10 @@ table oidc_authorization_codes {
|
|
|
713
749
|
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
714
750
|
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
715
751
|
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
752
|
+
|
|
753
|
+
indexes {
|
|
754
|
+
user_id [name: 'oidc_authorization_codes_user_id_idx']
|
|
755
|
+
}
|
|
716
756
|
}
|
|
717
757
|
|
|
718
758
|
table oidc_clients {
|
|
@@ -762,6 +802,10 @@ table oidc_device_codes {
|
|
|
762
802
|
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
763
803
|
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
764
804
|
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
805
|
+
|
|
806
|
+
indexes {
|
|
807
|
+
user_id [name: 'oidc_device_codes_user_id_idx']
|
|
808
|
+
}
|
|
765
809
|
}
|
|
766
810
|
|
|
767
811
|
table oidc_grants {
|
|
@@ -774,6 +818,10 @@ table oidc_grants {
|
|
|
774
818
|
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
775
819
|
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
776
820
|
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
821
|
+
|
|
822
|
+
indexes {
|
|
823
|
+
user_id [name: 'oidc_grants_user_id_idx']
|
|
824
|
+
}
|
|
777
825
|
}
|
|
778
826
|
|
|
779
827
|
table oidc_interactions {
|
|
@@ -796,6 +844,10 @@ table oidc_refresh_tokens {
|
|
|
796
844
|
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
797
845
|
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
798
846
|
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
847
|
+
|
|
848
|
+
indexes {
|
|
849
|
+
user_id [name: 'oidc_refresh_tokens_user_id_idx']
|
|
850
|
+
}
|
|
799
851
|
}
|
|
800
852
|
|
|
801
853
|
table oidc_sessions {
|
|
@@ -806,6 +858,10 @@ table oidc_sessions {
|
|
|
806
858
|
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
807
859
|
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
808
860
|
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
861
|
+
|
|
862
|
+
indexes {
|
|
863
|
+
user_id [name: 'oidc_sessions_user_id_idx']
|
|
864
|
+
}
|
|
809
865
|
}
|
|
810
866
|
|
|
811
867
|
table chunks {
|
|
@@ -838,6 +894,7 @@ table document_chunks {
|
|
|
838
894
|
(document_id, chunk_id) [pk]
|
|
839
895
|
document_id [name: 'document_chunks_document_id_idx']
|
|
840
896
|
chunk_id [name: 'document_chunks_chunk_id_idx']
|
|
897
|
+
user_id [name: 'document_chunks_user_id_idx']
|
|
841
898
|
}
|
|
842
899
|
}
|
|
843
900
|
|
|
@@ -873,6 +930,9 @@ table unstructured_chunks {
|
|
|
873
930
|
|
|
874
931
|
indexes {
|
|
875
932
|
(client_id, user_id) [name: 'unstructured_chunks_client_id_user_id_unique', unique]
|
|
933
|
+
user_id [name: 'unstructured_chunks_user_id_idx']
|
|
934
|
+
composite_id [name: 'unstructured_chunks_composite_id_idx']
|
|
935
|
+
file_id [name: 'unstructured_chunks_file_id_idx']
|
|
876
936
|
}
|
|
877
937
|
}
|
|
878
938
|
|
|
@@ -887,6 +947,10 @@ table rag_eval_dataset_records {
|
|
|
887
947
|
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
888
948
|
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
889
949
|
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
950
|
+
|
|
951
|
+
indexes {
|
|
952
|
+
user_id [name: 'rag_eval_dataset_records_user_id_idx']
|
|
953
|
+
}
|
|
890
954
|
}
|
|
891
955
|
|
|
892
956
|
table rag_eval_datasets {
|
|
@@ -898,6 +962,10 @@ table rag_eval_datasets {
|
|
|
898
962
|
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
899
963
|
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
900
964
|
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
965
|
+
|
|
966
|
+
indexes {
|
|
967
|
+
user_id [name: 'rag_eval_datasets_user_id_idx']
|
|
968
|
+
}
|
|
901
969
|
}
|
|
902
970
|
|
|
903
971
|
table rag_eval_evaluations {
|
|
@@ -915,6 +983,10 @@ table rag_eval_evaluations {
|
|
|
915
983
|
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
916
984
|
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
917
985
|
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
986
|
+
|
|
987
|
+
indexes {
|
|
988
|
+
user_id [name: 'rag_eval_evaluations_user_id_idx']
|
|
989
|
+
}
|
|
918
990
|
}
|
|
919
991
|
|
|
920
992
|
table rag_eval_evaluation_records {
|
|
@@ -935,6 +1007,10 @@ table rag_eval_evaluation_records {
|
|
|
935
1007
|
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
936
1008
|
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
937
1009
|
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
1010
|
+
|
|
1011
|
+
indexes {
|
|
1012
|
+
user_id [name: 'rag_eval_evaluation_records_user_id_idx']
|
|
1013
|
+
}
|
|
938
1014
|
}
|
|
939
1015
|
|
|
940
1016
|
table rbac_permissions {
|
|
@@ -996,6 +1072,7 @@ table agents_to_sessions {
|
|
|
996
1072
|
(agent_id, session_id) [pk]
|
|
997
1073
|
session_id [name: 'agents_to_sessions_session_id_idx']
|
|
998
1074
|
agent_id [name: 'agents_to_sessions_agent_id_idx']
|
|
1075
|
+
user_id [name: 'agents_to_sessions_user_id_idx']
|
|
999
1076
|
}
|
|
1000
1077
|
}
|
|
1001
1078
|
|
|
@@ -1007,6 +1084,9 @@ table file_chunks {
|
|
|
1007
1084
|
|
|
1008
1085
|
indexes {
|
|
1009
1086
|
(file_id, chunk_id) [pk]
|
|
1087
|
+
user_id [name: 'file_chunks_user_id_idx']
|
|
1088
|
+
file_id [name: 'file_chunks_file_id_idx']
|
|
1089
|
+
chunk_id [name: 'file_chunks_chunk_id_idx']
|
|
1010
1090
|
}
|
|
1011
1091
|
}
|
|
1012
1092
|
|
|
@@ -1017,6 +1097,9 @@ table files_to_sessions {
|
|
|
1017
1097
|
|
|
1018
1098
|
indexes {
|
|
1019
1099
|
(file_id, session_id) [pk]
|
|
1100
|
+
user_id [name: 'files_to_sessions_user_id_idx']
|
|
1101
|
+
file_id [name: 'files_to_sessions_file_id_idx']
|
|
1102
|
+
session_id [name: 'files_to_sessions_session_id_idx']
|
|
1020
1103
|
}
|
|
1021
1104
|
}
|
|
1022
1105
|
|
|
@@ -1032,6 +1115,7 @@ table session_groups {
|
|
|
1032
1115
|
|
|
1033
1116
|
indexes {
|
|
1034
1117
|
(client_id, user_id) [name: 'session_groups_client_id_user_id_unique', unique]
|
|
1118
|
+
user_id [name: 'session_groups_user_id_idx']
|
|
1035
1119
|
}
|
|
1036
1120
|
}
|
|
1037
1121
|
|
|
@@ -1083,9 +1167,11 @@ table threads {
|
|
|
1083
1167
|
|
|
1084
1168
|
indexes {
|
|
1085
1169
|
(client_id, user_id) [name: 'threads_client_id_user_id_unique', unique]
|
|
1170
|
+
user_id [name: 'threads_user_id_idx']
|
|
1086
1171
|
topic_id [name: 'threads_topic_id_idx']
|
|
1087
1172
|
agent_id [name: 'threads_agent_id_idx']
|
|
1088
1173
|
group_id [name: 'threads_group_id_idx']
|
|
1174
|
+
parent_thread_id [name: 'threads_parent_thread_id_idx']
|
|
1089
1175
|
}
|
|
1090
1176
|
}
|
|
1091
1177
|
|
|
@@ -1097,6 +1183,9 @@ table topic_documents {
|
|
|
1097
1183
|
|
|
1098
1184
|
indexes {
|
|
1099
1185
|
(document_id, topic_id) [pk]
|
|
1186
|
+
user_id [name: 'topic_documents_user_id_idx']
|
|
1187
|
+
topic_id [name: 'topic_documents_topic_id_idx']
|
|
1188
|
+
document_id [name: 'topic_documents_document_id_idx']
|
|
1100
1189
|
}
|
|
1101
1190
|
}
|
|
1102
1191
|
|
|
@@ -91,6 +91,12 @@ Better Auth supports additional features with these new environment variables:
|
|
|
91
91
|
|
|
92
92
|
For small self-hosted deployments, the simplest approach is to let users re-login with their SSO accounts.
|
|
93
93
|
|
|
94
|
+
<Callout type={'tip'}>
|
|
95
|
+
**Casdoor Users**: If you use Casdoor as your identity provider, please read
|
|
96
|
+
the [email\_not\_found Error](#email_not_found-error) section first to
|
|
97
|
+
understand email configuration requirements.
|
|
98
|
+
</Callout>
|
|
99
|
+
|
|
94
100
|
<Callout type={'warning'}>
|
|
95
101
|
**Limitation**: This method loses SSO connection data. Use [Full Migration](#full-migration) to preserve SSO connections.
|
|
96
102
|
|
|
@@ -87,6 +87,11 @@ Better Auth 支持更多功能,以下是新增的环境变量:
|
|
|
87
87
|
|
|
88
88
|
对于小型自托管部署,最简单的方法是让用户使用 SSO 账户重新登录。
|
|
89
89
|
|
|
90
|
+
<Callout type={'tip'}>
|
|
91
|
+
**Casdoor 用户注意**:如果你使用 Casdoor 作为身份提供商,请先阅读
|
|
92
|
+
[email\_not\_found 错误](#email_not_found-错误) 部分,了解邮箱配置要求。
|
|
93
|
+
</Callout>
|
|
94
|
+
|
|
90
95
|
<Callout type={'warning'}>
|
|
91
96
|
**限制**:此方法会丢失 SSO 连接数据。如需保留 SSO 连接,请使用 [完整迁移](#完整迁移)。
|
|
92
97
|
|
|
@@ -56,7 +56,7 @@ tags:
|
|
|
56
56
|
|
|
57
57
|
> Available in Casdoor `>=1.843.0`.
|
|
58
58
|
|
|
59
|
-
Configure Casdoor Webhook to sync user data updates to LobeChat.
|
|
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
61
|
1. Go to **Admin Tools** -> **Webhooks** and create a Webhook
|
|
62
62
|
2. Fill in the following fields:
|
|
@@ -54,7 +54,7 @@ tags:
|
|
|
54
54
|
|
|
55
55
|
> 在 Casdoor `>=1.843.0` 上可用。
|
|
56
56
|
|
|
57
|
-
配置 Casdoor 的 Webhook 以便在用户信息更新时同步到 LobeChat。
|
|
57
|
+
配置 Casdoor 的 [Webhook](https://www.casdoor.org/docs/webhooks/overview#setting-up-a-webhook) 以便在用户信息更新时同步到 LobeChat。
|
|
58
58
|
|
|
59
59
|
1. 前往 `管理工具` -> `Webhooks`,创建一个 Webhook
|
|
60
60
|
2. 填写以下字段:
|
|
@@ -56,7 +56,7 @@ tags:
|
|
|
56
56
|
|
|
57
57
|
### Configure Webhook (Optional)
|
|
58
58
|
|
|
59
|
-
Configure Logto Webhook to sync user data updates to LobeChat.
|
|
59
|
+
Configure Logto [Webhook](https://docs.logto.io/developers/webhooks/configure-webhooks) to sync user data updates to LobeChat.
|
|
60
60
|
|
|
61
61
|
1. Go to **Webhooks** in Logto Console and create a Webhook
|
|
62
62
|
2. Fill in the following fields:
|
|
@@ -54,7 +54,7 @@ tags:
|
|
|
54
54
|
|
|
55
55
|
### 配置 Webhook(可选)
|
|
56
56
|
|
|
57
|
-
配置 Logto 的 Webhook,以便在用户信息更新时 LobeChat 可以接收到通知并同步数据。
|
|
57
|
+
配置 Logto 的 [Webhook](https://docs.logto.io/developers/webhooks/configure-webhooks),以便在用户信息更新时 LobeChat 可以接收到通知并同步数据。
|
|
58
58
|
|
|
59
59
|
1. 前往 Logto 控制台的 `Webhooks`,创建一个 Webhook
|
|
60
60
|
2. 填写以下字段:
|
|
@@ -1,55 +1,76 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: User Authentication and Account Management
|
|
3
3
|
description: >-
|
|
4
|
-
Explore LobeChat's user authentication solutions with
|
|
4
|
+
Explore LobeChat's user authentication solutions with Better Auth for flexible and secure user management. Learn about features like email/password login, magic link, SSO, and account deletion.
|
|
5
5
|
|
|
6
6
|
tags:
|
|
7
|
-
- Multi-User Management
|
|
8
|
-
- Identity Verification
|
|
9
|
-
- next-auth
|
|
10
|
-
- Clerk
|
|
11
7
|
- User Authentication
|
|
8
|
+
- Better Auth
|
|
9
|
+
- SSO
|
|
10
|
+
- Account Management
|
|
12
11
|
- Session Management
|
|
13
|
-
- Multi-Factor Authentication
|
|
14
|
-
- User Management
|
|
15
12
|
---
|
|
16
13
|
|
|
17
|
-
#
|
|
14
|
+
# User Authentication and Account Management
|
|
18
15
|
|
|
19
16
|
<Image alt={'Identity Verification System'} cover src={'https://github.com/user-attachments/assets/80bb232e-19d1-4f97-98d6-e291f3585e6d'} />
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
LobeChat uses [Better Auth](https://www.better-auth.com) as its authentication solution, providing comprehensive, secure, and flexible identity verification services.
|
|
22
19
|
|
|
23
|
-
##
|
|
20
|
+
## Authentication Methods
|
|
24
21
|
|
|
25
|
-
LobeChat
|
|
22
|
+
LobeChat supports multiple authentication methods to meet diverse user needs:
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
- **Session Management**: Efficiently manage user sessions to ensure security.
|
|
29
|
-
- **Social Login**: Support quick login via various social platforms.
|
|
30
|
-
- **Data Security**: Ensure the security and privacy of user data.
|
|
24
|
+
### Email / Password
|
|
31
25
|
|
|
32
|
-
|
|
33
|
-
For information on using Next-Auth, you can refer to [Authentication Services - Next
|
|
34
|
-
Auth](/docs/self-hosting/advanced/authentication#next-auth).
|
|
35
|
-
</Callout>
|
|
26
|
+
Traditional email and password login with secure password hashing. You can register a new account with your email address and set a password.
|
|
36
27
|
|
|
37
|
-
|
|
28
|
+
### Magic Link
|
|
38
29
|
|
|
39
|
-
|
|
30
|
+
Passwordless authentication via email magic link. Simply enter your email, click the link sent to your inbox, and you're logged in - no password required.
|
|
40
31
|
|
|
41
|
-
|
|
42
|
-
- **User Profile Management**: Conveniently manage user information and configurations.
|
|
43
|
-
- **Login Activity Monitoring**: Real-time monitoring of user login activities to ensure account security.
|
|
44
|
-
- **Scalability**: Supports complex user management requirements.
|
|
32
|
+
### Social Login (SSO)
|
|
45
33
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
Quick login via popular identity providers:
|
|
35
|
+
|
|
36
|
+
- **Google** - Sign in with your Google account
|
|
37
|
+
- **GitHub** - Sign in with your GitHub account
|
|
38
|
+
- **Microsoft** - Sign in with your Microsoft account
|
|
39
|
+
- **Apple** - Sign in with your Apple ID
|
|
40
|
+
- And more...
|
|
41
|
+
|
|
42
|
+
## Account Management
|
|
43
|
+
|
|
44
|
+
### Profile Settings
|
|
45
|
+
|
|
46
|
+
You can manage your account profile in **Settings > Profile**:
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
- Update your avatar
|
|
51
|
+
- Change your display name
|
|
52
|
+
- Set your username
|
|
53
|
+
- Manage connected SSO providers
|
|
54
|
+
- Change your password (if using email/password login)
|
|
55
|
+
|
|
56
|
+
### Account Deletion
|
|
57
|
+
|
|
58
|
+
If you wish to delete your account, you can request account deletion in **Settings > Data Storage**:
|
|
59
|
+
|
|
60
|
+
1. Click **Request Account Deletion**
|
|
61
|
+
2. Enter the reason for deletion
|
|
62
|
+
3. Check the confirmation box
|
|
63
|
+
4. Submit your request
|
|
64
|
+
|
|
65
|
+
<Callout type={'warning'}>
|
|
66
|
+
After submission, there is a **72-hour cooling-off period** during which you can cancel at any time. Once the period ends:
|
|
67
|
+
|
|
68
|
+
- Your account data will be permanently deleted
|
|
69
|
+
- Unpaid invoices will be canceled immediately
|
|
70
|
+
- Paid fees will not be refunded
|
|
71
|
+
- Your registration and deletion records will be retained for compliance purposes
|
|
49
72
|
</Callout>
|
|
50
73
|
|
|
51
|
-
<Callout type={'
|
|
52
|
-
|
|
53
|
-
"Configuring Authentication Services" section in [Deploying with a Server-Side
|
|
54
|
-
Database](/docs/self-hosting/advanced/server-database).
|
|
74
|
+
<Callout type={'info'}>
|
|
75
|
+
For self-hosting deployment, please refer to [Authentication Services](/docs/self-hosting/advanced/auth) for configuration details.
|
|
55
76
|
</Callout>
|
|
@@ -1,51 +1,74 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description: LobeChat
|
|
2
|
+
title: 用户认证与账号管理
|
|
3
|
+
description: 了解 LobeChat 基于 Better Auth 的用户认证方案,支持邮箱密码、魔法链接、SSO 登录及账号注销等功能。
|
|
4
4
|
tags:
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- 多因素认证
|
|
5
|
+
- 用户认证
|
|
6
|
+
- Better Auth
|
|
7
|
+
- SSO
|
|
8
|
+
- 账号管理
|
|
9
|
+
- 会话管理
|
|
11
10
|
---
|
|
12
11
|
|
|
13
|
-
#
|
|
12
|
+
# 用户认证与账号管理
|
|
14
13
|
|
|
15
14
|
<Image alt={'身份验证系统'} cover src={'https://github.com/user-attachments/assets/80bb232e-19d1-4f97-98d6-e291f3585e6d'} />
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
LobeChat 使用 [Better Auth](https://www.better-auth.com) 作为身份验证解决方案,提供全面、安全、灵活的身份验证服务。
|
|
18
17
|
|
|
19
|
-
##
|
|
18
|
+
## 认证方式
|
|
20
19
|
|
|
21
|
-
LobeChat
|
|
20
|
+
LobeChat 支持多种认证方式,满足不同用户的需求:
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
- **会话管理**:高效管理用户会话,确保安全性。
|
|
25
|
-
- **社交登录**:支持多种社交平台的快捷登录。
|
|
26
|
-
- **数据安全**:保障用户数据的安全性和隐私性。
|
|
22
|
+
### 邮箱 / 密码
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
关于 Next-Auth 的使用,可以查阅 [身份验证服务 - Next
|
|
30
|
-
Auth](/zh/docs/self-hosting/advanced/authentication#next-auth)。
|
|
31
|
-
</Callout>
|
|
24
|
+
传统的邮箱和密码登录方式,采用安全的密码哈希算法。您可以使用邮箱地址注册新账号并设置密码。
|
|
32
25
|
|
|
33
|
-
|
|
26
|
+
### 魔法链接
|
|
34
27
|
|
|
35
|
-
|
|
28
|
+
通过邮件魔法链接实现无密码认证。只需输入邮箱,点击收件箱中的链接即可登录,无需记忆密码。
|
|
36
29
|
|
|
37
|
-
|
|
38
|
-
- **用户配置文件管理**:便捷管理用户信息和配置。
|
|
39
|
-
- **登录活动监控**:实时监控用户登录活动,确保账户安全。
|
|
40
|
-
- **扩展性**:支持复杂的用户管理需求。
|
|
30
|
+
### 社交登录 (SSO)
|
|
41
31
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
通过主流身份提供商快速登录:
|
|
33
|
+
|
|
34
|
+
- **Google** - 使用 Google 账号登录
|
|
35
|
+
- **GitHub** - 使用 GitHub 账号登录
|
|
36
|
+
- **Microsoft** - 使用 Microsoft 账号登录
|
|
37
|
+
- **Apple** - 使用 Apple ID 登录
|
|
38
|
+
- 更多...
|
|
39
|
+
|
|
40
|
+
## 账号管理
|
|
41
|
+
|
|
42
|
+
### 个人资料设置
|
|
43
|
+
|
|
44
|
+
您可以在 **设置 > 个人资料** 中管理您的账号资料:
|
|
45
|
+
|
|
46
|
+

|
|
47
|
+
|
|
48
|
+
- 更新头像
|
|
49
|
+
- 修改显示名称
|
|
50
|
+
- 设置用户名
|
|
51
|
+
- 管理已连接的 SSO 提供商
|
|
52
|
+
- 修改密码(如果使用邮箱密码登录)
|
|
53
|
+
|
|
54
|
+
### 账号注销
|
|
55
|
+
|
|
56
|
+
如果您希望注销账号,可以在 **设置 > 数据存储** 中申请注销:
|
|
57
|
+
|
|
58
|
+
1. 点击 **申请注销账号**
|
|
59
|
+
2. 填写注销原因
|
|
60
|
+
3. 勾选确认复选框
|
|
61
|
+
4. 提交申请
|
|
62
|
+
|
|
63
|
+
<Callout type={'warning'}>
|
|
64
|
+
提交后将进入 **72 小时冷静期**,期间可随时取消。冷静期结束后:
|
|
65
|
+
|
|
66
|
+
- 您的账号数据将被永久删除
|
|
67
|
+
- 未支付的账单将立即取消
|
|
68
|
+
- 已支付的费用不予退还
|
|
69
|
+
- 您的注册和注销记录将被保留以满足合规要求
|
|
45
70
|
</Callout>
|
|
46
71
|
|
|
47
|
-
<Callout type={'
|
|
48
|
-
|
|
49
|
-
[使用服务端数据库部署](/zh/docs/self-hosting/advanced/server-database)
|
|
50
|
-
中的「配置身份验证服务」部分。
|
|
72
|
+
<Callout type={'info'}>
|
|
73
|
+
如需自托管部署,请参阅 [身份验证服务](/zh/docs/self-hosting/advanced/auth) 了解配置详情。
|
|
51
74
|
</Callout>
|
|
@@ -165,6 +165,30 @@
|
|
|
165
165
|
"cmdk.themeLight": "Light",
|
|
166
166
|
"cmdk.toOpen": "Open",
|
|
167
167
|
"cmdk.toSelect": "Select",
|
|
168
|
+
"cmdk.keywords.contactUs": "feedback issue bug problem",
|
|
169
|
+
"cmdk.keywords.submitIssue": "issue bug problem feedback",
|
|
170
|
+
"cmdk.keywords.starGitHub": "github star favorite like",
|
|
171
|
+
"cmdk.keywords.discord": "discord help support customer service",
|
|
172
|
+
"cmdk.keywords.community": "discover market assistant model provider mcp",
|
|
173
|
+
"cmdk.keywords.painting": "painting art generate draw",
|
|
174
|
+
"cmdk.keywords.resources": "knowledge files library documents",
|
|
175
|
+
"cmdk.keywords.pages": "documents write notes",
|
|
176
|
+
"cmdk.keywords.memory": "identities contexts preferences experiences",
|
|
177
|
+
"cmdk.keywords.settings": "settings preferences configuration options",
|
|
178
|
+
"cmdk.keywords.profile": "profile user account personal",
|
|
179
|
+
"cmdk.keywords.appearance": "common appearance theme display",
|
|
180
|
+
"cmdk.keywords.provider": "provider llm model ai",
|
|
181
|
+
"cmdk.keywords.hotkey": "hotkey shortcut keyboard",
|
|
182
|
+
"cmdk.keywords.image": "image picture photo",
|
|
183
|
+
"cmdk.keywords.proxy": "proxy network connection",
|
|
184
|
+
"cmdk.keywords.stats": "stats statistics analytics",
|
|
185
|
+
"cmdk.keywords.apikey": "apikey api key token",
|
|
186
|
+
"cmdk.keywords.about": "about version info",
|
|
187
|
+
"cmdk.keywords.plans": "subscription plan upgrade pricing",
|
|
188
|
+
"cmdk.keywords.funds": "funds balance credit money",
|
|
189
|
+
"cmdk.keywords.usage": "usage statistics consumption quota",
|
|
190
|
+
"cmdk.keywords.billing": "billing payment invoice transaction",
|
|
191
|
+
"cmdk.keywords.referral": "referral rewards invite bonus",
|
|
168
192
|
"confirm": "Confirm",
|
|
169
193
|
"contact": "Contact Us",
|
|
170
194
|
"copy": "Copy",
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_cloud.officialProvider": "{{name}} Official Model Service",
|
|
3
3
|
"about.title": "About",
|
|
4
|
+
"accountDeletion.cancelButton": "Cancel Deletion",
|
|
5
|
+
"accountDeletion.cancelConfirmTitle": "Cancel account deletion request?",
|
|
6
|
+
"accountDeletion.cancelFailed": "Failed to cancel deletion request",
|
|
7
|
+
"accountDeletion.cancelSuccess": "Deletion request cancelled",
|
|
8
|
+
"accountDeletion.confirmCheckbox": "I have read and understood the above, and confirm to proceed with account deletion",
|
|
9
|
+
"accountDeletion.confirmContent": "After submission, you will enter a <0>72-hour</0> cooling-off period during which you can cancel at any time. Once the period ends, your account data will be permanently deleted, unpaid invoices will be canceled immediately, and paid fees will not be refunded. Your registration and deletion records will be retained for compliance purposes.",
|
|
10
|
+
"accountDeletion.confirmOk": "Delete Account",
|
|
11
|
+
"accountDeletion.confirmRequired": "Please confirm you understand the consequences",
|
|
12
|
+
"accountDeletion.confirmTitle": "Delete Account?",
|
|
13
|
+
"accountDeletion.desc": "Permanently delete your account and all associated data. This action cannot be undone.",
|
|
14
|
+
"accountDeletion.pendingDesc": "Your account is scheduled for deletion",
|
|
15
|
+
"accountDeletion.pendingMessage": "Your account will be deleted in {{hours}} hours",
|
|
16
|
+
"accountDeletion.reasonPlaceholder": "Please tell us why you want to delete your account...",
|
|
17
|
+
"accountDeletion.reasonRequired": "Please provide a reason for deletion",
|
|
18
|
+
"accountDeletion.requestButton": "Request Account Deletion",
|
|
19
|
+
"accountDeletion.requestFailed": "Failed to request account deletion",
|
|
20
|
+
"accountDeletion.requestSuccess": "Deletion request submitted",
|
|
21
|
+
"accountDeletion.sectionTitle": "Account Deletion",
|
|
22
|
+
"accountDeletion.title": "Delete Account",
|
|
4
23
|
"advancedSettings": "Advanced Settings",
|
|
5
24
|
"agentCronJobs.addJob": "Add Scheduled Task",
|
|
6
25
|
"agentCronJobs.confirmDelete": "Are you sure you want to delete this scheduled task?",
|