gb or gopherball is a gopher server written in Python with the main goals of
ease of use and integration. The name gopherball is inspired by a recurring
theme in the Calvin & Hobbes comicbooks and a tongue in cheek reference of an
alternative to the World Wide Web as we know it today.
Quick examples to get you running.
gb --mode=implicit . will start a gopher server on
a recursive index of files starting from the current directory.
gb --mode=explicit /home/user/explicit.json will start a gopher server on
7070 with an index generated from the passed configuration
file. For the format of this file see
gb --mode=implicit --magic . will start
gb in magic-mode on
7070. Magic mode will make
gb parse .txt files as templates. For more
information on magic mode see
gb --mode=implicit --host="127.1.1.1" --port 1025 . will start
gb in implicit
mode on the chosen ip and port. Note that using ports under 1024 requires
gb is written with the help of Python 3.5 and higher and the Tornado
framework for its networking.
gb has two main modes of operation that are commonly used. Each has its
appeal for differing usecases.
Implicit mode serves a directory recursively. Indexes are automatically generated and text files are served to the client. Data files are also supported.
Explicit mode requires a configuration which maps each path to a certain asset. This mode will generate indexes not based on the file system but based on a configuration file.
gb will serve all non-directories as type 9 files, these are non-readable
files and most clients will prompt for download. Turning on magic with
--magic will let
gb try to determine the correct filetypes.
Turning on magic will also start templating special
.gb files. See
documentation for what you can do with templating.
The source code for
gb lives on GitHub where you can also submit issues and
pull requests. It mostly needs help by people with the ability to test in
various clients and libraries that might still support the gopher protocol.
An often asked question is why
gb does not use any of Python 3.6+'s type
annotations. The answer is quite simply that
gb wants to support
well as CPython. When
pypy catches up to 3.6 type annotations will be added.
gb loves to run on
pypy so give it a whirl!