small-package/luci-app-passwall2/luasrc/passwall2/com.lua

57 lines
1.2 KiB
Lua
Raw Normal View History

2023-05-16 23:35:34 +08:00
local _M = {}
local function gh_release_url(self)
return "https://api.github.com/repos/" .. self.repo .. "/releases/latest"
end
local function gh_pre_release_url(self)
return "https://api.github.com/repos/" .. self.repo .. "/releases?per_page=1"
end
_M.hysteria = {
name = "Hysteria",
repo = "HyNetwork/hysteria",
get_url = gh_release_url,
2023-09-15 09:11:25 +08:00
cmd_version = "version | awk '/^Version:/ {print $2}'",
remote_version_str_replace = "app/",
2023-05-16 23:35:34 +08:00
zipped = false,
default_path = "/usr/bin/hysteria",
match_fmt_str = "linux%%-%s$",
file_tree = {
armv6 = "arm",
armv7 = "arm"
}
}
2023-09-04 23:36:20 +08:00
_M.singbox = {
name = "Sing-Box",
repo = "SagerNet/sing-box",
2024-01-11 23:34:58 +08:00
get_url = gh_release_url,
2023-09-04 23:36:20 +08:00
cmd_version = "version | awk '{print $3}' | sed -n 1P",
zipped = true,
2023-09-06 23:36:47 +08:00
zipped_suffix = "tar.gz",
2023-09-04 23:36:20 +08:00
default_path = "/usr/bin/sing-box",
match_fmt_str = "linux%%-%s",
file_tree = {
x86_64 = "amd64"
}
}
2023-09-05 19:23:30 +08:00
_M.xray = {
name = "Xray",
repo = "XTLS/Xray-core",
2023-05-16 23:35:34 +08:00
get_url = gh_pre_release_url,
cmd_version = "version | awk '{print $2}' | sed -n 1P",
zipped = true,
2023-09-05 19:23:30 +08:00
default_path = "/usr/bin/xray",
2023-05-16 23:35:34 +08:00
match_fmt_str = "linux%%-%s",
file_tree = {
x86_64 = "64",
x86 = "32",
mips = "mips32",
mipsel = "mips32le"
}
}
return _M