mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-03 03:13:56 +08:00
🐶 Sync 2026-06-07 20:35:32
This commit is contained in:
1 parent
0f3fe06329
commit
4fdf559def
8 files changed
+16
-13
No files matched your search
+1
-1
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=gecoosac
|
PKG_NAME:=gecoosac
|
||||||
PKG_VERSION:=2.2.20251015
|
PKG_VERSION:=2.2.20251015
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=3
|
||||||
|
|
||||||
ifeq ($(ARCH),aarch64)
|
ifeq ($(ARCH),aarch64)
|
||||||
PKG_ARCH:=ac_linux_arm64
|
PKG_ARCH:=ac_linux_arm64
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
config gecoosac 'config'
|
config gecoosac 'config'
|
||||||
option enabled '0'
|
option enabled '0'
|
||||||
option port '60650'
|
option port '60650'
|
||||||
option isonlyoneprot '0'
|
option isonlyoneprot '1'
|
||||||
option m_port '8080'
|
option m_port '8080'
|
||||||
option https '0'
|
option https '0'
|
||||||
option crt_file '/etc/gecoosac/tls/gecoosac.crt'
|
option crt_file '/etc/gecoosac/tls/gecoosac.crt'
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ init_conf() {
|
|||||||
config_get "upload_dir" "config" "upload_dir" "$DEFAULT_UPLOAD_DIR"
|
config_get "upload_dir" "config" "upload_dir" "$DEFAULT_UPLOAD_DIR"
|
||||||
config_get "enabled" "config" "enabled" "0"
|
config_get "enabled" "config" "enabled" "0"
|
||||||
config_get "port" "config" "port" "60650"
|
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 "m_port" "config" "m_port" "8080"
|
||||||
config_get "https" "config" "https" "0"
|
config_get "https" "config" "https" "0"
|
||||||
config_get "crt_file" "config" "crt_file" "$DEFAULT_CRT_FILE"
|
config_get "crt_file" "config" "crt_file" "$DEFAULT_CRT_FILE"
|
||||||
@@ -60,7 +60,7 @@ normalize_conf() {
|
|||||||
is_port "$m_port" || m_port="8080"
|
is_port "$m_port" || m_port="8080"
|
||||||
|
|
||||||
[ "$enabled" = "1" ] || enabled="0"
|
[ "$enabled" = "1" ] || enabled="0"
|
||||||
[ "$isonlyoneprot" = "1" ] || isonlyoneprot="0"
|
[ "$isonlyoneprot" = "0" ] || isonlyoneprot="1"
|
||||||
[ "$https" = "1" ] || https="0"
|
[ "$https" = "1" ] || https="0"
|
||||||
case "$lang" in
|
case "$lang" in
|
||||||
zh|en) ;;
|
zh|en) ;;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ set_default() {
|
|||||||
ensure_section
|
ensure_section
|
||||||
set_default enabled 0
|
set_default enabled 0
|
||||||
set_default port 60650
|
set_default port 60650
|
||||||
set_default isonlyoneprot 0
|
set_default isonlyoneprot 1
|
||||||
set_default m_port 8080
|
set_default m_port 8080
|
||||||
set_default https 0
|
set_default https 0
|
||||||
set_default crt_file /etc/gecoosac/tls/gecoosac.crt
|
set_default crt_file /etc/gecoosac/tls/gecoosac.crt
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=luci-app-gecoosac
|
PKG_NAME:=luci-app-gecoosac
|
||||||
PKG_VERSION:=2.2
|
PKG_VERSION:=2.2
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=3
|
||||||
|
|
||||||
LUCI_TITLE:=LuCI Support for gecoosac
|
LUCI_TITLE:=LuCI Support for gecoosac
|
||||||
LUCI_DEPENDS:=+luci-compat +gecoosac
|
LUCI_DEPENDS:=+luci-compat +gecoosac
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ module("luci.controller.gecoosac", package.seeall)
|
|||||||
|
|
||||||
local fs = require "nixio.fs"
|
local fs = require "nixio.fs"
|
||||||
local sys = require "luci.sys"
|
local sys = require "luci.sys"
|
||||||
|
local uci = require "luci.model.uci"
|
||||||
|
|
||||||
function index()
|
function index()
|
||||||
if not fs.access("/etc/config/gecoosac") then
|
if not fs.access("/etc/config/gecoosac") then
|
||||||
@@ -16,8 +17,10 @@ function index()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function act_status()
|
function act_status()
|
||||||
|
local cur = uci.cursor()
|
||||||
|
local enabled = cur:get("gecoosac", "config", "enabled") == "1"
|
||||||
local e = {
|
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.prepare_content("application/json")
|
||||||
luci.http.write_json(e)
|
luci.http.write_json(e)
|
||||||
|
|||||||
@@ -104,30 +104,30 @@ o.datatype = "port"
|
|||||||
o.rmempty = false
|
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 = 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.rmempty = false
|
||||||
|
|
||||||
o = s:option(Value, "m_port", translate("Set management port"))
|
o = s:option(Value, "m_port", translate("Set management port"))
|
||||||
o.placeholder = 8080
|
o.placeholder = 8080
|
||||||
o.default = 8080
|
o.default = 8080
|
||||||
o.datatype = "port"
|
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 = 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.default = 0
|
||||||
o:depends("isonlyoneprot", "0")
|
o:depends("isonlyoneprot", false)
|
||||||
|
|
||||||
o = s:option(Value, "crt_file", translate("Specify crt certificate file"))
|
o = s:option(Value, "crt_file", translate("Specify crt certificate file"))
|
||||||
o.placeholder = DEFAULT_CRT_FILE
|
o.placeholder = DEFAULT_CRT_FILE
|
||||||
o.default = DEFAULT_CRT_FILE
|
o.default = DEFAULT_CRT_FILE
|
||||||
o.validate = validate_abs_path
|
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 = s:option(Value, "key_file", translate("Specify key certificate file"))
|
||||||
o.placeholder = DEFAULT_KEY_FILE
|
o.placeholder = DEFAULT_KEY_FILE
|
||||||
o.default = DEFAULT_KEY_FILE
|
o.default = DEFAULT_KEY_FILE
|
||||||
o.validate = validate_abs_path
|
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 = s:option(Value, "upload_dir", translate("Upload dir path"), translate("The path to upload AP upgrade firmware"))
|
||||||
upload_dir.placeholder = DEFAULT_UPLOAD_DIR
|
upload_dir.placeholder = DEFAULT_UPLOAD_DIR
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
local uci=require"luci.model.uci".cursor()
|
local uci=require"luci.model.uci".cursor()
|
||||||
local json=require"luci.jsonc"
|
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 https = uci:get("gecoosac", "config", "https") or "0"
|
||||||
local port = uci:get("gecoosac", "config", "port") or "60650"
|
local port = uci:get("gecoosac", "config", "port") or "60650"
|
||||||
local m_port = uci:get("gecoosac", "config", "m_port") or "8080"
|
local m_port = uci:get("gecoosac", "config", "m_port") or "8080"
|
||||||
|
|||||||
Reference in new issue
Block a user