Date: Tue, 27 Apr 2021 18:14:52 GMT From: Neel Chauhan <nc@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 4ed1dafde047 - main - New port: net/gmid: Simple and secure Gemini server Message-ID: <202104271814.13RIEqUr045805@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by nc: URL: https://cgit.FreeBSD.org/ports/commit/?id=4ed1dafde04789df5bb273299fb593af34ccd81b commit 4ed1dafde04789df5bb273299fb593af34ccd81b Author: Neel Chauhan <nc@FreeBSD.org> AuthorDate: 2021-04-27 18:09:20 +0000 Commit: Neel Chauhan <nc@FreeBSD.org> CommitDate: 2021-04-27 18:11:49 +0000 New port: net/gmid: Simple and secure Gemini server PR: 255413 Submitted by: Omar Polo <freebsd@omarpolo.com> --- GIDs | 2 +- UIDs | 2 +- net/gmid/Makefile | 33 ++++++++++++++++++++++++++++++++ net/gmid/distinfo | 3 +++ net/gmid/files/gmid.conf.sample | 15 +++++++++++++++ net/gmid/files/gmid.in | 42 +++++++++++++++++++++++++++++++++++++++++ net/gmid/pkg-descr | 6 ++++++ net/gmid/pkg-plist | 3 +++ 8 files changed, 104 insertions(+), 2 deletions(-) diff --git a/GIDs b/GIDs index d0fcd597e2e2..4b5f07f6e5ee 100644 --- a/GIDs +++ b/GIDs @@ -229,7 +229,7 @@ rancid:*:286: webdis:*:287: ntopng:*:288: victoria-metrics:*:289: -# free: 290 +_gmid:*:290: # free: 291 # free: 292 # free: 293 diff --git a/UIDs b/UIDs index 63c34327481a..935a725356e3 100644 --- a/UIDs +++ b/UIDs @@ -234,7 +234,7 @@ rancid:*:286:286::0:0:RANCID daemon user:/usr/local/var/rancid:/bin/sh webdis:*:287:287::0:0:webdis daemon user:/nonexistent:/usr/sbin/nologin ntopng:*:288:288::0:0:ntopng daemon user:/nonexistent:/usr/sbin/nologin victoria-metrics:*:289:289::0:0:VictoriaMetrics user:/nonexistent:/usr/sbin/nologin -# free: 290 +_gmid:*:290:290::0:0:gmid daemon user:/var/empty:/usr/sbin/nologin # free: 291 # free: 292 # free: 293 diff --git a/net/gmid/Makefile b/net/gmid/Makefile new file mode 100644 index 000000000000..b4320c2b24b3 --- /dev/null +++ b/net/gmid/Makefile @@ -0,0 +1,33 @@ +PORTNAME= gmid +DISTVERSION= v1.6.1 +CATEGORIES= net + +MAINTAINER= freebsd@omarpolo.com +COMMENT= Simple and secure Gemini server + +LICENSE= ISCL +LICENSE_FILE= ${WRKSRC}/LICENSE + +LIB_DEPENDS= libevent.so:devel/libevent \ + libtls.so:security/libressl + +USES= localbase ssl +USE_GITHUB= yes +GH_ACCOUNT= omar-polo +USE_RC_SUBR= gmid + +HAS_CONFIGURE= yes + +TEST_TARGET= regress + +USERS= _gmid +GROUPS= _gmid + +post-build: + ${STRIP_CMD} ${WRKSRC}/gmid + +post-install: + ${INSTALL_DATA} ${FILESDIR}/gmid.conf.sample \ + ${STAGEDIR}${PREFIX}/etc/ + +.include <bsd.port.mk> diff --git a/net/gmid/distinfo b/net/gmid/distinfo new file mode 100644 index 000000000000..13b38ee14981 --- /dev/null +++ b/net/gmid/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1619421708 +SHA256 (omar-polo-gmid-v1.6.1_GH0.tar.gz) = bdbc8f184812554f3574791dfe43e435fa6c4cafcbd70b4e1e7a48b2407a54a2 +SIZE (omar-polo-gmid-v1.6.1_GH0.tar.gz) = 59388 diff --git a/net/gmid/files/gmid.conf.sample b/net/gmid/files/gmid.conf.sample new file mode 100644 index 000000000000..1443c67c961e --- /dev/null +++ b/net/gmid/files/gmid.conf.sample @@ -0,0 +1,15 @@ +# drop privileges +user "_gmid" + +# it's a good idea to enable chroot, but +# beware that can make CGI scripting harder +# +#chroot "/var/gemini" + +# An example of a server block: +# +#server "localhost" { +# root "/var/gemini/localhost" +# cert "/usr/local/etc/ssl/gmid/gmid.crt" +# key "/usr/local/etc/ssl/gmid/gmid.key" +#} diff --git a/net/gmid/files/gmid.in b/net/gmid/files/gmid.in new file mode 100644 index 000000000000..8ab69c3bfff2 --- /dev/null +++ b/net/gmid/files/gmid.in @@ -0,0 +1,42 @@ +#!/bin/sh +# + +# PROVIDE: gmid +# REQUIRE: SERVERS +# KEYWORD: shutdown + +# +# Add the following lines to /etc/rc.conf to enable gmid: +# gmid_enable (bool): Set it to "YES" to enable gmid +# Default is "NO". +# gmid_config (string): Path to gmid configuration file. +# Default is "%%PREFIX%%/etc/gmid.conf" +# +# + +. /etc/rc.subr + +name="gmid" +rcvar="gmid_enable" + +start_precmd="gmid_checkconfig" +configtest_cmd="gmid_checkconfig" +extra_commands="configtest" + +: ${gmid_enable:="NO"} +: ${gmid_config:="%%PREFIX%%/etc/gmid.conf"} + +load_rc_config $name + +command="%%PREFIX%%/bin/${name}" +command_flags="-c ${gmid_config}" + +required_files="${gmid_config}" + +gmid_checkconfig() +{ + echo "Performing sanity check on gmid configuration:" + eval ${command} -n ${command_flags} +} + +run_rc_command "$1" diff --git a/net/gmid/pkg-descr b/net/gmid/pkg-descr new file mode 100644 index 000000000000..6e2c141ad413 --- /dev/null +++ b/net/gmid/pkg-descr @@ -0,0 +1,6 @@ +gmid is a server for the Gemini protocol. It has various +features, among which Capsicum support and a "config-less" +mode akin to "python -m http.server" to quickly serve local +directories from the shell. + +WWW: https://github.com/omar-polo/gmid diff --git a/net/gmid/pkg-plist b/net/gmid/pkg-plist new file mode 100644 index 000000000000..2dbb6ab99576 --- /dev/null +++ b/net/gmid/pkg-plist @@ -0,0 +1,3 @@ +@sample etc/gmid.conf.sample +bin/gmid +man/man1/gmid.1.gzhome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104271814.13RIEqUr045805>
