Skip to content

Commit 2051016

Browse files
authored
Merge branch 'main' into feat/image-clipboard
2 parents 4c7087f + 2cc72f4 commit 2051016

File tree

775 files changed

+47700
-6409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

775 files changed

+47700
-6409
lines changed

.env.example

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
########################################
9-
######## Model Provider Service ########
9+
########## AI Provider Service #########
1010
########################################
1111

1212
### OpenAI ###
@@ -33,7 +33,7 @@ OPENAI_API_KEY=sk-xxxxxxxxx
3333
# AZURE_ENDPOINT=https://docs-test-001.openai.azure.com
3434

3535
# Azure's API version, follows the YYYY-MM-DD format
36-
# AZURE_API_VERSION=2024-06-01
36+
# AZURE_API_VERSION=2024-10-21
3737

3838

3939
### Anthropic Service ####
@@ -127,6 +127,10 @@ OPENAI_API_KEY=sk-xxxxxxxxx
127127

128128
# TENCENT_CLOUD_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
129129

130+
### PPIO ####
131+
132+
# PPIO_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
133+
130134
########################################
131135
############ Market Service ############
132136
########################################
@@ -214,7 +218,7 @@ OPENAI_API_KEY=sk-xxxxxxxxx
214218
# DATABASE_URL=postgres://username:password@host:port/database
215219

216220
# use `openssl rand -base64 32` to generate a key for the encryption of the database
217-
# we use this key to encrypt the user api key
221+
# we use this key to encrypt the user api key and proxy url
218222
#KEY_VAULTS_SECRET=xxxxx/xxxxxxxxxxxxxx=
219223

220224
# Specify the Embedding model and Reranker model(unImplemented)

.github/ISSUE_TEMPLATE/1_bug_report.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: '🐛 Bug Report'
22
description: 'Report an bug'
33
title: '[Bug] '
44
labels: ['🐛 Bug']
5+
type: Bug
56
body:
67
- type: dropdown
78
attributes:
@@ -23,6 +24,7 @@ body:
2324
multiple: true
2425
options:
2526
- 'client db (lobe-chat image)'
27+
- 'client pgelite db (lobe-chat-pglite image)'
2628
- 'server db(lobe-chat-database image)'
2729
validations:
2830
required: true
@@ -31,7 +33,7 @@ body:
3133
label: '📌 Version'
3234
validations:
3335
required: true
34-
36+
3537
- type: dropdown
3638
attributes:
3739
label: '💻 Operating System'

.github/ISSUE_TEMPLATE/1_bug_report_cn.yml

+9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ name: '🐛 反馈缺陷'
22
description: '反馈一个问题缺陷'
33
title: '[Bug] '
44
labels: ['🐛 Bug']
5+
type: Bug
56
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
在创建新的 Issue 之前,请先[搜索已有问题](https://github.com/lobehub/lobe-chat/issues),如果发现已有类似的问题,请给它 **👍 点赞**,这样可以帮助我们更快地解决问题。
11+
如果你在使用过程中遇到问题,可以尝试以下方式获取帮助:
12+
- 在 [GitHub Discussions](https://github.com/lobehub/lobe-chat/discussions) 的版块发起讨论。
13+
- 在 [LobeChat 社区](https://discord.gg/AYFPHvv2jT) 提问,与其他用户交流。
614
- type: dropdown
715
attributes:
816
label: '📦 部署环境'
@@ -23,6 +31,7 @@ body:
2331
multiple: true
2432
options:
2533
- '客户端模式(lobe-chat 镜像)'
34+
- '客户端 Pglite 模式(lobe-chat-pglite 镜像)'
2635
- '服务端模式(lobe-chat-database 镜像)'
2736
validations:
2837
required: true

.github/ISSUE_TEMPLATE/2_feature_request.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: '🌠 Feature Request'
22
description: 'Suggest an idea'
33
title: '[Request] '
44
labels: ['🌠 Feature Request']
5+
type: Feature
56
body:
67
- type: textarea
78
attributes:

.github/ISSUE_TEMPLATE/2_feature_request_cn.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: '🌠 功能需求'
22
description: '提出需求或建议'
33
title: '[Request] '
44
labels: ['🌠 Feature Request']
5+
type: Feature
56
body:
67
- type: textarea
78
attributes:

.github/ISSUE_TEMPLATE/config.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
contact_links:
2-
- name: Questions and ideas | 问题和想法
2+
- name: Ask a question for self-hosting | 咨询自部署问题
3+
url: https://github.com/lobehub/lobe-chat/discussions/new?category=self-hosting-%E7%A7%81%E6%9C%89%E5%8C%96%E9%83%A8%E7%BD%B2
4+
about: Please post questions, and ideas in discussions. | 请在讨论区发布问题和想法。
5+
- name: Questions and ideas | 其他问题和想法
36
url: https://github.com/lobehub/lobe-chat/discussions/new/choose
47
about: Please post questions, and ideas in discussions. | 请在讨论区发布问题和想法。

.github/workflows/docker-pglite.yml

+161
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: Publish Docker Pglite Image
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
pull_request:
8+
types: [synchronize, labeled, unlabeled]
9+
10+
concurrency:
11+
group: ${{ github.ref }}-${{ github.workflow }}
12+
cancel-in-progress: true
13+
14+
env:
15+
REGISTRY_IMAGE: lobehub/lobe-chat-pglite
16+
PR_TAG_PREFIX: pr-
17+
18+
jobs:
19+
build:
20+
# 添加 PR label 触发条件
21+
if: |
22+
(github.event_name == 'pull_request' &&
23+
contains(github.event.pull_request.labels.*.name, 'Build Docker')) ||
24+
github.event_name != 'pull_request'
25+
26+
strategy:
27+
matrix:
28+
include:
29+
- platform: linux/amd64
30+
os: ubuntu-latest
31+
- platform: linux/arm64
32+
os: ubuntu-24.04-arm
33+
runs-on: ${{ matrix.os }}
34+
name: Build ${{ matrix.platform }} Image
35+
steps:
36+
- name: Prepare
37+
run: |
38+
platform=${{ matrix.platform }}
39+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
40+
41+
- name: Checkout base
42+
uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
46+
- name: Set up Docker Buildx
47+
uses: docker/setup-buildx-action@v3
48+
49+
# 为 PR 生成特殊的 tag
50+
- name: Generate PR metadata
51+
if: github.event_name == 'pull_request'
52+
id: pr_meta
53+
run: |
54+
branch_name="${{ github.head_ref }}"
55+
sanitized_branch=$(echo "${branch_name}" | sed -E 's/[^a-zA-Z0-9_.-]+/-/g')
56+
echo "pr_tag=${sanitized_branch}-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
57+
58+
- name: Docker meta
59+
id: meta
60+
uses: docker/metadata-action@v5
61+
with:
62+
images: ${{ env.REGISTRY_IMAGE }}
63+
tags: |
64+
# PR 构建使用特殊的 tag
65+
type=raw,value=${{ env.PR_TAG_PREFIX }}${{ steps.pr_meta.outputs.pr_tag }},enable=${{ github.event_name == 'pull_request' }}
66+
# release 构建使用版本号
67+
type=semver,pattern={{version}},enable=${{ github.event_name != 'pull_request' }}
68+
type=raw,value=latest,enable=${{ github.event_name != 'pull_request' }}
69+
70+
- name: Docker login
71+
uses: docker/login-action@v3
72+
with:
73+
username: ${{ secrets.DOCKER_REGISTRY_USER }}
74+
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
75+
76+
- name: Get commit SHA
77+
if: github.ref == 'refs/heads/main'
78+
id: vars
79+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
80+
81+
- name: Build and export
82+
id: build
83+
uses: docker/build-push-action@v5
84+
with:
85+
platforms: ${{ matrix.platform }}
86+
context: .
87+
file: ./Dockerfile.pglite
88+
labels: ${{ steps.meta.outputs.labels }}
89+
build-args: |
90+
SHA=${{ steps.vars.outputs.sha_short }}
91+
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
92+
93+
- name: Export digest
94+
run: |
95+
rm -rf /tmp/digests
96+
mkdir -p /tmp/digests
97+
digest="${{ steps.build.outputs.digest }}"
98+
touch "/tmp/digests/${digest#sha256:}"
99+
100+
- name: Upload artifact
101+
uses: actions/upload-artifact@v4
102+
with:
103+
name: digest-${{ env.PLATFORM_PAIR }}
104+
path: /tmp/digests/*
105+
if-no-files-found: error
106+
retention-days: 1
107+
108+
merge:
109+
name: Merge
110+
needs: build
111+
runs-on: ubuntu-latest
112+
steps:
113+
- name: Checkout base
114+
uses: actions/checkout@v4
115+
with:
116+
fetch-depth: 0
117+
118+
- name: Download digests
119+
uses: actions/download-artifact@v4
120+
with:
121+
path: /tmp/digests
122+
pattern: digest-*
123+
merge-multiple: true
124+
125+
- name: Set up Docker Buildx
126+
uses: docker/setup-buildx-action@v3
127+
128+
# 为 merge job 添加 PR metadata 生成
129+
- name: Generate PR metadata
130+
if: github.event_name == 'pull_request'
131+
id: pr_meta
132+
run: |
133+
branch_name="${{ github.head_ref }}"
134+
sanitized_branch=$(echo "${branch_name}" | sed -E 's/[^a-zA-Z0-9_.-]+/-/g')
135+
echo "pr_tag=${sanitized_branch}-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
136+
137+
- name: Docker meta
138+
id: meta
139+
uses: docker/metadata-action@v5
140+
with:
141+
images: ${{ env.REGISTRY_IMAGE }}
142+
tags: |
143+
type=raw,value=${{ env.PR_TAG_PREFIX }}${{ steps.pr_meta.outputs.pr_tag }},enable=${{ github.event_name == 'pull_request' }}
144+
type=semver,pattern={{version}},enable=${{ github.event_name != 'pull_request' }}
145+
type=raw,value=latest,enable=${{ github.event_name != 'pull_request' }}
146+
147+
- name: Docker login
148+
uses: docker/login-action@v3
149+
with:
150+
username: ${{ secrets.DOCKER_REGISTRY_USER }}
151+
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
152+
153+
- name: Create manifest list and push
154+
working-directory: /tmp/digests
155+
run: |
156+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
157+
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
158+
159+
- name: Inspect image
160+
run: |
161+
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Database Schema Visualization CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/developer/database-schema.dbml'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install dbdocs
17+
run: sudo npm install -g dbdocs
18+
19+
- name: Check dbdocs
20+
run: dbdocs
21+
22+
- name: sync database schema to dbdocs
23+
env:
24+
DBDOCS_TOKEN: ${{ secrets.DBDOCS_TOKEN }}
25+
run: npm run db:visualize

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
lockfile=false
22
resolution-mode=highest
33

4+
ignore-workspace-root-check=true
45
enable-pre-post-scripts=true
56

67
public-hoist-pattern[]=*@umijs/lint*

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/iron
1+
lts/jod

0 commit comments

Comments
 (0)