mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 21:05:13 +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,15 @@
|
||||
# Copyright (C) 2018-2019 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:=+luci-compat +zlib +libpthread +librt +libreadline +libncurses +libiconv-full +kmod-tun +libopenssl +softethervpn5-bridge +softethervpn5-client +softethervpn5-server
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
module("luci.controller.softethervpn",package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/softethervpn") then
|
||||
return
|
||||
end
|
||||
|
||||
entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false
|
||||
local page = entry({"admin", "vpn", "softethervpn"}, cbi("softethervpn"), _("SoftEther VPN Service"), 50)
|
||||
page.dependent = true
|
||||
page.acl_depends = { "luci-app-softethervpn" }
|
||||
entry({"admin", "vpn", "softethervpn", "status"}, call("act_status")).leaf = true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e = {}
|
||||
e.running = luci.sys.call("pidof vpnserver >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
@@ -0,0 +1,17 @@
|
||||
local s = require"luci.sys"
|
||||
local m,s,o
|
||||
|
||||
m = Map("softethervpn", translate("SoftEther VPN Server"))
|
||||
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:section(SimpleSection).template = "softethervpn/softethervpn_status"
|
||||
|
||||
s = m:section(TypedSection, "softether")
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "enable", translate("Enabled"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(DummyValue, "moreinfo", translate("<strong>控制台下载:<a onclick=\"window.open('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')\"><br/>Windows-x86_x64-intel.exe</a><a onclick=\"window.open('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')\"><br/>macos-x86-32bit.pkg</a></strong>"))
|
||||
|
||||
return m
|
||||
@@ -0,0 +1,22 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[vpn]], [[softethervpn]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('softethervpn_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
var links = '<em><b><font color=green>softethervpn <%:RUNNING%></font></b></em>';
|
||||
tb.innerHTML = links;
|
||||
} else {
|
||||
tb.innerHTML = '<em><b><font color=red>softethervpn <%:NOT RUNNING%></font></b></em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="softethervpn_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
zh_Hans
|
||||
@@ -0,0 +1,20 @@
|
||||
msgid "SoftEther VPN Server"
|
||||
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 "Enabled"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "PPTP VPN Server status"
|
||||
msgstr "PPTP VPN 服务器运行状态"
|
||||
|
||||
msgid "Open L2TP/IPSec firewall"
|
||||
msgstr "开启 L2TP/IPSec 防火墙"
|
||||
|
||||
msgid "Open the MS-SSTP firewall"
|
||||
msgstr "开启 MS-SSTP 防火墙"
|
||||
|
||||
msgid "Open the OpenVPN firewall"
|
||||
msgstr "开启 OpenVPN 防火墙"
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
config softether
|
||||
option enable '0'
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (C) 2015 OpenWrt-dist
|
||||
# Copyright (C) 2016 Chen RuiWei <crwbak@gmail.com>
|
||||
# Copyright (C) 2018-2019 Lienol
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
CONFIG=softethervpn
|
||||
|
||||
get_config()
|
||||
{
|
||||
config_get_bool enable $1 enable 0
|
||||
}
|
||||
|
||||
uci_get_by_type() {
|
||||
local index=0
|
||||
if [ -n $4 ]; then
|
||||
index=$4
|
||||
fi
|
||||
local ret=$(uci get $CONFIG.@$1[$index].$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
config_load softethervpn
|
||||
config_foreach get_config softether
|
||||
[ $enable -ne 1 ] && exit 0
|
||||
logger -t 'softethervpn' "Starting softether vpnserver service."
|
||||
/usr/bin/env LANG=en_US.UTF-8 /usr/libexec/softethervpn/vpnserver start > /dev/null 2>&1
|
||||
fw3 reload
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
logger -t 'softethervpn' "Stopping softether vpnserver service."
|
||||
/usr/bin/env LANG=en_US.UTF-8 /usr/libexec/softethervpn/vpnserver stop > /dev/null 2>&1
|
||||
fw3 reload
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete firewall.softethervpn
|
||||
set firewall.softethervpn=include
|
||||
set firewall.softethervpn.type=script
|
||||
set firewall.softethervpn.path=/usr/share/softethervpn/firewall.include
|
||||
set firewall.softethervpn.reload=1
|
||||
EOF
|
||||
|
||||
/etc/init.d/softethervpnbridge disable && /etc/init.d/softethervpnbridge stop
|
||||
/etc/init.d/softethervpnclient disable && /etc/init.d/softethervpnclient stop
|
||||
/etc/init.d/softethervpnserver disable && /etc/init.d/softethervpnserver stop
|
||||
|
||||
chmod a+x /usr/share/softethervpn/* >/dev/null 2>&1
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"luci-app-softethervpn": {
|
||||
"description": "Grant UCI access for luci-app-softethervpn",
|
||||
"read": {
|
||||
"uci": [ "softethervpn" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "softethervpn" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
openvpnport=$(cat /usr/libexec/softethervpn/vpn_server.config 2>/dev/null|grep OpenVPN_UdpPortList | awk -F " " '{print $3}')
|
||||
[ -z "$openvpnport" ] && openvpnport=1194
|
||||
iptables -D INPUT -p udp -m multiport --dports 500,1701,4500 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
[ -n "$openvpnport" ] && iptables -D INPUT -p udp --dport $openvpnport -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
[ -n "$openvpnport" ] && iptables -D INPUT -p tcp --dport $openvpnport -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
iptables -D INPUT -p tcp --dport 443 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
iptables -D INPUT -p tcp --dport 5555 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
iptables -D INPUT -p tcp --dport 8888 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
iptables -D INPUT -p tcp --dport 992 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
|
||||
enable=$(uci get softethervpn.@softether[0].enable)
|
||||
if [ $enable -eq 1 ]; then
|
||||
iptables -I INPUT -p udp -m multiport --dports 500,1701,4500 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
iptables -I INPUT -p udp --dport $openvpnport -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport $openvpnport -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport 443 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport 5555 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport 8888 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport 992 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT
|
||||
fi
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"config": "softethervpn",
|
||||
"init": "softethervpn"
|
||||
}
|
||||
Reference in new issue
Block a user