diff --git a/en/deploy/settings.mdx b/en/deploy/settings.mdx index 9334ba27b..0da9bb7c1 100644 --- a/en/deploy/settings.mdx +++ b/en/deploy/settings.mdx @@ -2,171 +2,145 @@ title: "System Environment Settings" --- -Configure some environment information for system operation, located in the `data/config.yaml` file. +Configure system runtime settings in `data/config.yaml`. Generally, no modification is needed. ```yaml -# Administrator session list, only valid when processing commands -# Format is session ID (person_xxxx or group_xxxx) -# Session ID can be found in the console logs when sending messages -# For example: -# admins: -# - person_1234567890 -# - group_1234567890 admins: [] - -# API port api: port: 5300 - # LangBot centrally manages all bot addresses that require Webhook listening - # This is the Webhook address prefix displayed on the bot page that requires Webhook connection - # You can modify it according to your network environment webhook_prefix: 'http://127.0.0.1:5300' - -# Command configuration + extra_webhook_prefix: '' command: - # Command prefixes, messages with these prefixes will be recognized as commands + enable: true prefix: - '!' - ! - - # Command permission configuration, key is the command prefix, value is the permission type privilege: {} - -# Concurrency settings concurrency: - # Single pipeline concurrency pipeline: 20 - # Single session concurrency session: 1 - -# Database configuration +proxy: + http: '' + https: '' +system: + instance_id: '' + edition: community + recovery_key: '' + allow_modify_login_info: true + disabled_adapters: [] + limitation: + max_bots: -1 + max_pipelines: -1 + max_extensions: -1 + task_retention: + # Keep at most this many completed async task records in memory + completed_limit: 200 + jwt: + expire: 604800 + secret: '' database: - # The database to use - # Supported databases: - # - sqlite (local SQLite database, default) - # - postgresql (PostgreSQL database, please configure below) use: sqlite - # SQLite configuration sqlite: path: 'data/langbot.db' - # PostgreSQL configuration postgresql: host: '127.0.0.1' port: 5432 - database: 'postgres' user: 'postgres' password: 'postgres' - -# Plugin system configuration -plugin: - # Whether to enable the plugin system - enable: true - # Plugin runtime WebSocket address - # Default value for Docker environment - # If you want to use a standalone Plugin Runtime, please refer to https://docs.langbot.app/en/develop/plugin-runtime.html - runtime_ws_url: 'ws://langbot_plugin_runtime:5400/control/ws' - # Whether to enable the plugin marketplace - enable_marketplace: true - # Plugin marketplace URL - cloud_service_url: 'https://space.langbot.app' - -# Proxy configuration -proxy: - # HTTP proxy address - # If proxy is already set in environment variables, no configuration is needed - # For example: - # proxy: - # http: 'http://127.0.0.1:7890' - # https: 'http://127.0.0.1:7890' - http: '' - https: '' - -# Object storage configuration -storage: - # The object storage to use - # Supported object storage: - # - local (local storage, default) - # - s3 (S3 protocol object storage, supports R2, MinIO, etc. Please configure below) - use: local - # S3 configuration - s3: - endpoint_url: '' - access_key_id: '' - secret_access_key: '' - region: 'us-east-1' - bucket: 'langbot-storage' - -# System configuration -system: - # JWT configuration - jwt: - # JWT expiration time in seconds - expire: 604800 - # JWT secret key, a key will be automatically generated on first startup - secret: 'xxxx' - # Whether to allow changing the password - allow_change_password: true - # Recovery password key - recovery_key: 'xxxx' - -# Vector database configuration + database: 'postgres' vdb: - # The vector database to use - # Supported vector databases: - # - chroma (default, embedded vector database) - # - qdrant (external vector database, please configure below) - # - milvus (scalable vector database, please configure below) - # - pgvector (PostgreSQL extension, please configure below) - # - seekdb (Built-in embedded-model database, please configure below) use: chroma - # Qdrant configuration qdrant: - # Qdrant URL url: '' - # Qdrant Host host: localhost - # Qdrant Port port: 6333 - # Qdrant API Key api_key: '' - # Milvus configuration + seekdb: + mode: embedded # 'embedded' or 'server' + # Embedded mode options: + path: './data/seekdb' + database: 'langbot' + # Server mode options (used when mode='server'): + host: 'localhost' + port: 2881 + user: 'root' + password: '' + tenant: '' # Optional, for OceanBase server milvus: uri: 'http://127.0.0.1:19530' token: '' - # pgvector configuration + db_name: '' pgvector: host: '127.0.0.1' port: 5433 database: 'langbot' user: 'postgres' password: 'postgres' - seekdb: - # 'embedded' or 'server' - mode: embedded - # Embedded mode options: - path: './data/seekdb' - database: 'langbot' - # Server mode options (used when mode='server'): - host: 'localhost' - port: 2881 - user: 'root' - password: '' - # Optional, for OceanBase server - tenant: '' +storage: + use: local + cleanup: + # Enable periodic cleanup of local/S3 uploaded files and old log files + enabled: true + # Cleanup check interval in hours + check_interval_hours: 1 + # Root-level uploaded files older than this will be deleted + uploaded_file_retention_days: 7 + # LangBot log files older than this many days will be deleted + log_retention_days: 3 + s3: + endpoint_url: '' + access_key_id: '' + secret_access_key: '' + region: 'us-east-1' + bucket: 'langbot-storage' +plugin: + enable: true + runtime_ws_url: 'ws://langbot_plugin_runtime:5400/control/ws' + enable_marketplace: true + display_plugin_debug_url: 'ws://localhost:5401/plugin/debug/ws' + binary_storage: + # Max bytes for a single plugin binary storage value + max_value_bytes: 10485760 +monitoring: + auto_cleanup: + # Enable automatic cleanup of expired monitoring records + enabled: true + # Retention period in days, records older than this will be deleted + retention_days: 30 + # Cleanup check interval in hours + check_interval_hours: 1 + # Number of expired rows to delete per table batch + delete_batch_size: 1000 +space: + # Space service URL for OAuth and API + url: 'https://space.langbot.app' + # Space API URL for model requests (MaaS) + models_gateway_api_url: 'https://api.langbot.cloud/v1' + # OAuth authorization page URL + oauth_authorize_url: 'https://space.langbot.app/auth/authorize' + disable_models_service: false + disable_telemetry: false ``` -## Set configuration via environment variables +## Notes -The configuration in `config.yaml` can be set via environment variables. The environment variable name is uppercase letters, using double underscores to connect, for example: `API__PORT` represents `api.port`. +- `storage.cleanup.uploaded_file_retention_days` only cleans temporary uploaded files at the storage root. It does not delete plugin configuration files or internal objects stored under directories. +- `storage.cleanup.log_retention_days` cleans old log files by the date in their file names. The default keeps at most 3 days of logs. +- When SQLite is used as the database, automatic monitoring cleanup directly releases database file space after deleting expired records. +- `plugin.binary_storage.max_value_bytes` limits the size of a single plugin binary storage value. The default is 10 MiB. +- The WebUI sidebar includes a “Storage Analysis” page for viewing database, logs, uploaded files, vector store, plugins, MCP, temporary files, and cleanup candidates. + +## Set Configuration Via Environment Variables + +The configuration in `config.yaml` can be set via environment variables. Environment variable names use uppercase letters and double underscores, for example: `API__PORT` represents `api.port`. - `API__PORT` represents `api.port` - `CONCURRENCY__PIPELINE` represents `concurrency.pipeline` -- `CONCURRENCY__SESSION` represents `concurrency.session` -- `DATABASE__POSTGRESQL__DATABASE` represents `database.postgresql.database` -- `DATABASE__POSTGRESQL__HOST` represents `database.postgresql.host` - `DATABASE__SQLITE__PATH` represents `database.sqlite.path` +- `STORAGE__CLEANUP__UPLOADED_FILE_RETENTION_DAYS` represents `storage.cleanup.uploaded_file_retention_days` +- `STORAGE__CLEANUP__LOG_RETENTION_DAYS` represents `storage.cleanup.log_retention_days` +- `MONITORING__AUTO_CLEANUP__RETENTION_DAYS` represents `monitoring.auto_cleanup.retention_days` +- `PLUGIN__BINARY_STORAGE__MAX_VALUE_BYTES` represents `plugin.binary_storage.max_value_bytes` -... - -When starting, LangBot will read all environment variables and apply the corresponding configuration to `config.yaml` and write to the `data/config.yaml` file. +On startup, LangBot reads all environment variables, applies the corresponding configuration to `config.yaml`, and writes it to `data/config.yaml`. diff --git a/ja/deploy/settings.mdx b/ja/deploy/settings.mdx index 3c727b56f..54a81506f 100644 --- a/ja/deploy/settings.mdx +++ b/ja/deploy/settings.mdx @@ -2,171 +2,145 @@ title: "システム環境設定" --- -システム動作のための環境情報を設定します。`data/config.yaml`ファイルに配置されています。 +システム動作のための環境情報を設定します。設定ファイルは `data/config.yaml` にあります。 通常、変更は必要ありません。 ```yaml -# 管理者セッションリスト、コマンド処理時のみ有効 -# 形式はセッションID(person_xxxxまたはgroup_xxxx) -# セッションIDはメッセージ送信時のコンソールログで確認できます -# 例: -# admins: -# - person_1234567890 -# - group_1234567890 admins: [] - -# APIポート api: port: 5300 - # LangBotはWebhookリスニングを必要とするすべてのボットアドレスを一元管理します - # これはWebhook接続を必要とするボットページに表示されるWebhookアドレスプレフィックスです - # ネットワーク環境に応じて変更できます webhook_prefix: 'http://127.0.0.1:5300' - -# コマンド設定 + extra_webhook_prefix: '' command: - # コマンドプレフィックス、これらのプレフィックスを持つメッセージはコマンドとして認識されます + enable: true prefix: - '!' - ! - - # コマンド権限設定、キーはコマンドプレフィックス、値は権限タイプ privilege: {} - -# 同時実行設定 concurrency: - # 単一パイプライン同時実行 pipeline: 20 - # 単一セッション同時実行 session: 1 - -# データベース設定 +proxy: + http: '' + https: '' +system: + instance_id: '' + edition: community + recovery_key: '' + allow_modify_login_info: true + disabled_adapters: [] + limitation: + max_bots: -1 + max_pipelines: -1 + max_extensions: -1 + task_retention: + # メモリ内に保持する完了済み非同期タスク履歴の最大数 + completed_limit: 200 + jwt: + expire: 604800 + secret: '' database: - # 使用するデータベース - # サポートされているデータベース: - # - sqlite (ローカルSQLiteデータベース、デフォルト) - # - postgresql (PostgreSQLデータベース、以下で設定してください) use: sqlite - # SQLite設定 sqlite: path: 'data/langbot.db' - # PostgreSQL設定 postgresql: host: '127.0.0.1' port: 5432 - database: 'postgres' user: 'postgres' password: 'postgres' - -# プラグインシステム設定 -plugin: - # プラグインシステムを有効にするか - enable: true - # プラグインランタイムWebSocketアドレス - # Docker環境のデフォルト値 - # スタンドアロンのPlugin Runtimeを使用する場合は、https://docs.langbot.app/en/develop/plugin-runtime.htmlを参照してください - runtime_ws_url: 'ws://langbot_plugin_runtime:5400/control/ws' - # プラグインマーケットプレイスを有効にするか - enable_marketplace: true - # プラグインマーケットプレイスURL - cloud_service_url: 'https://space.langbot.app' - -# プロキシ設定 -proxy: - # HTTPプロキシアドレス - # プロキシが既に環境変数に設定されている場合、設定は不要です - # 例: - # proxy: - # http: 'http://127.0.0.1:7890' - # https: 'http://127.0.0.1:7890' - http: '' - https: '' - -# オブジェクトストレージ設定 -storage: - # 使用するオブジェクトストレージ - # サポートされているオブジェクトストレージ: - # - local (ローカルストレージ、デフォルト) - # - s3 (S3プロトコルオブジェクトストレージ、R2、MinIOなどをサポート。以下で設定してください) - use: local - # S3設定 - s3: - endpoint_url: '' - access_key_id: '' - secret_access_key: '' - region: 'us-east-1' - bucket: 'langbot-storage' - -# システム設定 -system: - # JWT設定 - jwt: - # JWT有効期限(秒) - expire: 604800 - # JWTシークレットキー、最初の起動時に自動生成されます - secret: 'xxxx' - # パスワード変更を許可するか - allow_change_password: true - # 復旧キー - recovery_key: 'xxxx' - -# ベクトルデータベース設定 + database: 'postgres' vdb: - # 使用するベクトルデータベース - # サポートされているベクトルデータベース: - # - chroma (デフォルト、組み込みベクトルデータベース) - # - qdrant (外部ベクトルデータベース、以下で設定してください) - # - milvus (スケーラブルベクトルデータベース、以下で設定してください) - # - pgvector (PostgreSQL拡張、以下で設定してください) - # - seekdb (組み込み埋め込みモデルを提供するデータベース、以下で設定してください) use: chroma - # Qdrant設定 qdrant: - # Qdrant URL url: '' - # Qdrant Host host: localhost - # Qdrant Port port: 6333 - # Qdrant API Key api_key: '' - # Milvus設定 + seekdb: + mode: embedded # 'embedded' または 'server' + # 組み込みモード設定: + path: './data/seekdb' + database: 'langbot' + # サーバーモード設定(mode='server' の場合): + host: 'localhost' + port: 2881 + user: 'root' + password: '' + tenant: '' # OceanBase サーバー向けの任意項目 milvus: uri: 'http://127.0.0.1:19530' token: '' - # pgvector設定 + db_name: '' pgvector: host: '127.0.0.1' port: 5433 database: 'langbot' user: 'postgres' password: 'postgres' - seekdb: - # 動作モード('embedded' または 'server') - mode: embedded - # 組み込みモード設定: - path: './data/seekdb' - database: 'langbot' - # サーバーモード設定(mode='server'の場合に有効): - host: 'localhost' - port: 2881 - user: 'root' - password: '' - # OceanBaseマルチテナントシナリオ用、オプション - tenant: '' +storage: + use: local + cleanup: + # ローカル/S3 のアップロードファイルと古いログを定期的に削除するか + enabled: true + # クリーンアップ確認間隔(時間) + check_interval_hours: 1 + # ストレージルート直下のアップロードファイルを保持する日数 + uploaded_file_retention_days: 7 + # LangBot ログファイルを保持する日数 + log_retention_days: 3 + s3: + endpoint_url: '' + access_key_id: '' + secret_access_key: '' + region: 'us-east-1' + bucket: 'langbot-storage' +plugin: + enable: true + runtime_ws_url: 'ws://langbot_plugin_runtime:5400/control/ws' + enable_marketplace: true + display_plugin_debug_url: 'ws://localhost:5401/plugin/debug/ws' + binary_storage: + # 1 つのプラグインバイナリストレージ値の最大バイト数 + max_value_bytes: 10485760 +monitoring: + auto_cleanup: + # 期限切れの監視レコードを自動削除するか + enabled: true + # 監視レコードの保持日数 + retention_days: 30 + # クリーンアップ確認間隔(時間) + check_interval_hours: 1 + # 各監視テーブルで 1 回に削除する期限切れ行数 + delete_batch_size: 1000 +space: + # Space サービス URL + url: 'https://space.langbot.app' + # Space モデルリクエスト API URL(MaaS) + models_gateway_api_url: 'https://api.langbot.cloud/v1' + # OAuth 認可ページ URL + oauth_authorize_url: 'https://space.langbot.app/auth/authorize' + disable_models_service: false + disable_telemetry: false ``` +## 補足 + +- `storage.cleanup.uploaded_file_retention_days` はストレージルート直下の一時アップロードファイルのみを削除します。プラグイン設定ファイルやディレクトリ配下の内部オブジェクトは削除しません。 +- `storage.cleanup.log_retention_days` はファイル名の日付に基づいて古いログを削除します。デフォルトでは最大 3 日分のログを保持します。 +- SQLite をデータベースとして使用している場合、監視レコードの自動削除後にデータベースファイルの空き容量を直接解放します。 +- `plugin.binary_storage.max_value_bytes` は 1 つのプラグインバイナリストレージ値のサイズを制限します。デフォルトは 10 MiB です。 +- WebUI のサイドバーには「ストレージ分析」ページがあり、データベース、ログ、アップロードファイル、ベクターストア、プラグイン、MCP、一時ファイル、クリーンアップ候補を確認できます。 + ## 環境変数による設定 -`config.yaml`の設定は環境変数を介して設定できます。環境変数名は大文字で、二重アンダースコアで接続されます。例: `API__PORT`は`api.port`を表します。 +`config.yaml` の設定は環境変数を介して設定できます。環境変数名は大文字で、二重アンダースコアで接続されます。例: `API__PORT` は `api.port` を表します。 -- `API__PORT`は`api.port`を表します -- `CONCURRENCY__PIPELINE`は`concurrency.pipeline`を表します -- `CONCURRENCY__SESSION`は`concurrency.session`を表します -- `DATABASE__POSTGRESQL__DATABASE`は`database.postgresql.database`を表します -- `DATABASE__POSTGRESQL__HOST`は`database.postgresql.host`を表します -- `DATABASE__SQLITE__PATH`は`database.sqlite.path`を表します +- `API__PORT` は `api.port` を表します +- `CONCURRENCY__PIPELINE` は `concurrency.pipeline` を表します +- `DATABASE__SQLITE__PATH` は `database.sqlite.path` を表します +- `STORAGE__CLEANUP__UPLOADED_FILE_RETENTION_DAYS` は `storage.cleanup.uploaded_file_retention_days` を表します +- `STORAGE__CLEANUP__LOG_RETENTION_DAYS` は `storage.cleanup.log_retention_days` を表します +- `MONITORING__AUTO_CLEANUP__RETENTION_DAYS` は `monitoring.auto_cleanup.retention_days` を表します +- `PLUGIN__BINARY_STORAGE__MAX_VALUE_BYTES` は `plugin.binary_storage.max_value_bytes` を表します -... - -起動時、LangBotはすべての環境変数を読み取り、対応する設定を`config.yaml`に適用して`data/config.yaml`ファイルに書き込みます。 +起動時、LangBot はすべての環境変数を読み取り、対応する設定を `config.yaml` に適用して `data/config.yaml` ファイルに書き込みます。 diff --git a/zh/deploy/settings.mdx b/zh/deploy/settings.mdx index a44d9bf46..be5c92927 100644 --- a/zh/deploy/settings.mdx +++ b/zh/deploy/settings.mdx @@ -2,50 +2,44 @@ title: "系统环境设置" --- -配置系统运行的一些环境信息,文件位于`data/config.yaml`。 +配置系统运行的一些环境信息,文件位于 `data/config.yaml`。 一般不需要修改。 ```yaml -# 管理员会话列表,仅在处理命令时有效 -# 格式为会话ID(person_xxxx 或 group_xxxx) -# 会话ID 可以在发送消息时查看控制台日志找到 -# 例如: -# admins: -# - person_1234567890 -# - group_1234567890 admins: [] - -# API 端口 api: port: 5300 - # LangBot 统一管理所有需要 Webhook 监听的机器人地址 - # 这是显示在需要 Webhook 连接的机器人页面上的 Webhook地址前缀 - # 您可以根据自身网络环境修改 webhook_prefix: 'http://127.0.0.1:5300' - -# 命令配置 + extra_webhook_prefix: '' command: - # 命令前缀,具有这些前缀的消息会被识别为命令 + enable: true prefix: - '!' - ! - - # 命令权限配置,key 为命令前缀,value 为权限类型 privilege: {} - -# 并发设置 concurrency: - # 单流水线并发数 pipeline: 20 - # 单会话并发数 session: 1 - -# 数据库配置 +proxy: + http: '' + https: '' +system: + instance_id: '' + edition: community + recovery_key: '' + allow_modify_login_info: true + disabled_adapters: [] + limitation: + max_bots: -1 + max_pipelines: -1 + max_extensions: -1 + task_retention: + # 内存中最多保留的已完成异步任务记录数量 + completed_limit: 200 + jwt: + expire: 604800 + secret: '' database: - # 所使用的数据库 - # 支持的数据库: - # - sqlite(本地 SQLite 数据库,默认) - # - postgresql(PostgreSQL 数据库,请在下方配置) use: sqlite sqlite: path: 'data/langbot.db' @@ -55,110 +49,98 @@ database: user: 'postgres' password: 'postgres' database: 'postgres' - -# 插件系统配置 -plugin: - # 是否启用插件系统 - enable: true - # 插件运行时 WebSocket 地址 - # 默认为 Docker 环境下的默认值 - # 若要使用独立的 Plugin Runtime,请参考 https://docs.langbot.app/zh/develop/plugin-runtime.html - runtime_ws_url: 'ws://langbot_plugin_runtime:5400/control/ws' - # 是否启用插件市场 - enable_marketplace: true - # 插件市场 URL - cloud_service_url: 'https://space.langbot.app' - -# 代理配置 -proxy: - # HTTP 代理地址 - # 如果已经在环境变量设置了代理,则不需要配置 - # 例如: - # proxy: - # http: 'http://127.0.0.1:7890' - # https: 'http://127.0.0.1:7890' - http: '' - https: '' - -# 对象存储配置 -storage: - # 所使用的对象存储 - # 支持的对象存储: - # - local(本地存储,默认) - # - s3(S3 协议对象存储,支持 R2、MinIO 等兼容 S3 协议的对象存储服务,请在下方配置) - use: local - # S3 配置 - s3: - endpoint_url: '' - access_key_id: '' - secret_access_key: '' - region: 'us-east-1' - bucket: 'langbot-storage' - -# 系统配置 -system: - # JWT 配置 - jwt: - # JWT 过期时间,单位为秒 - expire: 604800 - # JWT 密钥,首次启动时会自动生成一个密钥 - secret: 'xxxx' - # 是否允许修改密码 - allow_change_password: true - # 恢复密钥 - recovery_key: 'xxxx' - -# 向量数据库配置 vdb: - # 所使用的向量数据库 - # 支持的向量数据库: - # - chroma(默认,嵌入式向量数据库) - # - qdrant(外部向量数据库,请在下方配置) - # - milvus(可扩展的向量数据库,请在下方配置) - # - pgvector(PostgreSQL 扩展,请在下方配置) - # - seekdb(提供内置嵌入模型的数据库,请在下方配置) use: chroma - # Qdrant 配置 qdrant: url: '' host: localhost port: 6333 api_key: '' + seekdb: + mode: embedded # 'embedded' 或 'server' + # 嵌入式模式配置: + path: './data/seekdb' + database: 'langbot' + # 服务器模式配置(mode='server' 时生效): + host: 'localhost' + port: 2881 + user: 'root' + password: '' + tenant: '' # 可选,用于 OceanBase 多租户场景 milvus: uri: 'http://127.0.0.1:19530' token: '' + db_name: '' pgvector: host: '127.0.0.1' port: 5433 database: 'langbot' user: 'postgres' password: 'postgres' - seekdb: - # 嵌入式模式('embedded' 或 'server') - mode: embedded - # 嵌入式模式配置: - path: './data/seekdb' - database: 'langbot' - # 服务器模式配置(当 mode='server' 时生效): - host: 'localhost' - port: 2881 - user: 'root' - password: '' - # 可选,用于 OceanBase 多租户场景 - tenant: '' +storage: + use: local + cleanup: + # 是否定期清理本地/S3 上传文件和旧日志文件 + enabled: true + # 清理检查间隔,单位为小时 + check_interval_hours: 1 + # 超过此天数的根目录上传文件会被删除 + uploaded_file_retention_days: 7 + # 最多保留此天数内的 LangBot 日志文件 + log_retention_days: 3 + s3: + endpoint_url: '' + access_key_id: '' + secret_access_key: '' + region: 'us-east-1' + bucket: 'langbot-storage' +plugin: + enable: true + runtime_ws_url: 'ws://langbot_plugin_runtime:5400/control/ws' + enable_marketplace: true + display_plugin_debug_url: 'ws://localhost:5401/plugin/debug/ws' + binary_storage: + # 单个插件二进制存储值的最大字节数 + max_value_bytes: 10485760 +monitoring: + auto_cleanup: + # 是否自动清理过期监控记录 + enabled: true + # 监控记录保留天数,超过此天数的记录会被删除 + retention_days: 30 + # 清理检查间隔,单位为小时 + check_interval_hours: 1 + # 每个监控表单批删除的过期记录数量 + delete_batch_size: 1000 +space: + # Space 服务 URL + url: 'https://space.langbot.app' + # Space 模型请求 API URL(MaaS) + models_gateway_api_url: 'https://api.langbot.cloud/v1' + # OAuth 授权页面 URL + oauth_authorize_url: 'https://space.langbot.app/auth/authorize' + disable_models_service: false + disable_telemetry: false ``` +## 配置说明 + +- `storage.cleanup.uploaded_file_retention_days` 只清理存储根目录下的临时上传文件,不会清理插件配置文件或带目录的内部对象。 +- `storage.cleanup.log_retention_days` 按日志文件名中的日期清理旧日志,默认最多保留 3 天。 +- SQLite 作为数据库时,监控记录自动清理后会直接释放数据库文件空间。 +- `plugin.binary_storage.max_value_bytes` 用于限制插件单个二进制存储值大小,默认 10 MiB。 +- WebUI 侧边栏的“存储分析”页面可查看数据库、日志、上传文件、向量库、插件、MCP、临时文件等空间占用和清理候选项。 + ## 通过环境变量设置 -config.yaml 中的配置可以通过环境变量进行设置。环境变量名称为大写字母,使用双下划线连接,例如:`API__PORT`代表`api.port`。 +`config.yaml` 中的配置可以通过环境变量进行设置。环境变量名称为大写字母,使用双下划线连接,例如:`API__PORT` 代表 `api.port`。 - `API__PORT` 代表 `api.port` - `CONCURRENCY__PIPELINE` 代表 `concurrency.pipeline` -- `CONCURRENCY__SESSION` 代表 `concurrency.session` -- `DATABASE__POSTGRESQL__DATABASE` 代表 `database.postgresql.database` -- `DATABASE__POSTGRESQL__HOST` 代表 `database.postgresql.host` - `DATABASE__SQLITE__PATH` 代表 `database.sqlite.path` +- `STORAGE__CLEANUP__UPLOADED_FILE_RETENTION_DAYS` 代表 `storage.cleanup.uploaded_file_retention_days` +- `STORAGE__CLEANUP__LOG_RETENTION_DAYS` 代表 `storage.cleanup.log_retention_days` +- `MONITORING__AUTO_CLEANUP__RETENTION_DAYS` 代表 `monitoring.auto_cleanup.retention_days` +- `PLUGIN__BINARY_STORAGE__MAX_VALUE_BYTES` 代表 `plugin.binary_storage.max_value_bytes` -... - -在启动时,LangBot 会读取所有环境变量,将对应的配置应用到 config.yaml 中并写入到 data/config.yaml 文件中。 +在启动时,LangBot 会读取所有环境变量,将对应的配置应用到 `config.yaml` 中并写入到 `data/config.yaml` 文件中。