Skip to content

Commit d45936c

Browse files
authored
Merge branch 'dev' into feat_admin_panel
2 parents 6354cb5 + 05d80b9 commit d45936c

85 files changed

Lines changed: 2948 additions & 1028 deletions

File tree

Some content is hidden

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

Dockerfile

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,11 @@ ENV PATH=$PNPM_HOME:$PATH
1010
ARG NEXT_PUBLIC_API_BASE_URL=""
1111
ENV NEXT_PUBLIC_API_BASE_URL=${NEXT_PUBLIC_API_BASE_URL}
1212

13-
ARG NEXT_PUBLIC_LOGO_URL=""
14-
ARG NEXT_PUBLIC_FAVICON_URL=""
15-
ARG NEXT_PUBLIC_PWA_ICON_192_URL=""
16-
ARG NEXT_PUBLIC_PWA_ICON_512_URL=""
17-
ARG NEXT_PUBLIC_PWA_MASKABLE_ICON_512_URL=""
18-
ARG NEXT_PUBLIC_APPLE_TOUCH_ICON_180_URL=""
19-
ARG NEXT_PUBLIC_BRAND_TITLE=""
20-
ARG NEXT_PUBLIC_BRAND_SHORT_NAME=""
21-
ARG NEXT_PUBLIC_BRAND_DESCRIPTION=""
22-
23-
ENV NEXT_PUBLIC_LOGO_URL=${NEXT_PUBLIC_LOGO_URL}
24-
ENV NEXT_PUBLIC_FAVICON_URL=${NEXT_PUBLIC_FAVICON_URL}
25-
ENV NEXT_PUBLIC_PWA_ICON_192_URL=${NEXT_PUBLIC_PWA_ICON_192_URL}
26-
ENV NEXT_PUBLIC_PWA_ICON_512_URL=${NEXT_PUBLIC_PWA_ICON_512_URL}
27-
ENV NEXT_PUBLIC_PWA_MASKABLE_ICON_512_URL=${NEXT_PUBLIC_PWA_MASKABLE_ICON_512_URL}
28-
ENV NEXT_PUBLIC_APPLE_TOUCH_ICON_180_URL=${NEXT_PUBLIC_APPLE_TOUCH_ICON_180_URL}
29-
ENV NEXT_PUBLIC_BRAND_TITLE=${NEXT_PUBLIC_BRAND_TITLE}
30-
ENV NEXT_PUBLIC_BRAND_SHORT_NAME=${NEXT_PUBLIC_BRAND_SHORT_NAME}
31-
ENV NEXT_PUBLIC_BRAND_DESCRIPTION=${NEXT_PUBLIC_BRAND_DESCRIPTION}
32-
3313
COPY VERSION /src/VERSION
3414
COPY scripts /src/scripts
3515
COPY frontend/package.json frontend/pnpm-lock.yaml ./
3616
COPY frontend/scripts ./scripts
3717
COPY frontend/public/pwa ./public/pwa
38-
COPY frontend/public/sw.js ./public/sw.js
3918

4019
RUN corepack enable
4120

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,12 @@ If a superadmin already exists, the service does not regenerate or print the ini
311311

312312
> Full configuration guide: [Configuration](https://deeix.com/docs/deeix-chat/configuration).
313313
314-
Backend configuration is split into static runtime configuration and runtime business settings. Static runtime configuration describes the infrastructure, security, and storage parameters required to start the service, and is provided through `config.yaml` and environment variables. Runtime business settings cover product capabilities such as authentication, conversations, models, files, and billing; they are stored in `system_settings` and maintained from the admin console. Environment variables override matching config-file values, which is useful for containerized deployments, separated deployments, and secret injection.
314+
Backend configuration is split into static runtime configuration and runtime business settings. Static runtime configuration describes branding and the infrastructure, security, and storage parameters required to start the service, and is provided through `config.yaml` and environment variables. Runtime business settings cover product capabilities such as authentication, conversations, models, files, and billing; they are stored in `system_settings` and maintained from the admin console. Environment variables override matching config-file values, which is useful for containerized deployments, separated deployments, and secret injection.
315315

316316
At startup, the backend resolves the default config file from the working directory: starting from the repository root reads `config.yaml`, while starting from `backend/` reads `../config.yaml`. Docker deployments usually mount host `./config.yaml` as read-only `/app/config.yaml` inside the container. If the config file is stored elsewhere, set `CONFIG_FILE` to a path accessible from the running process or container.
317317

318+
Frontend branding is also runtime configuration. Set the `branding` section in `config.yaml`, then restart the application; rebuilding the frontend or Docker image is not required. See [Custom branding](docs/BRANDING.md).
319+
318320
Static configuration environment variables:
319321

320322
| Area | Environment variable | Purpose |

README.zh-CN.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ docker compose -f docker-compose.full.yml up -d
208208

209209
#### 配置、持久化和镜像
210210

211-
配置优先级是:`环境变量 > config.yaml > 代码内置默认值``config.yaml` 只负责静态基础设施和安全配置,例如服务地址、数据库、缓存、存储、GeoIP、Trace、JWT 和加密密钥。运行时业务配置存储在数据库中,并通过后台管理修改。
211+
配置优先级是:`环境变量 > config.yaml > 代码内置默认值``config.yaml` 负责品牌和静态基础设施、安全配置,例如品牌资源、服务地址、数据库、缓存、存储、GeoIP、Trace、JWT 和加密密钥。运行时业务配置存储在数据库中,并通过后台管理修改。
212212

213213
默认 compose 会持久化应用数据:
214214

@@ -311,10 +311,12 @@ docker compose logs app
311311

312312
> 完整配置说明:[配置说明](https://deeix.com/zh/docs/deeix-chat/configuration)
313313
314-
后端配置分为静态运行配置和运行时业务配置。静态运行配置用于描述服务启动所需的基础设施、安全和存储参数,由 `config.yaml` 与环境变量提供;运行时业务配置用于认证、会话、模型、文件、计费等产品能力,写入 `system_settings` 并通过后台管理维护。环境变量会覆盖配置文件中的同名项,适合容器化、分离部署和密钥注入场景。
314+
后端配置分为静态运行配置和运行时业务配置。静态运行配置用于描述品牌以及服务启动所需的基础设施、安全和存储参数,由 `config.yaml` 与环境变量提供;运行时业务配置用于认证、会话、模型、文件、计费等产品能力,写入 `system_settings` 并通过后台管理维护。环境变量会覆盖配置文件中的同名项,适合容器化、分离部署和密钥注入场景。
315315

316316
后端启动时会按运行目录解析默认配置文件:从仓库根目录启动读取 `config.yaml`,从 `backend/` 目录启动读取 `../config.yaml`。Docker 部署通常将宿主机 `./config.yaml` 只读挂载到容器内 `/app/config.yaml`;如果配置文件放在其他位置,请使用 `CONFIG_FILE` 指向实际运行环境可访问的路径。
317317

318+
前端品牌同样属于运行时配置。在 `config.yaml` 中设置 `branding` 后重启应用即可生效,无需重新构建前端或 Docker 镜像。详见[自定义品牌资源](docs/BRANDING.md)
319+
318320
静态配置环境变量:
319321

320322
| 所属域 | 环境变量 | 说明 |

backend/docs/docs.go

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6769,6 +6769,44 @@ const docTemplate = `{
67696769
}
67706770
}
67716771
},
6772+
"/branding": {
6773+
"get": {
6774+
"produces": [
6775+
"application/json"
6776+
],
6777+
"tags": [
6778+
"settings"
6779+
],
6780+
"summary": "查询公开品牌配置",
6781+
"responses": {
6782+
"200": {
6783+
"description": "OK",
6784+
"schema": {
6785+
"$ref": "#/definitions/internal_transport_http_settings.BrandingResponseDoc"
6786+
}
6787+
}
6788+
}
6789+
}
6790+
},
6791+
"/branding/manifest.webmanifest": {
6792+
"get": {
6793+
"produces": [
6794+
"application/manifest+json"
6795+
],
6796+
"tags": [
6797+
"settings"
6798+
],
6799+
"summary": "查询品牌 Web App Manifest",
6800+
"responses": {
6801+
"200": {
6802+
"description": "OK",
6803+
"schema": {
6804+
"$ref": "#/definitions/internal_transport_http_settings.BrandingManifestResponse"
6805+
}
6806+
}
6807+
}
6808+
}
6809+
},
67726810
"/context-artifacts/{id}": {
67736811
"get": {
67746812
"security": [
@@ -9944,6 +9982,16 @@ const docTemplate = `{
99449982
"name": "q",
99459983
"in": "query"
99469984
},
9985+
{
9986+
"type": "array",
9987+
"items": {
9988+
"type": "integer"
9989+
},
9990+
"collectionFormat": "multi",
9991+
"description": "按技能 ID 筛选,可重复传递",
9992+
"name": "id",
9993+
"in": "query"
9994+
},
99479995
{
99489996
"type": "integer",
99499997
"description": "页码",
@@ -9964,6 +10012,12 @@ const docTemplate = `{
996410012
"$ref": "#/definitions/internal_transport_http_skill.SkillSummaryPageResponseDoc"
996510013
}
996610014
},
10015+
"400": {
10016+
"description": "Bad Request",
10017+
"schema": {
10018+
"$ref": "#/definitions/internal_transport_http_skill.ErrorDoc"
10019+
}
10020+
},
996710021
"500": {
996810022
"description": "Internal Server Error",
996910023
"schema": {
@@ -16493,12 +16547,27 @@ const docTemplate = `{
1649316547
"createdAt": {
1649416548
"type": "string"
1649516549
},
16550+
"defaultMCPToolIDs": {
16551+
"type": "array",
16552+
"items": {
16553+
"type": "integer"
16554+
}
16555+
},
16556+
"defaultSkillIDs": {
16557+
"type": "array",
16558+
"items": {
16559+
"type": "integer"
16560+
}
16561+
},
1649616562
"description": {
1649716563
"type": "string"
1649816564
},
1649916565
"icon": {
1650016566
"type": "string"
1650116567
},
16568+
"mcpDefaultMode": {
16569+
"type": "string"
16570+
},
1650216571
"name": {
1650316572
"type": "string"
1650416573
},
@@ -16687,6 +16756,20 @@ const docTemplate = `{
1668716756
"type": "string",
1668816757
"maxLength": 32
1668916758
},
16759+
"defaultMCPToolIDs": {
16760+
"type": "array",
16761+
"maxItems": 128,
16762+
"items": {
16763+
"type": "integer"
16764+
}
16765+
},
16766+
"defaultSkillIDs": {
16767+
"type": "array",
16768+
"maxItems": 128,
16769+
"items": {
16770+
"type": "integer"
16771+
}
16772+
},
1669016773
"description": {
1669116774
"type": "string",
1669216775
"maxLength": 255
@@ -16695,6 +16778,13 @@ const docTemplate = `{
1669516778
"type": "string",
1669616779
"maxLength": 32
1669716780
},
16781+
"mcpDefaultMode": {
16782+
"type": "string",
16783+
"enum": [
16784+
"inherit",
16785+
"custom"
16786+
]
16787+
},
1669816788
"name": {
1669916789
"type": "string",
1670016790
"maxLength": 80
@@ -17755,6 +17845,20 @@ const docTemplate = `{
1775517845
"type": "string",
1775617846
"maxLength": 32
1775717847
},
17848+
"defaultMCPToolIDs": {
17849+
"type": "array",
17850+
"maxItems": 128,
17851+
"items": {
17852+
"type": "integer"
17853+
}
17854+
},
17855+
"defaultSkillIDs": {
17856+
"type": "array",
17857+
"maxItems": 128,
17858+
"items": {
17859+
"type": "integer"
17860+
}
17861+
},
1775817862
"description": {
1775917863
"type": "string",
1776017864
"maxLength": 255
@@ -17763,6 +17867,13 @@ const docTemplate = `{
1776317867
"type": "string",
1776417868
"maxLength": 32
1776517869
},
17870+
"mcpDefaultMode": {
17871+
"type": "string",
17872+
"enum": [
17873+
"inherit",
17874+
"custom"
17875+
]
17876+
},
1776617877
"name": {
1776717878
"type": "string",
1776817879
"maxLength": 80
@@ -18085,6 +18196,116 @@ const docTemplate = `{
1808518196
}
1808618197
}
1808718198
},
18199+
"internal_transport_http_settings.BrandingManifestIcon": {
18200+
"type": "object",
18201+
"properties": {
18202+
"purpose": {
18203+
"type": "string"
18204+
},
18205+
"sizes": {
18206+
"type": "string"
18207+
},
18208+
"src": {
18209+
"type": "string"
18210+
},
18211+
"type": {
18212+
"type": "string"
18213+
}
18214+
}
18215+
},
18216+
"internal_transport_http_settings.BrandingManifestResponse": {
18217+
"type": "object",
18218+
"properties": {
18219+
"background_color": {
18220+
"type": "string"
18221+
},
18222+
"categories": {
18223+
"type": "array",
18224+
"items": {
18225+
"type": "string"
18226+
}
18227+
},
18228+
"description": {
18229+
"type": "string"
18230+
},
18231+
"display": {
18232+
"type": "string"
18233+
},
18234+
"icons": {
18235+
"type": "array",
18236+
"items": {
18237+
"$ref": "#/definitions/internal_transport_http_settings.BrandingManifestIcon"
18238+
}
18239+
},
18240+
"id": {
18241+
"type": "string"
18242+
},
18243+
"lang": {
18244+
"type": "string"
18245+
},
18246+
"name": {
18247+
"type": "string"
18248+
},
18249+
"orientation": {
18250+
"type": "string"
18251+
},
18252+
"scope": {
18253+
"type": "string"
18254+
},
18255+
"short_name": {
18256+
"type": "string"
18257+
},
18258+
"start_url": {
18259+
"type": "string"
18260+
},
18261+
"theme_color": {
18262+
"type": "string"
18263+
}
18264+
}
18265+
},
18266+
"internal_transport_http_settings.BrandingResponse": {
18267+
"type": "object",
18268+
"properties": {
18269+
"appleTouchIcon180URL": {
18270+
"type": "string"
18271+
},
18272+
"description": {
18273+
"type": "string"
18274+
},
18275+
"faviconURL": {
18276+
"type": "string"
18277+
},
18278+
"logoURL": {
18279+
"type": "string"
18280+
},
18281+
"pwaIcon192URL": {
18282+
"type": "string"
18283+
},
18284+
"pwaIcon512URL": {
18285+
"type": "string"
18286+
},
18287+
"pwaMaskableIcon512URL": {
18288+
"type": "string"
18289+
},
18290+
"shortName": {
18291+
"type": "string"
18292+
},
18293+
"title": {
18294+
"type": "string"
18295+
}
18296+
}
18297+
},
18298+
"internal_transport_http_settings.BrandingResponseDoc": {
18299+
"type": "object",
18300+
"properties": {
18301+
"data": {
18302+
"$ref": "#/definitions/internal_transport_http_settings.BrandingResponse"
18303+
},
18304+
"errorMsg": {
18305+
"type": "string"
18306+
}
18307+
}
18308+
},
1808818309
"internal_transport_http_settings.PatchItem": {
1808918310
"type": "object",
1809018311
"required": [

0 commit comments

Comments
 (0)