🌴 Sync 2026-03-05 23:51:42

This commit is contained in:
github-actions[bot] committed 2026-03-05 23:51:42 +08:00
1 parent 0d155c70be
commit 32600acc60
14258 files changed
+3954570

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
# Copyright (C) 2016 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for PPTP VPN Server
LUCI_DEPENDS:=+pptpd +kmod-mppe +ppp
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-pptp-server
PKG_VERSION:=1.0
PKG_RELEASE:=1
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature
@@ -0,0 +1,18 @@
module("luci.controller.pptp-server", package.seeall)
function index()
if not nixio.fs.access("/etc/config/pptpd") then
return
end
entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false
entry({"admin", "vpn", "pptp-server"}, cbi("pptp-server"), _("PPTP VPN Server"), 80).dependent = false
entry({"admin", "vpn", "pptp-server", "status"}, call("act_status")).leaf = true
end
function act_status()
local e = {}
e.running = luci.sys.call("pgrep pptpd >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
@@ -0,0 +1,37 @@
mp = Map("pptpd")
mp.title = translate("PPTP VPN Server")
mp.description = translate("PPTP VPN Server connectivity using the native built-in VPN Client on Windows/Linux or Android")
mp:section(SimpleSection).template = "pptp-server/pptp-server_status"
s = mp:section(NamedSection, "pptpd", "service")
s.anonymouse = true
enabled = s:option(Flag, "enabled", translate("Enable"))
enabled.default = 0
enabled.rmempty = false
localip = s:option(Value, "localip", translate("Local IP"))
localip.datatype = "ip4addr"
clientip = s:option(Value, "remoteip", translate("Client IP"))
clientip.description = translate("LAN DHCP reserved start-to-end IP addresses with the same subnet mask")
clientip.datatype = "string"
remotedns = s:option(Value, "remotedns", translate("Remote Client DNS"))
remotedns.datatype = "ip4addr"
logging = s:option(Flag, "logwtmp", translate("Debug Logging"))
logging.default = 0
logging.rmempty = false
logins = mp:section(NamedSection, "login", "login", translate("PPTP Logins"))
logins.anonymouse = true
username = logins:option(Value, "username", translate("User name"))
username.datatype = "string"
password = logins:option(Value, "password", translate("Password"))
password.password = true
return mp
@@ -0,0 +1,22 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[vpn]], [[pptp-server]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('pptp-server_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>PPTP VPN Server <%:RUNNING%></font></b></em>';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red>PPTP VPN Server <%:NOT RUNNING%></font></b></em>';
}
}
}
);
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="pptp-server_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>
+53
View File
@@ -0,0 +1,53 @@
msgid "Disable from startup"
msgstr "禁止开机启动"
msgid "Enable on startup"
msgstr "允许开机启动"
msgid "PPTP VPN Server"
msgstr "PPTP VPN 服务器"
msgid "PPTP Service"
msgstr "PPTP 服务设置"
msgid "Local IP"
msgstr "PPTP 服务器IP"
msgid "Client IP"
msgstr "客户端分配的IP范围"
msgid "LAN DHCP reserved start-to-end IP addresses with the same subnet mask"
msgstr "使用和 LAN 同一网段。请使用 DHCP分配地址以外的空余IP地址范围,例如 192.168.0.20-30"
msgid "Remote Client DNS"
msgstr "客户端分配 IP 的 DNS 服务器"
msgid "Debug Logging"
msgstr "记录日志"
msgid "PPTP Logins"
msgstr "PPTP 登录设置"
msgid "User name"
msgstr "用户名"
msgid "Password"
msgstr "密码"
msgid "Enable"
msgstr "启用"
msgid "PPTPD status"
msgstr "PPTPD 服务状态"
msgid "Start"
msgstr "启动"
msgid "Stop"
msgstr "关闭"
msgid "PPTP VPN Server"
msgstr "PPTP VPN 服务器"
msgid "PPTP VPN Server connectivity using the native built-in VPN Client on Windows/Linux or Android"
msgstr "使用 Windows/Linux 或者 Android 内置的 PPTP VPN 客户端进行连接"
+1
View File
@@ -0,0 +1 @@
zh-cn
@@ -0,0 +1,12 @@
config service 'pptpd'
option enabled '0'
option remoteip '192.168.0.20-30'
option remotedns '192.168.0.1'
option logwtmp '0'
option localip '192.168.0.1'
config login 'login'
option username 'lean'
option password 'I234567B'
+11
View File
@@ -0,0 +1,11 @@
iptables -D forwarding_rule -i pppoe+ -j RETURN 2>/dev/null
iptables -D forwarding_rule -o pppoe+ -j RETURN 2>/dev/null
iptables -D forwarding_rule -i ppp+ -m conntrack --ctstate NEW -j ACCEPT 2>/dev/null
iptables -D forwarding_rule -o ppp+ -m conntrack --ctstate NEW -j ACCEPT 2>/dev/null
iptables -A forwarding_rule -i pppoe+ -j RETURN
iptables -A forwarding_rule -o pppoe+ -j RETURN
iptables -A forwarding_rule -i ppp+ -m conntrack --ctstate NEW -j ACCEPT
iptables -A forwarding_rule -o ppp+ -m conntrack --ctstate NEW -j ACCEPT
echo 1 > /proc/sys/net/ipv4/conf/br-lan/proxy_arp
@@ -0,0 +1,47 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-pptpd.json" ] && {
cat > /usr/share/ucitrack/luci-app-pptpd.json << EEOF
{
"config": "pptpd",
"init": "pptpd"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete firewall.pptpd
set firewall.pptpd=include
set firewall.pptpd.type=script
set firewall.pptpd.path=/etc/pptpd.include
set firewall.pptpd.reload=1
delete firewall.pptp
add firewall rule
rename firewall.@rule[-1]="pptp"
set firewall.@rule[-1].name="pptp"
set firewall.@rule[-1].target="ACCEPT"
set firewall.@rule[-1].src="wan"
set firewall.@rule[-1].proto="tcp"
set firewall.@rule[-1].dest_port="1723"
delete firewall.gre
add firewall rule
rename firewall.@rule[-1]="gre"
set firewall.@rule[-1].name="gre"
set firewall.@rule[-1].target="ACCEPT"
set firewall.@rule[-1].src="wan"
set firewall.@rule[-1].proto="47"
commit firewall
EOF
uci -q batch <<-EOF >/dev/null
delete ucitrack.@pptpd[-1]
add ucitrack pptpd
set ucitrack.@pptpd[-1].init=pptpd
commit ucitrack
EOF
/etc/init.d/pptpd enable && /etc/init.d/pptpd restart
rm -f /tmp/luci-indexcache
exit 0
@@ -0,0 +1,11 @@
{
"luci-app-pptp-server": {
"description": "Grant UCI access for luci-app-pptp-server",
"read": {
"uci": [ "pptpd" ]
},
"write": {
"uci": [ "pptpd" ]
}
}
}