[gopher] Pygopherd is in beta test
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Hello,
Today, I have switched quux.org over to Pygopherd. I found some more
bugs really fast <grin>, and now everything is running smoothly.
Pygopherd 0.9.0 has been released. I'm including a from-memory
changelog and, at the bottom, the default configuration file so you can
see how the configuration system works. I should mention that some
parts of the configuration file are actually interpreted as Python
expressions when it's loaded (most notably, the lists and hashes in
there).
* CompressedFileHandler to support transparent de-compression of files
before sending them on to the clients. It works based on the detected
MIME encoding, so it tends to be more accurate than other mechanisms.
* UMNDirHandler now does extension stripping for menus like UMN gopherd
does. It is also configurable to determine exactly how this stripping
is done.
* Lots of bugfixes, many of them with UMN stuff.
* Pygopherd can now run chroot and can drop root privileges.
* Moved to a more-correct MIME type value when encodings are present. I
believe that this is now the most accurate MIME type calculation code in
any Gopher server.
* Made a Debian package available.
* Added logging capabilities. Can log nowhere, to stdout, or to
syslog. A sample log line is:
Apr 10 16:29:31 pi pygopherd[20915]: 127.0.0.1
[GopherProtocol/UMNDirHandler]: /Government/USA/Enron
* Made mimetypes a searchable path.
* Added setup.py for installing pygopherd system-wide
* Added ability to specify aliased server name.
* Added scriptexec handler to execute arbitrary scripts in a Bucktooth
fashion.
* Added support for gopher search requests to all protocols save HTTP.
* Maildirs are now supported.
Config file:
######################################################################
# OVERALL SETTINGS FOR PYGOPHERD
######################################################################
[pygopherd]
##################################################
# Network
##################################################
# The server name to present to the world. If you do not specify it
# here, Pygopherd will attempt to figure it out automatically.
#
# servername = gopher.example.com
# What port to listen on. If not running as root, this must be
# greater than 1024.
port = 70
# Type of server to run. Valid options are ForkingTCPServer
# and ThreadingTCPServer. ForkingTCPServer is highly recommended
# for now.
servertype = ForkingTCPServer
##################################################
# Security
##################################################
## Whether or not to use chroot.
# This option is only valid if you are running pygopherd as root!
usechroot = yes
## Username and groupname to setreuid/setregid to. Valid only if
## starting pygopherd as root. Comment out if you don't want this
## functionality. NOTE: DO NOT RUN AS ROOT UNLESS YOU USE THESE! BAD
BAD BAD!
setuid = gopher
setgid = gopher
##################################################
# Filesystem and MIME
##################################################
# Where the documents are stored.
root = /var/gopher
# Location of a file to use to figure out MIME types. You can
# specify multiple files here -- just separate them with a colon.
mimetypes = /etc/pygopherd/mime.types:/etc/mime.types
# Encodings. You can use the default with the following syntax. The
# mimetypex.encodings_map is {'.Z': 'compress', '.gz': 'gzip'}.
#
# For ease of use in the config file, we specify this as a list of
# tuples. You can convert any hash to a list of tuples by using .items()
# encoding = mimetypes.encodings_map.items()
# You can override the default entirely (ie, to remove those) like this:
# encoding = {'.bz2' : 'bzip2', '.gz' : 'gzip'}.items()
# Or the same thing:
# encoding = [('.bz2', 'bzip2'), ('.gz', 'gzip')]
# Or, you can extend the default like so:
encoding = mimetypes.encodings_map.items() + \
{'.bz2' : 'bzip2'
}.items()
######################################################################
# Logging
######################################################################
[logger]
# Log method to use. One of:
# syslog -- use Unix syslog facility
# stdout -- log to standard output
# none -- no logging
logmethod = syslog
# If you enable syslog, you will need to define these as well:
# priority -- one of the following (listed in order of high to low):
# LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE,
# LOG_INFO, LOG_DEBUG
priority = LOG_INFO
# Facility -- one of the following:
# LOG_KERN, LOG_USER, LOG_MAIL, LOG_DAEMON, LOG_AUTH, LOG_LPR, LOG_NEWS,
# LOG_UUCP, LOG_CRON, LOG_LOCAL0 - LOG_LOCAL7
facility = LOG_LOCAL3
######################################################################
# GOPHER OBJECTS
######################################################################
# Settings for gopher objects
[GopherEntry]
# Use this MIME type if no other type is found.
defaultmimetype = text/plain
# Mapping from MIME types to gopher0 single-character types.
# This is a list of lists. The first entry in each list is a
# regexp to match and the second is the result.
#
# Please have a .* at the end to map all unknown types to a certain
# character. For best results, that character should be nicely
# corresponding to the defaultmimetype.
mapping = [['text/html', 'h'],
['text/.+', '0'],
['application/mac-binhex40', '4'],
['audio/.+', 's'],
['image/gif', 'g'],
['image/.+', 'I'],
['application/gopher-menu', '1'],
['application/gopher\+-menu', '1'],
['multipart/mixed', 'M'],
['application/.+', '9'],
['.*', '0']
]
######################################################################
# HANDLERS
######################################################################
##################################################
# Handler multiplexer
##################################################
[handlers.HandlerMultiplexer]
# A list of the handlers to consider. The handlers
# are tried in the order listed.
#
#
### Suggested settings:
# Note: the UMNDirHandler will handle all directories, even if they
# do not have UMN-specific files, so you do not need to list the
# dirhandler in this case.
#
# Warning: scriptexec and pyg can execute arbitrary code stored in
# your path. Don't enable unless you know what you're doing!
#
# For UMN emulation: (full UMN featureset excluding scriptexec, no
others)
#
# handlers = [url.HTMLURLHandler, UMN.UMNDirHandler,
# html.HTMLFileTitleHandler,
# mbox.MBoxMessageHandler, mbox.MBoxFolderHandler,
# file.CompressedFileHandler, file.FileHandler]
#
# For Bucktooth emulation: (full Buck featureset excluding scriptexec)
#
#handlers = [gophermap.BuckGophermapHandler, url.HTMLURLHandler,
# file.FileHandler, dir.DirHandler]
#
# For full Pygopherd featureset excluding scripts, compression, and PYG.
# Supports both UMN and Bucktooth featuresets. This is the default
# configuration for Pygopherd because it is secure yet versatile.
#
handlers = [url.HTMLURLHandler, gophermap.BuckGophermapHandler,
mbox.MaildirFolderHandler, mbox.MaildirMessageHandler,
UMN.UMNDirHandler, html.HTMLFileTitleHandler,
mbox.MBoxMessageHandler, mbox.MBoxFolderHandler,
file.FileHandler]
# For full Pygopherd featureset including scripts and PYG. Same as
# above but adds scripts, decompression, and PYG execution.
#handlers = [url.HTMLURLHandler, gophermap.BuckGophermapHandler,
# mbox.MaildirFolderHandler, mbox.MaildirMessageHandler,
# UMN.UMNDirHandler, html.HTMLFileTitleHandler,
# mbox.MBoxMessageHandler, mbox.MBoxFolderHandler,
# pyg.PYGHandler, scriptexec.ExecHandler,
# file.CompressedFileHandler, file.FileHandler]
##################################################
# Decompressing file handler
##################################################
[handlers.file.CompressedFileHandler]
# Decompressors is a map from an encoding (as specified in the
# pygopherd section above) to a decompression program.
# The decompression program must
# accept the input in its stdin and write the decompressed output
# to stdout.
#
# If you do not want to decompress things automatically for your
# clients, you might wish to NOT use this handler.
#
# Note: this feature is probably NOT compatible with chroot unless
# you take extra precautions.
# We enable no decompressors by default... you'll need to do that.
decompressors = {}
#decompressors = {'bzip2': 'bzcat',
# 'gzip' : 'zcat',
# 'compress' : 'zcat'}
# Regexp to match against filenames pending decompression.
# The default will let ALL files be decompressed.
decompresspatt = .*
# You can be more restrictive:
# decompresspatt = \.txt\.(bz2|gz|Z)$
##################################################
# Directory handler
##################################################
[handlers.dir.DirHandler]
# A regular expression of files to ignore. These files
# will not be presented in lists of files to clients,
# but if clients know the exact path to the files, they can
# still be requested.
#
# This pattern is matched against the requested selector.
# Selectors are guaranteed to begin with a slash by this point.
# and never end with a slash unless they consist solely of a slash.
#
# By default, we ignore files starting with a period, gophermap
# files, and files ending with a tilde.
#
# The default emulates UMN's default plus buck.
#
# A buck-only server might like:
#
# ignorepatt = ~$|/\.|/gophermap$
ignorepatt =
/.cap$|/lost\+found$|/lib$|/bin$|/etc$|/dev$|~$|/\.cache|/\.forward$|/\.message$|
/\.hushlogin$|/\.kermrc$|/\.notar$|/\.where$|/veronica.ctl$|/robots.txt$|/nohup.
out$|/gophermap$|~$
# Expiration time, in seconds, for the cache.
# Set to 0 to disable caching entirely.
cachetime = 180
# Name of the cahe file. Must be set to something even if the cachetime
# is zero. In that case, this filename will not be used but for the conf
# file to parse, it must still be set.
cachefile = .cache.pygopherd.dir
##################################################
# UMN Directory Handler
##################################################
[handlers.UMN.UMNDirHandler]
# Extension stripping behavior. When a file from a directory
# is presented in a menu, and no name is given, what to do?
# For instance, given a file Welcome.txt and pygopherd.tar.gz:
#
# If extstrip is none, present Welcome.txt and pygopherd.tar.gz in the
# menu.
#
# If extstrip is nonencoded, modify only those files that do not
# have encodings. (If CompressedFileHandler is used, modify only
# those files that to not have *HANDLED* encodings.)
# If gzip is NOT a handled encoding, you'd get names Welcome and
# pygopherd.tar.gz. If gzip IS a handled encoding, you'd get
# Welcome and pygopherd.
#
# If extstrip is full, modify all modifyable names. Welcome.txt ->
# Welcome and pygopherd.tar.gz -> pygopherd.
# extstrip = none
extstrip = nonencoded
# extstrip = full
######################################################################
# PROTOCOLS
######################################################################
##################################################
# Protocol Multiplexer
##################################################
[protocols.ProtocolMultiplexer]
# A list of the protocols to consider for each request.
# The protocols are tried in the order listed.
protocols = [http.HTTPProtocol,
gopherp.GopherPlusProtocol, rfc1436.GopherProtocol]
##################################################
# Gopher+ Protocol
##################################################
[protocols.gopherp.GopherPlusProtocol]
# The name and e-mail of the administrator
admin = Unconfigured Pygopherd Admin <pygopherd@nowhere.nowhere>
##################################################
# HTTP Protocol
##################################################
[protocols.http.HTTPProtocol]
iconmapping = {'h' : 'text.gif',
'0' : 'text.gif',
'4' : 'binhex.gif',
's' : 'sound1.gif',
'g' : 'image3.gif',
'I' : 'image3.gif',
'M' : 'text.gif',
'9' : 'binary.gif',
'1' : 'folder.gif',
'i' : 'blank.gif'}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gopher] Pygopherd is in beta test,
John Goerzen <=
|
|