JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix: 用户界面,报:配置错误
chen-hui-zhe-xibf9cd516996f
diff --git a/deploy/enterprise/global_vars.sh b/deploy/enterprise/global_vars.shindex c7af596299..57da000ff9 100755--- a/deploy/enterprise/global_vars.sh+++ b/deploy/enterprise/global_vars.sh@@ -109,10 +109,10 @@ declare -A DEPLOY_VARS=(["COLLECT_LOG_MASK_ENABLED"]="false"["DB_TYPE"]="sqlite"["DEPLOYMENT_MODE"]="standalone"- ["GATEWAY_HTTP_PORT"]="19001"- ["GATEWAY_WS_PORT"]="19000"- # Manager → Gateway 配置同步 HTTP(manager_config_receiver)+ ["WEB_PORT"]="19000"+ ["GATEWAY_PORT"]="19001"["GATEWAY_CONFIG_HTTP_PORT"]="8775"+ ["GATEWAY_WEB_HTTP_PORT"]="19002"["ENABLE_EXTERNAL_OBS"]="false"["ENABLE_EXTERNAL_NFS"]="false"["ENABLE_EXTERNAL_PVC"]="false"diff --git a/deploy/enterprise/runtime_handler.sh b/deploy/enterprise/runtime_handler.shindex f1b5896338..89b3d7a9a5 100755--- a/deploy/enterprise/runtime_handler.sh+++ b/deploy/enterprise/runtime_handler.sh@@ -24,7 +24,6 @@ deploy_runtime() {ensure_secret_configmapexec_cmd kubectl apply -f ${file}wait_k8s_resource_ready "deployment" "${name}" "${namespace}"- success "AGENT_RUNTIME_PORT: ${DEPLOY_VARS["AGENT_RUNTIME_PORT"]}"}uninstall_runtime() {diff --git a/deploy/enterprise/templates/gateway.template.env b/deploy/enterprise/templates/gateway.template.envindex b8c1b3fc75..e4d5ba4993 100644--- a/deploy/enterprise/templates/gateway.template.env+++ b/deploy/enterprise/templates/gateway.template.env@@ -95,9 +95,9 @@ GATEWAY_CLAW_WS_PING_TIMEOUT=<<GATEWAY_CLAW_WS_PING_TIMEOUT>># Websocket ConfigurationWEB_HOST=0.0.0.0-WEB_PORT=<<GATEWAY_WS_PORT>>+WEB_PORT=<<WEB_PORT>>GATEWAY_HOST=0.0.0.0-GATEWAY_PORT=<<GATEWAY_HTTP_PORT>>+GATEWAY_PORT=<<GATEWAY_PORT>># Enterprise Web: browser WS on app_enterprise_web; Gateway WS client to /gatewayENTERPRISE_WEB_ENABLED=true@@ -114,7 +114,6 @@ GATEWAY_DB_PORT=<<DB_PORT>>GATEWAY_DB_USER=<<GATEWAY_DB_USER>>GATEWAY_DB_NAME=<<GATEWAY_DB_NAME>>GATEWAY_PG_SCHEMA=<<GATEWAY_PG_SCHEMA>>-# SQLAlchemy pool: SDK reads RUNTIME_DB_*; values come from GATEWAY_DB_POOL_* in .env.customRUNTIME_DB_POOL_SIZE=<<GATEWAY_DB_POOL_SIZE>>RUNTIME_DB_MAX_OVERFLOW=<<GATEWAY_DB_MAX_OVERFLOW>>RUNTIME_DB_POOL_TIMEOUT=<<GATEWAY_DB_POOL_TIMEOUT>>@@ -123,9 +122,8 @@ RUNTIME_DB_POOL_TIMEOUT=<<GATEWAY_DB_POOL_TIMEOUT>>GATEWAY_CONFIG_RECEIVER_ENABLED=trueGATEWAY_CONFIG_HTTP_HOST=0.0.0.0GATEWAY_CONFIG_HTTP_PORT=<<GATEWAY_CONFIG_HTTP_PORT>>-# 集群内对外主机名(拼成 http://host:HTTP_PORT,写入 Manager gateway_endpoint)+GATEWAY_WEB_HTTP_PORT=<<GATEWAY_WEB_HTTP_PORT>>GATEWAY_CONFIG_PUBLIC_HOST=<<GATEWAY_NAME>>-# Gateway 出站调用 Manager RESTGATEWAY_MANAGER_HTTP_URL=http://<<MANAGER_SERVER_NAME>>:<<MANAGER_REST_PORT>>GATEWAY_CONFIG_HEARTBEAT_SECONDS=60GATEWAY_MANAGER_MAX_RECONNECT_ATTEMPTS=3diff --git a/deploy/enterprise/templates/gateway.template.yaml b/deploy/enterprise/templates/gateway.template.yamlindex a5a6d142c1..5d39d2fbee 100644--- a/deploy/enterprise/templates/gateway.template.yaml+++ b/deploy/enterprise/templates/gateway.template.yaml@@ -75,9 +75,11 @@ spec:# args: ["jiuwenswarm-gateway; echo '[debug-keepalive] gateway exited rc=$?, sleeping'; sleep infinity"]ports:- name: web-ws- containerPort: <<GATEWAY_WS_PORT>>- - name: http- containerPort: <<GATEWAY_HTTP_PORT>>+ containerPort: <<WEB_PORT>>+ - name: acp-ws+ containerPort: <<GATEWAY_PORT>>+ - name: web-http+ containerPort: <<GATEWAY_WEB_HTTP_PORT>>- name: config-httpcontainerPort: <<GATEWAY_CONFIG_HTTP_PORT>># active-standby:仅 PRIMARY Ready,保证 ClusterIP 流量打到主@@ -151,11 +153,14 @@ spec:app: <<GATEWAY_NAME>>ports:- name: web-ws- port: <<GATEWAY_WS_PORT>>- targetPort: <<GATEWAY_WS_PORT>>- - name: http- port: <<GATEWAY_HTTP_PORT>>- targetPort: <<GATEWAY_HTTP_PORT>>+ port: <<WEB_PORT>>+ targetPort: <<WEB_PORT>>+ - name: acp-ws+ port: <<GATEWAY_PORT>>+ targetPort: <<GATEWAY_PORT>>+ - name: web-http+ port: <<GATEWAY_WEB_HTTP_PORT>>+ targetPort: <<GATEWAY_WEB_HTTP_PORT>>- name: config-httpport: <<GATEWAY_CONFIG_HTTP_PORT>>targetPort: <<GATEWAY_CONFIG_HTTP_PORT>>diff --git a/deploy/enterprise/templates/manager-web.template.yaml b/deploy/enterprise/templates/manager-web.template.yamlindex 5f3b416b50..639c319dd3 100644--- a/deploy/enterprise/templates/manager-web.template.yaml+++ b/deploy/enterprise/templates/manager-web.template.yaml@@ -33,7 +33,7 @@ spec:- name: MANAGER_WEB_IDP_TARGETvalue: "http://<<IDENTITY_NAME>>:<<IDENTITY_REST_PORT>>"- name: MANAGER_WEB_GATEWAY_SSE- value: "http://<<GATEWAY_NAME>>:<<GATEWAY_HTTP_PORT>>/web/invoke"+ value: "http://<<GATEWAY_NAME>>:<<GATEWAY_PORT>>/web/invoke"- name: MANAGER_WEB_USER_SERVER_TARGETvalue: "http://<<WEB_NAME>>:<<WEB_WS_PORT>>"- name: TZdiff --git a/deploy/enterprise/templates/web.template.yaml b/deploy/enterprise/templates/web.template.yamlindex 20ac9367de..b9e24cf7c0 100644--- a/deploy/enterprise/templates/web.template.yaml+++ b/deploy/enterprise/templates/web.template.yaml@@ -40,6 +40,10 @@ spec:value: "0.0.0.0"- name: ENTERPRISE_WEB_WS_PORTvalue: "<<WEB_WS_PORT>>"+ - name: GATEWAY_URL+ value: "http://<<GATEWAY_NAME>>:<<WEB_PORT>>"+ - name: GATEWAY_WEB_HTTP_URL+ value: "http://<<GATEWAY_NAME>>:<<GATEWAY_WEB_HTTP_PORT>>"- name: WS_ORIGIN_CHECK_ENABLEDvalue: "<<WS_ORIGIN_CHECK_ENABLED>>"- name: WS_ALLOWED_ORIGINSdiff --git a/deploy/enterprise/tests/test_identity_user_web_deploy.sh b/deploy/enterprise/tests/test_identity_user_web_deploy.shdeleted file mode 100755index 836a271886..0000000000--- a/deploy/enterprise/tests/test_identity_user_web_deploy.sh+++ /dev/null@@ -1,141 +0,0 @@-#!/usr/bin/env bash-set -euo pipefail--SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"--source "${SCRIPT_DIR}/common.sh"-source "${SCRIPT_DIR}/global_vars.sh"-source "${SCRIPT_DIR}/cmd_handler.sh"-source "${SCRIPT_DIR}/envfile_handler.sh"-source "${SCRIPT_DIR}/template_handler.sh"-source "${SCRIPT_DIR}/check_handler.sh"-source "${SCRIPT_DIR}/web_handler.sh"-source "${SCRIPT_DIR}/manager_handler.sh"--TEST_DIR=""--cleanup() {- if [ -n "${TEST_DIR}" ] && [ -d "${TEST_DIR}" ]; then- rm -rf -- "${TEST_DIR}"- fi-}--assert_equal() {- local expected="$1"- local actual="$2"- local message="$3"- if [ "${actual}" != "${expected}" ]; then- echo "FAIL: ${message}: expected=${expected}, actual=${actual}" >&2- exit 1- fi-}--main() {- check_cmd "yq"-- TEST_DIR="$(mktemp -d)"- local test_dir="${TEST_DIR}"- trap cleanup EXIT-- DEPLOY_VARS["OS_TYPE"]="linux"- DEPLOY_VARS["MODE"]="product"- DEPLOY_VARS["WEB_NODE_PORT"]="31001"- DEPLOY_VARS["MANAGER_SERVER_NODE_PORT"]="31002"- DEPLOY_VARS["MANAGER_WEB_NODE_PORT"]="31003"-- assert_equal \- "false" \- "${DEPLOY_VARS["ENABLE_USER_WEB_EMBEDDING"]}" \- "User Web embedding must be disabled by default"- printf '%s\n' 'ENABLE_USER_WEB_EMBEDDING=true' > "${test_dir}/.env.custom"- read_env_from_file "${test_dir}/.env.custom" "DEPLOY_VARS"- assert_equal \- "true" \- "${DEPLOY_VARS["ENABLE_USER_WEB_EMBEDDING"]}" \- ".env.custom must override the embedding default"-- CONFIG["WEB_FILE"]="${test_dir}/web.yaml"-- DEPLOY_VARS["ENABLE_USER_WEB_EMBEDDING"]="false"- gen_web_file- assert_equal \- "NodePort" \- "$(yq eval-all 'select(.metadata.name == "jiuwenclaw-web-nodeport") | .spec.type' "${CONFIG["WEB_FILE"]}")" \- "standalone mode must expose the User Web NodePort"- assert_equal \- "0.0.0.0" \- "$(yq eval-all 'select(.kind == "Deployment").spec.template.spec.containers[0].env[] | select(.name == "FRONTEND_HOST").value' "${CONFIG["WEB_FILE"]}")" \- "User Web frontend must listen on all interfaces"-- DEPLOY_VARS["ENABLE_USER_WEB_EMBEDDING"]="true"- gen_web_file- assert_equal \- "0" \- "$(yq eval-all '[select(.metadata.name == "jiuwenclaw-web-nodeport")] | length' "${CONFIG["WEB_FILE"]}")" \- "embedded mode must remove the User Web NodePort"- assert_equal \- "ClusterIP" \- "$(yq eval-all 'select(.kind == "Service") | .spec.type' "${CONFIG["WEB_FILE"]}")" \- "embedded mode must retain the internal User Web service"-- DEPLOY_VARS["IS_UP_MANAGER_WEB"]="false"- if (check_user_web_embedding_config) >/dev/null 2>&1; then- echo "FAIL: embedded mode must require Manager Web" >&2- exit 1- fi-- DEPLOY_VARS["IS_UP_MANAGER_WEB"]="true"- check_user_web_embedding_config-- DEPLOY_VARS["ENABLE_USER_WEB_EMBEDDING"]="invalid"- if (check_user_web_embedding_config) >/dev/null 2>&1; then- echo "FAIL: invalid boolean value must be rejected" >&2- exit 1- fi-- CONFIG["MANAGER_SERVER_FILE"]="${test_dir}/manager-server.yaml"- render_config_template \- "${CONFIG["MANAGER_SERVER_TEMPLATE_FILE"]}" \- "${CONFIG["MANAGER_SERVER_FILE"]}" \- "DEPLOY_VARS"- assert_equal \- "http://jiuwenclaw-identity:8770/v1/auth/public_key" \- "$(yq eval 'select(.kind == "Deployment").spec.template.spec.containers[0].env[] | select(.name == "IDENTITY_PUBLIC_KEY_URL").value' "${CONFIG["MANAGER_SERVER_FILE"]}")" \- "Manager Server must receive the Identity public-key URL"-- CONFIG["MANAGER_WEB_FILE"]="${test_dir}/manager-web.yaml"- render_config_template \- "${CONFIG["MANAGER_WEB_TEMPLATE_FILE"]}" \- "${CONFIG["MANAGER_WEB_FILE"]}" \- "DEPLOY_VARS"- assert_equal \- "0" \- "$(yq eval-all '[select(.kind == "Deployment").spec.template.spec.containers[0].env[] | select(.name == "IDENTITY_PUBLIC_KEY_URL")] | length' "${CONFIG["MANAGER_WEB_FILE"]}")" \- "Manager Web must not receive the unused public-key URL"-- local deleted_service=""- ensure_secret_configmap() { :; }- exec_cmd() { :; }- wait_k8s_resource_ready() { :; }- success() { :; }- delete_k8s_resource() { deleted_service="$1/$2/$3"; }-- DEPLOY_VARS["ENABLE_USER_WEB_EMBEDDING"]="true"- deploy_web- assert_equal \- "service/jiuwenclaw-web-nodeport/default" \- "${deleted_service}" \- "embedded deployment must remove a stale User Web NodePort"-- deleted_service=""- DEPLOY_VARS["IS_UP_MANAGER_WEB"]="true"- deploy_manager- assert_equal \- "service/jiuwenclaw-web-nodeport/default" \- "${deleted_service}" \- "Manager deployment must also remove a stale User Web NodePort"-- echo "PASS: identity and User Web deployment checks"-}--main "$@"diff --git a/jiuwenswarm/channels/web/frontend/vite.config.ts b/jiuwenswarm/channels/web/frontend/vite.config.tsindex 60e21507ff..ab1ac2164a 100644--- a/jiuwenswarm/channels/web/frontend/vite.config.ts+++ b/jiuwenswarm/channels/web/frontend/vite.config.ts@@ -321,7 +321,7 @@ function resolveWebHttpPort(wsPort: number): number {const frontendPort = portFromEnv('FRONTEND_PORT', 5173)const webPort = portFromEnv('WEB_PORT', 19000)-const webTarget = `http://127.0.0.1:${webPort}`+const webTarget = process.env.GATEWAY_URL?.replace(/\/$/, '') || `http://127.0.0.1:${webPort}`const webHttpPort = resolveWebHttpPort(webPort)const webHttpTarget =process.env.GATEWAY_WEB_HTTP_URL?.replace(/\/$/, '') ||