From nobody Mon Oct 18 11:44:12 2021 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 5D35817F02C2; Mon, 18 Oct 2021 11:44:13 +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 4HXw585qfYz3nNS; Mon, 18 Oct 2021 11:44:12 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 2BD691FFB8; Mon, 18 Oct 2021 11:44:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19IBiC0c079343; Mon, 18 Oct 2021 11:44:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IBiC5J079342; Mon, 18 Oct 2021 11:44:12 GMT (envelope-from git) Date: Mon, 18 Oct 2021 11:44:12 GMT Message-Id: <202110181144.19IBiC5J079342@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mikael Urankar Subject: git: d1557166daf3 - main - security/tailscale: Add tailscaled_exitnode_enable in rc script. 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: mikael X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1557166daf359c493a37d7b3311289a95b4ee4d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mikael: URL: https://cgit.FreeBSD.org/ports/commit/?id=d1557166daf359c493a37d7b3311289a95b4ee4d commit d1557166daf359c493a37d7b3311289a95b4ee4d Author: Ollivier Robert AuthorDate: 2021-10-18 10:39:39 +0000 Commit: Mikael Urankar CommitDate: 2021-10-18 11:43:57 +0000 security/tailscale: Add tailscaled_exitnode_enable in rc script. PR: 259237 --- security/tailscale/Makefile | 1 + security/tailscale/files/tailscaled.in | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/security/tailscale/Makefile b/security/tailscale/Makefile index ab6ae1d35a9b..cbf5a8db586a 100644 --- a/security/tailscale/Makefile +++ b/security/tailscale/Makefile @@ -1,6 +1,7 @@ PORTNAME= tailscale PORTVERSION= 1.14.6 DISTVERSIONPREFIX= v +PORTREVISION= 1 CATEGORIES= security MAINTAINER= mikael@FreeBSD.org diff --git a/security/tailscale/files/tailscaled.in b/security/tailscale/files/tailscaled.in index ffbc5350f7de..b1cb480b92bc 100644 --- a/security/tailscale/files/tailscaled.in +++ b/security/tailscale/files/tailscaled.in @@ -17,6 +17,8 @@ # Default is "info". See daemon(8). # tailscaled_syslog_output_facility (str): Set syslog facility if syslog enabled. # Default is "daemon". See daemon(8). +# tailscaled_exitnode_enable (bool): Set it to YES to announce tailscaled as +# an exit node. Default is "NO". . /etc/rc.subr @@ -27,6 +29,7 @@ load_rc_config $name : ${tailscaled_enable:="NO"} : ${tailscaled_port:="41641"} +: ${tailscaled_exitnode_enable:="NO"} DAEMON=$(/usr/sbin/daemon 2>&1 | grep -q syslog ; echo $?) if [ ${DAEMON} -eq 0 ]; then @@ -51,11 +54,13 @@ fi pidfile=/var/run/${name}.pid procname="%%PREFIX%%/bin/${name}" +ctlname="%%PREFIX%%/bin/tailscale" # XXX: Can we have multiple interfaces? tailscale_tap_dev="tailscale0" start_cmd="${name}_start" +start_postcmd="${name}_poststart" stop_postcmd="${name}_poststop" tailscaled_start() @@ -63,6 +68,14 @@ tailscaled_start() env CACHE_DIRECTORY=/var/db/tailscale /usr/sbin/daemon -f ${tailscaled_syslog_output_flags} -p ${pidfile} ${procname} --port ${tailscaled_port} } +tailscaled_poststart() +{ + if checkyesno tailscaled_exitnode_enable; then + logger -s -t tailscale "Enabling Exit node mode" + ${ctlname} up --advertise-exit-node + fi +} + tailscaled_poststop() { /sbin/ifconfig ${tailscale_tap_dev} >/dev/null 2>&1 && (