-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotcache.5
94 lines (93 loc) · 3.27 KB
/
dotcache.5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.TH .CACHE "5" "August 2002" "" "GoFish"
.SH NAME
\.cache \- description files for the GoFish gopher server
.SH DESCRIPTION
.PP
The GoFish gopher server uses .cache files for directory listings. A
.cache file must exist in every directory that you want GoFish to
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.
.PP
However, unless the caller has prior knowledge of a file, only files
specified in the .cache file will be displayed.
.PP
The .cache file does not need to contain only the files in
the current directory. Any file in gopherspace, and this means
external as well as internal files, can be put in the .cache.
.SH FILE FORMAT
.PP
The .cache file is an ascii text file. It is sent to the
client as the directory listing. This means that the .cache file must
match the gopher spec. Here is my take on a BNF for GoFish.
.PP
<type><desc>\fBtab\fR[019]<path>\fBtab\fR<server>\fBtab\fR<port>
.PP
.B tab
\- is the ASCII tab character as per the gopher spec
.br
.B <type>
\- can be any gopher type but should match the filetype in some way
.br
.B <desc>
\- is a description of the file. This field can contain any ascii text
except
.BR tab
.
.br
.B [019]
\- GoFish allowed file types. See below.
.br
.B <pathname>
\- is the path for the file, rooted at the chroot jail home
.br
.B <server>
\- is the server name. This does not have to be local.
.br
.B <port>
\- is the port number. Usually 70.
.SH EXAMPLE
.nf
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
.fi
.SH FILE TYPES
.PP
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.
.PP
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.
.PP
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.
.SH FILE PERMISSIONS
.PP
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 server any file that the user knows the name of.
.SH "SEE ALSO"
.BR gofish (1)
.SH AUTHOR
Written by Sean MacLennan
.SH "REPORTING BUGS"
Report bugs to <headgopher@seanm.ca>.
.SH COPYRIGHT
Copyright \(co 2002 Sean MacLennan
.br
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.