Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jul 2018 05:26:24 +0000 (UTC)
From:      Sean Chittenden <seanc@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r473704 - in head/security/teleport: . files
Message-ID:  <201807020526.w625QOBt074318@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: seanc
Date: Mon Jul  2 05:26:24 2018
New Revision: 473704
URL: https://svnweb.freebsd.org/changeset/ports/473704

Log:
  Upgrade gravitational teleport to 2.6.6.
  
  * See upstream's changelog for details
    https://github.com/gravitational/teleport/blob/master/CHANGELOG.md
  * Explicitly specify the git sha when building teleport.
  * Restrict builds to amd64.
  * Work around daemon(8)'s lack of syslog functionality in 10-STABLE.
  
  Submitted by:	swills
  Approved by:	swills (mentor)
  Differential Revision:	https://reviews.freebsd.org/D15311

Deleted:
  head/security/teleport/files/patch-version.mk
Modified:
  head/security/teleport/Makefile
  head/security/teleport/distinfo
  head/security/teleport/files/teleport.in
  head/security/teleport/pkg-descr

Modified: head/security/teleport/Makefile
==============================================================================
--- head/security/teleport/Makefile	Mon Jul  2 05:08:06 2018	(r473703)
+++ head/security/teleport/Makefile	Mon Jul  2 05:26:24 2018	(r473704)
@@ -2,7 +2,7 @@
 
 PORTNAME=	teleport
 DISTVERSIONPREFIX=	v
-DISTVERSION=	2.5.7
+DISTVERSION=	2.6.6
 CATEGORIES=	security
 
 MAINTAINER=	seanc@FreeBSD.org
@@ -10,10 +10,11 @@ COMMENT=	Gravitational Telport SSH
 
 LICENSE=	APACHE20
 
-ONLY_FOR_ARCHS=	amd64
+NOT_FOR_ARCHS=	i386
+NOT_FOR_ARCHS_REASON=	Uses 64bit types
 
-BUILD_DEPENDS=	${LOCALBASE}/bin/go:lang/go \
-		${LOCALBASE}/bin/zip:archivers/zip
+BUILD_DEPENDS=	go:lang/go \
+		zip:archivers/zip
 
 USES=		compiler gmake
 
@@ -28,8 +29,9 @@ SUB_FILES=	pkg-message
 PLIST_FILES=	bin/teleport \
 		bin/tctl \
 		bin/tsh \
-		etc/teleport.yaml.sample
+		"@sample etc/teleport.yaml.sample"
 
+# Extra assets are stored in the binary and must not be inadvertently removed
 STRIP=
 
 GO_TELEPORT_SRC_DIR=	src/github.com/gravitational/teleport
@@ -41,17 +43,21 @@ post-extract:
 	@${CP} -rp ${WRKDIR}/${PRE_GOPATH_DIR}/* ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/
 
 post-patch:
-	@${REINPLACE_CMD} -e "s|%%GH_TAG_COMMIT%%|${GH_TAG_COMMIT}|g" \
+	@${REINPLACE_CMD} -e 's|^GITREF=.*|GITREF=${GH_TAG_COMMIT}|' \
 		${WRKDIR}/${GO_TELEPORT_SRC_DIR}/version.mk
+	@${FIND} ${WRKDIR} -type f -exec ${SED} -i '' -e 's|\/var\/lib|/var/db|g' {} \;
+	@${FIND} ${WRKDIR} -type f -exec ${SED} -i '' -e 's|\/usr\/bin\/hostname|/bin/hostname|g' {} \;
 
 do-build:
 	@cd ${WRKDIR}/${GO_TELEPORT_SRC_DIR} && \
 		${SETENV} ${MAKE_ENV} ${BUILD_ENV} \
 		CGO_ENABLED=1 GOPATH=${WRKDIR} \
-		${GMAKE} -s full
+		${GMAKE} full
 
 do-install:
 	${WRKDIR}/${GO_TELEPORT_SRC_DIR}/build/teleport configure > ${STAGEDIR}${PREFIX}/etc/teleport.yaml.sample
+	@${SED} -i '' -e "s|nodename: .*|nodename: |g" ${STAGEDIR}${PREFIX}/etc/teleport.yaml.sample
+	@${SED} -i '' -e "s|cluster-join-token||g" ${STAGEDIR}${PREFIX}/etc/teleport.yaml.sample
 	${INSTALL_PROGRAM} ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/build/teleport ${STAGEDIR}${PREFIX}/bin
 	${INSTALL_PROGRAM} ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/build/tsh ${STAGEDIR}${PREFIX}/bin
 	${INSTALL_PROGRAM} ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/build/tctl ${STAGEDIR}${PREFIX}/bin

Modified: head/security/teleport/distinfo
==============================================================================
--- head/security/teleport/distinfo	Mon Jul  2 05:08:06 2018	(r473703)
+++ head/security/teleport/distinfo	Mon Jul  2 05:26:24 2018	(r473704)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1525898627
-SHA256 (gravitational-teleport-v2.5.7_GH0.tar.gz) = 26a62a4ae91482d51191f53edde01a93b13e23a257b5336de06e336ed39c8e7e
-SIZE (gravitational-teleport-v2.5.7_GH0.tar.gz) = 16216353
+TIMESTAMP = 1530495583
+SHA256 (gravitational-teleport-v2.6.6_GH0.tar.gz) = 4c88989e9a780d964156040c87a027a445400d800b5e300cfceb1be6400eb042
+SIZE (gravitational-teleport-v2.6.6_GH0.tar.gz) = 16652923

Modified: head/security/teleport/files/teleport.in
==============================================================================
--- head/security/teleport/files/teleport.in	Mon Jul  2 05:08:06 2018	(r473703)
+++ head/security/teleport/files/teleport.in	Mon Jul  2 05:26:24 2018	(r473704)
@@ -9,14 +9,16 @@
 # Add the following lines to /etc/rc.conf.local or /etc/rc.conf
 # to enable this service:
 #
-# teleport_enable (bool):	Set to NO by default.
-#				Set it to YES to enable teleport.
-# teleport_config (str):	Configuration file.
-#				Default is "${LOCALBASE}/etc/teleport.yaml"
+# teleport_enable (bool):       Set to NO by default.
+#                               Set it to YES to enable teleport.
+# teleport_config (str):        Configuration file.
+#                               Default is "${LOCALBASE}/etc/teleport.yaml"
 # teleport_dir (dir):           Set dir to run teleport in.
-#                               Default is "/var/lib/teleport".
+#                               Default is "/var/db/teleport".
 # teleport_roles (dir):         Set roles to run teleport in.
 #                               Default is "node".
+#                               Can be any combination of
+#                               "proxy" "node" and "auth", separated by commas
 
 . /etc/rc.subr
 
@@ -27,14 +29,29 @@ load_rc_config $name
 
 : ${teleport_enable:="NO"}
 : ${teleport_config:="%%PREFIX%%/etc/teleport.yaml"}
-: ${teleport_args:="--config=${teleport_config}"
-: ${teleport_dir:="/var/lib/teleport"}
+: ${teleport_args:="--config=${teleport_config}"}
+: ${teleport_dir:="/var/db/teleport"}
 : ${teleport_roles:="node"}
 
 pidfile=/var/run/teleport.pid
 required_files="${teleport_config}"
 procname="%%PREFIX%%/bin/teleport"
 command="/usr/sbin/daemon"
-command_args="-S -T teleport -s info -m 3 -p ${pidfile} /usr/bin/env ${teleport_env} ${procname} start --roles=${teleport_roles} ${teleport_args}"
+
+DAEMON=$(daemon 2>&1 | grep -q syslog ; echo $?)
+if [ ${DAEMON} -eq 0 ]; then
+  DAEMON_SYSLOG_FLAGS="-S -T teleport -s info -m 3"
+else
+  DAEMON_SYSLOG_FLAGS=""
+fi
+
+command_args="${DAEMON_SYSLOG_FLAGS} -f -p ${pidfile} /usr/bin/env ${teleport_env} ${procname} start --roles=${teleport_roles} ${teleport_args}"
+
+start_precmd="teleport_prestart"
+
+teleport_prestart()
+{
+	mkdir -p ${teleport_dir}
+}
 
 run_rc_command "$1"

Modified: head/security/teleport/pkg-descr
==============================================================================
--- head/security/teleport/pkg-descr	Mon Jul  2 05:08:06 2018	(r473703)
+++ head/security/teleport/pkg-descr	Mon Jul  2 05:26:24 2018	(r473704)
@@ -1,7 +1,7 @@
 What is Teleport?
 =================
 Gravitational Teleport ("Teleport") is a modern SSH server for remotely
-accessing clusters of Linux servers via SSH or HTTPS. It is intended to be used
+accessing clusters of servers via SSH or HTTPS. It is intended to be used
 instead of sshd. Teleport enables teams to easily adopt the best SSH practices
 like:
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807020526.w625QOBt074318>