mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-30 05:05:13 +08:00
update 2026-10-07 11:52:44
This commit is contained in:
1 parent
d6cc6efa77
commit
617f7ca2a6
4898 files changed
-1713675
No files matched your search
@@ -1,16 +0,0 @@
|
||||
# Copyright (C) 2018-2022 Lienol
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for SoftEtherVPN
|
||||
LUCI_DEPENDS:=+zlib +libpthread +librt +libreadline +libncurses +libiconv-full +kmod-tun +libopenssl +softethervpn-server
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=20260426
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@@ -1,18 +0,0 @@
|
||||
module("luci.controller.softethervpn", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/luci-app-softethervpn") then return end
|
||||
|
||||
e = entry({"admin", "vpn", "softethervpn"}, cbi("softethervpn"), _("SoftEther VPN"), 80)
|
||||
e.dependent = true
|
||||
e.acl_depends = { "luci-app-softethervpn" }
|
||||
|
||||
entry({"admin", "vpn", "softethervpn", "status"}, call("status")).leaf = true
|
||||
end
|
||||
|
||||
function status()
|
||||
local e = {}
|
||||
e.status = luci.sys.call("pidof %s >/dev/null" % "vpnserver") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
@@ -1,38 +0,0 @@
|
||||
m = Map("luci-app-softethervpn", translate("SoftEther VPN"))
|
||||
m.description = translate("SoftEther VPN is an open source, cross-platform, multi-protocol virtual private network solution developed by university of tsukuba graduate student Daiyuu Nobori for master's thesis. <br>can easily set up OpenVPN, IPsec, L2TP, ms-sstp, L2TPv3 and EtherIP servers on the router using the console.")
|
||||
m.template = "softethervpn/index"
|
||||
|
||||
s = m:section(TypedSection, "softether")
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(DummyValue, "softethervpn_status", translate("Current Condition"))
|
||||
o.template = "softethervpn/status"
|
||||
o.value = translate("Collecting data...")
|
||||
|
||||
o = s:option(Flag, "enabled", translate("Enabled"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(DummyValue, "moreinfo", translate("Console download"))
|
||||
o.rawhtml = true
|
||||
o.cfgvalue = function(self, section)
|
||||
local obj = {
|
||||
{
|
||||
title = "Windows-x86_x64-intel.exe",
|
||||
url = "https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.38-9760-rtm/softether-vpnserver_vpnbridge-v4.38-9760-rtm-2021.08.17-windows-x86_x64-intel.exe"
|
||||
},
|
||||
{
|
||||
title = "macos-x86-32bit.pkg",
|
||||
url = "https://www.softether-download.com/files/softether/v4.21-9613-beta-2016.04.24-tree/Mac_OS_X/Admin_Tools/VPN_Server_Manager_Package/softether-vpnserver_manager-v4.21-9613-beta-2016.04.24-macos-x86-32bit.pkg"
|
||||
}
|
||||
}
|
||||
|
||||
local html = ""
|
||||
|
||||
for i, o in ipairs(obj) do
|
||||
html = html .. string.format("<a href='%s'>%s   </a>", o.url, o.title)
|
||||
end
|
||||
|
||||
return html
|
||||
end
|
||||
|
||||
return m
|
||||
@@ -1,13 +0,0 @@
|
||||
<% include("cbi/map") %>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(2, '<%=luci.dispatcher.build_url("admin", "vpn", "softethervpn", "status")%>', null,
|
||||
function(x, result)
|
||||
{
|
||||
var status = document.getElementsByClassName('softethervpn_status')[0];
|
||||
status.setAttribute("style","font-weight:bold;");
|
||||
status.setAttribute("color",result.status ? "green":"red");
|
||||
status.innerHTML = result.status?'<%=translate("RUNNING")%>':'<%=translate("NOT RUNNING")%>';
|
||||
}
|
||||
)
|
||||
//]]>
|
||||
</script>
|
||||
@@ -1,3 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<font class="softethervpn_status"><%=pcdata(self:cfgvalue(section) or self.default or "")%></font>
|
||||
<%+cbi/valuefooter%>
|
||||
@@ -1,17 +0,0 @@
|
||||
msgid "SoftEther VPN"
|
||||
msgstr "SoftEther VPN 服务器"
|
||||
|
||||
msgid "SoftEther VPN is an open source, cross-platform, multi-protocol virtual private network solution developed by university of tsukuba graduate student Daiyuu Nobori for master's thesis. <br>can easily set up OpenVPN, IPsec, L2TP, ms-sstp, L2TPv3 and EtherIP servers on the router using the console."
|
||||
msgstr "SoftEther VPN是由筑波大学研究生Daiyuu Nobori因硕士论文开发的开源,跨平台,多重协定的虚拟私人网路方案。<br/>使用控制台可以轻松在路由器上搭建OpenVPN, IPsec, L2TP, MS-SSTP, L2TPv3 和 EtherIP服务器。"
|
||||
|
||||
msgid "Current Condition"
|
||||
msgstr "当前状态"
|
||||
|
||||
msgid "Collecting data..."
|
||||
msgstr "收集数据..."
|
||||
|
||||
msgid "Enabled"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Console download"
|
||||
msgstr "控制台下载"
|
||||
@@ -1 +0,0 @@
|
||||
zh-cn
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
config softether
|
||||
option enabled '0'
|
||||
@@ -1,90 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2016 Chen RuiWei <crwbak@gmail.com>
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
CONFIG="luci-app-softethervpn"
|
||||
IPT="iptables -w"
|
||||
|
||||
add_rule() {
|
||||
openvpnport=$(cat /usr/libexec/softethervpn/vpn_server.config 2>/dev/null | grep OpenVPN_UdpPortList | awk -F " " '{print $3}')
|
||||
[ -z "$openvpnport" ] && openvpnport=1194
|
||||
|
||||
${IPT} -N SOFTETHER_VPN-SERVER
|
||||
${IPT} -I INPUT -j SOFTETHER_VPN-SERVER
|
||||
|
||||
${IPT} -A SOFTETHER_VPN-SERVER -p udp -m multiport --dports 500,1701,4500 -m comment --comment "L2TP-IPSec" -j ACCEPT
|
||||
${IPT} -A SOFTETHER_VPN-SERVER -p udp --dport $openvpnport -m comment --comment "OpenVPN" -j ACCEPT
|
||||
${IPT} -A SOFTETHER_VPN-SERVER -p tcp --dport $openvpnport -m comment --comment "OpenVPN" -j ACCEPT
|
||||
${IPT} -A SOFTETHER_VPN-SERVER -p tcp --dport 5555 -j ACCEPT
|
||||
${IPT} -A SOFTETHER_VPN-SERVER -p tcp --dport 8888 -j ACCEPT
|
||||
${IPT} -A SOFTETHER_VPN-SERVER -p tcp --dport 992 -j ACCEPT
|
||||
${IPT} -t mangle -I OUTPUT -p udp -m multiport --sports 500,1701,4500 -m comment --comment "SOFTETHER_VPN-SERVER-L2TP-IPSec" -j RETURN
|
||||
${IPT} -t mangle -I OUTPUT -p udp --sport $openvpnport -m comment --comment "SOFTETHER_VPN-SERVER-OPENVPN" -j RETURN
|
||||
${IPT} -t mangle -I OUTPUT -p tcp --sport $openvpnport -m comment --comment "SOFTETHER_VPN-SERVER-OPENVPN" -j RETURN
|
||||
}
|
||||
|
||||
del_rule() {
|
||||
ipt_del() {
|
||||
for i in $(seq 1 $($1 -nL $2 | grep -c "SOFTETHER_VPN-SERVER")); do
|
||||
local index=$($1 --line-number -nL $2 | grep "SOFTETHER_VPN-SERVER" | head -1 | awk '{print $1}')
|
||||
$1 -w -D $2 $index 2>/dev/null
|
||||
done
|
||||
}
|
||||
|
||||
ipt_del "${IPT} -t mangle" "OUTPUT"
|
||||
ipt_del "${IPT}" "INPUT"
|
||||
|
||||
${IPT} -F SOFTETHER_VPN-SERVER 2>/dev/null
|
||||
${IPT} -X SOFTETHER_VPN-SERVER 2>/dev/null
|
||||
}
|
||||
|
||||
gen_include() {
|
||||
echo '#!/bin/sh' > /var/etc/$CONFIG.include
|
||||
extract_rules() {
|
||||
echo "*$1"
|
||||
iptables-save -t $1 | grep "SOFTETHER_VPN-SERVER" | \
|
||||
sed -e "s/^-A \(INPUT\)/-I \1 1/"
|
||||
echo 'COMMIT'
|
||||
}
|
||||
cat <<-EOF >> /var/etc/$CONFIG.include
|
||||
iptables-save -c | grep -v "SOFTETHER_VPN-SERVER" | iptables-restore -c
|
||||
iptables-restore -n <<-EOT
|
||||
$(extract_rules filter)
|
||||
EOT
|
||||
exit 0
|
||||
EOF
|
||||
return 0
|
||||
}
|
||||
|
||||
start_service() {
|
||||
enabled=$(uci -q get $CONFIG.@softether[0].enabled || echo "0")
|
||||
[ $enabled -ne 1 ] && return 0
|
||||
|
||||
procd_open_instance $CONFIG
|
||||
procd_set_param env LANG=en_US.UTF-8
|
||||
procd_set_param command /usr/libexec/softethervpn/vpnserver start --foreground
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
|
||||
add_rule
|
||||
gen_include
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
#top -bn1 | grep "/usr/libexec/softethervpn" | grep -v "grep" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1
|
||||
/usr/libexec/softethervpn/vpnserver stop
|
||||
del_rule
|
||||
rm -rf /var/etc/$CONFIG.include
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
restart
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger $CONFIG
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete firewall.luci_app_softethervpn
|
||||
set firewall.luci_app_softethervpn=include
|
||||
set firewall.luci_app_softethervpn.type=script
|
||||
set firewall.luci_app_softethervpn.path=/var/etc/luci-app-softethervpn.include
|
||||
EOF
|
||||
|
||||
if [ -x "/sbin/fw3" ] && [ ! -L "/sbin/fw3" ]; then
|
||||
uci -q set firewall.luci_app_softethervpn.reload='1'
|
||||
else
|
||||
uci -q delete firewall.luci_app_softethervpn.reload
|
||||
uci -q delete firewall.luci_app_softethervpn.fw4_compatible
|
||||
fi
|
||||
uci commit firewall
|
||||
|
||||
/etc/init.d/softethervpnserver stop 2>/dev/null
|
||||
/etc/init.d/softethervpnserver disable 2>/dev/null
|
||||
|
||||
rm -rf /tmp/luci-*cache
|
||||
exit 0
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"luci-app-softethervpn": {
|
||||
"description": "Grant UCI access for luci-app-softethervpn",
|
||||
"read": {
|
||||
"uci": [ "luci-app-softethervpn" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "luci-app-softethervpn" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"config": "luci-app-softethervpn",
|
||||
"init": "luci-app-softethervpn"
|
||||
}
|
||||
Reference in new issue
Block a user