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
|
Serving files and the gophermap file
------------------------------------
The gophermap file is responsible for the look of a gopher menu.
Unlike the UMN gopherd-style map files, which are somewhat cumbersome and
can get rather large, Bucktooth encourages a slimline approach, or you can
have none at all. This is not too secure since it will happily serve any and
every file in its mountpoint to a greedy user, but if that's really what you
want, congratulations. You can stop reading this now, since that's exactly
what it will do when you install it with no gophermap files. Only gophermap,
., and .. are not served to the user.
Assuming you want to do a little more customisation than that, you can
edit the gophermap file (one per directory) with any text editor and follow a
few simple rules to gopher goodness. (A sample file is in stuff/ for your
enjoyment.)
Bucktooth sends any RFC-1436 compliant line to the client. In other words,
1gopher.ptloma.edu home<TAB><TAB>gopher.ptloma.edu<TAB>70
where <TAB>, is of course, the tab (CTRL-I, 0x09) character, generates a
link to "null" selector on gopher.ptloma.edu 70 with an itemtype of 1 and
a display string of "gopher.ptloma.edu home". You don't even have to enter
valid selectors, although this will not endear you much to your users.
If you are not well-versed in RFC-1436, it breaks down to the first character
being the itemtype (0 = text, 1 = gopher menu, 5 = zip file, 9 = generic
binary, 7 = search server, I = generic image, g = gif image; others are
also supported by some clients), then the string shown by the client up to
the first tab ("display string"); then the full path to the resource
("selector"); the hostname of the server; and the port.
Since this would be a drag to always have to type things out in full,
Bucktooth allows the following shortcuts:
* If you don't specify a port, Bucktooth provides the one your server is
using (almost always 70).
* If you don't specify a host, Bucktooth provides your server's hostname.
* If you only specify a relative selector and not an absolute path, Bucktooth
sticks on the path they're browsing.
So, if your server is gopher.somenetwork.com and your server's port is 7070,
and this gophermap is inside of /lotsa, then
1Lots of stuff<TAB>stuff
is expanded out to
1Lots of stuff<TAB>/lotsa/stuff<TAB>gopher.somenetwork.com<TAB>7070
If you don't specify a selector, two things can happen. Putting a <TAB> at
the end, like
1src<TAB>
explicitly tells Bucktooth you aren't specifying a selector, so Bucktooth
uses your display string as the selector, adds on the host and port, and
gives the client that.
Otherwise, Bucktooth sees it as a description, and has the client display it
as text. This allows you to add text descriptions to your menus. However,
don't use the <TAB> character anywhere in your text description or Bucktooth
will try to interpret it as an RFC-1436 resource, which will yield possibly
hilarious and definitely erroneous results.
One last warning: keep display strings at 67 characters or less -- some
clients may abnormally wrap them or display them in a way you didn't intend.
.
|