From a0412f91a97862f9945c4619168258a8d8aea8a1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 31 Aug 2026 03:15:28 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=9E=20Sync=202026-08-31=2003:15:28?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agentflow/Makefile | 6 +++--- agentflow/files/agentflow.init | 7 ++++--- luci-app-agentflow/Makefile | 2 +- luci-app-agentflow/luasrc/model/cbi/agentflow.lua | 11 +++++++++++ luci-app-agentflow/po/zh-cn/agentflow.po | 6 ++++++ 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/agentflow/Makefile b/agentflow/Makefile index 8cd1d229..b1081d99 100644 --- a/agentflow/Makefile +++ b/agentflow/Makefile @@ -15,7 +15,7 @@ AGENTFLOW_HASH_aarch64:=938b5feca2fc942eca13b0e8c9df9ea6e7d45c0b0adba0b61f6a3da5 PKG_NAME:=agentflow PKG_VERSION:=0.3.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 AGENTFLOW_DOWNLOAD:=agentflow-linux-$(AGENTFLOW_ARCH) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) @@ -62,8 +62,8 @@ define Build/Compile endef define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d $(1)/etc/uci-defaults $(1)/etc/config - $(INSTALL_BIN) $(PKG_BUILD_DIR)/agentflow $(1)/usr/bin/agentflow + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/uci-defaults $(1)/etc/config + $(INSTALL_BIN) $(PKG_BUILD_DIR)/agentflow $(1)/usr/sbin/agentflow $(INSTALL_BIN) ./files/agentflow.init $(1)/etc/init.d/agentflow $(INSTALL_BIN) ./files/agentflow.uci-default $(1)/etc/uci-defaults/09-agentflow $(INSTALL_CONF) ./files/agentflow.config $(1)/etc/config/agentflow diff --git a/agentflow/files/agentflow.init b/agentflow/files/agentflow.init index 76a7a8ac..879c07be 100644 --- a/agentflow/files/agentflow.init +++ b/agentflow/files/agentflow.init @@ -14,6 +14,7 @@ set_mise_env() { procd_set_param env \ "$@" \ MISE_INSTALLS_DIR="$data_dir/globalmise/mise-installs" \ + MISE_GLOBAL_CONFIG_FILE="$data_dir/globalmise/mise-config/config.toml" \ MISE_DATA_DIR="$data_dir/globalmise/mise-data" \ MISE_CACHE_DIR="$data_dir/globalmise/mise-cache" \ MISE_STATE_DIR="$data_dir/globalmise/mise-state" \ @@ -27,15 +28,15 @@ start_service() { config_foreach get_config agentflow [ "$enabled" = 1 ] || return 1 - [ -x /usr/bin/agentflow ] || { - logger -t agentflow "missing executable: /usr/bin/agentflow" + [ -x /usr/sbin/agentflow ] || { + logger -t agentflow "missing executable: /usr/sbin/agentflow" return 1 } mkdir -p "$data_dir" || return 1 logger -t agentflow "starting AgentFlow on $host:$port" procd_open_instance - procd_set_param command /usr/bin/agentflow + procd_set_param command /usr/sbin/agentflow set_mise_env \ "AGENT_FLOW_DATA=$data_dir/data" \ "AGENT_FLOW_HOST=$host" \ diff --git a/luci-app-agentflow/Makefile b/luci-app-agentflow/Makefile index f5d112ca..5ba90f81 100644 --- a/luci-app-agentflow/Makefile +++ b/luci-app-agentflow/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=AgentFlow PKG_VERSION:=1.0.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 LUCI_DEPENDS:=+agentflow +luci-compat LUCI_MINIFY_CSS:=0 LUCI_MINIFY_JS:=0 diff --git a/luci-app-agentflow/luasrc/model/cbi/agentflow.lua b/luci-app-agentflow/luasrc/model/cbi/agentflow.lua index 3fa03818..41df7446 100644 --- a/luci-app-agentflow/luasrc/model/cbi/agentflow.lua +++ b/luci-app-agentflow/luasrc/model/cbi/agentflow.lua @@ -17,6 +17,17 @@ local data_dir = s:option(Value, "data_dir", translate("Data directory")) data_dir.rmempty = false data_dir.description = translate("Required. AgentFlow stores its configuration, database and workspace data under this directory.") +function data_dir.validate(self, value, section) + value = (value or ""):match("^%s*(.-)%s*$") + if value == "" or value == "/" then + return nil, translate("Data directory cannot be empty.") + end + if not value:match("^/mnt/[^/]+/") then + return nil, translate("Please select a disk as the data directory.") + end + return value +end + local paths, default_path = agentflow_model.find_paths(blocks, home) for _, val in pairs(paths) do data_dir:value(val, val) diff --git a/luci-app-agentflow/po/zh-cn/agentflow.po b/luci-app-agentflow/po/zh-cn/agentflow.po index adda11a5..a674988b 100644 --- a/luci-app-agentflow/po/zh-cn/agentflow.po +++ b/luci-app-agentflow/po/zh-cn/agentflow.po @@ -16,6 +16,9 @@ msgstr "正在获取数据……" msgid "Data directory" msgstr "数据目录" +msgid "Data directory cannot be empty." +msgstr "数据目录不能为空" + msgid "Enable" msgstr "启用" @@ -28,6 +31,9 @@ msgstr "监听端口" msgid "Port for the AgentFlow HTTP server." msgstr "AgentFlow HTTP 服务的端口号。" +msgid "Please select a disk as the data directory." +msgstr "请选择硬盘作为数据目录" + msgid "Required. AgentFlow stores its configuration, database and workspace data under this directory." msgstr "必需。AgentFlow 在此目录中保存配置、数据库和工作区数据。"