Bug 255684 - [NEW PORT] net/gemserv A gemini server written in Rust
Summary: [NEW PORT] net/gemserv A gemini server written in Rust
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Neel Chauhan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-07 15:34 UTC by Evaldas Auryla
Modified: 2021-05-07 18:52 UTC (History)
1 user (show)

See Also:


Attachments
net/gemserv port diff (22.56 KB, patch)
2021-05-07 15:34 UTC, Evaldas Auryla
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Evaldas Auryla 2021-05-07 15:34:05 UTC
Created attachment 224751 [details]
net/gemserv port diff

Gemserv is a Gemini protocol server written in Rust.

Default port build has all features active (Vhosts, CGI, User directories, Reverse proxy, Redirect, SCGI), they can be disabled with single configuration option to leave serving only static files.

I used Porter's Handbook and a few other ports as examples to build it, with the idea to start running gemini server as easy as possible.

Tested build and running on FreeBSD 12 and 13 jails, amd64 arch. Poudriere "bulk" build of www/gemserv is also ok, tested with 13.0-RELEASE jail, amd64 arch.

Diff also includes reservation for uid/gid 877 in portstree, I thought maybe having a single uid "_gemini" would be simpler for Gemini protocol servers.

All comments are welcome, thanks!


WWW: https://git.sr.ht/~int80h/gemserv
Comment 1 Evaldas Auryla 2021-05-07 15:44:57 UTC
Comment on attachment 224751 [details]
net/gemserv port diff

diff --git a/GIDs b/GIDs
index de45039..8aa354a 100644
--- a/GIDs
+++ b/GIDs
@@ -817,7 +817,7 @@ bitmark-recorder:*:873:
 librespeed:*:874:
 # free: 875
 # free: 876
-# free: 877
+_gemini:*:877:
 gerbera:*:878:
 _encrypted-dns:*:879:
 pyspf-milter:*:880:
diff --git a/UIDs b/UIDs
index f4aff0b..5c6ea88 100644
--- a/UIDs
+++ b/UIDs
@@ -822,7 +822,7 @@ bitmark-recorder:*:873:873::0:0:Bitmark Property Recorder:/var/lib/recorderd:/us
 librespeed:*:874:874::0:0:LibreSpeed user:/nonexistent:/usr/sbin/nologin
 # free: 875
 # free: 876
-# free: 877
+_gemini:*:877:877::0:0:gemini server user:/nonexistent:/usr/sbin/nologin
 gerbera:*:878:878::0:0:Gerbera DLNA Media Server:/nonexistent:/usr/sbin/nologin
 _encrypted-dns:*:879:879::0:0:encrypted-dns user:/var/empty:/usr/sbin/nologin
 pyspf-milter:*:880:880::0:0:pyspf-milter:/nonexistent:/usr/sbin/nologin
diff --git a/net/gemserv/Makefile b/net/gemserv/Makefile
new file mode 100644
index 0000000..40176cf
--- /dev/null
+++ b/net/gemserv/Makefile
@@ -0,0 +1,129 @@
+PORTNAME=	gemserv
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.4.5
+PORTREVISION=	1
+CATEGORIES=	net
+MASTER_SITES=	https://git.sr.ht/~int80h/${PORTNAME}/archive/${DISTVERSIONFULL}${EXTRACT_SUFX}?dummy=/
+DISTFILES=	${PORTNAME}-${DISTVERSIONPREFIX}${PORTVERSION}${EXTRACT_SUFX}
+
+MAINTAINER=	ea@uoga.net
+COMMENT=	Gemini protocol server written in Rust.
+
+LICENSE=	MIT APACHE20 BSD3CLAUSE MPL20
+LICENSE_FILE_MIT=	${WRKSRC}/LICENSE
+LICENSE_COMB=	multi
+
+USES=		cargo ssl
+
+CARGO_CRATES=	atty-0.2.14 \
+		autocfg-1.0.1 \
+		bitflags-1.2.1 \
+		bytes-0.5.6 \
+		cc-1.0.66 \
+		cfg-if-0.1.10 \
+		cfg-if-1.0.0 \
+		chrono-0.4.19 \
+		colored-1.9.3 \
+		foreign-types-0.3.2 \
+		foreign-types-shared-0.1.1 \
+		form_urlencoded-1.0.0 \
+		futures-core-0.3.8 \
+		futures-macro-0.3.8 \
+		futures-task-0.3.8 \
+		futures-util-0.3.8 \
+		idna-0.2.0 \
+		iovec-0.1.4 \
+		lazy_static-1.4.0 \
+		libc-0.2.81 \
+		log-0.4.11 \
+		matches-0.1.8 \
+		memchr-2.3.4 \
+		mime-0.3.16 \
+		mime_guess-2.0.3 \
+		mio-0.6.23 \
+		mio-uds-0.6.8 \
+		net2-0.2.37 \
+		num-integer-0.1.44 \
+		num-traits-0.2.14 \
+		num_cpus-1.13.0 \
+		once_cell-1.5.2 \
+		openssl-0.10.32 \
+		percent-encoding-2.1.0 \
+		pin-project-1.0.2 \
+		pin-project-internal-1.0.2 \
+		pin-project-lite-0.1.11 \
+		pin-utils-0.1.0 \
+		pkg-config-0.3.19 \
+		proc-macro-hack-0.5.19 \
+		proc-macro-nested-0.1.6 \
+		proc-macro2-1.0.24 \
+		quote-1.0.8 \
+		serde-1.0.118 \
+		serde_derive-1.0.118 \
+		signal-hook-registry-1.3.0 \
+		simple_logger-1.11.0 \
+		slab-0.4.2 \
+		syn-1.0.55 \
+		time-0.1.44 \
+		tinyvec-1.1.0 \
+		tinyvec_macros-0.1.0 \
+		tokio-0.2.24 \
+		tokio-openssl-0.4.0 \
+		toml-0.5.8 \
+		unicase-2.6.0 \
+		unicode-bidi-0.3.4 \
+		unicode-normalization-0.1.16 \
+		unicode-xid-0.2.1 \
+		url-2.2.0 \
+		version_check-0.9.2 \
+		winapi-0.2.8 \
+		winapi-0.3.9 \
+		mio-named-pipes-0.1.7 \
+		openssl-sys-0.9.61 \
+		hermit-abi-0.1.18 \
+		winapi-i686-pc-windows-gnu-0.4.0 \
+		winapi-x86_64-pc-windows-gnu-0.4.0 \
+		fuchsia-zircon-0.3.3 \
+		fuchsia-zircon-sys-0.3.3 \
+		kernel32-sys-0.2.2 \
+		miow-0.2.2 \
+		miow-0.3.7 \
+		wasi-0.10.0+wasi-snapshot-preview1 \
+		winapi-build-0.1.1 \
+		ws2_32-sys-0.2.1 \
+		vcpkg-0.2.12
+
+OPTIONS_DEFINE=	STATICONLY
+OPTIONS_DEFAULT=
+
+STATICONLY_DESC=	Only serve static files, no additional features (CGI..)
+STATICONLY_VARS=	CARGO_FEATURES+=--no-default-features
+
+GEMSERV_USER?=	_gemini
+GEMSERV_GROUP?=	_gemini
+
+USERS=		${GEMSERV_USER}
+GROUPS=		${GEMSERV_GROUP}
+
+USE_RC_SUBR=	gemserv
+SUB_LIST=	GEMSERV_USER=${GEMSERV_USER} \
+		GEMSERV_GROUP=${GEMSERV_GROUP}
+SUB_FILES=	config.toml.sample index.gmi.sample
+
+PLIST_SUB=	GEMSERV_DATADIR=${PREFIX}/gemini/gemserv-dist
+
+post-install:
+	${MKDIR} ${STAGEDIR}${ETCDIR}
+	${INSTALL_DATA} ${WRKSRC}/config.toml ${STAGEDIR}${ETCDIR}/config.toml-dist
+	${INSTALL_DATA} ${WRKDIR}/config.toml.sample ${STAGEDIR}${ETCDIR}
+
+	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_MAN} ${WRKSRC}/README ${WRKSRC}/UPDATING ${STAGEDIR}${DOCSDIR}
+
+	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+	(cd ${WRKSRC}/cgi-scripts && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})
+
+	${MKDIR} ${STAGEDIR}${PREFIX}/gemini/gemserv-dist
+	${INSTALL_DATA} ${WRKDIR}/index.gmi.sample ${STAGEDIR}${EXAMPLESDIR}
+
+.include <bsd.port.mk>
diff --git a/net/gemserv/distinfo b/net/gemserv/distinfo
new file mode 100644
index 0000000..5a2c942
--- /dev/null
+++ b/net/gemserv/distinfo
@@ -0,0 +1,157 @@
+TIMESTAMP = 1620397069
+SHA256 (gemserv-v0.4.5.tar.gz) = 7aeb5edc8af6ebefc2331aebc0c360798711c2fb16ee9cbde8c5c4f9502c491f
+SIZE (gemserv-v0.4.5.tar.gz) = 16739
+SHA256 (rust/crates/atty-0.2.14.tar.gz) = d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8
+SIZE (rust/crates/atty-0.2.14.tar.gz) = 5470
+SHA256 (rust/crates/autocfg-1.0.1.tar.gz) = cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a
+SIZE (rust/crates/autocfg-1.0.1.tar.gz) = 12908
+SHA256 (rust/crates/bitflags-1.2.1.tar.gz) = cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693
+SIZE (rust/crates/bitflags-1.2.1.tar.gz) = 16745
+SHA256 (rust/crates/bytes-0.5.6.tar.gz) = 0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38
+SIZE (rust/crates/bytes-0.5.6.tar.gz) = 46291
+SHA256 (rust/crates/cc-1.0.66.tar.gz) = 4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48
+SIZE (rust/crates/cc-1.0.66.tar.gz) = 53454
+SHA256 (rust/crates/cfg-if-0.1.10.tar.gz) = 4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822
+SIZE (rust/crates/cfg-if-0.1.10.tar.gz) = 7933
+SHA256 (rust/crates/cfg-if-1.0.0.tar.gz) = baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd
+SIZE (rust/crates/cfg-if-1.0.0.tar.gz) = 7934
+SHA256 (rust/crates/chrono-0.4.19.tar.gz) = 670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73
+SIZE (rust/crates/chrono-0.4.19.tar.gz) = 155663
+SHA256 (rust/crates/colored-1.9.3.tar.gz) = f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59
+SIZE (rust/crates/colored-1.9.3.tar.gz) = 20062
+SHA256 (rust/crates/foreign-types-0.3.2.tar.gz) = f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1
+SIZE (rust/crates/foreign-types-0.3.2.tar.gz) = 7504
+SHA256 (rust/crates/foreign-types-shared-0.1.1.tar.gz) = 00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b
+SIZE (rust/crates/foreign-types-shared-0.1.1.tar.gz) = 5672
+SHA256 (rust/crates/form_urlencoded-1.0.0.tar.gz) = ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00
+SIZE (rust/crates/form_urlencoded-1.0.0.tar.gz) = 8412
+SHA256 (rust/crates/futures-core-0.3.8.tar.gz) = 847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748
+SIZE (rust/crates/futures-core-0.3.8.tar.gz) = 13857
+SHA256 (rust/crates/futures-macro-0.3.8.tar.gz) = 77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556
+SIZE (rust/crates/futures-macro-0.3.8.tar.gz) = 9766
+SHA256 (rust/crates/futures-task-0.3.8.tar.gz) = 7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d
+SIZE (rust/crates/futures-task-0.3.8.tar.gz) = 11118
+SHA256 (rust/crates/futures-util-0.3.8.tar.gz) = d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2
+SIZE (rust/crates/futures-util-0.3.8.tar.gz) = 134020
+SHA256 (rust/crates/idna-0.2.0.tar.gz) = 02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9
+SIZE (rust/crates/idna-0.2.0.tar.gz) = 257203
+SHA256 (rust/crates/iovec-0.1.4.tar.gz) = b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e
+SIZE (rust/crates/iovec-0.1.4.tar.gz) = 8720
+SHA256 (rust/crates/lazy_static-1.4.0.tar.gz) = e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646
+SIZE (rust/crates/lazy_static-1.4.0.tar.gz) = 10443
+SHA256 (rust/crates/libc-0.2.81.tar.gz) = 1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb
+SIZE (rust/crates/libc-0.2.81.tar.gz) = 513105
+SHA256 (rust/crates/log-0.4.11.tar.gz) = 4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b
+SIZE (rust/crates/log-0.4.11.tar.gz) = 36276
+SHA256 (rust/crates/matches-0.1.8.tar.gz) = 7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08
+SIZE (rust/crates/matches-0.1.8.tar.gz) = 2216
+SHA256 (rust/crates/memchr-2.3.4.tar.gz) = 0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525
+SIZE (rust/crates/memchr-2.3.4.tar.gz) = 23077
+SHA256 (rust/crates/mime-0.3.16.tar.gz) = 2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d
+SIZE (rust/crates/mime-0.3.16.tar.gz) = 15206
+SHA256 (rust/crates/mime_guess-2.0.3.tar.gz) = 2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212
+SIZE (rust/crates/mime_guess-2.0.3.tar.gz) = 27437
+SHA256 (rust/crates/mio-0.6.23.tar.gz) = 4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4
+SIZE (rust/crates/mio-0.6.23.tar.gz) = 103554
+SHA256 (rust/crates/mio-uds-0.6.8.tar.gz) = afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0
+SIZE (rust/crates/mio-uds-0.6.8.tar.gz) = 11496
+SHA256 (rust/crates/net2-0.2.37.tar.gz) = 391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae
+SIZE (rust/crates/net2-0.2.37.tar.gz) = 21311
+SHA256 (rust/crates/num-integer-0.1.44.tar.gz) = d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db
+SIZE (rust/crates/num-integer-0.1.44.tar.gz) = 22216
+SHA256 (rust/crates/num-traits-0.2.14.tar.gz) = 9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290
+SIZE (rust/crates/num-traits-0.2.14.tar.gz) = 45476
+SHA256 (rust/crates/num_cpus-1.13.0.tar.gz) = 05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3
+SIZE (rust/crates/num_cpus-1.13.0.tar.gz) = 14704
+SHA256 (rust/crates/once_cell-1.5.2.tar.gz) = 13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0
+SIZE (rust/crates/once_cell-1.5.2.tar.gz) = 27660
+SHA256 (rust/crates/openssl-0.10.32.tar.gz) = 038d43985d1ddca7a9900630d8cd031b56e4794eecc2e9ea39dd17aa04399a70
+SIZE (rust/crates/openssl-0.10.32.tar.gz) = 199469
+SHA256 (rust/crates/percent-encoding-2.1.0.tar.gz) = d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e
+SIZE (rust/crates/percent-encoding-2.1.0.tar.gz) = 9748
+SHA256 (rust/crates/pin-project-1.0.2.tar.gz) = 9ccc2237c2c489783abd8c4c80e5450fc0e98644555b1364da68cc29aa151ca7
+SIZE (rust/crates/pin-project-1.0.2.tar.gz) = 54886
+SHA256 (rust/crates/pin-project-internal-1.0.2.tar.gz) = f8e8d2bf0b23038a4424865103a4df472855692821aab4e4f5c3312d461d9e5f
+SIZE (rust/crates/pin-project-internal-1.0.2.tar.gz) = 27379
+SHA256 (rust/crates/pin-project-lite-0.1.11.tar.gz) = c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b
+SIZE (rust/crates/pin-project-lite-0.1.11.tar.gz) = 25308
+SHA256 (rust/crates/pin-utils-0.1.0.tar.gz) = 8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184
+SIZE (rust/crates/pin-utils-0.1.0.tar.gz) = 7580
+SHA256 (rust/crates/pkg-config-0.3.19.tar.gz) = 3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c
+SIZE (rust/crates/pkg-config-0.3.19.tar.gz) = 15451
+SHA256 (rust/crates/proc-macro-hack-0.5.19.tar.gz) = dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5
+SIZE (rust/crates/proc-macro-hack-0.5.19.tar.gz) = 15556
+SHA256 (rust/crates/proc-macro-nested-0.1.6.tar.gz) = eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a
+SIZE (rust/crates/proc-macro-nested-0.1.6.tar.gz) = 6498
+SHA256 (rust/crates/proc-macro2-1.0.24.tar.gz) = 1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71
+SIZE (rust/crates/proc-macro2-1.0.24.tar.gz) = 37716
+SHA256 (rust/crates/quote-1.0.8.tar.gz) = 991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df
+SIZE (rust/crates/quote-1.0.8.tar.gz) = 24997
+SHA256 (rust/crates/serde-1.0.118.tar.gz) = 06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800
+SIZE (rust/crates/serde-1.0.118.tar.gz) = 74248
+SHA256 (rust/crates/serde_derive-1.0.118.tar.gz) = c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df
+SIZE (rust/crates/serde_derive-1.0.118.tar.gz) = 50589
+SHA256 (rust/crates/signal-hook-registry-1.3.0.tar.gz) = 16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6
+SIZE (rust/crates/signal-hook-registry-1.3.0.tar.gz) = 17786
+SHA256 (rust/crates/simple_logger-1.11.0.tar.gz) = cd57f17c093ead1d4a1499dc9acaafdd71240908d64775465543b8d9a9f1d198
+SIZE (rust/crates/simple_logger-1.11.0.tar.gz) = 7194
+SHA256 (rust/crates/slab-0.4.2.tar.gz) = c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8
+SIZE (rust/crates/slab-0.4.2.tar.gz) = 10136
+SHA256 (rust/crates/syn-1.0.55.tar.gz) = a571a711dddd09019ccc628e1b17fe87c59b09d513c06c026877aa708334f37a
+SIZE (rust/crates/syn-1.0.55.tar.gz) = 229095
+SHA256 (rust/crates/time-0.1.44.tar.gz) = 6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255
+SIZE (rust/crates/time-0.1.44.tar.gz) = 28885
+SHA256 (rust/crates/tinyvec-1.1.0.tar.gz) = ccf8dbc19eb42fba10e8feaaec282fb50e2c14b2726d6301dbfeed0f73306a6f
+SIZE (rust/crates/tinyvec-1.1.0.tar.gz) = 39037
+SHA256 (rust/crates/tinyvec_macros-0.1.0.tar.gz) = cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c
+SIZE (rust/crates/tinyvec_macros-0.1.0.tar.gz) = 1817
+SHA256 (rust/crates/tokio-0.2.24.tar.gz) = 099837d3464c16a808060bb3f02263b412f6fafcb5d01c533d309985fbeebe48
+SIZE (rust/crates/tokio-0.2.24.tar.gz) = 413332
+SHA256 (rust/crates/tokio-openssl-0.4.0.tar.gz) = 3c4b08c5f4208e699ede3df2520aca2e82401b2de33f45e96696a074480be594
+SIZE (rust/crates/tokio-openssl-0.4.0.tar.gz) = 11790
+SHA256 (rust/crates/toml-0.5.8.tar.gz) = a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa
+SIZE (rust/crates/toml-0.5.8.tar.gz) = 54219
+SHA256 (rust/crates/unicase-2.6.0.tar.gz) = 50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6
+SIZE (rust/crates/unicase-2.6.0.tar.gz) = 23478
+SHA256 (rust/crates/unicode-bidi-0.3.4.tar.gz) = 49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5
+SIZE (rust/crates/unicode-bidi-0.3.4.tar.gz) = 32228
+SHA256 (rust/crates/unicode-normalization-0.1.16.tar.gz) = a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606
+SIZE (rust/crates/unicode-normalization-0.1.16.tar.gz) = 92805
+SHA256 (rust/crates/unicode-xid-0.2.1.tar.gz) = f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564
+SIZE (rust/crates/unicode-xid-0.2.1.tar.gz) = 14392
+SHA256 (rust/crates/url-2.2.0.tar.gz) = 5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e
+SIZE (rust/crates/url-2.2.0.tar.gz) = 42787
+SHA256 (rust/crates/version_check-0.9.2.tar.gz) = b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed
+SIZE (rust/crates/version_check-0.9.2.tar.gz) = 11979
+SHA256 (rust/crates/winapi-0.2.8.tar.gz) = 167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a
+SIZE (rust/crates/winapi-0.2.8.tar.gz) = 455145
+SHA256 (rust/crates/winapi-0.3.9.tar.gz) = 5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419
+SIZE (rust/crates/winapi-0.3.9.tar.gz) = 1200382
+SHA256 (rust/crates/mio-named-pipes-0.1.7.tar.gz) = 0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656
+SIZE (rust/crates/mio-named-pipes-0.1.7.tar.gz) = 15140
+SHA256 (rust/crates/openssl-sys-0.9.61.tar.gz) = 313752393519e876837e09e1fa183ddef0be7735868dced3196f4472d536277f
+SIZE (rust/crates/openssl-sys-0.9.61.tar.gz) = 52010
+SHA256 (rust/crates/hermit-abi-0.1.18.tar.gz) = 322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c
+SIZE (rust/crates/hermit-abi-0.1.18.tar.gz) = 9936
+SHA256 (rust/crates/winapi-i686-pc-windows-gnu-0.4.0.tar.gz) = ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6
+SIZE (rust/crates/winapi-i686-pc-windows-gnu-0.4.0.tar.gz) = 2918815
+SHA256 (rust/crates/winapi-x86_64-pc-windows-gnu-0.4.0.tar.gz) = 712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f
+SIZE (rust/crates/winapi-x86_64-pc-windows-gnu-0.4.0.tar.gz) = 2947998
+SHA256 (rust/crates/fuchsia-zircon-0.3.3.tar.gz) = 2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82
+SIZE (rust/crates/fuchsia-zircon-0.3.3.tar.gz) = 22565
+SHA256 (rust/crates/fuchsia-zircon-sys-0.3.3.tar.gz) = 3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7
+SIZE (rust/crates/fuchsia-zircon-sys-0.3.3.tar.gz) = 7191
+SHA256 (rust/crates/kernel32-sys-0.2.2.tar.gz) = 7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d
+SIZE (rust/crates/kernel32-sys-0.2.2.tar.gz) = 24537
+SHA256 (rust/crates/miow-0.2.2.tar.gz) = ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d
+SIZE (rust/crates/miow-0.2.2.tar.gz) = 22044
+SHA256 (rust/crates/miow-0.3.7.tar.gz) = b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21
+SIZE (rust/crates/miow-0.3.7.tar.gz) = 24563
+SHA256 (rust/crates/wasi-0.10.0+wasi-snapshot-preview1.tar.gz) = 1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f
+SIZE (rust/crates/wasi-0.10.0+wasi-snapshot-preview1.tar.gz) = 26964
+SHA256 (rust/crates/winapi-build-0.1.1.tar.gz) = 2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc
+SIZE (rust/crates/winapi-build-0.1.1.tar.gz) = 669
+SHA256 (rust/crates/ws2_32-sys-0.2.1.tar.gz) = d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e
+SIZE (rust/crates/ws2_32-sys-0.2.1.tar.gz) = 4697
+SHA256 (rust/crates/vcpkg-0.2.12.tar.gz) = cbdbff6266a24120518560b5dc983096efb98462e51d0d68169895b237be3e5d
+SIZE (rust/crates/vcpkg-0.2.12.tar.gz) = 15530
diff --git a/net/gemserv/files/config.toml.sample.in b/net/gemserv/files/config.toml.sample.in
new file mode 100644
index 0000000..5c9d412
--- /dev/null
+++ b/net/gemserv/files/config.toml.sample.in
@@ -0,0 +1,21 @@
+port = 1965
+# use "::" for ipv6 and ipv4 or "0.0.0.0" for ipv4 only
+host = "0.0.0.0"
+# log is optional and server wide. It defaults to info if not set. Other levels
+# are error, warn, and info. If error is set it will only show error. If warn
+# is set it will show error and warn. Info shows all three.
+log = "info"
+
+# There must be at least 1 server tag if a client doesn't send sni the server
+# will use this tag as its default.
+# Server 1
+[[server]]
+hostname = "gemini.example.net"
+dir = "/usr/local/gemini/gemserv-dist"
+key = "/usr/local/etc/gemserv/key.pem"
+cert = "/usr/local/etc/gemserv/cert.pem"
+# index is optional but defaults to index.gemini. The server will serve files
+# ending in gemini or gmi.
+index = "index.gmi"
+# lang is optional
+lang = "en"
diff --git a/net/gemserv/files/gemserv.in b/net/gemserv/files/gemserv.in
new file mode 100644
index 0000000..b1fcb39
--- /dev/null
+++ b/net/gemserv/files/gemserv.in
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+# PROVIDE: gemserv
+# REQUIRE: NETWORKING
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# gemserv_enable (bool):		Set to NO by default.
+#					Set it to YES to enable gemserv.
+# gemserv_user (user):			Set user to run gemserv.
+#					Default: _gemini
+# gemserv_group (group):		Set group to run gemserv.
+#					Default: _gemini
+# gemserv_config (path):		Set to %%ETCDIR%%/config.toml
+#					by default.
+# gemserv_syslog_output_enable:		Set to enable syslog output.
+#					Default: YES
+# gemserv_syslog_output_tag:		Set syslog tag if syslog enabled.
+#					Default: gemserv
+# gemserv_syslog_output_priority:	Set syslog priority if syslog enabled.
+#					Default: notice
+# gemserv_syslog_output_facility:	Set syslog facility if syslog enabled.
+#					Default: daemon
+
+. /etc/rc.subr
+
+name=gemserv
+rcvar=gemserv_enable
+
+load_rc_config $name
+
+: ${gemserv_enable:=NO}
+: ${gemserv_user:="%%GEMSERV_USER%%"}
+: ${gemserv_group:="%%GEMSERV_GROUP%%"}
+: ${gemserv_config="%%ETCDIR%%/config.toml"}
+: ${gemserv_syslog_output_enable:="YES"}
+: ${gemserv_syslog_output_tag:="gemserv"}
+: ${gemserv_syslog_output_priority:="notice"}
+: ${gemserv_syslog_output_facility:="daemon"}
+
+
+if checkyesno gemserv_syslog_output_enable; then
+	if [ -n "${gemserv_syslog_output_tag}" ]; then
+		gemserv_syslog_output_flags="-T ${gemserv_syslog_output_tag}"
+	else
+		gemserv_syslog_output_flags="-T ${name}"
+	fi
+	if [ -n "${gemserv_syslog_output_priority}" ]; then
+		gemserv_syslog_output_flags="${gemserv_syslog_output_flags} -s ${gemserv_syslog_output_priority}"
+	fi
+	if [ -n "${gemserv_syslog_output_facility}" ]; then
+		gemserv_syslog_output_flags="${gemserv_syslog_output_flags} -l ${gemserv_syslog_output_facility}"
+	fi
+fi
+
+pidfile=/var/run/gemserv.pid
+command=/usr/sbin/daemon
+procname=%%PREFIX%%/bin/gemserv
+command_args="-p ${pidfile} ${gemserv_syslog_output_flags} ${procname} ${gemserv_config}"
+
+start_precmd="gemserv_start_precmd"
+stop_postcmd="gemserv_stop_postcmd"
+
+gemserv_start_precmd() {
+	if [ ! -e "${pidfile}" ]; then
+		/usr/bin/install -m 0644 -o ${gemserv_user} -g ${gemserv_group} /dev/null "${pidfile}"
+	fi
+}
+
+gemserv_stop_postcmd() {
+        /bin/rm -f ${pidfile}
+}
+
+run_rc_command "$1"
diff --git a/net/gemserv/files/index.gmi.sample.in b/net/gemserv/files/index.gmi.sample.in
new file mode 100644
index 0000000..152be52
--- /dev/null
+++ b/net/gemserv/files/index.gmi.sample.in
@@ -0,0 +1,3 @@
+Hello world !
+
+New gemini server running here.
diff --git a/net/gemserv/pkg-descr b/net/gemserv/pkg-descr
new file mode 100644
index 0000000..32cd746
--- /dev/null
+++ b/net/gemserv/pkg-descr
@@ -0,0 +1,10 @@
+A gemini server written in Rust. It features:
+
+ - Vhosts
+ - CGI
+ - User directories
+ - Reverse proxy
+ - Redirect
+ - SCGI
+
+WWW: https://git.sr.ht/~int80h/gemserv
diff --git a/net/gemserv/pkg-message b/net/gemserv/pkg-message
new file mode 100644
index 0000000..4152484
--- /dev/null
+++ b/net/gemserv/pkg-message
@@ -0,0 +1,30 @@
+[
+{ type: install
+  message: <<EOM
+Gemserv gemini server is now installed.
+README and UPDATING files from source distribution are installed in:
+
+    /usr/local/share/doc/gemserv
+
+Example cgi-scripts are installed in:
+
+    /usr/local/share/examples/gemserv
+
+Quick Start:
+
+1) Check, edit server configuration in /usr/local/etc/gemserv/config.toml
+   (see config.toml-dist for all configuration options)
+2) Generate TLS key and cert, i.e. for domain "gemini.example.net":
+
+    openssl req -newkey rsa:4096 -nodes -keyout /usr/local/etc/gemserv/key.pem  \
+                         -x509 -days 36500 -out /usr/local/etc/gemserv/cert.pem \
+      -subj "/C=FR/ST=FR/L=FR/O=example.net/OU=IT/CN=gemini.example.net/emailAddress=root@example.net"
+
+    chown _gemini /usr/local/etc/gemserv/key.pem
+
+3) sysrc gemserv_enable=YES
+4) service gemserv start
+5) tail /var/log/messages
+EOM
+}
+]
diff --git a/net/gemserv/pkg-plist b/net/gemserv/pkg-plist
new file mode 100644
index 0000000..cafde52
--- /dev/null
+++ b/net/gemserv/pkg-plist
@@ -0,0 +1,12 @@
+bin/gemserv
+@dir %%ETCDIR%%
+@sample %%ETCDIR%%/config.toml.sample
+%%ETCDIR%%/config.toml-dist
+%%DOCSDIR%%/README
+%%DOCSDIR%%/UPDATING
+%%EXAMPLESDIR%%/agena-cgi/Cargo.toml
+%%EXAMPLESDIR%%/agena-cgi/src/main.rs
+%%EXAMPLESDIR%%/scgi/scgi.pl
+%%EXAMPLESDIR%%/scgi/scgi.py
+@dir %%GEMSERV_DATADIR%%
+@sample %%EXAMPLESDIR%%/index.gmi.sample %%GEMSERV_DATADIR%%/index.gmi
Comment 2 Evaldas Auryla 2021-05-07 15:50:45 UTC
Makefile reformat after portlint suggestions in the comment above, no other changes.
Comment 3 Chris Hutchinson 2021-05-07 17:08:42 UTC
Hello, you seemed to have overlooked the
part in the porters handbook that indicated
the proper format to submit a new port. ;-)
Your attachment needs to be in shar format
(SHell ARchive). eg;
$ shar `find port-name` > portname.shar

Thanks for taking the time to create a new port. :-)

--Chris
Comment 4 Neel Chauhan freebsd_committer freebsd_triage 2021-05-07 18:52:17 UTC
Committed!
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-05-07 18:52:36 UTC
A commit in branch main references this bug:

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

commit 23be95ab476aa70f86b4ada5bc5059f50fbb2b1d
Author:     Evaldas Auryla <ea@uoga.net>
AuthorDate: 2021-05-07 18:50:16 +0000
Commit:     Neel Chauhan <nc@FreeBSD.org>
CommitDate: 2021-05-07 18:52:17 +0000

    New port: net/gemserv: Gemini server written in Rust

    PR:     255684

 GIDs                                          |   2 +-
 UIDs                                          |   2 +-
 net/Makefile                                  |   1 +
 net/gemserv/Makefile (new)                    | 129 +++++++++++++++++++++
 net/gemserv/distinfo (new)                    | 157 ++++++++++++++++++++++++++
 net/gemserv/files/config.toml.sample.in (new) |  21 ++++
 net/gemserv/files/gemserv.in (new)            |  76 +++++++++++++
 net/gemserv/files/index.gmi.sample.in (new)   |   3 +
 net/gemserv/pkg-descr (new)                   |  10 ++
 net/gemserv/pkg-message (new)                 |  31 +++++
 net/gemserv/pkg-plist (new)                   |  12 ++
 11 files changed, 442 insertions(+), 2 deletions(-)