2026-04-09 10:01:23 +08:00
|
|
|
server:
|
|
|
|
|
port: 8083
|
2026-05-27 22:05:02 +08:00
|
|
|
cors:
|
2026-06-01 09:52:22 +08:00
|
|
|
# Browser CORS allowlist. In production, replace this with the actual frontend or embedded-site domains, such as https://support.example.com.
|
|
|
|
|
# Leave it empty to reject cross-origin browser requests. Same-origin and non-browser calls are still supported.
|
2026-05-27 22:05:02 +08:00
|
|
|
allowedOrigins:
|
|
|
|
|
- http://127.0.0.1:8083
|
|
|
|
|
- http://localhost:8083
|
2026-04-09 10:01:23 +08:00
|
|
|
|
|
|
|
|
db:
|
2026-06-01 10:10:36 +08:00
|
|
|
# Database driver. Supported values: sqlite, mysql.
|
2026-04-09 10:01:23 +08:00
|
|
|
type: sqlite
|
2026-06-01 10:10:36 +08:00
|
|
|
# Database connection string.
|
|
|
|
|
# SQLite example: file:./data/app.db?_busy_timeout=5000
|
|
|
|
|
# MySQL example: user:password@tcp(127.0.0.1:3306)/cs_ai_agent_db?charset=utf8mb4&parseTime=True&multiStatements=true&loc=Local
|
|
|
|
|
# For MySQL, keep parseTime=True so datetime fields are scanned into Go time values correctly.
|
2026-04-09 10:01:23 +08:00
|
|
|
dsn: file:./data/app.db?_busy_timeout=5000
|
2026-06-01 10:10:36 +08:00
|
|
|
# Maximum number of idle connections kept in the pool. Values <= 0 use the database/sql default.
|
2026-04-09 10:01:23 +08:00
|
|
|
maxIdleConns: 5
|
2026-06-01 10:10:36 +08:00
|
|
|
# Maximum number of open connections. Values <= 0 mean no explicit limit.
|
2026-04-09 10:01:23 +08:00
|
|
|
maxOpenConns: 20
|
2026-06-01 10:10:36 +08:00
|
|
|
# Maximum time an idle connection may stay in the pool, in seconds. Values <= 0 leave it unset.
|
2026-04-09 10:01:23 +08:00
|
|
|
connMaxIdleTimeSeconds: 300
|
2026-06-01 10:10:36 +08:00
|
|
|
# Maximum lifetime of a connection, in seconds. Values <= 0 leave it unset.
|
2026-04-09 10:01:23 +08:00
|
|
|
connMaxLifetimeSeconds: 1800
|
|
|
|
|
|
|
|
|
|
logger:
|
|
|
|
|
level: info
|
|
|
|
|
format: text
|
|
|
|
|
addSource: false
|
|
|
|
|
|
|
|
|
|
auth:
|
2026-06-01 10:10:36 +08:00
|
|
|
# Login access token lifetime, in hours. Values <= 0 fall back to 12 hours.
|
|
|
|
|
# Applies to password login, OIDC login, and WeCom login sessions.
|
2026-04-30 17:42:24 +08:00
|
|
|
tokenTTLHours: 12
|
2026-06-01 10:10:36 +08:00
|
|
|
# Maximum failed password attempts allowed within the lock window.
|
|
|
|
|
# Values <= 0 disable credential lockout.
|
2026-04-09 10:01:23 +08:00
|
|
|
maxFailedAttempts: 5
|
2026-06-01 10:10:36 +08:00
|
|
|
# Failed-login lock window, in minutes. When maxFailedAttempts is reached within this window, login is temporarily blocked.
|
|
|
|
|
# Values <= 0 fall back to 15 minutes when lockout is enabled.
|
2026-04-09 10:01:23 +08:00
|
|
|
credentialLockMinute: 15
|
|
|
|
|
|
2026-04-28 19:56:27 +08:00
|
|
|
customerSession:
|
2026-06-01 09:52:22 +08:00
|
|
|
# Signing secret for customer service session tokens. Use a separate, high-entropy random string; do not reuse the channel userTokenSecret.
|
2026-04-28 19:56:27 +08:00
|
|
|
secret: ""
|
2026-06-01 09:52:22 +08:00
|
|
|
# Default lifetime for customer service session tokens, in minutes.
|
2026-04-28 19:56:27 +08:00
|
|
|
ttlMinutes: 120
|
2026-06-01 09:52:22 +08:00
|
|
|
# Automatically refresh the token when its remaining lifetime falls below this value, in minutes.
|
2026-04-28 19:56:27 +08:00
|
|
|
refreshThresholdMinutes: 30
|
|
|
|
|
|
2026-04-09 10:01:23 +08:00
|
|
|
storage:
|
2026-06-01 09:52:22 +08:00
|
|
|
# Default file storage provider used for uploads. Supported values: local, oss.
|
|
|
|
|
# Empty value is treated as local by the backend.
|
2026-04-09 10:01:23 +08:00
|
|
|
default: local
|
2026-06-01 09:52:22 +08:00
|
|
|
# Maximum size of a single uploaded file, in MB. Values <= 0 fall back to the backend default.
|
2026-04-09 10:01:23 +08:00
|
|
|
maxUploadSizeMB: 20
|
|
|
|
|
local:
|
2026-06-01 09:52:22 +08:00
|
|
|
# Files are written under this directory, relative to the process working directory unless an absolute path is used.
|
2026-04-09 10:01:23 +08:00
|
|
|
root: data/storage
|
2026-06-01 09:52:22 +08:00
|
|
|
# Public URL prefix used when returning local file URLs. The server must expose this path as static files.
|
|
|
|
|
# Example: storage key "images/a.png" becomes "/storage/images/a.png".
|
2026-04-09 10:01:23 +08:00
|
|
|
baseUrl: /storage
|
|
|
|
|
oss:
|
2026-06-01 09:52:22 +08:00
|
|
|
# Aliyun OSS endpoint. Both "oss-cn-hangzhou.aliyuncs.com" and "https://oss-cn-hangzhou.aliyuncs.com" are accepted.
|
2026-04-09 10:01:23 +08:00
|
|
|
endpoint: ""
|
2026-06-01 09:52:22 +08:00
|
|
|
# OSS bucket name.
|
2026-04-09 10:01:23 +08:00
|
|
|
bucket: ""
|
2026-06-01 09:52:22 +08:00
|
|
|
# OSS access credentials. Keep the secret out of committed environment-specific config.
|
2026-04-09 10:01:23 +08:00
|
|
|
accessKeyId: ""
|
|
|
|
|
accessKeySecret: ""
|
2026-06-01 09:52:22 +08:00
|
|
|
# Optional public CDN/custom domain prefix for object URLs, for example https://files.example.com.
|
|
|
|
|
# If empty, public buckets use the default bucket endpoint URL; private buckets use signed URLs.
|
2026-04-09 10:01:23 +08:00
|
|
|
baseUrl: ""
|
2026-06-01 09:52:22 +08:00
|
|
|
# Set to true for private buckets. Private buckets return temporary signed URLs for reads.
|
2026-04-09 10:01:23 +08:00
|
|
|
private: false
|
2026-06-01 09:52:22 +08:00
|
|
|
# Expiration for generated OSS signed GET URLs, in seconds. Values <= 0 fall back to 600.
|
2026-04-09 10:01:23 +08:00
|
|
|
signedUrlExpireSeconds: 600
|
|
|
|
|
|
|
|
|
|
vectorDB:
|
2026-06-07 17:32:29 +08:00
|
|
|
type: qdrant # qdrant, lancedb
|
|
|
|
|
qdrant:
|
|
|
|
|
host: 127.0.0.1
|
|
|
|
|
grpcPort: 6334
|
|
|
|
|
apiKey: ""
|
|
|
|
|
useTls: false
|
|
|
|
|
# LanceDB requires building the backend with -tags lancedb and LanceDB native libraries.
|
|
|
|
|
lancedb:
|
|
|
|
|
path: data/lancedb
|
2026-04-09 10:01:23 +08:00
|
|
|
|
|
|
|
|
mcp:
|
2026-06-01 10:10:36 +08:00
|
|
|
# Global switch for MCP tool integration.
|
|
|
|
|
# When false, MCP tool catalog, debug endpoints, and runtime tool calls are disabled.
|
2026-04-09 10:01:23 +08:00
|
|
|
enabled: true
|
2026-06-01 10:10:36 +08:00
|
|
|
# MCP server registry. Each map key is the serverCode used by toolCode values like "system/tool_name".
|
2026-04-09 10:01:23 +08:00
|
|
|
servers:
|
|
|
|
|
system:
|
2026-06-01 10:10:36 +08:00
|
|
|
# Whether this MCP server is available for catalog listing, debug calls, and agent runtime calls.
|
2026-04-09 10:01:23 +08:00
|
|
|
enabled: true
|
2026-06-01 10:10:36 +08:00
|
|
|
# Streamable HTTP MCP endpoint. The built-in system server is exposed by this backend at /api/mcp.
|
2026-04-09 10:01:23 +08:00
|
|
|
endpoint: "http://127.0.0.1:8083/api/mcp"
|
2026-06-01 10:10:36 +08:00
|
|
|
# Connection and request timeout in milliseconds. Values <= 0 fall back to 15000.
|
2026-04-09 10:01:23 +08:00
|
|
|
timeoutMs: 15000
|
2026-06-01 10:10:36 +08:00
|
|
|
# Extra HTTP headers sent to this MCP server on every request, for example Authorization or tenant headers.
|
2026-04-09 10:01:23 +08:00
|
|
|
headers: {}
|
|
|
|
|
|
2026-05-24 20:49:10 +08:00
|
|
|
oidc:
|
2026-06-01 09:52:22 +08:00
|
|
|
# Whether to enable OIDC login. This system acts as the OIDC client.
|
2026-05-24 20:49:10 +08:00
|
|
|
enabled: false
|
2026-06-01 09:52:22 +08:00
|
|
|
# OIDC provider issuer, for example https://idp.example.com/realms/demo.
|
2026-05-24 20:49:10 +08:00
|
|
|
issuer: ""
|
|
|
|
|
clientId: ""
|
|
|
|
|
clientSecret: ""
|
2026-06-01 09:52:22 +08:00
|
|
|
# Must exactly match the redirect_uri registered with the OIDC provider.
|
2026-05-24 20:49:10 +08:00
|
|
|
redirectUrl: "http://127.0.0.1:8083/api/auth/oidc_callback"
|
2026-06-01 09:52:22 +08:00
|
|
|
# Signing secret for the OIDC login state. If left empty, clientSecret is used as the fallback.
|
2026-05-24 20:49:10 +08:00
|
|
|
stateSecret: ""
|
|
|
|
|
scopes:
|
|
|
|
|
- openid
|
|
|
|
|
- profile
|
|
|
|
|
- email
|
|
|
|
|
|
2026-04-09 10:01:23 +08:00
|
|
|
wxWork:
|
2026-06-01 09:52:22 +08:00
|
|
|
# Whether to enable WeCom features.
|
|
|
|
|
# When set to false, the WeCom SDK is not initialized, and login, customer service callbacks, and app notifications are unavailable.
|
2026-04-09 10:01:23 +08:00
|
|
|
enabled: false
|
2026-06-01 09:52:22 +08:00
|
|
|
# WeCom corporate ID.
|
|
|
|
|
# Example: wwxxxxxxxxxxxxxxxx, from the WeCom admin console.
|
2026-04-09 10:01:23 +08:00
|
|
|
corpId:
|
2026-06-01 09:52:22 +08:00
|
|
|
# WeCom app secret.
|
|
|
|
|
# Used by the backend to obtain access tokens and user identities. Keep it confidential.
|
2026-04-09 10:01:23 +08:00
|
|
|
corpSecret: ""
|
2026-06-01 09:52:22 +08:00
|
|
|
# AgentID of the WeCom custom app.
|
|
|
|
|
# Used for web authorization when scope=snsapi_privateinfo.
|
2026-04-09 10:01:23 +08:00
|
|
|
agentId:
|
2026-06-01 09:52:22 +08:00
|
|
|
# WeCom web authorization callback URL.
|
|
|
|
|
# Must be a full URL pointing to the backend endpoint:
|
|
|
|
|
# Example: http://127.0.0.1:8083/api/auth/wxwork_callback
|
|
|
|
|
# In production, use an official domain that WeCom can access, and make sure the domain is configured in the WeCom admin console.
|
2026-04-09 10:01:23 +08:00
|
|
|
oauthRedirect: ""
|
2026-06-01 09:52:22 +08:00
|
|
|
# Signing secret for the WeCom login state.
|
|
|
|
|
# Used for tamper protection and replay protection. A separate random string is recommended.
|
|
|
|
|
# If left empty, the code falls back to corpSecret, but this is not recommended.
|
2026-04-09 10:01:23 +08:00
|
|
|
stateSecret: ""
|
2026-06-01 09:52:22 +08:00
|
|
|
# Private key for decrypting WeCom callbacks.
|
|
|
|
|
# Not used by the current login flow. Reserved for message callbacks and similar scenarios.
|
2026-04-09 10:01:23 +08:00
|
|
|
rsaPrivateKey: ""
|
2026-06-01 09:52:22 +08:00
|
|
|
# WeCom callback token.
|
|
|
|
|
# Not used by the current login flow. Reserved for message callbacks and similar scenarios.
|
2026-04-09 10:01:23 +08:00
|
|
|
token: ""
|
2026-06-01 09:52:22 +08:00
|
|
|
# WeCom message encryption/decryption EncodingAESKey.
|
|
|
|
|
# Not used by the current login flow. Reserved for message callbacks and similar scenarios.
|
2026-04-09 10:01:23 +08:00
|
|
|
encodingAESKey: ""
|
2026-04-19 18:11:34 +08:00
|
|
|
|
|
|
|
|
notify:
|
2026-06-01 09:52:22 +08:00
|
|
|
# Whether to enable WeCom app message notifications.
|
2026-04-19 18:11:34 +08:00
|
|
|
enabled: false
|
2026-06-01 09:52:22 +08:00
|
|
|
# Default list of system user IDs to receive notifications. If the target business user has a bound WeCom identity, that user is preferred.
|
|
|
|
|
# System user IDs are mapped to WeCom member IDs through identity bindings before messages are sent.
|
2026-04-19 18:11:34 +08:00
|
|
|
toUsers: []
|
2026-06-01 09:52:22 +08:00
|
|
|
# Whether to send confidential messages.
|
2026-04-19 18:11:34 +08:00
|
|
|
safe: false
|
2026-06-01 09:52:22 +08:00
|
|
|
# Whether to enable duplicate message checks.
|
2026-04-19 18:11:34 +08:00
|
|
|
enableDuplicateCheck: true
|
2026-06-01 09:52:22 +08:00
|
|
|
# Duplicate message check window, in seconds.
|
2026-04-19 18:11:34 +08:00
|
|
|
duplicateCheckInterval: 1800
|