.CACHE(5)
π
.CACHE(5) β the GoFish .cache files, explained by your fav unix bestie
okay so real talk β this is the manual page for .cache, the description files that make the GoFish gopher server work. yes, GoFish, the gopher server. gopher is vintage but it's serving and we respect it π«Ά
β¨ NAME β¨
.cache β description files for the GoFish gopher server, no cap.
πΈ DESCRIPTION πΈ
The GoFish gopher server uses .cache files for directory listings. A .cache file can serve as a directory page. GoFish will serve any page that resides inside the chroot jail and has read permissions for the gopher uid/gid. literally any page, it's very generous π
However β and this is the important part, bestie β unless the caller has prior knowledge of a file, only files specified in the .cache file will be displayed.
And here's the slay detail: the .cache file does not need to contain only the files in the current directory. Any file in gopherspace β and yes, that means external as well as internal files β can be put in the .cache. it's giving "no boundaries" energy π₯
π¦ FILE FORMAT π¦
The .cache file is an ascii text file. It is sent to the client as the directory listing. This means the .cache file must match the gopher spec. Here is my take on a BNF for GoFish:
<type><desc>tab[019]<path>tab<server>tab<port>
and here's the field-by-field breakdown, because you deserve to know π
tabβ is the ASCII tab character as per the gopher spec<type>β can be any gopher type but should match the filetype in some way<desc>β is a description of the file. This field can contain any ascii text except tab[019]β GoFish allowed file types. See below.<pathname>β is the path for the file, rooted at the chroot jail home<server>β is the server name. This does not have to be local.<port>β is the port number. Usually70.
π EXAMPLE π
ngl this is the part where it all clicks. look at these icons:
0Text File 0/text.txt domain.com 70
hHTML File 0/text.html domain.com 70
9Binary File 9/binary.tgz domain.com 70
Iimage.gif 9/image.gif domain.com 70
1Directory 1/asubdir/ domain.com 70
β FILE TYPES β
At a basic level GoFish only understands two types of file: text (0) and binary (9). Directory specifications (1) are special in the GoFish knows to concat the .cache to the end of the specification. But it is then treated as a text file.
There is a distinction between text and binary files because the gopher spec says that text files end with a period (.) on a line by itself. Binary files are sent raw. Most modern clients have no problem with sending a text file marked binary. In fact, both Netscape and IE will display the final . from a text file. However, for old clients, you should specify the text files as such.
The gopher type at the start of a line can be more expressive. This tells the client what type of file it is. For example, an html file will be processed by Netscape/IE as an html file. A binary file will popup a dialog box asking if you want to save the file. An image will be displayed if possible. β¨ main character type field, honestly β¨
π FILE PERMISSIONS π
okay so permissions time, pay attention π
GoFish must run as root to be able to accept connections on the privileged port 70. However, it does not need to be root to serve the files. GoFish drops to a non-privileged user while opening the file. This means you can protect special files if you want. GoFish has no checking, it will serve any file that the user knows the name of.
β οΈ heads up: no checking means no checking. if a user knows the name of a file, it's getting served. protect your special files yourself, bestie π
π SEE ALSO π
π AUTHOR π
Written by Sean MacLennan
π REPORTING BUGS π
Report bugs to <headgopher@seanm.ca>.
π COPYRIGHT π
Copyright Β© 2002 Sean MacLennan
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
okay that's the whole page, you ate that π this was the .cache(5) page from the GoFish manual, dated August 2002 β go forth and populate your chroot jail, periodt π
π¦ where this page comes from
- nixos 26.05: gofish 1.2
- nixpkgs unstable: gofish 1.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms