Skip to content

Commit 71f3ed6

Browse files
authored
Merge branch 'main' into main
2 parents 5bb25ea + d8950b2 commit 71f3ed6

File tree

937 files changed

+63759
-4232
lines changed

Some content is hidden

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

937 files changed

+63759
-4232
lines changed

.dockerignore

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ node_modules
44
npm-debug.log
55
.next
66
.git
7-
scripts
87
docs
98
.github
109
*.md

.env.example

+65-1
Original file line numberDiff line numberDiff line change
@@ -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-02-01
36+
# AZURE_API_VERSION=2024-06-01
3737

3838

3939
### Anthropic Service ####
@@ -112,6 +112,10 @@ OPENAI_API_KEY=sk-xxxxxxxxx
112112

113113
# QWEN_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
114114

115+
### SiliconCloud AI ####
116+
117+
# SILICONCLOUD_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
118+
115119
########################################
116120
############ Market Service ############
117121
########################################
@@ -129,3 +133,63 @@ OPENAI_API_KEY=sk-xxxxxxxxx
129133
# set the plugin settings
130134
# the format is `plugin-identifier:key1=value1;key2=value2`, multiple settings fields are separated by semicolons `;`, multiple plugin settings are separated by commas `,`.
131135
# PLUGIN_SETTINGS=search-engine:SERPAPI_API_KEY=xxxxx
136+
137+
138+
########################################
139+
##### S3 Object Storage Service ########
140+
########################################
141+
142+
# S3 keys
143+
#S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
144+
#S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
145+
146+
# Bucket name
147+
#S3_BUCKET=lobechat
148+
149+
# Bucket request endpoint
150+
#S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
151+
152+
# Public access domain for the bucket
153+
#NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
154+
155+
# Bucket region, such as us-west-1, generally not needed to add
156+
# but some service providers may require configuration
157+
# S3_REGION=us-west-1
158+
159+
160+
########################################
161+
############ Auth Service ##############
162+
########################################
163+
164+
165+
# Clerk related configurations
166+
167+
# Clerk public key and secret key
168+
#NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
169+
#CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
170+
171+
# you need to config the clerk webhook secret key if you want to use the clerk with database
172+
#CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
173+
174+
175+
# NextAuth related configurations
176+
# NEXT_AUTH_SECRET=
177+
178+
# Auth0 configurations
179+
# AUTH0_CLIENT_ID=
180+
# AUTH0_CLIENT_SECRET=
181+
# AUTH0_ISSUER=https://your-domain.auth0.com
182+
183+
########################################
184+
########## Server Database #############
185+
########################################
186+
187+
# Specify the service mode as server if you want to use the server database
188+
#NEXT_PUBLIC_SERVICE_MODE=server
189+
190+
# Postgres database URL
191+
#DATABASE_URL=postgres://username:password@host:port/database
192+
193+
# use `openssl rand -base64 32` to generate a key for the encryption of the database
194+
# we use this key to encrypt the user api key
195+
#KEY_VAULTS_SECRET=xxxxx/xxxxxxxxxxxxxx=

.github/ISSUE_TEMPLATE/1_bug_report.yml

+25-20
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ description: 'Report an bug'
33
title: '[Bug] '
44
labels: ['🐛 Bug']
55
body:
6-
- type: checkboxes
6+
- type: dropdown
77
attributes:
88
label: '📦 Environment'
9+
multiple: true
910
options:
10-
- label: 'Official'
11-
- label: 'Official Preview'
12-
- label: 'Vercel / Zeabur / Sealos'
13-
- label: 'Docker'
14-
- label: 'Other'
11+
- 'Official Preview'
12+
- 'Vercel'
13+
- 'Zeabur'
14+
- 'Sealos'
15+
- 'Netlify'
16+
- 'Docker'
17+
- 'Other'
1518
validations:
1619
required: true
1720
- type: input
@@ -20,28 +23,30 @@ body:
2023
validations:
2124
required: true
2225

23-
- type: checkboxes
26+
- type: dropdown
2427
attributes:
2528
label: '💻 Operating System'
29+
multiple: true
2630
options:
27-
- label: 'Windows'
28-
- label: 'macOS'
29-
- label: 'Ubuntu'
30-
- label: 'Other Linux'
31-
- label: 'iOS'
32-
- label: 'Android'
33-
- label: 'Other'
31+
- 'Windows'
32+
- 'macOS'
33+
- 'Ubuntu'
34+
- 'Other Linux'
35+
- 'iOS'
36+
- 'Android'
37+
- 'Other'
3438
validations:
3539
required: true
36-
- type: checkboxes
40+
- type: dropdown
3741
attributes:
3842
label: '🌐 Browser'
43+
multiple: true
3944
options:
40-
- label: 'Chrome'
41-
- label: 'Edge'
42-
- label: 'Safari'
43-
- label: 'Firefox'
44-
- label: 'Other'
45+
- 'Chrome'
46+
- 'Edge'
47+
- 'Safari'
48+
- 'Firefox'
49+
- 'Other'
4550
validations:
4651
required: true
4752
- type: textarea

.github/ISSUE_TEMPLATE/1_bug_report_cn.yml

+25-20
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ description: '反馈一个问题缺陷'
33
title: '[Bug] '
44
labels: ['🐛 Bug']
55
body:
6-
- type: checkboxes
6+
- type: dropdown
77
attributes:
88
label: '📦 部署环境'
9+
multiple: true
910
options:
10-
- label: 'Official'
11-
- label: 'Official Preview'
12-
- label: 'Vercel / Zeabur / Sealos'
13-
- label: 'Docker'
14-
- label: 'Other'
11+
- 'Official Preview'
12+
- 'Vercel'
13+
- 'Zeabur'
14+
- 'Sealos'
15+
- 'Netlify'
16+
- 'Docker'
17+
- 'Other'
1518
validations:
1619
required: true
1720
- type: input
@@ -20,28 +23,30 @@ body:
2023
validations:
2124
required: true
2225

23-
- type: checkboxes
26+
- type: dropdown
2427
attributes:
2528
label: '💻 系统环境'
29+
multiple: true
2630
options:
27-
- label: 'Windows'
28-
- label: 'macOS'
29-
- label: 'Ubuntu'
30-
- label: 'Other Linux'
31-
- label: 'iOS'
32-
- label: 'Android'
33-
- label: 'Other'
31+
- 'Windows'
32+
- 'macOS'
33+
- 'Ubuntu'
34+
- 'Other Linux'
35+
- 'iOS'
36+
- 'Android'
37+
- 'Other'
3438
validations:
3539
required: true
36-
- type: checkboxes
40+
- type: dropdown
3741
attributes:
3842
label: '🌐 浏览器'
43+
multiple: true
3944
options:
40-
- label: 'Chrome'
41-
- label: 'Edge'
42-
- label: 'Safari'
43-
- label: 'Firefox'
44-
- label: 'Other'
45+
- 'Chrome'
46+
- 'Edge'
47+
- 'Safari'
48+
- 'Firefox'
49+
- 'Other'
4550
validations:
4651
required: true
4752
- type: textarea

.github/PULL_REQUEST_TEMPLATE.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
- [ ] 🐛 fix
77
- [ ] ♻️ refactor
88
- [ ] 💄 style
9-
- [ ] 🔨 chore
9+
- [ ] 👷 build
1010
- [ ] ⚡️ perf
1111
- [ ] 📝 docs
12+
- [ ] 🔨 chore
1213

1314
#### 🔀 变更说明 | Description of Change
1415

.github/workflows/docker-database.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish Database Docker Image
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
push_to_registry:
10+
name: Push Docker image to Docker Hub
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out the repo
14+
uses: actions/checkout@v4
15+
- name: Log in to Docker Hub
16+
uses: docker/login-action@v3
17+
with:
18+
username: ${{ secrets.DOCKER_REGISTRY_USER }}
19+
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
20+
21+
- name: Extract metadata (tags, labels) for Docker
22+
id: meta
23+
uses: docker/metadata-action@v5
24+
with:
25+
images: lobehub/lobe-chat-database
26+
tags: |
27+
type=raw,value=latest
28+
type=ref,event=tag
29+
30+
- name: Set up QEMU
31+
uses: docker/setup-qemu-action@v3
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Build and push Docker image
37+
uses: docker/build-push-action@v5
38+
with:
39+
context: .
40+
file: ./Dockerfile.database # 指定使用 Dockerfile.database 文件
41+
platforms: linux/amd64,linux/arm64
42+
push: true
43+
tags: ${{ steps.meta.outputs.tags }}
44+
labels: ${{ steps.meta.outputs.labels }}
45+
cache-from: type=gha
46+
cache-to: type=gha,mode=max

.github/workflows/release.yml

+21-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ jobs:
88
release:
99
name: Release
1010
runs-on: ubuntu-latest
11+
12+
services:
13+
postgres:
14+
image: postgres:16
15+
env:
16+
POSTGRES_PASSWORD: postgres
17+
options: >-
18+
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
19+
ports:
20+
- 5432:5432
21+
1122
steps:
1223
- uses: actions/checkout@v4
1324

@@ -22,8 +33,16 @@ jobs:
2233
- name: Lint
2334
run: bun run lint
2435

25-
- name: Test
26-
run: bun run test
36+
- name: Test Server Coverage
37+
run: bun run test-server:coverage
38+
env:
39+
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
40+
DATABASE_DRIVER: node
41+
NEXT_PUBLIC_SERVICE_MODE: server
42+
KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
43+
44+
- name: Test App Coverage
45+
run: bun run test-app:coverage
2746

2847
- name: Release
2948
run: bun run release

.github/workflows/sync.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions:
77

88
on:
99
schedule:
10-
- cron: '0 * * * *' # every hour
10+
- cron: '0 */6 * * *' # every 6 hours
1111
workflow_dispatch:
1212

1313
jobs:

.github/workflows/test.yml

+35-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
name: Test CI
2+
23
on: [push, pull_request]
4+
35
jobs:
46
test:
57
runs-on: ubuntu-latest
68

9+
services:
10+
postgres:
11+
image: postgres:16
12+
env:
13+
POSTGRES_PASSWORD: postgres
14+
options: >-
15+
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
16+
17+
18+
ports:
19+
- 5432:5432
20+
721
steps:
822
- uses: actions/checkout@v4
923

@@ -18,10 +32,27 @@ jobs:
1832
- name: Lint
1933
run: bun run lint
2034

21-
- name: Test and coverage
22-
run: bun run test:coverage
35+
- name: Test Server Coverage
36+
run: bun run test-server:coverage
37+
env:
38+
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
39+
DATABASE_DRIVER: node
40+
NEXT_PUBLIC_SERVICE_MODE: server
41+
KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
42+
43+
- name: Upload Server coverage to Codecov
44+
uses: codecov/codecov-action@v4
45+
with:
46+
token: ${{ secrets.CODECOV_TOKEN }}
47+
files: ./coverage/server/lcov.info
48+
flags: server
49+
50+
- name: Test App Coverage
51+
run: bun run test-app:coverage
2352

24-
- name: Upload coverage to Codecov
53+
- name: Upload App Coverage to Codecov
2554
uses: codecov/codecov-action@v4
2655
with:
27-
token: ${{ secrets.CODECOV_TOKEN }} # required
56+
token: ${{ secrets.CODECOV_TOKEN }}
57+
files: ./coverage/app/lcov.info
58+
flags: app

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ sitemap*.xml
6060
robots.txt
6161

6262
*.patch
63+
*.pdf

0 commit comments

Comments
 (0)