From fd4dfefb8d39606ca45337a7d7e026754914f43f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 7 Jun 2026 20:35:32 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B6=20Sync=202026-06-07=2020:35:32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gecoosac/Makefile | 2 +- gecoosac/files/etc/config/gecoosac | 2 +- gecoosac/files/etc/init.d/gecoosac | 4 ++-- gecoosac/files/etc/uci-defaults/gecoosac | 2 +- luci-app-gecoosac/Makefile | 2 +- luci-app-gecoosac/luasrc/controller/gecoosac.lua | 5 ++++- luci-app-gecoosac/luasrc/model/cbi/gecoosac.lua | 10 +++++----- .../luasrc/view/gecoosac/gecoosac_status.htm | 2 +- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/gecoosac/Makefile b/gecoosac/Makefile index 0487a527..ad336ced 100644 --- a/gecoosac/Makefile +++ b/gecoosac/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gecoosac PKG_VERSION:=2.2.20251015 -PKG_RELEASE:=2 +PKG_RELEASE:=3 ifeq ($(ARCH),aarch64) PKG_ARCH:=ac_linux_arm64 diff --git a/gecoosac/files/etc/config/gecoosac b/gecoosac/files/etc/config/gecoosac index fa4d0785..996fdd0f 100644 --- a/gecoosac/files/etc/config/gecoosac +++ b/gecoosac/files/etc/config/gecoosac @@ -1,7 +1,7 @@ config gecoosac 'config' option enabled '0' option port '60650' - option isonlyoneprot '0' + option isonlyoneprot '1' option m_port '8080' option https '0' option crt_file '/etc/gecoosac/tls/gecoosac.crt' diff --git a/gecoosac/files/etc/init.d/gecoosac b/gecoosac/files/etc/init.d/gecoosac index 59f53635..f6bdc86d 100644 --- a/gecoosac/files/etc/init.d/gecoosac +++ b/gecoosac/files/etc/init.d/gecoosac @@ -23,7 +23,7 @@ init_conf() { config_get "upload_dir" "config" "upload_dir" "$DEFAULT_UPLOAD_DIR" config_get "enabled" "config" "enabled" "0" config_get "port" "config" "port" "60650" - config_get "isonlyoneprot" "config" "isonlyoneprot" "0" + config_get "isonlyoneprot" "config" "isonlyoneprot" "1" config_get "m_port" "config" "m_port" "8080" config_get "https" "config" "https" "0" config_get "crt_file" "config" "crt_file" "$DEFAULT_CRT_FILE" @@ -60,7 +60,7 @@ normalize_conf() { is_port "$m_port" || m_port="8080" [ "$enabled" = "1" ] || enabled="0" - [ "$isonlyoneprot" = "1" ] || isonlyoneprot="0" + [ "$isonlyoneprot" = "0" ] || isonlyoneprot="1" [ "$https" = "1" ] || https="0" case "$lang" in zh|en) ;; diff --git a/gecoosac/files/etc/uci-defaults/gecoosac b/gecoosac/files/etc/uci-defaults/gecoosac index 56b54be5..692f578a 100644 --- a/gecoosac/files/etc/uci-defaults/gecoosac +++ b/gecoosac/files/etc/uci-defaults/gecoosac @@ -20,7 +20,7 @@ set_default() { ensure_section set_default enabled 0 set_default port 60650 -set_default isonlyoneprot 0 +set_default isonlyoneprot 1 set_default m_port 8080 set_default https 0 set_default crt_file /etc/gecoosac/tls/gecoosac.crt diff --git a/luci-app-gecoosac/Makefile b/luci-app-gecoosac/Makefile index b07ba993..b37f6b20 100644 --- a/luci-app-gecoosac/Makefile +++ b/luci-app-gecoosac/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-gecoosac PKG_VERSION:=2.2 -PKG_RELEASE:=2 +PKG_RELEASE:=3 LUCI_TITLE:=LuCI Support for gecoosac LUCI_DEPENDS:=+luci-compat +gecoosac diff --git a/luci-app-gecoosac/luasrc/controller/gecoosac.lua b/luci-app-gecoosac/luasrc/controller/gecoosac.lua index 891977d8..856c561f 100644 --- a/luci-app-gecoosac/luasrc/controller/gecoosac.lua +++ b/luci-app-gecoosac/luasrc/controller/gecoosac.lua @@ -3,6 +3,7 @@ module("luci.controller.gecoosac", package.seeall) local fs = require "nixio.fs" local sys = require "luci.sys" +local uci = require "luci.model.uci" function index() if not fs.access("/etc/config/gecoosac") then @@ -16,8 +17,10 @@ function index() end function act_status() + local cur = uci.cursor() + local enabled = cur:get("gecoosac", "config", "enabled") == "1" local e = { - running = sys.call("/etc/init.d/gecoosac status >/dev/null 2>&1") == 0 + running = enabled and sys.call("/etc/init.d/gecoosac status >/dev/null 2>&1") == 0 } luci.http.prepare_content("application/json") luci.http.write_json(e) diff --git a/luci-app-gecoosac/luasrc/model/cbi/gecoosac.lua b/luci-app-gecoosac/luasrc/model/cbi/gecoosac.lua index d6edbbcd..088c77c8 100644 --- a/luci-app-gecoosac/luasrc/model/cbi/gecoosac.lua +++ b/luci-app-gecoosac/luasrc/model/cbi/gecoosac.lua @@ -104,30 +104,30 @@ o.datatype = "port" o.rmempty = false o = s:option(Flag, "isonlyoneprot", translate("Single Port Mode"), translate("Do not enable the independent management port, only use one port for management.")) -o.default = 0 +o.default = 1 o.rmempty = false o = s:option(Value, "m_port", translate("Set management port")) o.placeholder = 8080 o.default = 8080 o.datatype = "port" -o:depends("isonlyoneprot", "0") +o:depends("isonlyoneprot", false) o = s:option(Flag, "https", translate("Enable HTTPS service"), translate("A certificate file must be specified, otherwise it will fail to start.")) o.default = 0 -o:depends("isonlyoneprot", "0") +o:depends("isonlyoneprot", false) o = s:option(Value, "crt_file", translate("Specify crt certificate file")) o.placeholder = DEFAULT_CRT_FILE o.default = DEFAULT_CRT_FILE o.validate = validate_abs_path -o:depends({isonlyoneprot = "0", https = "1"}) +o:depends("https", true) o = s:option(Value, "key_file", translate("Specify key certificate file")) o.placeholder = DEFAULT_KEY_FILE o.default = DEFAULT_KEY_FILE o.validate = validate_abs_path -o:depends({isonlyoneprot = "0", https = "1"}) +o:depends("https", true) upload_dir = s:option(Value, "upload_dir", translate("Upload dir path"), translate("The path to upload AP upgrade firmware")) upload_dir.placeholder = DEFAULT_UPLOAD_DIR diff --git a/luci-app-gecoosac/luasrc/view/gecoosac/gecoosac_status.htm b/luci-app-gecoosac/luasrc/view/gecoosac/gecoosac_status.htm index 1f7e17dc..acbf5d1e 100644 --- a/luci-app-gecoosac/luasrc/view/gecoosac/gecoosac_status.htm +++ b/luci-app-gecoosac/luasrc/view/gecoosac/gecoosac_status.htm @@ -2,7 +2,7 @@ local uci=require"luci.model.uci".cursor() local json=require"luci.jsonc" -local isonlyoneprot = uci:get("gecoosac", "config", "isonlyoneprot") or "0" +local isonlyoneprot = uci:get("gecoosac", "config", "isonlyoneprot") or "1" local https = uci:get("gecoosac", "config", "https") or "0" local port = uci:get("gecoosac", "config", "port") or "60650" local m_port = uci:get("gecoosac", "config", "m_port") or "8080"