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 "" -nm -nu -nx

Modify pf

set skip on lo
tcp_services="{ssh, http, https, 1965, 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://

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: 

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

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	79