Compare commits

..

No commits in common. "b82dbcd0e6ca1b38954cb59f6f5c7135eb68a5ca" and "e1ea96271542f0bbe807a8da9e86e5a61796e780" have entirely different histories.

4 changed files with 44 additions and 79 deletions

View File

@ -14,27 +14,19 @@ How to compile native programs for use in openwrt
cd openwrt
2) #go to openwrt directory
cd ~/openwrt
#Create custom feed:
mkdir custom-feed
cp feeds.conf.default feeds.conf
echo "src-link custom ~/openwrt/custom-feed/" >> ~/openwrt/feeds.conf
3) #add zapret packages to custom feed
#create zapret directory structure
mkdir -p ~/openwrt/custom-feed/zapret
#copy source code of tpws
copy tpws to ~/openwrt/custom-feed/zapret/tpws
#copy source code of nfq
copy nfq to ~/openwrt/custom-feed/zapret/nfq
#copy source code of ip2net
copy ip2net to ~/openwrt/custom-feed/zapret/ip2net
4) ./scripts/feeds update -a
2) ./scripts/feeds update -a
./scripts/feeds install -a
3) #add zapret packages to build root
#copy package descriptions
copy compile/openwrt/* to ~/openwrt
#copy source code of tpws
copy tpws to ~/openwrt/package/zapret/tpws
#copy source code of nfq
copy nfq to ~/openwrt/package/zapret/nfq
#copy source code of ip2net
copy ip2net to ~/openwrt/package/zapret/ip2net
4) make menuconfig
#select your target architecture
#select packages Network/Zapret/* as "M"

View File

@ -1,27 +1,19 @@
# Copyright Zapret
# This is free software, licensed under the GNU General Public License v2.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=tpws
PKG_VERSION:=1.4
PKG_RELEASE:=2
PKG_LICENSE:=GPL-2.0-or-later
PKG_MAINTAINER:=Zapret
PKG_RELEASE:=1.1
include $(INCLUDE_DIR)/package.mk
define Package/tpws
SECTION:=net
CATEGORY:=Network
TITLE:=TPWS DPI bypass proxy server
TITLE:=tpws
SUBMENU:=Zapret
DEPENDS:=+zlib +libcap +libcap +iptables
endef
DEPENDS:=+zlib +libcap +zlib +libcap +iptables
define Package/tpws/description
DPI bypass proxy
endef
define Build/Prepare
@ -49,3 +41,4 @@ define Package/tpws/install
endef
$(eval $(call BuildPackage,tpws))

View File

@ -2,5 +2,3 @@ config zapret tpws
option opts "--split-pos=2"
option pidfile "tpws.pid"
option port "8088"
option forward_ports "80 443"
option block_quic no

View File

@ -7,34 +7,32 @@ START=21
CONFIGURATION=zapret
PIDDIR=/var/run
load_fw_rules()
{
for fp in $3
do
json_add_object ""
json_add_string type redirect
json_add_string name "Transparent Proxy Redirect port $fp"
json_add_string src lan
json_add_string proto tcp
json_add_string dest_port "$1"
json_add_string src_dip "!$2"
json_add_string dest_ip "$2"
json_add_string src_dport "$fp"
json_add_string dest lan
json_close_object
done
json_add_object ""
json_add_string type redirect
json_add_string name "Transparent Proxy Redirect HTTP"
json_add_string src lan
json_add_string proto tcp
json_add_string dest_port "$1"
json_add_string src_dip "!$2"
json_add_string dest_ip "$2"
json_add_string src_dport "80"
json_add_string dest lan
json_close_object
if [ "$4" = "1" ]; then
json_add_object ""
json_add_string type rule
json_add_string name "deny quic traffic"
json_add_string src lan
json_add_string proto udp
json_add_string dest_port "443"
json_add_string dest wan
json_add_string target "REJECT"
json_close_object
fi
json_add_object ""
json_add_string type redirect
json_add_string name "Transparent Proxy Redirect HTTPS"
json_add_string src lan
json_add_string proto tcp
json_add_string dest_port "$1"
json_add_string src_dip "!$2"
json_add_string dest_ip "$2"
json_add_string src_dport "443"
json_add_string dest lan
json_close_object
}
start_service()
@ -46,16 +44,11 @@ start_service()
local pid
local lanaddr
local lport
local fports
local blockq
config_get opts tpws opts
config_get pid tpws pid "tpws.pid"
config_get lport tpws port "8088"
config_get fports tpws forward_ports "80 443"
config_get_bool blockq tpws block_quic 0
config_load "network"
config_get pid tpws pid
config_get lport tpws port
config_load "network"
config_get lanaddr lan ipaddr
procd_open_instance
@ -68,13 +61,14 @@ start_service()
procd_append_param command "--bind-wait-ip=10"
procd_append_param command "$opts"
procd_set_param file /etc/config/zapret
procd_set_param pidfile "$PIDDIR/$pid"
procd_set_param netdev "br-lan"
procd_open_data
json_add_array firewall
load_fw_rules "$lport" "$lanaddr" "$fports" "$blockq"
load_fw_rules "$lport" "$lanaddr"
json_close_array
procd_close_data
@ -90,18 +84,6 @@ stop_service()
echo "STOP Zapret service"
}
service_triggers()
{
procd_add_reload_trigger "zapret"
}
reload_service()
{
echo "Restarting service"
stop
start
}
service_started()
{
procd_set_config_changed firewall