luci-app-leigod-acc: add tun mode support

This commit is contained in:
coolsnowwolf 2024-08-02 16:37:53 +08:00
parent e53905ae41
commit 0d4e0de6a1
12 changed files with 62 additions and 22 deletions

View File

@ -10,7 +10,7 @@ LUCI_TITLE:=Luci for Leigod Game Accelerater
LUCI_PKGARCH:=all LUCI_PKGARCH:=all
LUCI_DEPENDS:=+libpcap +iptables +kmod-ipt-nat +iptables-mod-tproxy +kmod-ipt-tproxy +kmod-tun +kmod-netem +tc-full +kmod-ipt-ipset +ipset +curl +miniupnpd +conntrack +conntrackd +leigod-acc LUCI_DEPENDS:=+libpcap +iptables +kmod-ipt-nat +iptables-mod-tproxy +kmod-ipt-tproxy +kmod-tun +kmod-netem +tc-full +kmod-ipt-ipset +ipset +curl +miniupnpd +conntrack +conntrackd +leigod-acc
PKG_VERSION:=1 PKG_VERSION:=1
PKG_RELEASE:=2 PKG_RELEASE:=3
include $(TOPDIR)/feeds/luci/luci.mk include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -5,6 +5,7 @@ function index()
entry({ "admin", "services", "acc" }, alias("admin", "services", "acc", "service"), translate("Leigod Acc"), 50) entry({ "admin", "services", "acc" }, alias("admin", "services", "acc", "service"), translate("Leigod Acc"), 50)
entry({ "admin", "services", "acc", "service" }, cbi("leigod/service"), translate("Leigod Service"), 30).i18n = "acc" entry({ "admin", "services", "acc", "service" }, cbi("leigod/service"), translate("Leigod Service"), 30).i18n = "acc"
entry({ "admin", "services", "acc", "device" }, cbi("leigod/device"), translate("Leigod Device"), 50).i18n = "acc" entry({ "admin", "services", "acc", "device" }, cbi("leigod/device"), translate("Leigod Device"), 50).i18n = "acc"
entry({ "admin", "services", "acc", "app" }, cbi("leigod/app"), translate("Leigod App"), 60).i18n = "acc"
entry({ "admin", "services", "acc", "notice" }, cbi("leigod/notice"), translate("Leigod Notice"), 80).i18n = "acc" entry({ "admin", "services", "acc", "notice" }, cbi("leigod/notice"), translate("Leigod Notice"), 80).i18n = "acc"
entry({ "admin", "services", "acc", "status" }, call("get_acc_status")).leaf = true entry({ "admin", "services", "acc", "status" }, call("get_acc_status")).leaf = true
entry({ "admin", "services", "acc", "start_acc_service" }, call("start_acc_service")) entry({ "admin", "services", "acc", "start_acc_service" }, call("start_acc_service"))

View File

@ -0,0 +1,7 @@
require("luci.util")
mp = Map("accelerator")
mp:section(SimpleSection).template = "leigod/app"
return mp

View File

@ -1,9 +1,21 @@
local uci = require "luci.model.uci".cursor() local uci = require "luci.model.uci".cursor()
-- config -- config
m = Map("accelerator") m = Map("accelerator")
m.title = translate("Leigod Accelerator Config") m.title = translate("Leigod Accelerator Config")
m.description = translate("Control Accelerator Config") m.description = translate("Control Accelerator Config")
s = m:section(TypedSection, "system")
s.addremove = false
s.anonymous = true
enable = s:option(Flag,"enabled" ,translate("Enable"))
enable.rmempty = false
enable.default = 0
tun = s:option(Flag,"tun" ,translate("Tunnel Mode"))
tun.rmempty = false
tun.default = 0
m:section(SimpleSection).template = "leigod/service" m:section(SimpleSection).template = "leigod/service"

View File

@ -0,0 +1,6 @@
<fieldset class="cbi-section">
<p id="leigod_qcode">
<img src="/leigodapp.png" height="300" /><img src="/leigodbind.png" height="300" />
</p>
</fieldset>

View File

@ -1,4 +1,4 @@
<!-- acc service state --> <!-- acc service state
<fieldset class="cbi-section"> <fieldset class="cbi-section">
<table class="cbi-section-table" id="acc_service_state_table"> <table class="cbi-section-table" id="acc_service_state_table">
<tr class="cbi-section-table-title"> <tr class="cbi-section-table-title">
@ -12,7 +12,7 @@
<td id="acc_service_state_button"><%:Acc_Service_Operate%></td> <td id="acc_service_state_button"><%:Acc_Service_Operate%></td>
</tr> </tr>
</table> </table>
</fieldset> </fieldset> -->
<!-- acc catalog state --> <!-- acc catalog state -->
<fieldset class="cbi-section"> <fieldset class="cbi-section">

View File

@ -8,14 +8,17 @@ msgstr "服务控制"
msgid "Leigod Device" msgid "Leigod Device"
msgstr "设备管理" msgstr "设备管理"
msgid "Leigod App"
msgstr "雷神移动端APP"
msgid "Leigod Notice" msgid "Leigod Notice"
msgstr "加速公告" msgstr "加速公告"
msgid "Leigod Accelerator Config" msgid "Leigod Accelerator Config"
msgstr "加速器配置" msgstr "雷神加速器 - 专线加速游戏,按分钟计费可暂停,玩多久算多久,时长永久有效"
msgid "Control Accelerator Config" msgid "Control Accelerator Config"
msgstr "控制加速配置选项" msgstr "加速时长6端通用 (Windows端 Mac端 NN 手机端 主机端 路由器)"
msgid "Acc_Service_Name" msgid "Acc_Service_Name"
msgstr "服务名称" msgstr "服务名称"
@ -80,8 +83,8 @@ msgstr "手机设备"
msgid "None_Catalog" msgid "None_Catalog"
msgstr "未分类设备" msgstr "未分类设备"
msgid "None" msgid "Tunnel Mode"
msgstr "无数据" msgstr "TUN 模式"
msgid "PC_Catalog" msgid "PC_Catalog"
msgstr "PC 设备" msgstr "PC 设备"

View File

@ -3,6 +3,8 @@ config system 'base'
option url 'https://opapi.nn.com/speed/router/plug/check' option url 'https://opapi.nn.com/speed/router/plug/check'
option heart 'https://opapi.nn.com/speed/router/heartbeat' option heart 'https://opapi.nn.com/speed/router/heartbeat'
option base_url 'https://opapi.nn.com/speed' option base_url 'https://opapi.nn.com/speed'
option enabled '0'
option tun '0'
config bind 'bind' config bind 'bind'

View File

@ -126,7 +126,6 @@ get_xiaomi_name() {
echo "router is not xiaomi, use general openwrt" echo "router is not xiaomi, use general openwrt"
sbin_dir="/usr/sbin/leigod" sbin_dir="/usr/sbin/leigod"
init_dir="/etc/init.d" init_dir="/etc/init.d"
show_openwrt_suggestion
return 0 return 0
} }
@ -144,19 +143,24 @@ start_service_daemon() {
procd_close_instance procd_close_instance
# start check update # start check update
# update_plugin & # update_plugin &
# start led light
# /etc/init.d/internetled start
} }
# proc start service # proc start service
start_service() { start_service() {
# prepare env
# prepare_env config_load "accelerator"
# run service as daemon
local enabled
config_get_bool enabled base enabled 0
local tun
config_get_bool tun base tun 0
[ "${enabled}" -gt 0 ] || return
[ "${tun}" -eq 1 ] && args="--mode tun"
get_device_arch get_device_arch
get_xiaomi_name
start_service_daemon start_service_daemon
} }

View File

@ -18,7 +18,12 @@ uci set accelerator.base.heart='https://opapi.nn.com/speed/router/heartbeat'
uci set accelerator.base.base_url='https://opapi.nn.com/speed' uci set accelerator.base.base_url='https://opapi.nn.com/speed'
uci commit accelerator uci commit accelerator
echo "Fistboot Disable " uci -q batch <<-EOF >/dev/null
delete ucitrack.@accelerator[-1]
add ucitrack accelerator
set ucitrack.@accelerator[-1].init=acc
commit ucitrack
EOF
/etc/init.d/acc stop rm -f /tmp/luci-indexcache
/etc/init.d/acc disable exit 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB