From nobody Sun Nov 19 14:22:37 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SYCXF41tdz51qvl; Sun, 19 Nov 2023 14:22:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SYCXF3Dbgz3TFC; Sun, 19 Nov 2023 14:22:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700403757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jayoblFw1oWqgT+ha6AQ2oyO9MYEmqTjZtlVP8XMfF0=; b=PkmBlYej4Yj0UzxaFjqWyI7iKG+Tq19vuc4NEyG21JgyZ8klz1vUTymOYFHpuofmncd9lx F81/E3RB80EMbi9jPIV48ODzUn8U6NmyWdSR9MVxtLi/OpFPVuwvpLovrdVlQeoE+GJK1X HEftl/M5NSfFq7UPfMS9Jq+IJCySHCw9foRRzS5W5nsgx0b7P4me39AGyjcECd7qydmdmk bnl1+KTft3DmE3J9ed8KDrt/N11srkmRakbKZJ0nQqXn3flOVNdsrxi9OdtOBmVSOEESwI wFwLyjSOcMFcKOGM2OP5Ja1kAy4NtOtPA5/y7ip5ptcRAOZN/Bp19TKxnBQ4xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700403757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jayoblFw1oWqgT+ha6AQ2oyO9MYEmqTjZtlVP8XMfF0=; b=W6wmcreOSepQby/DQTonUuELm0uKOhWNB/FdNPj5h5xm3HGRmY3DzTSMQwurdDWbWm4MPG Ef4C3i7VLhqnuG3Y69fcU7X0QUl4L4Z/BskZXcvYQcnJnTOanaNM5L6uk/Bvyij+b7E1T4 /sgTHD5E20ozzpbPDHY6sBg5lWggKBDstSaoZYTrU2ZGGqSv6C6gG6swbhPZcT7TwtgJEw tqnXdftf1Bg1EnNPUnaf0uR337s7zkUG8khfLN8pF8cYIDurLfTiHsWGwX+w6lU+thFA6k 8jt2+majgc2D+yKwNwR5qZH//8TZiv0SuWyBbRyDpxNcjSLEwQBD8QCmWHMKcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700403757; a=rsa-sha256; cv=none; b=Bkjo7gaADR6cNXeAQgwLeRzASTCSnjk+9df7+2acNGwCOwIu9uaUpoBXh4QeWNr4Dm1Agx CvrpNBcXoW1h2jnMKDFU0E7da5J5hg0NW3w8tEp5OYKXbvXui4RlU8q123tbSwJbFftuIT AA+YODzf/wPtGrDAqM/Mh+V3VBh2O3k67dWOO53fGHOwsgl8ICMb5y2ykVKY3LDTXt/4ee PxFTHhZZxLPmIsdK/xCo7fKIkBY2zFWi2ynGE44hr6jS9kckdIdqLy32fiwQtmlqftU8+a aSZHWgdvstHi0KlrPDim5y4USpysOl1mkgSfh3fYdfHE/3f4k4E5UbW/YDpWLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SYCXF2H4Fz1C6H; Sun, 19 Nov 2023 14:22:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AJEMb6K016934; Sun, 19 Nov 2023 14:22:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AJEMbwh016931; Sun, 19 Nov 2023 14:22:37 GMT (envelope-from git) Date: Sun, 19 Nov 2023 14:22:37 GMT Message-Id: <202311191422.3AJEMbwh016931@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Juraj Lutter Subject: git: ab04066dd703 - main - net/ts-warp: Add new port List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: otis X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab04066dd703688b2ca580c6c20d26e14e6d3a37 Auto-Submitted: auto-generated The branch main has been updated by otis: URL: https://cgit.FreeBSD.org/ports/commit/?id=ab04066dd703688b2ca580c6c20d26e14e6d3a37 commit ab04066dd703688b2ca580c6c20d26e14e6d3a37 Author: Juraj Lutter AuthorDate: 2023-11-17 22:25:29 +0000 Commit: Juraj Lutter CommitDate: 2023-11-19 14:22:25 +0000 net/ts-warp: Add new port Add net/ts-warp port, Transparent proxy server and traffic wrapper. WWW: https://github.com/mezantrop/ts-warp Committing slightly modified version (reworked Makefile a bit, corrected pkg-plist and rc.d script). Also connect to the category's Makefile. PR: 269460 Differential Revision: https://reviews.freebsd.org/D42665 --- net/Makefile | 1 + net/ts-warp/Makefile | 31 +++++++++++++++++++++ net/ts-warp/distinfo | 3 ++ net/ts-warp/files/tswarp.in | 67 +++++++++++++++++++++++++++++++++++++++++++++ net/ts-warp/pkg-descr | 6 ++++ net/ts-warp/pkg-plist | 8 ++++++ 6 files changed, 116 insertions(+) diff --git a/net/Makefile b/net/Makefile index ed089872d347..0cafc8732ad4 100644 --- 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 index 000000000000..2a8f65721853 --- /dev/null +++ b/net/ts-warp/Makefile @@ -0,0 +1,31 @@ +PORTNAME= ts-warp +DISTVERSION= 1.4.0-15 +DISTVERSIONSUFFIX= -g4c04cb2 +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 + +USE_GITHUB= yes +GH_ACCOUNT= mezantrop + +USE_RC_SUBR= tswarp + +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 + ${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 diff --git a/net/ts-warp/distinfo b/net/ts-warp/distinfo new file mode 100644 index 000000000000..4e45922db830 --- /dev/null +++ b/net/ts-warp/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1700394340 +SHA256 (mezantrop-ts-warp-1.4.0-15-g4c04cb2_GH0.tar.gz) = c886b07135a255102a4f44a00c0f192b19ced361ffd9a00a519de601489d6a42 +SIZE (mezantrop-ts-warp-1.4.0-15-g4c04cb2_GH0.tar.gz) = 22432943 diff --git a/net/ts-warp/files/tswarp.in b/net/ts-warp/files/tswarp.in new file mode 100755 index 000000000000..8f01d8583d63 --- /dev/null +++ b/net/ts-warp/files/tswarp.in @@ -0,0 +1,67 @@ +#!/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 +pidfile=/var/run/ts-warp.pid + +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_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 ${pidfile} -t ${tswarp_actfile} ${tswarp_flags}" +required_files="${pf_rules} ${tswarp_configfile} ${tswarp_pfconf}" +start_precmd=ts_warp_prestart +stop_postcmd="[ -e ${pf_rules} ] && /sbin/pfctl -f ${pf_rules}" + +ts_warp_prestart() +{ + [ -d /var/db/ts-warp ] || /bin/mkdir -p /var/db/ts-warp + + 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) + } + ' ${pf_rules} | /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 index 000000000000..1d38a5320afa --- /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 index 000000000000..ba773905cd32 --- /dev/null +++ b/net/ts-warp/pkg-plist @@ -0,0 +1,8 @@ +bin/ts-pass +bin/ts-warp +@sample etc/ts-warp.conf.sample +@sample etc/ts-warp_pf.conf.sample +man/man1/ts-pass.1.gz +man/man1/ts-warp.sh.1.gz +man/man5/ts-warp.5.gz +man/man8/ts-warp.8.gz