Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,6 @@ ENV PATH=$PNPM_HOME:$PATH
ARG NEXT_PUBLIC_API_BASE_URL=""
ENV NEXT_PUBLIC_API_BASE_URL=${NEXT_PUBLIC_API_BASE_URL}

ARG NEXT_PUBLIC_LOGO_URL=""
ARG NEXT_PUBLIC_FAVICON_URL=""
ARG NEXT_PUBLIC_PWA_ICON_192_URL=""
ARG NEXT_PUBLIC_PWA_ICON_512_URL=""
ARG NEXT_PUBLIC_PWA_MASKABLE_ICON_512_URL=""
ARG NEXT_PUBLIC_APPLE_TOUCH_ICON_180_URL=""
ARG NEXT_PUBLIC_BRAND_TITLE=""
ARG NEXT_PUBLIC_BRAND_SHORT_NAME=""
ARG NEXT_PUBLIC_BRAND_DESCRIPTION=""

ENV NEXT_PUBLIC_LOGO_URL=${NEXT_PUBLIC_LOGO_URL}
ENV NEXT_PUBLIC_FAVICON_URL=${NEXT_PUBLIC_FAVICON_URL}
ENV NEXT_PUBLIC_PWA_ICON_192_URL=${NEXT_PUBLIC_PWA_ICON_192_URL}
ENV NEXT_PUBLIC_PWA_ICON_512_URL=${NEXT_PUBLIC_PWA_ICON_512_URL}
ENV NEXT_PUBLIC_PWA_MASKABLE_ICON_512_URL=${NEXT_PUBLIC_PWA_MASKABLE_ICON_512_URL}
ENV NEXT_PUBLIC_APPLE_TOUCH_ICON_180_URL=${NEXT_PUBLIC_APPLE_TOUCH_ICON_180_URL}
ENV NEXT_PUBLIC_BRAND_TITLE=${NEXT_PUBLIC_BRAND_TITLE}
ENV NEXT_PUBLIC_BRAND_SHORT_NAME=${NEXT_PUBLIC_BRAND_SHORT_NAME}
ENV NEXT_PUBLIC_BRAND_DESCRIPTION=${NEXT_PUBLIC_BRAND_DESCRIPTION}

COPY VERSION /src/VERSION
COPY scripts /src/scripts
COPY frontend/package.json frontend/pnpm-lock.yaml ./
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,12 @@ If a superadmin already exists, the service does not regenerate or print the ini

> Full configuration guide: [Configuration](https://deeix.com/docs/deeix-chat/configuration).

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.
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.

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.

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).

Static configuration environment variables:

| Area | Environment variable | Purpose |
Expand Down
6 changes: 4 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ docker compose -f docker-compose.full.yml up -d

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

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

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

Expand Down Expand Up @@ -311,10 +311,12 @@ docker compose logs app

> 完整配置说明:[配置说明](https://deeix.com/zh/docs/deeix-chat/configuration)。

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

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

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

静态配置环境变量:

| 所属域 | 环境变量 | 说明 |
Expand Down
148 changes: 148 additions & 0 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6625,6 +6625,44 @@ const docTemplate = `{
}
}
},
"/branding": {
"get": {
"produces": [
"application/json"
],
"tags": [
"settings"
],
"summary": "查询公开品牌配置",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/internal_transport_http_settings.BrandingResponseDoc"
}
}
}
}
},
"/branding/manifest.webmanifest": {
"get": {
"produces": [
"application/manifest+json"
],
"tags": [
"settings"
],
"summary": "查询品牌 Web App Manifest",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/internal_transport_http_settings.BrandingManifestResponse"
}
}
}
}
},
"/context-artifacts/{id}": {
"get": {
"security": [
Expand Down Expand Up @@ -17681,6 +17719,116 @@ const docTemplate = `{
}
}
},
"internal_transport_http_settings.BrandingManifestIcon": {
"type": "object",
"properties": {
"purpose": {
"type": "string"
},
"sizes": {
"type": "string"
},
"src": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"internal_transport_http_settings.BrandingManifestResponse": {
"type": "object",
"properties": {
"background_color": {
"type": "string"
},
"categories": {
"type": "array",
"items": {
"type": "string"
}
},
"description": {
"type": "string"
},
"display": {
"type": "string"
},
"icons": {
"type": "array",
"items": {
"$ref": "#/definitions/internal_transport_http_settings.BrandingManifestIcon"
}
},
"id": {
"type": "string"
},
"lang": {
"type": "string"
},
"name": {
"type": "string"
},
"orientation": {
"type": "string"
},
"scope": {
"type": "string"
},
"short_name": {
"type": "string"
},
"start_url": {
"type": "string"
},
"theme_color": {
"type": "string"
}
}
},
"internal_transport_http_settings.BrandingResponse": {
"type": "object",
"properties": {
"appleTouchIcon180URL": {
"type": "string"
},
"description": {
"type": "string"
},
"faviconURL": {
"type": "string"
},
"logoURL": {
"type": "string"
},
"pwaIcon192URL": {
"type": "string"
},
"pwaIcon512URL": {
"type": "string"
},
"pwaMaskableIcon512URL": {
"type": "string"
},
"shortName": {
"type": "string"
},
"title": {
"type": "string"
}
}
},
"internal_transport_http_settings.BrandingResponseDoc": {
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/internal_transport_http_settings.BrandingResponse"
},
"errorMsg": {
"type": "string"
}
}
},
"internal_transport_http_settings.PatchItem": {
"type": "object",
"required": [
Expand Down
148 changes: 148 additions & 0 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -6618,6 +6618,44 @@
}
}
},
"/branding": {
"get": {
"produces": [
"application/json"
],
"tags": [
"settings"
],
"summary": "查询公开品牌配置",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/internal_transport_http_settings.BrandingResponseDoc"
}
}
}
}
},
"/branding/manifest.webmanifest": {
"get": {
"produces": [
"application/manifest+json"
],
"tags": [
"settings"
],
"summary": "查询品牌 Web App Manifest",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/internal_transport_http_settings.BrandingManifestResponse"
}
}
}
}
},
"/context-artifacts/{id}": {
"get": {
"security": [
Expand Down Expand Up @@ -17674,6 +17712,116 @@
}
}
},
"internal_transport_http_settings.BrandingManifestIcon": {
"type": "object",
"properties": {
"purpose": {
"type": "string"
},
"sizes": {
"type": "string"
},
"src": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"internal_transport_http_settings.BrandingManifestResponse": {
"type": "object",
"properties": {
"background_color": {
"type": "string"
},
"categories": {
"type": "array",
"items": {
"type": "string"
}
},
"description": {
"type": "string"
},
"display": {
"type": "string"
},
"icons": {
"type": "array",
"items": {
"$ref": "#/definitions/internal_transport_http_settings.BrandingManifestIcon"
}
},
"id": {
"type": "string"
},
"lang": {
"type": "string"
},
"name": {
"type": "string"
},
"orientation": {
"type": "string"
},
"scope": {
"type": "string"
},
"short_name": {
"type": "string"
},
"start_url": {
"type": "string"
},
"theme_color": {
"type": "string"
}
}
},
"internal_transport_http_settings.BrandingResponse": {
"type": "object",
"properties": {
"appleTouchIcon180URL": {
"type": "string"
},
"description": {
"type": "string"
},
"faviconURL": {
"type": "string"
},
"logoURL": {
"type": "string"
},
"pwaIcon192URL": {
"type": "string"
},
"pwaIcon512URL": {
"type": "string"
},
"pwaMaskableIcon512URL": {
"type": "string"
},
"shortName": {
"type": "string"
},
"title": {
"type": "string"
}
}
},
"internal_transport_http_settings.BrandingResponseDoc": {
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/internal_transport_http_settings.BrandingResponse"
},
"errorMsg": {
"type": "string"
}
}
},
"internal_transport_http_settings.PatchItem": {
"type": "object",
"required": [
Expand Down
Loading
Loading