mirror of https://github.com/bol-van/zapret/
committed by
GitHub
5 changed files with 74 additions and 0 deletions
@ -0,0 +1,17 @@ |
|||
# Copyright 2024
|
|||
# This is free software, licensed under the GNU General Public License v2.
|
|||
|
|||
include $(TOPDIR)/rules.mk |
|||
|
|||
PKG_LICENSE:=GPL-2.0-or-later |
|||
PKG_MAINTAINER:=Zapret |
|||
PKG_VERSION:=0.1.7 |
|||
|
|||
LUCI_TITLE:=Zapret TPWS Web UI |
|||
LUCI_DESCRIPTION:=Provides Web UI for Zapret tpws transparent proxy |
|||
LUCI_DEPENDS:=+luci-compat +luci-mod-admin-full +tpws |
|||
LUCI_PKGARCH:=all |
|||
|
|||
include ../../../feeds/luci/luci.mk |
|||
|
|||
# call BuildPackage - OpenWrt buildroot signature
|
@ -0,0 +1,6 @@ |
|||
module("luci.controller.zapret-tpws", package.seeall) |
|||
function index() |
|||
if nixio.fs.access("/etc/config/zapret") then |
|||
entry({"admin", "services", "zapret-tpws"}, cbi("zapret-tpws"), _("TPWS Configuration")).acl_depends = { "luci-app-zapret-tpws" } |
|||
end |
|||
end |
@ -0,0 +1,29 @@ |
|||
m = Map("zapret", translate("TPWS Proxy Settings")) |
|||
c = m:section(NamedSection, "tpws", "zapret", translate("Configuration")) |
|||
opt = c:option(Value, "opts", translate("TPWS Options")) |
|||
opt.placeholder = "--split-pos=2" |
|||
function checkDoubleMinus(inputString) |
|||
-- Split the string into words |
|||
local words = {} |
|||
for word in inputString:gmatch("%S+") do |
|||
table.insert(words, word) |
|||
end |
|||
|
|||
-- Check each word |
|||
for _, word in ipairs(words) do |
|||
if not word:sub(1, 2) == "--" then |
|||
return false, translate("Error: Not all words start with double minuses.") |
|||
end |
|||
end |
|||
|
|||
return true |
|||
end |
|||
opt.validate = checkDoubleMinus(opt.Value) |
|||
b = c:option(Flag, "block_quic", "Block QUIC", translate("Block QUIC protocol to come outside")) |
|||
lp = c:option(Value, "port", translate("Listen Port")) |
|||
lp.datatype = "port" |
|||
lp.placeholder = "8088" |
|||
fp = c:option(Value, "forward_ports", translate("Ports, forwarded to proxy")) |
|||
fp.datatype = "list(neg(portrange))" |
|||
fp.placeholder = "80 443" |
|||
return m |
@ -0,0 +1,4 @@ |
|||
#!/bin/sh |
|||
rm -rf /var/luci-modulecache/; rm -f /var/luci-indexcache; |
|||
[ -x /etc/init.d/rpcd ] && /etc/init.d/rpcd reload |
|||
exit 0 |
@ -0,0 +1,18 @@ |
|||
{ |
|||
"luci-app-zapret-tpws": { |
|||
"description": "Grant UCI and file access for luci-app-zapret-tpws", |
|||
"read": { |
|||
"cgi-io": [ |
|||
"exec" |
|||
], |
|||
"uci": [ |
|||
"zapret" |
|||
] |
|||
}, |
|||
"write": { |
|||
"uci": [ |
|||
"zapret" |
|||
] |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue