Fix Bedrock tool history and add upload limit config
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# 配置线上 nginx 上传体积限制。
|
||||
# 需要 sudo 权限;应用服务本身仍然用普通用户运行。
|
||||
|
||||
LIMIT="${CLAW_NGINX_CLIENT_MAX_BODY_SIZE:-300m}"
|
||||
CONF_PATH="${CLAW_NGINX_UPLOAD_CONF:-/etc/nginx/conf.d/zk-data-agent-upload.conf}"
|
||||
|
||||
if ! command -v nginx >/dev/null 2>&1; then
|
||||
echo "WARN 未发现 nginx,跳过上传限制配置。"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! command -v sudo >/dev/null 2>&1; then
|
||||
echo "ERROR 配置 nginx 需要 sudo。" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo tee "${CONF_PATH}" >/dev/null <<EOF
|
||||
# Managed by zk-data-agent.
|
||||
# 放开 Web 文件上传体积,避免大文件上传被 nginx 直接 413。
|
||||
client_max_body_size ${LIMIT};
|
||||
EOF
|
||||
|
||||
sudo nginx -t
|
||||
sudo systemctl reload nginx
|
||||
echo "已配置 nginx client_max_body_size=${LIMIT} (${CONF_PATH})"
|
||||
Reference in New Issue
Block a user