update 2025-11-11 20:46:50

This commit is contained in:
kenzok8
2025-11-11 20:46:50 +08:00
parent afa9b3e930
commit 5df0b3c6f6
8 changed files with 156 additions and 17 deletions

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=filebrowser
PKG_VERSION:=2.45.0
PKG_VERSION:=2.45.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/filebrowser/filebrowser/tar.gz/v${PKG_VERSION}?
PKG_HASH:=fd7ed8dff59cdb11d56d76dbe739d341780e08ebcdc2ee5833849ccf8090d809
PKG_HASH:=8c1076ee39ecd01f4e887f5d3d8593f4ae3d75f0cfcdded56cbc3d773e2f07a0
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE

View File

@@ -453,7 +453,7 @@ o.description = desc .. "</ul>"
o:depends({dns_shunt = "dnsmasq", tcp_proxy_mode = "proxy", chn_list = "direct"})
for k, v in pairs(nodes_table) do
if v.protocol and v.protocol ~= "_shunt" then
if v.protocol ~= "_shunt" then
s.fields["dns_mode"]:depends({ _tcp_node_bool = "1", tcp_node = v.id })
end
end

View File

@@ -773,7 +773,7 @@ for k, v in pairs(nodes_table) do
s2.fields["node"]:value(v.id, v["remark"])
end
if v.protocol and v.protocol ~= "_shunt" then
if v.protocol ~= "_shunt" then
s.fields["dns_mode"]:depends({ dns_shunt = "chinadns-ng", tcp_node = v.id })
s.fields["dns_mode"]:depends({ dns_shunt = "dnsmasq", tcp_node = v.id })
if api.is_finded("smartdns") then

View File

@@ -11,13 +11,13 @@ LUCI_DEPENDS:=+curl +opkg +luci-base +tar +libuci-lua +mount-utils +luci-lib-tas
LUCI_EXTRA_DEPENDS:=luci-lib-taskd (>=1.0.19)
LUCI_PKGARCH:=all
PKG_VERSION:=0.1.29-6
PKG_VERSION:=0.1.30-1
# PKG_RELEASE MUST be empty for luci.mk
PKG_RELEASE:=
ISTORE_UI_VERSION:=0.1.28
ISTORE_UI_RELEASE:=3
PKG_HASH:=5097082a9d0821ff23f468f20c7ba9f635a9cb52eeac8b155a55b3441741d260
ISTORE_UI_VERSION:=0.1.30
ISTORE_UI_RELEASE:=1
PKG_HASH:=74a9732e78351b0a78596a67410bafd838678e047a11dfdf3d40ab9d7ce65a78
PKG_SOURCE_URL_FILE:=v$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE).tar.gz
PKG_SOURCE:=istore-ui-$(PKG_SOURCE_URL_FILE)

View File

@@ -23,6 +23,10 @@ function index()
entry({"admin", "store", "log"}, call("store_log"))
entry({"admin", "store", "uid"}, call("action_user_id"))
entry({"admin", "store", "upload"}, post("store_upload"))
entry({"admin", "store", "del_record"}, post("store_del_record"))
entry({"admin", "store", "unrun"}, post("store_unrun"))
entry({"admin", "store", "run_records"}, call("store_run_records"))
entry({"admin", "store", "check_self_upgrade"}, call("check_self_upgrade"))
entry({"admin", "store", "do_self_upgrade"}, post("do_self_upgrade"))
entry({"admin", "store", "toggle_docker"}, post("toggle_docker"))
@@ -435,11 +439,7 @@ function store_upload()
local code, out, err
out = ""
if finished then
if string.lower(string.sub(path, -4, -1)) == ".run" then
code, out, err = _action("sh", "-c", "ls -l \"%s\"; md5sum \"%s\" 2>/dev/null; chmod 755 \"%s\" && \"%s\"; RET=$?; rm -f \"%s\"; exit $RET" %{ path, path, path, path, path })
else
code, out, err = _action("sh", "-c", "opkg install \"%s\"; RET=$?; rm -f \"%s\"; exit $RET" %{ path, path })
end
code, out, err = _action(myopkg, "dotrun", path)
else
code = 500
err = "upload failed!"
@@ -454,6 +454,46 @@ function store_upload()
luci.http.write_json(ret)
end
function store_unrun()
local record_id = luci.http.formvalue("id")
if record_id == nil or record_id == "" then
luci.http.status(400, "Bad Request")
return
end
local code, out, err = _action(myopkg, "unrun", record_id)
local ret = {
code = code,
stdout = out,
stderr = err
}
luci.http.prepare_content("application/json")
luci.http.write_json(ret)
end
function store_run_records()
local util = require "luci.util"
local run_records = util.exec(myopkg .. " run_records")
luci.http.prepare_content("application/json")
luci.http.write("{\n\"code\":200,\n\"records\":")
luci.http.write(run_records)
luci.http.write("\n}\n")
end
function store_del_record()
local nixio = require "nixio"
local os = require "os"
local rshift = nixio.bit.rshift
local record_id = luci.http.formvalue("id")
if record_id == nil or record_id == "" then
luci.http.status(400, "Bad Request")
return
end
local r = os.execute(myopkg.." del_record "..luci.util.shellquote(record_id).." >/dev/null 2>&1")
luci.http.prepare_content("application/json")
luci.http.write_json({code=rshift(r,8)})
end
function configured()
local uci = luci.http.formvalue("uci")
if not validate_pkgname(uci) then

View File

@@ -25,6 +25,8 @@ ISTORE_PKG=luci-app-store
ISTORE_DEP_PKGS="luci-lib-taskd luci-lib-xterm taskd"
ISTORE_INDEX=https://istore.istoreos.com/repo/all/store/Packages.gz
NEWLINE=$'\n'
is_init() {
mkdir -p ${DL_DIR} ${LISTS_DIR} ${IS_ROOT}/etc ${IS_ROOT}/var
@@ -231,6 +233,87 @@ try_upgrade_depends() {
return 0
}
CMD_INSTALLED="opkg list-installed | cut -d' ' -f1 | sort -u"
dotrun() {
local path="$1"
[ -f "$path" ] || { echo "file not found: $path" >&2; return 1; }
ls -l "$path"
local md5=$(md5sum "$path" 2>/dev/null | cut -d' ' -f1)
local ts=$(date '+%s')
#local date=$(date '+%Y-%m-%d_%H-%M-%S')
echo "MD5: $md5"
echo "Save installed pkg list before installing"
sh -c "$CMD_INSTALLED" > "/tmp/is-root/tmp/pre_$md5.txt"
if echo "$path" | grep -q '\.run$'; then
echo "Executing .run file"
chmod 0755 "$path" && "$path"
else
echo "Installing .ipk file"
opkg install "$path"
fi
local RET=$?
rm -f "$path"
if [ -s "/tmp/is-root/tmp/pre_$md5.txt" ]; then
echo "Save installed pkg list after installing"
sh -c "$CMD_INSTALLED" > "/tmp/is-root/tmp/post_$md5.txt"
grep -Fxf "/tmp/is-root/tmp/pre_$md5.txt" -v "/tmp/is-root/tmp/post_$md5.txt" > "/tmp/is-root/tmp/added_$md5.txt"
if [ -s "/tmp/is-root/tmp/added_$md5.txt" ]; then
echo "The following packages were added:"
cat "/tmp/is-root/tmp/added_$md5.txt"
mkdir -p /usr/share/istore/run-records
path="${path##*/}"
path="${path//\\/\\\\}" #\
path="${path//\"/\\\"}" #"
path="${path//$NEWLINE/\\n}" # \n
path="${path//^M/\\r}" # \r
echo "{\"id\":\"$ts-$md5\",\"ts\":$ts,\"md5\":\"$md5\",\"file\":\"$path\"}" > /usr/share/istore/run-records/$ts-$md5.txt
cat "/tmp/is-root/tmp/added_$md5.txt" >> /usr/share/istore/run-records/$ts-$md5.txt
fi
fi
rm -f "/tmp/is-root/tmp/pre_$md5.txt" "/tmp/is-root/tmp/post_$md5.txt" "/tmp/is-root/tmp/added_$md5.txt"
return $RET
}
run_records() {
local record
local file
echo "["
for record in /usr/share/istore/run-records/*.txt; do
[ -f "$record" ] || continue
echo "`head -1 "$record"`,"
done | head -c -2
echo ""
echo "]"
}
unrun() {
local id="$1"
[ -s "/usr/share/istore/run-records/$id.txt" ] || { echo "record not found: $id" >&2; return 1; }
echo "The following packages will be removed:"
tail -n +2 "/usr/share/istore/run-records/$id.txt" > "/tmp/is-root/tmp/to_unrun_$id.txt"
cat "/tmp/is-root/tmp/to_unrun_$id.txt"
local round max_round=6
for round in `seq 1 $max_round`; do
if [ $round == $max_round ]; then
opkg --autoremove remove `cat "/tmp/is-root/tmp/to_unrun_$id.txt"`
else
opkg --autoremove remove `cat "/tmp/is-root/tmp/to_unrun_$id.txt"` 2>/dev/null && break
fi
done
sh -c "$CMD_INSTALLED" > "/tmp/is-root/tmp/post_unrun_$id.txt"
grep -Fxf "/tmp/is-root/tmp/post_unrun_$id.txt" "/tmp/is-root/tmp/to_unrun_$id.txt" > "/tmp/is-root/tmp/remain_unrun_$id.txt"
if [ -s "/tmp/is-root/tmp/remain_unrun_$id.txt" ]; then
echo "The following packages failed to be removed:"
cat "/tmp/is-root/tmp/remain_unrun_$id.txt"
else
echo "All packages removed successfully."
rm -f "/usr/share/istore/run-records/$id.txt"
fi
rm -f "/tmp/is-root/tmp/to_unrun_$id.txt" "/tmp/is-root/tmp/post_unrun_$id.txt" "/tmp/is-root/tmp/remain_unrun_$id.txt"
return 0
}
usage() {
echo "usage: is-opkg sub-command [arguments...]"
echo "where sub-command is one of:"
@@ -244,6 +327,11 @@ usage() {
echo " do_self_upgrade Upgrade iStore"
echo " arch Show libc architecture"
echo " opkg sys opkg wrap"
echo " dotrun {path} install .run/.ipk"
echo " run_records list .run/.ipk install records"
echo " del_record {id} delete .run/.ipk install record"
echo " unrun {id} Remove installed packages by .run/.ipk"
exit 1
}
is_init >/dev/null 2>&1
@@ -284,7 +372,18 @@ case $action in
"opkg")
opkg_wrap "$@"
;;
"dotrun")
dotrun "$@"
;;
"run_records")
run_records
;;
"del_record")
rm -f "/usr/share/istore/run-records/$1.txt"
;;
"unrun")
unrun "$1"
;;
*)
usage
;;

View File

@@ -21,13 +21,13 @@ define Download/geoip
HASH:=2445b44d9ae3ab9a867c9d1e0e244646c4c378622e14b9afaf3658ecf46a40b9
endef
GEOSITE_VER:=20251111080805
GEOSITE_VER:=20251111115905
GEOSITE_FILE:=dlc.dat.$(GEOSITE_VER)
define Download/geosite
URL:=https://github.com/v2fly/domain-list-community/releases/download/$(GEOSITE_VER)/
URL_FILE:=dlc.dat
FILE:=$(GEOSITE_FILE)
HASH:=55e76a86c943e4d343640e3fec7e06662036489df89815b527c518f2fe3797cb
HASH:=6a84d64202fa6f3cd1a290387ed6e10e12dbc5906a2adc7646fae307541d45ab
endef
GEOSITE_IRAN_VER:=202511100042

View File

@@ -11,7 +11,7 @@ config watchdog 'config'
list login_control 'web_login_failed'
list login_control 'ssh_login_failed'
option login_max_num '3'
option enable '1'
option enable '0'
option login_web_black '1'
option login_ip_black_timeout '86400'