mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-02 23:23:56 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=mac for luci
|
||||
LUCI_DEPENDS:=
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=4.2.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@@ -0,0 +1,11 @@
|
||||
module("luci.controller.brukamen_mac", package.seeall)
|
||||
|
||||
function index()
|
||||
entry({"admin", "services", "brukamen_mac"}, cbi("brukamen_mac"), _("MAC克隆"), 90)
|
||||
entry({"admin", "services", "ua2f"}, cbi("ua2f"), "防检测配置", 92)
|
||||
entry({"admin", "services", "Brukamen_WiFi"}, cbi("Brukamen_WiFi"), "WIFI设置", 93)
|
||||
--entry({"admin", "services", "webauto"}, alias("admin", "services", "webauto", "settings"), _("Web认证"), 99).index = true
|
||||
--entry({"admin", "services", "webauto", "settings"}, cbi("autoshell"), _("认证设置"), 1)
|
||||
--entry({"admin", "services", "webauto", "log"}, cbi("autoshell_log"), _("认证日志"), 2)
|
||||
entry({"admin", "services", "autoreboot"}, cbi("autoreboot"), _("定时重启"), 100)
|
||||
end
|
||||
@@ -0,0 +1,26 @@
|
||||
m = Map("wireless", "Wi-Fi设置", "配置Wi-Fi设置")
|
||||
|
||||
s = m:section(TypedSection, "wifi-iface", "修改为不同名称即可分为两个wifi信号")
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Value, "ssid", "Wi-Fi名称")
|
||||
o.placeholder = "我的网络"
|
||||
|
||||
o = s:option(ListValue, "encryption", "加密类型")
|
||||
o:value("psk", "WPA/WPA2-PSK")
|
||||
o:value("none", "无线不加密")
|
||||
o.default = "none"
|
||||
|
||||
o = s:option(Value, "key", "密码")
|
||||
o.datatype = "wpakey"
|
||||
o.password = true
|
||||
o:depends("encryption", "psk")
|
||||
o.validate = function(self, value)
|
||||
if #value < 8 then
|
||||
return nil, "密码至少需要8个字符"
|
||||
end
|
||||
|
||||
return value
|
||||
end
|
||||
|
||||
return m
|
||||
@@ -0,0 +1,30 @@
|
||||
--[[
|
||||
LuCI - Lua Configuration Interface
|
||||
|
||||
Copyright 2010 Jo-Philipp Wich <xm@subsignal.org>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
]]--
|
||||
|
||||
require("luci.sys")
|
||||
|
||||
m = Map("autoreboot", translate("定时重启"), translate("配置定时重启。"))
|
||||
|
||||
s = m:section(TypedSection, "login", "")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
enable = s:option(Flag, "enable", translate("启用"))
|
||||
pass = s:option(Value, "minute", translate("分"))
|
||||
hour = s:option(Value, "hour", translate("时"))
|
||||
|
||||
local apply = luci.http.formvalue("cbi.apply")
|
||||
if apply then
|
||||
io.popen("/etc/init.d/autoreboot restart")
|
||||
end
|
||||
|
||||
return m
|
||||
@@ -0,0 +1,45 @@
|
||||
require("luci.sys")
|
||||
|
||||
get_login_device_mac = function()
|
||||
local remote_ip = os.getenv("REMOTE_ADDR")
|
||||
if not remote_ip then return "" end
|
||||
|
||||
local arp_cmd = "ip neigh show | grep '" .. remote_ip .. "' | awk '{print $5}'"
|
||||
return luci.sys.exec(arp_cmd):gsub("\n", ""):upper()
|
||||
end
|
||||
|
||||
set_interface_mac = function(new_mac)
|
||||
luci.sys.call("uci set network.cfg050f15.macaddr=" .. new_mac .. " && uci commit network")
|
||||
luci.sys.call("ifconfig eth0.2 down && ifconfig eth0.2 hw ether " .. new_mac .. " && ifconfig eth0.2 up")
|
||||
end
|
||||
|
||||
m = Map("brukamen_mac", translate("克隆MAC"), translate("更改外网(WAN)接口的 MAC 地址,用于模拟本机上网"))
|
||||
|
||||
s = m:section(TypedSection, "brukamen_mac", "")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
|
||||
current_mac = s:option(DummyValue, "current_mac", translate("当前 MAC 地址"))
|
||||
current_mac.value = luci.sys.exec("ifconfig eth0.2 | grep HWaddr | awk '{ print $5 }'"):gsub("\n","")
|
||||
|
||||
new_mac = s:option(Value, "new_mac", translate("新的 MAC 地址"))
|
||||
|
||||
get_login_device_mac_btn = s:option(Button, "_get_login_device_mac")
|
||||
get_login_device_mac_btn.title = "<span style='color:green'>" .. translate("获取本机的MAC地址") .. "</span>"
|
||||
get_login_device_mac_btn.inputtitle = translate("获取")
|
||||
get_login_device_mac_btn.inputstyle = "apply"
|
||||
|
||||
get_login_device_mac_btn.write = function(self, section)
|
||||
local mac = get_login_device_mac()
|
||||
if mac ~= "" then
|
||||
set_interface_mac(mac)
|
||||
new_mac:write(section, mac)
|
||||
new_mac.datatype = "macaddr"
|
||||
end
|
||||
end
|
||||
|
||||
description = s:option(DummyValue, "", "")
|
||||
description.rawhtml = true
|
||||
description.value = "<p style='color: pink;'>点击获取即可克隆本设备的mac,点击保存应用以生效</p>"
|
||||
|
||||
return m
|
||||
@@ -0,0 +1,188 @@
|
||||
local uci = require("luci.model.uci").cursor()
|
||||
|
||||
function get_status_html(status_value)
|
||||
local html = "<span style='color:red'>" .. translate("Disabled") .. "</span>"
|
||||
if status_value == "1" then
|
||||
html = "<span style='color:green'>" .. translate("Enabled") .. "</span>"
|
||||
end
|
||||
return html
|
||||
end
|
||||
|
||||
m = Map("ua2f",
|
||||
translate("UA2F配置中心"),
|
||||
translate([[
|
||||
<span style="font-family: '微软雅黑'; color: pink">该界面由 Brukamen 开发</span><br>
|
||||
<span style="font-family: '微软雅黑'; color: pink">联系邮箱:169296793@qq.com</span><br>
|
||||
<span style="font-family: '微软雅黑'; color: blue">点击按钮启用或关闭相应功能,转到测试网址测试结果为Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.68则成功开启防检测</span><br>
|
||||
<span style="font-family: '微软雅黑'; color: blue">该插件并非适合所有类型的检测!!!</span><br>
|
||||
<span style="font-family: '微软雅黑'; color: yellow"><a href="http://ua.233996.xyz/" target="_blank">点击此处跳转到测试网址</a></span>
|
||||
]])
|
||||
)
|
||||
|
||||
s = m:section(NamedSection, "enabled", "ua2f", translate("启用/禁用 UA2F-->开启后开机自动运行"))
|
||||
|
||||
o = s:option(Button, "__enable_btn")
|
||||
o.inputtitle = translate("Enable")
|
||||
o.inputstyle = "apply"
|
||||
function o.write()
|
||||
uci:set("ua2f", "enabled", "enabled", "1")
|
||||
uci:commit("ua2f")
|
||||
os.execute("/etc/init.d/ua2f enable")
|
||||
os.execute("/etc/init.d/ua2f start")
|
||||
end
|
||||
|
||||
o = s:option(Button, "__disable_btn")
|
||||
o.inputtitle = translate("Disable")
|
||||
o.inputstyle = "reset"
|
||||
function o.write()
|
||||
uci:set("ua2f", "enabled", "enabled", "0")
|
||||
uci:commit("ua2f")
|
||||
os.execute("/etc/init.d/ua2f stop")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "__status")
|
||||
o.rawhtml = true
|
||||
o.placeholder = "-"
|
||||
function o.cfgvalue()
|
||||
local enabled = uci:get("ua2f", "enabled", "enabled")
|
||||
o.value = get_status_html(enabled)
|
||||
return o.value
|
||||
end
|
||||
|
||||
status = s:option(DummyValue, "status", translate("运行状态:"))
|
||||
status.cfgvalue = function(self, section)
|
||||
local pid = luci.sys.exec("pidof ua2f")
|
||||
if pid == "" then
|
||||
return translate("未运行")
|
||||
else
|
||||
return translate("运行中(系统进程 %s)"):format(pid)
|
||||
end
|
||||
end
|
||||
|
||||
s = m:section(NamedSection, "firewall", "ua2f", translate("处理内网流量,防止访问内网时被检测(建议开启)"))
|
||||
|
||||
o = s:option(Button, "__enable_intranet_btn")
|
||||
o.inputtitle = translate("Enable")
|
||||
o.inputstyle = "apply"
|
||||
function o.write()
|
||||
uci:set("ua2f", "firewall", "handle_intranet", "1")
|
||||
uci:commit("ua2f")
|
||||
end
|
||||
|
||||
o = s:option(Button, "__disable_intranet_btn")
|
||||
o.inputtitle = translate("Disable")
|
||||
o.inputstyle = "reset"
|
||||
function o.write()
|
||||
uci:set("ua2f", "firewall", "handle_intranet", "0")
|
||||
uci:commit("ua2f")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "__status")
|
||||
o.rawhtml = true
|
||||
o.placeholder = "-"
|
||||
function o.cfgvalue()
|
||||
local handle_intranet = uci:get("ua2f", "firewall", "handle_intranet")
|
||||
o.value = get_status_html(handle_intranet)
|
||||
return o.value
|
||||
end
|
||||
|
||||
|
||||
s = m:section(NamedSection, "firewall", "ua2f", translate("自动配置防火墙(建议开启)"))
|
||||
|
||||
o = s:option(Button, "__enable_firewall_btn")
|
||||
o.inputtitle = translate("Enable")
|
||||
o.inputstyle = "apply"
|
||||
function o.write()
|
||||
uci:set("ua2f", "firewall", "handle_fw", "1")
|
||||
uci:commit("ua2f")
|
||||
end
|
||||
|
||||
o = s:option(Button, "__disable_firewall_btn")
|
||||
o.inputtitle = translate("Disable")
|
||||
o.inputstyle = "reset"
|
||||
function o.write()
|
||||
uci:set("ua2f", "firewall", "handle_fw", "0")
|
||||
uci:commit("ua2f")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "__status")
|
||||
o.rawhtml = true
|
||||
o.placeholder = "-"
|
||||
function o.cfgvalue()
|
||||
local handle_fw = uci:get("ua2f", "firewall", "handle_fw")
|
||||
o.value = get_status_html(handle_fw)
|
||||
return o.value
|
||||
end
|
||||
|
||||
s = m:section(NamedSection, "firewall", "ua2f", translate("处理443端口流量,443端口出现 http 流量的概率较低(建议关闭)"))
|
||||
|
||||
o = s:option(Button, "__enable_tls_btn")
|
||||
o.inputtitle = translate("Enable")
|
||||
o.inputstyle = "apply"
|
||||
function o.write()
|
||||
uci:set("ua2f", "firewall", "handle_tls", "1")
|
||||
uci:commit("ua2f")
|
||||
end
|
||||
|
||||
o = s:option(Button, "__disable_tls_btn")
|
||||
o.inputtitle = translate("Disable")
|
||||
o.inputstyle = "reset"
|
||||
function o.write()
|
||||
uci:set("ua2f", "firewall", "handle_tls", "0")
|
||||
uci:commit("ua2f")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "__status")
|
||||
o.rawhtml = true
|
||||
o.placeholder = "-"
|
||||
function o.cfgvalue()
|
||||
local handle_tls = uci:get("ua2f", "firewall", "handle_tls")
|
||||
o.value = get_status_html(handle_tls)
|
||||
return o.value
|
||||
end
|
||||
|
||||
s = m:section(NamedSection, "firewall", "ua2f", translate("处理mmtls流量(微信不能正常使用时关闭)"))
|
||||
|
||||
o = s:option(Button, "__enable_mmtls_btn")
|
||||
o.inputtitle = translate("Enable")
|
||||
o.inputstyle = "apply"
|
||||
function o.write()
|
||||
uci:set("ua2f", "firewall", "handle_mmtls", "1")
|
||||
uci:commit("ua2f")
|
||||
end
|
||||
|
||||
o = s:option(Button, "__disable_mmtls_btn")
|
||||
o.inputtitle = translate("Disable")
|
||||
o.inputstyle = "reset"
|
||||
function o.write()
|
||||
uci:set("ua2f", "firewall", "handle_mmtls", "0")
|
||||
uci:commit("ua2f")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "__status")
|
||||
o.rawhtml = true
|
||||
o.placeholder = "-"
|
||||
function o.cfgvalue()
|
||||
local handle_mmtls = uci:get("ua2f", "firewall", "handle_mmtls")
|
||||
o.value = get_status_html(handle_mmtls)
|
||||
return o.value
|
||||
end
|
||||
|
||||
_log = s:option(TextValue, "运行日志")
|
||||
_log.rmempty = true
|
||||
function _log.cfgvalue(self, section)
|
||||
local log_msg = ""
|
||||
local fp = io.popen("logread -e UA2F | tail -n 20")
|
||||
if fp then
|
||||
local data = fp:read("*all")
|
||||
fp:close()
|
||||
log_msg = data
|
||||
else
|
||||
log_msg = translate("Failed to read log.")
|
||||
end
|
||||
return log_msg
|
||||
end
|
||||
|
||||
return m
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
config login
|
||||
option enable '0'
|
||||
option minute '0'
|
||||
option hour '6'
|
||||
@@ -0,0 +1,3 @@
|
||||
config brukamen_mac
|
||||
option current_mac ''
|
||||
option new_mac ''
|
||||
Reference in new issue
Block a user