Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Sep 2021 10:08:32 GMT
From:      Jimmy Olgeni <olgeni@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: d8fef4674b11 - main - net/croc: add rc script for setting up a self-hosted relay.
Message-ID:  <202109071008.187A8Wpq026164@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by olgeni:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d8fef4674b11040acfbdbea651f5d0463182893f

commit d8fef4674b11040acfbdbea651f5d0463182893f
Author:     Jimmy Olgeni <olgeni@FreeBSD.org>
AuthorDate: 2021-09-07 10:03:34 +0000
Commit:     Jimmy Olgeni <olgeni@FreeBSD.org>
CommitDate: 2021-09-07 10:08:04 +0000

    net/croc: add rc script for setting up a self-hosted relay.
    
    PR:             257880
    Reported by:    yzrh@noema.org
---
 net/croc/Makefile      |  2 ++
 net/croc/files/croc.in | 30 ++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/net/croc/Makefile b/net/croc/Makefile
index db31eff80e86..ac0aad8a8826 100644
--- a/net/croc/Makefile
+++ b/net/croc/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	croc
 PORTVERSION=	9.3.0
 DISTVERSIONPREFIX=	v
+PORTREVISION=	1
 CATEGORIES=	net
 
 MAINTAINER=	olgeni@FreeBSD.org
@@ -38,6 +39,7 @@ GH_TUPLE=	cespare:xxhash:v1.1.0:cespare_xxhash/vendor/github.com/cespare/xxhash
 		stretchr:testify:v1.6.1:stretchr_testify/vendor/github.com/stretchr/testify \
 		tscholl2:siec:9bdfc483d499:tscholl2_siec/vendor/github.com/tscholl2/siec \
 		twmb:murmur3:v1.1.5:twmb_murmur3/vendor/github.com/twmb/murmur3
+USE_RC_SUBR=	croc
 
 PLIST_FILES=	bin/croc
 
diff --git a/net/croc/files/croc.in b/net/croc/files/croc.in
new file mode 100644
index 000000000000..831c9ce2321b
--- /dev/null
+++ b/net/croc/files/croc.in
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# PROVIDE: croc
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable croc relaying:
+#
+# croc_enable (bool):	Set to NO by default.
+# 			Set it to YES to enable croc relaying.
+# croc_ports (string):	List of comma-separated ports to be used.
+#			Service requires at least *two* ports.
+#			Default is "9009,9010,9011,9012,9013"
+
+. /etc/rc.subr
+
+name=croc
+rcvar=croc_enable
+
+load_rc_config $name
+
+: ${croc_enable:="NO"}
+: ${croc_ports="9009,9010,9011,9012,9013"}
+
+pidfile="/var/run/${name}.pid"
+procname="%%PREFIX%%/bin/croc"
+command="/usr/sbin/daemon"
+command_args="-f -t ${name} -T ${name} -p ${pidfile} /usr/bin/env ${croc_env} ${procname} relay --ports \"${croc_ports}\""
+
+run_rc_command "$1"



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