Install Deps

# pkg_add gophernicus bombadillo

Read the manual

# cat /usr/local/share/doc/pkg-readmes/gophernicus | less

the manual instructs the sysadmin to run gophernicus via inetd.

Edit configs

the manual is very useful, it instructs you where to put the confs.

Edit /etc/inded.conf

gopher stream tcp nowait _gophernicus /usr/local/libexec/in.gophernicus in.cophernicus -h "example.com" -nm -nu -nx

Modify pf

set skip on lo
tcp_services="{ssh, http, https, 1965, gopher}"
udp_services="{gopher}"

block in all

pass in proto tcp to any port $tcp_services keep state
pass in proto udp to any port $udp_services keep state
pass out all

block return in on ! lo0 proto tcp to port 6000:6010
# pfctl -f /etc/pf.conf
# rcctl enable inetd 
# rcctl start inetd 

Smoke test

# bombadillo gopher://example.com

Adding content

If you read the manual, it helps you figure out valid syntax for a gophermap.

 cat /usr/local/share/doc/gophernicus/README.Gophermap | less 

An excerpt:

Valid filetypes include: 
	0	text file
	1 	directory
	3	error message
	5	archive file (zip, tar etc)
	7	search query
	8	telnet session
	9	binary file
	g	GIF image
	h	HTML file
	i	info text
	I	generic image file (other than GIF)
	d	document file (ps, pdf, etc)
	s	sound file
	;	video file
	c	calendar file
	M	MIME file (mbox, emails, etc)

Additional type characters supported by Gophernicus: 
	#		comment - rest of the line is ingored
	!title		menu title (use on the first line)
	:ext-type	change filetype (for this directory only)
	~		include a list of users with valid ~/public_gopher
	%		include a list of available virtual hosts
	=mapfile	include or execute other gophermap
	* 		stop processing gophermap, include file listing
	.		stop processing gophermap (default)

Examples of valid resource lines: 

1subdir
1Relative internal link 	subdir
1Absolute internal link 	/subdir
1External link 			/	gopher.floodgap.com	70
1External relative link 	subdir/ gopher.domain.tld	70
0Finger-to-gopher link 		user 	example.com 		79
hLink to a website 		URL:http://example.com

hLink to a local HTML page	/path/to/file.html
5Link to a tar archive 		/path/to/archive.tar.gz
9LInk to a binary file		/path/to/binary
7Search engine query		/query

8Telnet session		user	example.com	79

SSL

no