Page MenuHomeFreeBSD

D42665.id130298.diff
No OneTemporary

D42665.id130298.diff

diff --git a/net/Makefile b/net/Makefile
--- a/net/Makefile
+++ b/net/Makefile
@@ -1555,6 +1555,7 @@
SUBDIR += trafshow3
SUBDIR += trickle
SUBDIR += trippy
+ SUBDIR += ts-warp
SUBDIR += tsclient
SUBDIR += tsctp
SUBDIR += tsocks
diff --git a/net/ts-warp/Makefile b/net/ts-warp/Makefile
new file mode 100644
--- /dev/null
+++ b/net/ts-warp/Makefile
@@ -0,0 +1,43 @@
+PORTNAME= ts-warp
+DISTVERSION= 1.4.0.20231116
+CATEGORIES= net
+
+MAINTAINER= zmey20000@yahoo.com
+COMMENT= Transparent proxy server and traffic wrapper
+WWW= https://github.com/mezantrop/ts-warp
+
+LICENSE= BSD2CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+USES= tar:tgz
+
+USE_GITHUB= yes
+GH_ACCOUNT= mezantrop
+GH_TAGNAME= 4c04cb2
+
+USE_RC_SUBR= tswarp
+
+MAKE_ARGS+= CC="${CC}"
+
+OPTIONS_DEFINE= MANPAGES
+OPTIONS_DEFAULT= MANPAGES
+OPTIONS_SUB= yes
+
+.include <bsd.port.options.mk>
+
+do-install:
+ ${MKDIR} ${STAGEDIR}/var/db/ts-warp
+ ${INSTALL_PROGRAM} ${WRKSRC}/ts-warp ${STAGEDIR}${PREFIX}/bin
+ ${INSTALL_PROGRAM} ${WRKSRC}/ts-pass ${STAGEDIR}${PREFIX}/bin
+ ${INSTALL_DATA} ${WRKSRC}/examples/ts-warp.ini \
+ ${STAGEDIR}${PREFIX}/etc/ts-warp.conf.sample
+ ${INSTALL_DATA} ${WRKSRC}/examples/ts-warp_pf_freebsd.conf \
+ ${STAGEDIR}${PREFIX}/etc/ts-warp_pf.conf.sample
+
+post-install-MANPAGES-on:
+ ${INSTALL_MAN} ${WRKSRC}/man/ts-pass.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
+ ${INSTALL_MAN} ${WRKSRC}/man/ts-warp.sh.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
+ ${INSTALL_MAN} ${WRKSRC}/man/ts-warp.5 ${STAGEDIR}${MAN5PREFIX}/man/man5
+ ${INSTALL_MAN} ${WRKSRC}/man/ts-warp.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
+
+.include <bsd.port.mk>
diff --git a/net/ts-warp/distinfo b/net/ts-warp/distinfo
new file mode 100644
--- /dev/null
+++ b/net/ts-warp/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1700154839
+SHA256 (mezantrop-ts-warp-1.4.0.20231116-4c04cb2_GH0.tar.gz) = 772a1b5a7c01ec22738eb7b145bbc98e66dd5cdbff7eca044bc863060cc61566
+SIZE (mezantrop-ts-warp-1.4.0.20231116-4c04cb2_GH0.tar.gz) = 22432892
diff --git a/net/ts-warp/files/tswarp.in b/net/ts-warp/files/tswarp.in
new file mode 100755
--- /dev/null
+++ b/net/ts-warp/files/tswarp.in
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+# PROVIDE: tswarp
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# tswarp_enable (bool): Set to NO by default.
+# Set it to YES to enable ts-warp.
+# tswarp_configfile (string): Set to %%PREFIX%%/etc/ts-warp.conf
+#
+# tswarp_pfconf (string): Set to %%PREFIX%%/etc/ts-warp_pf.conf
+#
+# tswarp_flags (string): Set to "-d -v 2" by default
+
+. /etc/rc.subr
+
+name=tswarp
+desc="ts-warp serice startup script"
+rcvar=tswarp_enable
+
+load_rc_config $name
+
+: ${tswarp_enable:=NO}
+: ${tswarp_configfile:="%%PREFIX%%/etc/ts-warp.conf"}
+: ${tswarp_pfconf:="%%PREFIX%%/etc/ts-warp_pf.conf"}
+: ${tswarp_logfile:=/var/log/ts-warp.log}
+: ${tswarp_pidfile:=/var/run/ts-warp.pid}
+: ${tswarp_actfile:=/var/db/ts-warp/ts-warp.act}
+: ${tswarp_flags="-d -v 2"}
+
+command="%%PREFIX%%/bin/ts-warp"
+command_args="-c ${tswarp_configfile} -l ${tswarp_logfile} \
+ -p ${tswarp_pidfile} -t ${tswarp_actfile} ${tswarp_flags}"
+required_files="${tswarp_configfile} ${tswarp_pfconf}"
+start_precmd=ts_warp_prestart
+stop_postcmd="[ -e /etc/pf.conf ] && /sbin/pfctl -f /etc/pf.conf"
+
+ts_warp_prestart()
+{
+ echo "Configuring PF for TS-Warp"
+
+ awk -v pf_conf=${tswarp_pfconf} '
+ /ts-warp/ {next}
+ /ns-warp/ {next}
+ /rdr-anchor/ {rdrpos = NR}
+ {pf[NR] = $0}
+
+ END {
+ for (i = 0; i < NR; i++)
+ if (i == rdrpos + 1) {
+ print("rdr-anchor \"ts-warp\"")
+ print("rdr-anchor \"ns-warp\"")
+ } else
+ print(pf[i])
+ print("anchor \"ts-warp\"")
+ print("anchor \"ns-warp\"")
+ printf("load anchor \"ts-warp\" from \"%s\"\n", pf_conf)
+ }
+ ' /etc/pf.conf | /sbin/pfctl -f -
+}
+
+run_rc_command "$1"
diff --git a/net/ts-warp/pkg-descr b/net/ts-warp/pkg-descr
new file mode 100644
--- /dev/null
+++ b/net/ts-warp/pkg-descr
@@ -0,0 +1,6 @@
+ts-warp - Transparent proxy server and traffic wrapper
+
+It features a proxy services with TCP-traffic redirection to
+external Socks4/5 and HTTPS proxy servers:
+ - Transparent firewall-based traffic redirector
+ - Internal Socks and HTTPS proxy server
diff --git a/net/ts-warp/pkg-plist b/net/ts-warp/pkg-plist
new file mode 100644
--- /dev/null
+++ b/net/ts-warp/pkg-plist
@@ -0,0 +1,9 @@
+bin/ts-pass
+bin/ts-warp
+@sample etc/ts-warp.conf.sample
+@sample etc/ts-warp_pf.conf.sample
+@dir /var/db/ts-warp
+%%MANPAGES%%man/man1/ts-pass.1.gz
+%%MANPAGES%%man/man1/ts-warp.sh.1.gz
+%%MANPAGES%%man/man5/ts-warp.5.gz
+%%MANPAGES%%man/man8/ts-warp.8.gz

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 8, 8:00 AM (6 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31087260
Default Alt Text
D42665.id130298.diff (4 KB)

Event Timeline