From 7ecc868c414baec355f446aa47d70145ac7a2587 Mon Sep 17 00:00:00 2001 From: Felix Palmen Date: Sat, 22 Apr 2023 19:47:46 +0200 Subject: [PATCH] security/tlsc: Add new port --- security/Makefile | 1 + security/tlsc/Makefile | 30 +++++++++++++++++++++++++ security/tlsc/distinfo | 5 +++++ security/tlsc/files/tlsc.in | 44 +++++++++++++++++++++++++++++++++++++ security/tlsc/pkg-descr | 6 +++++ 5 files changed, 86 insertions(+) create mode 100644 security/tlsc/Makefile create mode 100644 security/tlsc/distinfo create mode 100644 security/tlsc/files/tlsc.in create mode 100644 security/tlsc/pkg-descr diff --git a/security/Makefile b/security/Makefile index 624766505d37..dfe389b49503 100644 --- a/security/Makefile +++ b/security/Makefile @@ -1284,6 +1284,7 @@ SUBDIR += tinc-devel SUBDIR += tinyca SUBDIR += tls-check + SUBDIR += tlsc SUBDIR += tor SUBDIR += tor-devel SUBDIR += totp-cli diff --git a/security/tlsc/Makefile b/security/tlsc/Makefile new file mode 100644 index 000000000000..27edd255a7f6 --- /dev/null +++ b/security/tlsc/Makefile @@ -0,0 +1,30 @@ +PORTNAME= tlsc +DISTVERSIONPREFIX= v +DISTVERSION= 1.1 +PORTREVISION= 2 +CATEGORIES= security + +MAINTAINER= zirias@FreeBSD.org +COMMENT= TLS connect daemon +WWW= https://github.com/Zirias/tlsc + +LICENSE= BSD2CLAUSE + +USES= compiler:c11 gmake ssl + +USE_GITHUB= yes +GH_ACCOUNT= Zirias +GH_PROJECT= zimk:zimk +GH_TAGNAME= 586c84f 0def4fa:zimk + +USE_RC_SUBR= ${PORTNAME} + +MAKE_ARGS= V=1 +ALL_TARGET= strip + +PLIST_FILES= bin/tlsc + +post-extract: + @${MV} ${WRKSRC_zimk}/* ${WRKSRC}/zimk/ + +.include diff --git a/security/tlsc/distinfo b/security/tlsc/distinfo new file mode 100644 index 000000000000..a5bed160fc89 --- /dev/null +++ b/security/tlsc/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1682769198 +SHA256 (Zirias-tlsc-v1.1-586c84f_GH0.tar.gz) = 41c4991440ba33c976d6426bbe0d47133328d308cf8b33df27382148d326fee7 +SIZE (Zirias-tlsc-v1.1-586c84f_GH0.tar.gz) = 23095 +SHA256 (Zirias-zimk-0def4fa_GH0.tar.gz) = faff68b6f7a0e337c9d42da7a7686b83e64a430592471d7eeaee3c5e2525d8fc +SIZE (Zirias-zimk-0def4fa_GH0.tar.gz) = 12738 diff --git a/security/tlsc/files/tlsc.in b/security/tlsc/files/tlsc.in new file mode 100644 index 000000000000..2d82526fdc80 --- /dev/null +++ b/security/tlsc/files/tlsc.in @@ -0,0 +1,44 @@ +#!/bin/sh + +# PROVIDE: tlsc +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: shutdown + +. /etc/rc.subr + +name=tlsc +desc="TLS connect daemon" + +rcvar=tlsc_enable + +load_rc_config ${name} + +: ${tlsc_enable:=NO} + +start_precmd=tlsc_prestart +command="%%PREFIX%%/bin/tlsc" +pidfile=/var/run/tlsc/tlsc.pid +command_args="-p ${pidfile} ${tlsc_flags} ${tlsc_tunnels}" + +tlsc_prestart() +{ + if [ -z "${tlsc_tunnels}" ]; then + err 1 "tlsc_tunnels must be configured." + fi + if [ -n "${tlsc_user}" ]; then + rc_flags="-u ${tlsc_user} ${rc_flags}" + fi + if [ -n "${tlsc_group}" ]; then + rc_flags="-g ${tlsc_group} ${rc_flags}" + fi + + # tlsc handles user and group itself + unset _user + unset _group + install -d -m 755 -o ${tlsc_user:-root} $(dirname ${pidfile}) + + return 0 +} + +run_rc_command "$1" diff --git a/security/tlsc/pkg-descr b/security/tlsc/pkg-descr new file mode 100644 index 000000000000..709b440b8940 --- /dev/null +++ b/security/tlsc/pkg-descr @@ -0,0 +1,6 @@ +A simple socket proxy for connecting to TLS-enabled services. + +This daemon will listen on sockets (typically on localhost) and forward +connecting clients to some remote host, adding TLS encryption. + +It does the job in the simplest possible way, using all-standard options. -- 2.40.0