diff --git a/Makefile b/Makefile index e680a35..465ed9f 100644 --- a/Makefile +++ b/Makefile @@ -28,12 +28,12 @@ clean: changelog: git log -M -C --find-copies-harder --name-status > ChangeLog -docs: doc/pygopherd.8 doc/pygopherd.html doc/pygopherd.ps \ +docs: doc/pygopherd.8 doc/pygopherd.ps \ doc/pygopherd.pdf doc/pygopherd.txt -doc/pygopherd.8: doc/pygopherd.sgml - docbook2man doc/pygopherd.sgml - docbook2man doc/pygopherd.sgml +doc/pygopherd.8: doc/pygopherd.sgml doc/book.sgml + docbook2man doc/book.sgml + docbook2man doc/book.sgml -rm manpage.links manpage.refs mv pygopherd.8 doc @@ -41,8 +41,8 @@ doc/pygopherd.8: doc/pygopherd.sgml # docbook2html -u doc/pygopherd.sgml # mv pygopherd.html doc -doc/pygopherd.html: doc/pygopherd.sgml - docbook-2-html -s local doc/pygopherd.sgml +doc/pygopherd.html: doc/pygopherd.sgml doc/book.sgml + docbook2html doc/book.sgml mv doc/pygopherd-html/pygopherd.html doc/pygopherd.html rm -r doc/pygopherd-html @@ -50,7 +50,7 @@ doc/pygopherd.html: doc/pygopherd.sgml # man -t -l doc/pygopherd.8 > doc/pygopherd.ps doc/pygopherd.ps: doc/pygopherd.sgml doc/book.sgml doc/manpage.sgml - docbook-2-ps -q -O -V -O paper-size=Letter -s local=printlocal \ + docbook2ps \ doc/book.sgml mv book.ps doc/pygopherd.ps diff --git a/conf/pygopherd.conf b/conf/pygopherd.conf index 08863a8..7b0022c 100644 --- a/conf/pygopherd.conf +++ b/conf/pygopherd.conf @@ -11,12 +11,12 @@ # Set this to true if you want the server to "detach" itself; that is, # to go into the background after it starts. -detach = yes +detach = no # If you want gopherd to write a PID file, set this to the location # where you want it. Otherwise, comment out this line. -pidfile = /var/run/pygopherd.pid +pidfile = /var/run/pygopherd/pygopherd.pid ################################################## # Network @@ -110,8 +110,8 @@ usechroot = yes ## 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 +#setuid = gopher +#setgid = gopher ################################################## # TLS @@ -510,4 +510,5 @@ footer = => https://www.github.com/michael-lazar/pygopherd Generated by PyGopher [protocols.gemini.SpartanProtocol] -footer = => https://www.github.com/michael-lazar/pygopherd Generated by PyGopherd \ No newline at end of file +footer = => https://www.github.com/michael-lazar/pygopherd Generated by PyGopherd + diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 83c3928..0000000 --- a/debian/changelog +++ /dev/null @@ -1,352 +0,0 @@ -pygopherd (2.0.18.5) unstable; urgency=medium - - * Correct Cvs-Git and related in debian/control. - * Bump standards-version. - * Build fix: use newer source:Version in control. - - -- John Goerzen Tue, 14 Feb 2017 19:08:39 -0600 - -pygopherd (2.0.18.4) unstable; urgency=low - - * Ack NMU. Closes: #771501, #616966, #547835. - * Don't crash if Numb= is empty. - * Migrate to compat 9. Closes: #800204. - * Correct a typo in URL handler. Closes: #663420. - - -- John Goerzen Sun, 29 May 2016 21:01:06 -0500 - -pygopherd (2.0.18.3+nmu4) unstable; urgency=medium - - * Non-maintainer upload. - * Copy gophermap from /usr/share, not /usr/share/doc (Closes: #771501) - - -- Cameron Norman Mon, 08 Dec 2014 17:25:38 -0800 - -pygopherd (2.0.18.3+nmu3) unstable; urgency=low - - * Non-maintainer upload. - * Convert to dh_python2. (Closes: #616966) - - -- Andrea Colangelo Fri, 28 Jun 2013 18:08:31 +0200 - -pygopherd (2.0.18.3+nmu2) unstable; urgency=low - - * Non-maintainer upload. - * Build-Depend on python >= 2.5.4 for install-layout=deb. - - -- Kumar Appaiah Mon, 19 Oct 2009 18:00:54 -0500 - -pygopherd (2.0.18.3+nmu1) unstable; urgency=low - - * Non-maintainer upload. - * Fix "manipulates site-packages/ directly, failing with Python 2.6" - Applied and uploaded Kumar's patch, thanks dude! (Closes: #547835) - - -- Bastian Venthur Sat, 17 Oct 2009 15:41:30 +0200 - -pygopherd (2.0.18.3) unstable; urgency=low - - * Now remove build directory in clean target. - - -- John Goerzen Fri, 08 Aug 2008 22:02:16 -0500 - -pygopherd (2.0.18.2) unstable; urgency=medium - - * Correct typo in debian/rules. Really get RFC out of Debian source package - this time. Closes: #475376. - - -- John Goerzen Tue, 05 Aug 2008 08:40:10 -0500 - -pygopherd (2.0.18.1) unstable; urgency=low - - * Remove RFC from Debian source package. Closes: #475376. - - -- John Goerzen Thu, 01 May 2008 01:31:59 -0500 - -pygopherd (2.0.18) unstable; urgency=low - - * Move #DEBHELPER# section to end of postinst so that adduser gets run - first. Fixes a bug introduced in 2.0.17. Closes: #475247. - * Removed weird stuff from source tree - * Acknowledge NMU. Closes: #469619. - - -- John Goerzen Thu, 10 Apr 2008 00:23:56 -0500 - -pygopherd (2.0.17-0.1) unstable; urgency=low - - * Non-maintainer upload to solve release goal. - * Add LSB dependency header to init.d scripts (Closes: #469619). - - -- Petter Reinholdtsen Fri, 4 Apr 2008 20:18:22 +0200 - -pygopherd (2.0.17) unstable; urgency=high - - * Make sure python-central does its thing before the init script - tries to start Python. Closes: #387663. - - -- John Goerzen Fri, 15 Sep 2006 14:01:50 -0500 - -pygopherd (2.0.16) unstable; urgency=medium - - * New config file option: timeout - * Updated to latest Debian python policy (Closes: #380906) - - -- John Goerzen Mon, 11 Sep 2006 08:54:50 -0500 - -pygopherd (2.0.15) unstable; urgency=low - - * Fixed handling of interface config option. Closes: #357315, #361435. - - -- John Goerzen Tue, 9 May 2006 10:43:42 -0500 - -pygopherd (2.0.14) unstable; urgency=low - - * Fixed a bug where no subject line would crash the mailbox handler. - * Updated ChangeLog. - - -- John Goerzen Thu, 22 Sep 2005 05:46:29 -0500 - -pygopherd (2.0.13) unstable; urgency=low - - * Applied patch from Tim to clean up some typos in the docs. - * Manpage was missing from .deb. Fixed. - - -- John Goerzen Sat, 19 Feb 2005 12:05:48 -0600 - -pygopherd (2.0.12) unstable; urgency=low - - * Cleaner handling of connection reset by peer - - -- John Goerzen Sat, 15 Jan 2005 15:23:38 -0600 - -pygopherd (2.0.11) unstable; urgency=medium - - * Work around a bug that occurs when a type is missing. - - -- John Goerzen Fri, 14 Jan 2005 09:35:25 -0600 - -pygopherd (2.0.10) unstable; urgency=low - - * Some modifications to make more Windows friendly, based on patch from - Grant D. Watson. - - -- John Goerzen Mon, 30 Aug 2004 14:49:15 -0500 - -pygopherd (2.0.9) unstable; urgency=low - - * Don't crash if simpletal is unavailable. - - -- John Goerzen Wed, 17 Dec 2003 11:26:14 -0600 - -pygopherd (2.0.8) unstable; urgency=low - - * Fixed a logic error in the Numb handling fix. - - -- John Goerzen Wed, 17 Dec 2003 08:43:38 -0600 - -pygopherd (2.0.7) unstable; urgency=low - - * Fixed UMN.py to properly handle Numb=. - - -- John Goerzen Wed, 17 Dec 2003 08:25:49 -0600 - -pygopherd (2.0.6) unstable; urgency=low - - * Updated debian/docs. - - -- John Goerzen Thu, 9 Oct 2003 16:46:37 -0500 - -pygopherd (2.0.5) unstable; urgency=low - - * Added build-dep on python2.3-dev. Closes: #213938. - - -- John Goerzen Thu, 9 Oct 2003 11:09:41 -0500 - -pygopherd (2.0.4) unstable; urgency=low - - * Eliminated outdated import of xreadlines, clearing up a warning - with Python 2.3. - - -- John Goerzen Sun, 24 Aug 2003 17:23:41 -0500 - -pygopherd (2.0.3) unstable; urgency=low - - * Fixed a silly typo in wap.py. - - -- John Goerzen Sat, 23 Aug 2003 20:59:12 -0500 - -pygopherd (2.0.2) unstable; urgency=low - - * Can now autodetect many WAP browsers. - - -- John Goerzen Sat, 23 Aug 2003 17:29:20 -0500 - -pygopherd (2.0.1) unstable; urgency=low - - * Oops, a stray print was left over. - - -- John Goerzen Sat, 23 Aug 2003 15:04:19 -0500 - -pygopherd (2.0.0) unstable; urgency=low - - * New feature: WAP/WMP support! - * HTTP bugfix: use \r\n line endings. - * Debian: Updated for Python 2.3. - * Virtual: now use | for selector sep (keep ? for legacy) - for WAP compatibility. - - -- John Goerzen Sat, 23 Aug 2003 12:00:48 -0500 - -pygopherd (1.99.5) unstable; urgency=low - - * Introduced new "inode-like" caching system for ZIP files. - Now, the first time a ZIP file is accessed, it will be scanned. - Links will be resolved immediately. A dictionary tree is built up; - values being either file offsets in the ZIP file or dictionaries - (for subdirectories). This dictionary is then cached on-disk using - a binary database and marshal algorithm derived from Python's shelve - module. We do not need to use pickle for this task since we are saving - only simple structures. The performance gain for large ZIP files using - this method is tremendous. The only time a ZIP file's central - directory structure must be scanned now is the very first time it is - ever accessed. - - -- John Goerzen Thu, 13 Mar 2003 09:49:39 -0600 - -pygopherd (1.99.4) unstable; urgency=low - - * Wrote my own ZIP file reader and heavily optimized it. This reduced run - times for certain torture cases from over 100 seconds to somewhere - around 20, and others from over 200 seconds to around 80. - - -- John Goerzen Fri, 7 Mar 2003 16:03:35 -0600 - -pygopherd (1.99.3) unstable; urgency=low - - * Backed out ZIP content cache. Was slower than the ZIP file itself. - - -- John Goerzen Thu, 6 Mar 2003 15:43:03 -0600 - -pygopherd (1.99.2) unstable; urgency=low - - * Made some aggressive optimizations in the ZIP handler. - - -- John Goerzen Thu, 6 Mar 2003 15:34:08 -0600 - -pygopherd (1.99.1) unstable; urgency=low - - * Fixed a bug in html handler. - - -- John Goerzen Thu, 6 Mar 2003 11:26:14 -0600 - -pygopherd (1.99.0) unstable; urgency=low - - * Implemented virtual file system support. - * Implemented VFS_Real, the VFS module for the on-disk filesystem - (as was the only option in the past) - * Implemented VFS_ZIP, the VFS module for ZIP archives. - * New handler ZIP to work with VFS_ZIP. - * Implemented symlink capabilities for VFS_ZIP. - * Implemented directory symlink capabilities for VFS_ZIP. - * Wrote extensive test battery for VFS_ZIP and VFS_ZIP's symlink handling. - All tests pass. - - -- John Goerzen Wed, 5 Mar 2003 22:24:43 -0600 - -pygopherd (1.1.1) unstable; urgency=low - - * Added ability to serve up files ending in ".gophermap" as - Gophermap files. - - -- John Goerzen Fri, 21 Feb 2003 15:14:03 -0600 - -pygopherd (1.1.0) unstable; urgency=low - - * Added new configuration option: advertisedport. - * Removed TODO file (now contained in bug-tracking system) - * Moved pygopherd.py to bin/pygopherd to make installation clearer - and testing smoother. - * Extensive new manual that thoroughly documents the system. - * UMN Compatibility: type - will also hide things in the fashion of X. - - -- John Goerzen Thu, 08 Aug 2002 20:17:17 -0500 - -pygopherd (1.0.0) unstable; urgency=low - - * First release. Welcome, pygopherd. - * Added URL type rewriting handler. - * Fixed gophermap info-only lines that have no tabs. - * UMN dir handler now keeps directories beginning with a . out of the - directory list. - * Shored up tests to work with Subversion. - - -- John Goerzen Wed, 17 Jul 2002 19:32:32 -0500 - -pygopherd (0.9.14) unstable; urgency=low - - * Fixed some more bugs -- HTMLParser. - * Detect failure to allocate a socket and log it. And still scream about - it. - - -- John Goerzen Tue, 2 Jul 2002 11:45:20 -0500 - -pygopherd (0.9.13) unstable; urgency=low - - * Added signal handlers so shutdowns work properly. - - -- John Goerzen Tue, 2 Jul 2002 11:03:18 -0500 - -pygopherd (0.9.12) unstable; urgency=low - - * Minor bugfixes. - * Added support for detached operation and pidfile writing. - - -- John Goerzen Wed, 1 May 2002 11:46:19 -0500 - -pygopherd (0.9.11) unstable; urgency=low - - * Added support for searches in HTTP handler. - * Added pygfarm package and a PYG. - * Many bugfixes. - - -- John Goerzen Thu, 18 Apr 2002 12:23:09 -0500 - -pygopherd (0.9.10) unstable; urgency=low - - * Added handling of abstracts and other extended attributes. - * More test cases. - - -- John Goerzen Mon, 15 Apr 2002 19:20:04 -0500 - -pygopherd (0.9.4) unstable; urgency=low - - * Moved security handling to the handler base. - * Fixed bug in URL handling -- it works now. - - -- John Goerzen Fri, 12 Apr 2002 11:46:14 -0500 - -pygopherd (0.9.3) unstable; urgency=low - - * Fixed a bug that prevented proper startup. Fixed a lot of bugs - with new HTTP code. - - -- John Goerzen Thu, 11 Apr 2002 16:41:02 -0500 - -pygopherd (0.9.2) unstable; urgency=low - - * More bugfixes and new testing code. - - -- John Goerzen Thu, 11 Apr 2002 14:34:43 -0500 - -pygopherd (0.9.1) unstable; urgency=low - - * Many routine bugfixes. - - -- John Goerzen Wed, 10 Apr 2002 19:31:13 -0500 - -pygopherd (0.9.0) unstable; urgency=low - - * Initial Release. Closes: #142221. - - -- John Goerzen Wed, 10 Apr 2002 08:58:31 -0500 - diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec63514..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/conffiles b/debian/conffiles deleted file mode 100644 index 0446bce..0000000 --- a/debian/conffiles +++ /dev/null @@ -1 +0,0 @@ -/etc/pygopherd/pygopherd.conf diff --git a/debian/control b/debian/control deleted file mode 100644 index 80b4783..0000000 --- a/debian/control +++ /dev/null @@ -1,41 +0,0 @@ -Source: pygopherd -Section: net -Priority: optional -Maintainer: John Goerzen -Build-Depends-Indep: debhelper (>> 9), python (>= 2.6.6-3~), dh-python -Build-Depends: debhelper (>= 9) -Standards-Version: 3.9.8 -Homepage: gopher://gopher.quux.org/1/devel/gopher/pygopherd -Vcs-Git: https://github.com/jgoerzen/gopher.git -Vcs-Browser: https://github.com/jgoerzen/gopher.git - -Package: pygopherd -Architecture: all -Depends: python, mime-support, logrotate, python-simpletal, ${python:Depends}, ${misc:Depends}, adduser -Provides: gopher-server -Description: Modular Multiprotocol Gopher/HTTP/WAP Server in Python - This is an all-new, modern Gopher server. It can serve documents - with Gopher+, standard Gopher (RFC1436), HTTP, and WAP -- all on the same - port. Pygopherd features a modular extension system as well as - loadable scripts and much more. It contains full support for - UMN gopherd systems -- including .Links, .names, .cap, searches, etc. - Pygopherd also supports Bucktooth features such as gophermap files - and executables. In addition to all this, there are Pygopherd's own - extra features. All features are fully customizable and can be enabled - or disabled by editing /etc/pygopherd/pygopherd.conf. - . - This version of PyGopherd introduces WAP support. - -Package: pygfarm -Architecture: all -Depends: pygopherd (>= ${source:Version}), python-dictclient (>= 1.0.1), ${misc:Depends} -Description: Collection of add-on modules for Pygopherd - These add-on modules provide additional functionality for - your Pygopherd server. - . - Included modules are: - . - dict.pyg: Interface to a dictd database - . - These are installed into /usr/share/pygfarm for you to link to - as you like. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index d3af802..0000000 --- a/debian/copyright +++ /dev/null @@ -1,27 +0,0 @@ -This package was debianized by John Goerzen on -Wed, 10 Apr 2002 08:58:31 -0500. - -It was downloaded from http://quux.org/give-me-gopher/ - -Upstream Author(s): John Goerzen - -Copyright: - -Copyright (C) 2021 Michael Lazar -Copyright (C) 2002-2019 John Goerzen - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Debian GNU/Linux may find the GNU General Public License, version 2, in -/usr/share/common-licenses/GPL-2. diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index ac3556a..0000000 --- a/debian/dirs +++ /dev/null @@ -1,3 +0,0 @@ -usr/bin -usr/sbin -usr/share/pygopherd diff --git a/debian/docs b/debian/docs deleted file mode 100644 index 564c4a4..0000000 --- a/debian/docs +++ /dev/null @@ -1,6 +0,0 @@ -ChangeLog -doc/pygopherd.txt -doc/pygopherd.ps -doc/pygopherd.pdf -doc/pygopherd.html -README diff --git a/debian/examples b/debian/examples deleted file mode 100644 index e39721e..0000000 --- a/debian/examples +++ /dev/null @@ -1 +0,0 @@ -examples/* diff --git a/debian/init.d b/debian/init.d deleted file mode 100644 index d41eb6a..0000000 --- a/debian/init.d +++ /dev/null @@ -1,77 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: pygopherd -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -### END INIT INFO -# -# skeleton example file to build /etc/init.d/ scripts. -# This file should be used to construct scripts for /etc/init.d. -# -# Written by Miquel van Smoorenburg . -# Modified for Debian GNU/Linux -# by Ian Murdock . -# -# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl -# -# This file was automatically customized by dh-make on Wed, 10 Apr 2002 08:58:31 -0500 - -PATH=/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/sbin/pygopherd -NAME=pygopherd -DESC="Python Gopher Server" -CONF=/etc/pygopherd/pygopherd.conf - -test -f $DAEMON || exit 0 - -set -e - -case "$1" in - start) - echo -n "Starting $DESC: " - start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ - --exec $DAEMON -- $CONF - echo "$NAME." - ;; - stop) - echo -n "Stopping $DESC: " - start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid - echo "$NAME." - ;; - #reload) - # - # If the daemon can reload its config files on the fly - # for example by sending it SIGHUP, do it here. - # - # If the daemon responds to changes in its config file - # directly anyway, make this a do-nothing entry. - # - # echo "Reloading $DESC configuration files." - # start-stop-daemon --stop --signal 1 --quiet --pidfile \ - # /var/run/$NAME.pid --exec $DAEMON - #;; - restart|force-reload) - # - # If the "reload" option is implemented, move the "force-reload" - # option to the "reload" entry above. If not, "force-reload" is - # just the same as "restart". - # - echo -n "Restarting $DESC: " - start-stop-daemon --stop --quiet --pidfile \ - /var/run/$NAME.pid - sleep 1 - start-stop-daemon --start --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON -- $CONF - echo "$NAME." - ;; - *) - N=/etc/init.d/$NAME - # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $N {start|stop|restart|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index c7c0af5..0000000 --- a/debian/postinst +++ /dev/null @@ -1,93 +0,0 @@ -#! /bin/sh -# postinst script for pygopherd -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see /usr/share/doc/packaging-manual/ -# -# quoting from the policy: -# Any necessary prompting should almost always be confined to the -# post-installation script, and should be protected with a conditional -# so that unnecessary prompting doesn't happen if a package's -# installation fails and the `postinst' is called with `abort-upgrade', -# `abort-remove' or `abort-deconfigure'. - -case "$1" in - configure) - - -# Allow this part to fail. - -set +e - -UNAME=gopher -HOMEDIR=/var/gopher - -if test -d $HOMEDIR; then HOMEDIREXISTS=yes; else HOMEDIREXISTS=no; fi - -if ! grep -q "^${UNAME}:.*${HOMEDIR}" /etc/passwd -then - adduser --system --home $HOMEDIR --group $UNAME -else - echo "Gopher account already in place; not modifying." -fi - -if ! grep -q "^${UNAME}:" /etc/passwd -then - echo Failed to create user $UNAME - exit 1 -fi - -if ! grep -q \^${UNAME}: /etc/group -then - echo Failed to create group $UNAME - exit 1 -fi - -# Restore normal error checking - -set -e - -if [ `grep ^gopher: /etc/passwd | cut -d: -f7` = '/bin/false' ] ; then - chsh -s /bin/sh gopher -fi - - -if [ "$HOMEDIREXISTS" = "no" ]; then - if ! test -d $HOMEDIR; then - mkdir $HOMEDIR - fi - cp /usr/share/pygopherd/gophermap $HOMEDIR/gophermap - chown -R gopher:gopher $HOMEDIR -fi - - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 0 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - diff --git a/debian/postrm b/debian/postrm deleted file mode 100644 index 247ae0d..0000000 --- a/debian/postrm +++ /dev/null @@ -1,46 +0,0 @@ -#! /bin/sh -# postrm script for pygopherd -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' overwrit>r> -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - purge|remove) - - echo "Removing old .pyc files." - # Clean up .pyc and .class files left around. - rm -fr /usr/lib/python2.2/site-packages/pygopherd || true - - ;; - - upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - true - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - -esac - - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 diff --git a/debian/pycompat b/debian/pycompat deleted file mode 100644 index 0cfbf08..0000000 --- a/debian/pycompat +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/debian/pygfarm.README.Debian b/debian/pygfarm.README.Debian deleted file mode 100644 index 41ac6c2..0000000 --- a/debian/pygfarm.README.Debian +++ /dev/null @@ -1,8 +0,0 @@ -pygfarm for Debian ------------------- - -This package installs its files into /usr/share/pygfarm. To actually make -them visible to your server, you'll need to either symlink (if not running -chroot) or copy (if running chroot) them into a path under your server root. - - -- John Goerzen , Wed, 10 Apr 2002 08:58:31 -0500 diff --git a/debian/pygfarm.dirs b/debian/pygfarm.dirs deleted file mode 100644 index 0dc29f6..0000000 --- a/debian/pygfarm.dirs +++ /dev/null @@ -1 +0,0 @@ -/usr/share/pygfarm diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 0f2b67e..0000000 --- a/debian/rules +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. -# Modified by John Goerzen - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -PYTHON=python -PACKAGE=pygopherd - - -ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) - CFLAGS += -g -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - #$(PYTHON) setup.py configure - - touch configure-stamp - - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - - # Add here commands to compile the package. - $(PYTHON) setup.py build - #/usr/bin/docbook-to-man debian/pygopherd.sgml > pygopherd.1 - - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - -rm -f doc/standards/rfc* - - # Add here commands to clean up after the build process. - -$(MAKE) clean - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_prep - dh_installdirs - - # Add here commands to install the package into debian/pygopherd. - #$(MAKE) install DESTDIR=$(CURDIR)/debian/pygopherd - $(PYTHON) setup.py install --root=`pwd`/debian/$(PACKAGE) --no-compile --install-layout=deb - - -# Build architecture-dependent files here. -binary-arch: build install -# We have nothing to do by default. - -# Build architecture-independent files here. -binary-indep: build install - dh_testdir - dh_testroot -# dh_installdebconf - dh_installdocs - mv debian/pygopherd/usr/bin/pygopherd \ - debian/pygopherd/usr/sbin/pygopherd - rm debian/pygopherd/etc/pygopherd/mime.types - cp examples/gophermap debian/pygopherd/usr/share/pygopherd/gophermap - cp pygfarm/*.pyg debian/pygfarm/usr/share/pygfarm - chown root.root debian/pygfarm/usr/share/pygfarm/* - chmod 0755 debian/pygfarm/usr/share/pygfarm/* - dh_installexamples examples/* - dh_installmenu -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime - dh_installinit - dh_installcron - dh_installman doc/pygopherd.8 - dh_installinfo -# dh_undocumented - dh_installchangelogs - dh_python2 - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_makeshlibs - dh_installdeb -# dh_perl - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/doc/book.sgml b/doc/book.sgml index dcd1a23..2cbab27 100644 --- a/doc/book.sgml +++ b/doc/book.sgml @@ -7,8 +7,6 @@ PyGopherd Manual</> - <pubdate>$Date$</> - <edition>$Rev$</> </bookinfo> &maindoc; diff --git a/doc/manpage.sgml b/doc/manpage.sgml index 200e9b7..b601123 100644 --- a/doc/manpage.sgml +++ b/doc/manpage.sgml @@ -12,7 +12,6 @@ <refentryinfo> <address><email>jgoerzen@complete.org</email></address> <author><firstname>John</firstname><surname>Goerzen</surname></author> - <date> $Date: 2003-08-25 16:14:52 -0500 (Mon, 25 Aug 2003) $ </date> </refentryinfo> <refmeta> diff --git a/doc/pygopherd.8 b/doc/pygopherd.8 index 64b7d51..415c109 100644 --- a/doc/pygopherd.8 +++ b/doc/pygopherd.8 @@ -3,7 +3,7 @@ .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng <steve@ggi-project.org>. -.TH "PYGOPHERD" "8" "25 August 2003" "John Goerzen" "PyGopherd Manual" +.TH "PYGOPHERD" "8" "25 November 2022" "John Goerzen" "PyGopherd Manpage" .SH NAME PyGopherd \- Multiprotocol Information Server @@ -13,7 +13,7 @@ PyGopherd \- Multiprotocol Information Server .SH "DESCRIPTION" .PP -Welcome to \fBPyGopherd\fR. In a nutshell, \fBPyGopherd\fR +Welcome to \fBPyGopherd\fR\&. In a nutshell, \fBPyGopherd\fR is a modern dynamic multi-protocol hierarchical information server with a pluggable modularized extension system, @@ -21,152 +21,6 @@ full flexible caching, virtual files and folders, and autodetection of file types -- all with support for standardized yet extensible per-document metadata. Whew! Read on for information on this what all these buzzwords mean. -.SS "FEATURES" -.PP -Here are some of \fBPyGopherd\fR's features: -.TP 0.2i -\(bu -Provides built-in support for multiple protocols: -HTTP (Web), Gopher+, Gopher (RFC1436), Enhanced Gopher0, -and WAP (mobile phones). Protocols can be enabled or -disabled as desired. -.TP 0.2i -\(bu -Provides protocol autodetection. That is, -\fBPyGopherd\fR can listen for all the above protocols -\fBon a single port\fR and will -automatically respond using the protocol it detects the -client is using. Practical effects of this are that you -can, for instance, give out a single URL and have it -viewable normally on desktop Web browsers and in WAP -mode on mobile phones -- and appropriately in various -Gopher browsers. -.TP 0.2i -\(bu -Metadata and site links can be entered in a -variety of formats, including full UMN dotfile metadata -formats as well as Bucktooth gophermap files. Moreover, -gophermap files are not limited to Gopher protocols, and -can be used for all protocols. -.TP 0.2i -\(bu -Support for inter-protocol linking (linking -from Gopher sites to web sites) -.TP 0.2i -\(bu -Virtual folder system lets you serve up -anything as if it were regular files and directories. -PyGopherd comes with the following virtual folder systems -built in: -.RS -.TP 0.2i -\(bu -Can present any Unix MBOX, MMDF box, MH -directory, Maildir directory, or Babyl mailbox as a -virtual folder, the contents of which are the -messages in the mailbox. -.TP 0.2i -\(bu -Can use a configurable separator to -split a file into multiple parts, the first line of each -becoming the name for the virtual folder. -.TP 0.2i -\(bu -Can peek inside a ZIP file and serve it -up as first-class site citizens -- metadata can even be -stored in the ZIP files. -.TP 0.2i -\(bu -Can serve up the contents of a dictd -server as a filesystem. -.RE -.TP 0.2i -\(bu -Modular, extensible design: you can use PyGopherd's own -PYG extension format, or UMN- or Bucktooth-style -executables. -.TP 0.2i -\(bu -Runs on any platform supported by Python 2.2 or 2.3. -This includes virtually every past and current flavor of -Unix (Linux, *BSD, Solaris, SunOS), Windows, MacOS 9.x -and X, and more. Some features may not be available on -non-Unix platforms. -.TP 0.2i -\(bu -Runs on any platform supported by Java 1.1 -via the Jython Python implementation. -.TP 0.2i -\(bu -Tunable server types via configuration -directive -- forking or threading. -.TP 0.2i -\(bu -Secure design with support for chrooted execution. -.TP 0.2i -\(bu -Feature-complete, full implementations of: -Gopher0 (RFC1435), Gopher+, HTTP, and WAP. -.TP 0.2i -\(bu -Support for automatically finding the titles -of HTML documents for presentation in a directory. -.TP 0.2i -\(bu -Versatile configuration file format is both -extensible and nicely complementary of the module system. -.TP 0.2i -\(bu -Protocol-independant, handler-dependant -caching. This increases performance by letting handlers -cache dynamically-generated information -- currently used by -the directory handlers. This can improve performance of -directories by several orders of magnitude. Because this is -a handler cache only, all protococls share the single -cache. Since the processing time for the protocols is -negligable, this works out very well. -.TP 0.2i -\(bu -Autosensing of MIME types and gopher0 item -types. Both are completely configurable. MIME type -detection is done using a standard mime.types file, and -gopher0 types are calculated by using a configurable -regexp-based MIME-to-gophertype map. -.TP 0.2i -\(bu -Heavy support of regular expressions in configuration. -.TP 0.2i -\(bu -ProtocolMultiplexer and HandlerMultiplexer -let you choose only those protocols and handlers that you -wish your server to support and the order in which they are -tried when a request comes in. -.TP 0.2i -\(bu -Full logging via syslog. -.SS "ABOUT GOPHER" -.PP -\fBPyGopherd\fR started life as a server for the Gopher Internet -protocol. With Gopher, you can mount a filesystem (viewing files and -folders as if they were local), -browse Gopherspace with a web browser, -download files, and be interactive with searching. -.PP -But this is only part of the story. The world of Gopher is more -expansive than this. There are two major gopher protocols: Gopher0 -(also known as RFC1436) and Gopher+. Gopher0 is a small, simple, -lightweight protocol that is very functional yet also extremely easy -to implement. Gopher0 clients can be easily places in small embedded -devices or in massive environments like a modern web browser. -.PP -Gopher+ is based on Gopher0 but extends it by providing document -metadata such as file size and MIME type. Gopher+ allows all sorts of -neat features, such as configurable metadata (serving up a bunch of -photos? Add a Subject field to your metadata to let -a customized photo -browser display who is pictured) and multiple -views of a file (let the -user select to view your photos as PNG or JPEG). .SH "QUICK START" .PP If you have already installed \fBPyGopherd\fR system-wide, or your @@ -178,7 +32,7 @@ and run it! You can quickly set up your configuration file. The distribution includes two files of interest: \fIconf/pygopherd.conf\fR and -\fIconf/mime.types\fR. Debian users will find +\fIconf/mime.types\fR\&. Debian users will find the configuration file pre-installed in \fI/etc/pygopherd/pygopherd.conf\fR and the \fImime.types\fR file provided by the system @@ -190,7 +44,7 @@ refer to it for detailed information. Some settings to take a look at include: \fIdetach\fR, \fIpidfile\fR, \fIport\fR, \fIusechroot\fR, \fIsetuid\fR, -\fIsetgid\fR, and \fIroot\fR. +\fIsetgid\fR, and \fIroot\fR\&. These may or may not work at their defaults for you. The remaining ones should be fine for a basic setup. .PP @@ -200,99 +54,6 @@ path/to/configfile\fR (or Place some files in the location specified by the \fIroot\fR directive in the config file and you're ready to run! -.SH "INSTALLATION" -.PP -If you are reading this document via the "man" command, it is likely -that you have no installation tasks to perform; your system administra- -tor has already installed \fBPyGopherd\fR. If you need to install it yourself, you -have three options: a system-wide installation with Debian, system-wide -installation with other systems, and a single-user installation. You -can download the latest version of PyGopherd -from - <URL:http://quux.org/devel/gopher/pygopherd/> -.SS "DEBIAN SYSTEM-WIDE INSTALLATION" -.PP -If you are tracking Debian unstable, you may install -\fBPyGopherd\fR by simply running this command as root: -.PP -\fBapt-get install pygopherd\fR -.PP -If you are not tracking Debian unstable, download the .deb -package from the \fBPyGopherd\fR website and then run -\fBdpkg -i\fR to install the downloaded -package. Then, skip to the configuration section below. -You will use \fB/etc/init.d/pygopherd start\fR -to start the program. -.SS "OTHER SYSTEM-WIDE INSTALLATION" -.PP -Download the tar.gz version of the package from the website. Make -sure you have Python 2.2 or above installed; if now, download and -install it from <URL:http://www.python.org/>. Then run these -commands: - -.nf - \fBtar -zxvf pygopherd-x.y.z.tar.gz\fR - \fBcd pygopherd-x.y.z\fR - \fBpython2.2 setup.py\fR - -.fi -.PP -Some systems will use \fBpython\fR or -\fBpython2.3\fR in place of -\fBpython2.2\fR. -.PP -Next, proceed to configuration. Make sure that the -\fI/etc/pygopherd/pygopherd.conf\fR file -names valid users (\fIsetuid\fR and -\fIsetgid\fR options) and a valid document -root (\fIroot\fR option). -.PP -You will type \fIpygopherd\fR to invoke the -program. -.SS "SINGLE-ACCOUNT INSTALLATION" -.PP -Download the tar.gz version of the package from the website. Make -sure you have Python 2.2 or above installed; if now, download and -install it from <URL:http://www.python.org/>. Then run these -commands: - -.nf - \fBtar -zxvf pygopherd-z.y.z.tar.gz\fR - \fBcd pygopherd-x.y.z\fR - -.fi -.PP -Modify \fIconf/pygopherd.conf\fR as follows: -.TP 0.2i -\(bu -Set \fIusechroot = no\fR -.TP 0.2i -\(bu -Comment out (add a # sign to the start of -the line) the \fIpidfile\fR, -\fIsetuid\fR, and -\fIsetgid\fR lines. -.TP 0.2i -\(bu -Set \fIroot\fR to osomething appropriate. -.TP 0.2i -\(bu -Set \fIport\fR to a number -greater than 1024. -.PP -When you want to run \fBPyGopherd\fR, you will issue the -\fBcd\fR command as above and then type -\fBPYTHONPATH=. bin/pygopherd\fR. There is no -installation step necessary. -.SH "CONFIGURATION" -.PP -\fBPyGopherd\fR is regulated by a configuratoin file normally -stored in \fI/etc/pygopherd/pygopherd.conf\fR. -You can specify an alternate configuration file on the command -line. The \fBPyGopherd\fR distribution ships -with a sample \fIpygopherd.conf\fR file that -thoroughly documents the configuration file options and -settings. .SH "OPTIONS" .PP All \fBPyGopherd\fR configuratoin is done via the configuration @@ -302,603 +63,6 @@ option: \fB\fIconfigfile\fB\fR This option argument specifies the location of the configuration file that \fBPyGopherd\fR is to use. -.SH "HANDLERS" -.PP -\fBPyGopherd\fR defines several handlers which are responsible for -finding data on your server and presenting it to the user. The -handlers are used to generate things like links to other documents and -directory listings. They are also responsible for serving up regular -files and even virtual folders. -.PP -Handlers are specified with the \fIhandlers\fR -option in \fIpygopherd.conf\fR. This option is -a list of handlers to use. For each request that arrives, -\fBPyGopherd\fR will ask each handler in -turn whether or not it can handle the request, and will handle the -request according to the first handler that is capable of doing so. -If no handlers can handle the request, a file not found error is -generated. See the example configuration file for an example. -.PP -The remaining parts of this section describe the different -handlers that ship with \fBPyGopherd\fR. Please note that some -versions of this manual may show the handlers in all caps; -however, their names are not all caps and are case-sensitive. -.SS "DIR.DIRHANDLER" -.PP -This handler is a basic one that generates menus based -on the contents of a directory. It is used for -directories that contain neither a -\fIgophermap\fR file nor UMN-style links -files, or situations where you have no need for either -of those. -.PP -This handler simply reads the contents of your on-disk -directory, determines the appropriate types of each file, -and sends the result to the client. The descriptions of -each item are usually set to the filename, but the -\fIhtml.HTMLFileTitleHandler\fR may override -that. -.SS "GOPHERMAP.BUCKGOPHERMAPHANDLER" -.PP -This handler is used to generate directory listings -based on \fIgophermap\fR files. It will -not read the directory on-disk, instead serving content -from the \fIgophermap\fR file only. -Gophermaps are useful if you want to present a directory -in which the files do not frequently change and there is -general information to present. Overall, if you only -wish to present information particular to certain files, -you should consider using the abstract feature of -UMN.UMNDirHandler. -.PP -The \fIgophermap\fR files contain two -types of lines, which are described here using the same -convention normally used for command line arguments. In -this section, the symbol \\t will be used to indicate a -tab character, Control-I. - - \fB\fIfull line of informational -text\fB\fR - - - \fB\fIgophertypeDESCRIPTION\fB\fR [ \fB\\t\fIselector\fB [ \\t\fIhost\fB [ \\t\fIport\fB ] ]\fR ] - -.PP -Note: spaces shown above are for clarity only and should -not actually be present in your file. -.PP -The informational text must not contain any tab -characters, but may contain spaces. Informational text -will be rendered with gopher type -\fIi\fR, which will cause it to be -displayed on a client's screen at its particular -position in the file. -.PP -The second type of line represents a link to a file or -directory. It begins with a single-character Gopher -type (see Gopher Item Types below) followed immediately -by a description and a tab character. There is no space -or other separator between the gopher type and the -description. The description may contain spaces but not -tabs. -.PP -The remaining arguments are optional, but only to the -extent that arguments may be omitted only if all -arguments after them are also omitted. These arguments -are: -.TP -\fB\fIselector\fB\fR -The \fIselector\fR is -the name of the file on the server. If it begins -with a slash, it is an absolute path; otherwise, -it is interpreted relative to the directory that -the gophermap file is in. If no selector is -specified, the description is also used as the -selector. -.TP -\fB\fIhost\fB\fR -The \fIhost\fR -specifies the host on which this resource is -located. If not specified, defaults to the -current server. -.TP -\fB\fIport\fB\fR -The \fIport\fR -specifies the port on which the resource is -located. If not specified, defaults to the port -the current server is listening on. -.PP -An example of a gophermap to help illustrate the concept -is included with the \fBPyGopherd\fR distribution in the -file \fIexamples/gophermap\fR. -.SS "FILE.COMPRESSEDFILEHANDLER" -.PP -In order to save space, you might want to store -documents on-disk in a compressed format. But then -clients would ordinarily have to decompress the files -themselves. It would be nice to have the server -automatically decompress the files on the fly, sending -that result to the client. That's where -\fIfile.CompressedFileHandler\fR comes -in. -.PP -This handler will take compressed files, pipe them -through your chosen decompression program, and send the -result directly to clients -- completely transparently. -.PP -To use this handler, set the -\fIdecompressors\fR option in the -configuration file. This option defines a mapping from -MIME encodings (as defined with the -\fIencoding\fR option) to decompression -programs. Files that are not encoded, or which have an -encoding that does not occur in the -\fIdecompressors\fR map, will not be -decompressed by this handler. -.PP -Please see the sample configuration file for more -examples and details about the configuration of this -handler. -.SS "FILE.FILEHANDLER" -.PP -The \fIfile.FileHandler\fR is just that --- its duty is to serve up regular files to clients. -.SS "HTML.HTMLFILETITLEHANDLER" -.PP -This handler is used when generating directories and -will set the description of HTML files to the HTML title -defined in them rather than let it be the default -filename. Other than that, it has no effect. UMN -gopherd implements a similar policy. -.SS "MBOX HANDLERS" -.PP -There are four mailbox handlers: -.TP 0.2i -\(bu -mbox.MaildirFolderHandler -.TP 0.2i -\(bu -mbox.MaildirMessageHandler -.TP 0.2i -\(bu -mbox.MBoxMessageHandler -.TP 0.2i -\(bu -mbox.MBoxFolderHandler -.PP -These four handlers provide a unique "virtual folder" -service. They allow you to present mailboxes as if they -were folders, the items of the folders being the -messages in the mailbox, organized by subject. This is -useful for presenting mail archives or just making -e-mail accessible in a nice and easy fashion. -.PP -To use these handlers, all you have to do is enable them -in your \fIhandlers\fR section. They -will automatically detect requests for mailboxes and -handle them appropriately. -.PP -The different handlers are for traditional Unix mbox -mailboxes (all messages in a single file) and new -qmail-stype Maildir mailboxes. You can enable only the -two handlers for the specific mailbox type that you use, -if desired. -.SS "PYG.PYGHANDLER" -.PP -PYG (short for PYGopherd) is a mechanism that provides a -tremendous amount of flexibility. Rather than just -letting you execute a script like other Gopher or HTTP -servers, PYGs are actually loaded up into PyGopherd and -become fully-capable first-class virtual handlers. Yet -they need not be known ahead of time, and are loaded -dynamically. -.PP -With a PYG handler, you can generate gopher directories, -handle searches, generate files, and more on the fly. -You can create entire virtual directory trees (for -instance, to interface with NNTP servers or with DICT -servers), and access them all using the standard Gopher -protocol. All of this without having to modify even one -line of \fBPyGopherd\fR code. -.PP -If enabled, the \fIpyg.PYGHandler\fR will -look for files with the extension .pyg that are marked -executable. If found, they will be loaded and run as -PYGs. -.PP -Please note: this module provides the capability to -execute arbitrary code. Please consider the security -ramifications of that before enabling it. -.PP -See the \fIvirtual.Virtual\fR handler for -more information about passing data to your scripts at -runtime. -.PP -At present, documentation on writing PYGs is not -provides, but you may find examples in the -\fIpygfarm\fR directory included with the -\fBPyGopherd\fR distribution. -.SS "SCRIPTEXEC.EXECHANDLER" -.PP -This handler implements "old-style" script execution; -that is, executing arbitrary programs and piping the -result to the client. It is, for the most part, -compatible with both scripts written for UMN gopherd and -the Bucktooth gopher server. If enabled, it will -execute any file that is marked executable in the -filesystem. It will normally list scripts as returning -plain text, but you may create a custom link to the -script that defines it as returning whatever kind of -file you desire. Unlike PYGs, this type must be known -in advance. -.PP -The \fIscriptexec.ExecHandler\fR will set -environment variables for your scripts to use. They are -as follows: -.TP -\fBSERVER_NAME\fR -The name of this server as defined in -the configuration file or detected from the -operating system. -.TP -\fBSERVER_PORT\fR -The port this server is listening on. -.TP -\fBREMOTE_ADDR\fR -The IP address of the client. -.TP -\fBREMOTE_PORT\fR -The port number of the client. -.TP -\fBREMOTE_HOST\fR -The same value as \fIREMOTE_ADDR\fR -.TP -\fBSELECTOR\fR -The file that was requested; that is, -the relative path to this script. If the selector -included additional parameters after a |, they -will be included in this string as well. -.TP -\fBREQUEST\fR -The "base" part of the selector; that -is, the part leading up to the |. -.TP -\fBSEARCHREQUEST\fR -Included only if the client specified -search data, this is used if the client is -searching for something. -.PP -See the \fIvirtual.Virtual\fR handler for -more information about passing data to your scripts at -runtime. -.PP -Please note: this module provides the capability to -execute arbitrary code. Please consider the security -ramifications of that before enabling it. -.SS "UMN.UMNDIRHANDLER" -.PP -This is one of the most powerful workhorse handlers in -\fBPyGopherd\fR. It is designed to emulate most of the ways -in which the UMN gopherd distribution generates -directories, even going so far as to be bug-compatible -in some cases. Generating directories with this handler -is often the best general-purpose way to make nice -directories in gopherspace. -.PP -The remainder of the description of the -\fIUMN.UMNDirHandler\fR, except for the -Abstracts and Info section, is lifted directly from the -original UMN gopherd documentation, with light editing, -because this handler implements it so exactly that there -was no point in rewriting all that documentation :-) -.SS "LINKS" -.PP -You can override the default view of a directory as -generated by \fIdir.DirHandler\fR by -creating what are known as \fBLinks\fR in -the data tree. -.PP -The ability to make links to other hosts is how gopher -distributes itself among multiple hosts. There are two -different ways to make a link. The first and simplest is -to create a link file that contains the data needed by the -server. By default all files in the gopher data directory -starting with a period are taken to be link files. A link -file can contain multiple links. To define a link you -need to put five lines in a link file that define the -needed characteristics for the document. Here is an -example of a link. - -.nf -Name=Cheese Ball Recipes -Numb=1 -Type=1 -Port=150 -Path=1/Moo/Cheesy -Host=zippy.micro.umn.edu - -.fi -.PP -The Name= line is what the user will see when cruising -through the database. In this case the name is "Cheese -Ball Recipes". The "Type=" defines what kind of document -this object is. For a list of all defined types, see -Gopher Item Types below. For Gopher+ and HTTP, a MIME -type is also used, which is determined automatically based -on the type you specify. -.PP -The "Path=" line contains the selector string that the -client will use to retrieve the actual document. The -Numb= specifies that this entry should be presented first -in the directory list (instead of being alphabetized). -The "Numb=" line is optional. If it is present it cannot -be the last line of the link. The "Port=" and "Host=" -lines specify a fully qualified domain name (FQDN) and a -port respectively. You may substitute a plus '+' for -these two parameters if you wish. The server will insert -the current hostname and the current port when it sees a -plus in either of these two fields. -.PP -An easy way to retrieve links is to use the Curses -Gopher Client. By pressing '=' You can get information -suitable for inclusion in a link file. -.SS "OVERRIDING DEFAULTS" -.PP -The server looks for a directory called -\fI.cap\fR when parsing a directory. The -server then checks to see if the \fI.cap\fR -directory contains a file with the same name as the file -it's parsing. If this file exists then the server will -open it for reading. The server parses this file just -like a link file. However, instead of making a new -object, the parameters inside the -\fI.cap/\fR file are used to override any -of the server supplied default values. -.PP -For instance, say you wanted to change the Title of a text -file for gopher, but don't want to change the filename. -You also don't want it alphabetized, instead you want it -second in the directory listing. You could make a -set-aside file in the \fI.cap\fR directory with the same -filename that contained the following lines: - -.nf -Name=New Long Cool Name -Numb=2 - -.fi -.PP -An alternative to \fI.cap\fR files are -extended link files. They work just the same as the files -described in Links above, but have a somewhat abbreviated -format. As an example, if the name of the file was -\fIfile-to-change\fR, then you could create -a file called \fI.names\fR with the -following contents: - -.nf -Path=./file-to-change -Name=New Long Cool Name -Numb=2 - -.fi -.SS "ADDING COOL LINKS" -.PP -One cool thing you can do with .Links is to add neato -services to your gopher server. Adding a link like this: - -.nf -Name=Cool ftp directory -Type=h -Path=/URL:ftp://hostname/path/ -Host=+ -Port=+ - -Name=Cool web site -Type=h -Path=/URL:http://hostname/ -Host=+ -Port=+ - -.fi -.PP -Will allow you to link in any FTP or Web site to your -gopher. (See url.URLHandler for more details.) -.PP -You can easily add a finger site to your gopher server thusly: - -.nf -Name=Finger information -Type=0 -Path=lindner -Host=mudhoney.micro.umn.edu -Port=79 - -.fi -.SS "HIDING AN ENTRY" -.PP -This kind of trick may be necessary in some cases, -and thus for -object "fred", the overriding .names file entry would be: - -.nf - Type=X - Path=./fred - -.fi -.PP -by overriding default type to be "X". This kind of -hideouts may be usefull, when for some reason there are -symlinks (or whatever) in the directory at which -\fBPyGopherd\fR looks at, and those entries are not desired to -be shown at all. -.SS "ABSTRACTS AND INFO" -.PP -Many modern gopher server maintainers like to intersperse -gopher directory listings with other information -- often, -additional information about the contents of files in the -directory. The gophermap system provides one way to do -that, and abstracts used with UMN gopher directories -provides another. -.PP -Subject to the \fIabstract_headers\fR and -\fIabstract_entries\fR configuration file -options, this feature allows you to define that extra -information. You can do that by simply creating a file -named \fIfilename.abstract\fR right -alongside the regular file in your directory. The file -will be interpreted as the abstract. For a directory, -create a file named \fI.abstract\fR in the -directory. Simple as that! -.SS "URL.HTMLURLHANDLER" -.PP -\fBPyGopherd\fR provides ways for you to link to pages outside -Gopherspace -- that is, web pages, FTP sites, and the like. -This is accomplished according to the Links -to URL <URL:http://lists.complete.org/gopher@complete.org/2002/02/msg00033.html.gz> specification (see Conforming To below for -details). In order to link to a URL (EXCEPT gopher URLs) -from a menu, you create a link of type h (regardless of the -actual type of the resource that you are linking to) in your -\fIgophermap\fR or -\fI.Links\fR -file that looks like this: - -.nf -/URL:http://www.complete.org/ - -.fi -.PP -Modern Gopher clients that follow the Links to URL -specification will automatically follow that link when you -select it. The rest need some help, and that's where this -handler comes in. -.PP -For Gopher clients that do not follow the Links to URL -specification, the \fIurl.HTMLURLHandler\fR -will automatically generate an HTML document for them on the -fly. This document includes a refresh code that will send -them to the proper page. You should not disable this -handler. -.SS "URL.URLTYPEREWRITER" -.PP -Some people wish to serve HTML documents from their Gopher -server. One problem with that is that links in Gopherspace -include an extra type character at the beginning, whereas -links in HTTP do not. This handler will remove the extra -type character from HTTP requests that come in, allowing a -single relative-to-root link to work for both. -.SS "VIRTUAL.VIRTUAL" -.PP -This handler is not intended to ever be used directly, but -is used by many other handlers such as the mbox support, PYG -handlers, and others. It is used to generate virtual -entries in the directory hierarchy -- that is, entries that -look normal to a client, but do not actually correspond to a -file on disk. -.PP -One special feature of the -\fIvirtual.Virtual\fR handler is that you can -send information to it at runtime in a manner similar to a -CGI script on the web. You do this by adding a question -mark after the regular selector, followed by any arbitrary -data that you wish to have sent to the virtual request -handler. -.SS "ZIP.ZIPHANDLER" -.PP -Using zip.ZIPHandler, you can save space on your server by -converting part or all of your site into a ZIP file. -\fBPyGopherd\fR can use the contents of that ZIP file as the -contents of your site -- completely transparently. -.PP -The ZIP file handler must be enabled in the configuration -file for this to work. -.SH "GOPHER ITEM TYPES" -.PP -When you construct links to files via -\fI.Links\fR or \fIgophermap\fR -files, or modify the \fImapping\fR in the -configuration file, you will need to know these. Items -bearing the "not implemented" text are not served up by -\fBPyGopherd\fR as it ships, generally due to requirements of -customized per-site software, but may be served up via PYG -extension modules or other gopher servers. -.PP -This list was prepared based on RFC1436, the UMN gopherd(1) manpage, -and best current practices. -.TP -\fB0\fR -Plain text file -.TP -\fB1\fR -Directory -.TP -\fB2\fR -CSO phone book server (not implemented by \fBPyGopherd\fR) -.TP -\fB3\fR -Error condition; text that follows is plain text -.TP -\fB4\fR -Macintosh file, BinHex format -.TP -\fB5\fR -DOS binary archive (not implemented by -\fBPyGopherd\fR; use type 9 instead) -.TP -\fB6\fR -uuencoded file; not directly generated by -\fBPyGopherd\fR automatically, but can be linked to -manually. Most gopher clients will handle this better -as type 1. -.TP -\fB7\fR -Search -.TP -\fB8\fR -Telnet link -.TP -\fB9\fR -Binary file -.TP -\fB+\fR -Redundant server (not implemented by \fBPyGopherd\fR) -.TP -\fBc\fR -Calendar (not implemented by \fBPyGopherd\fR) -.TP -\fBe\fR -Event (not implemented by \fBPyGopherd\fR) -.TP -\fBg\fR -GIF-format graphic -.TP -\fBh\fR -HTML file -.TP -\fBI\fR -Any kind of graphic file other than GIF -.TP -\fBi\fR -Informational -text included in a directory that is displayed but does not -link to any actual file. -.TP -\fBM\fR -MIME multipart/mixed file -.TP -\fBs\fR -Any kind of sound file -.TP -\fBT\fR -tn3270 link -.TP -\fBX\fR -.TP -\fB-\fR -UMN-specific -- signifies that this entry should not be -displayed in a directory entry, but may be accessed via a -direct link. This value is never transmitted in any Gopher -protocol. .SH "CONFORMING TO" .TP 0.2i \(bu @@ -907,17 +71,17 @@ The Internet Gopher Protocol as specified in RFC1436 \(bu The Gopher+ upward-compatible enhancements to the Internet Gopher Protocol from the University of Minnesota as laid out at - <URL:gopher://gopher.quux.org/0/Archives/mirrors/boombox.micro.umn.edu/pub/gopher/gopher_protocol/Gopher+/Gopher+.txt>. + <URL:gopher://gopher.quux.org/0/Archives/mirrors/boombox.micro.umn.edu/pub/gopher/gopher_protocol/Gopher+/Gopher+.txt>\&. .TP 0.2i \(bu The gophermap file format as originally implemented in the Bucktooth gopher server and described at - <URL:gopher://gopher.floodgap.com/0/buck/dbrowse%3Ffaquse%201>. + <URL:gopher://gopher.floodgap.com/0/buck/dbrowse%3Ffaquse%201>\&. .TP 0.2i \(bu The Links to URL specification as laid out by John Goerzen at - <URL:gopher://gopher.quux.org/0/Archives/Mailing%20Lists/gopher/gopher.2002-02%3f/MBOX-MESSAGE/34>. + <URL:gopher://gopher.quux.org/0/Archives/Mailing%20Lists/gopher/gopher.2002-02%3f/MBOX-MESSAGE/34>\&. .TP 0.2i \(bu The UMN format for specifying object attributes and links @@ -926,7 +90,7 @@ in this document and implemented by UMN gopherd. .TP 0.2i \(bu The PYG format for extensible Python gopher objects as created for -\fBPyGopherd\fR. +\fBPyGopherd\fR\&. .TP 0.2i \(bu Hypertext Transfer Protocol HTTP/1.0 as specified in @@ -939,11 +103,11 @@ Transitional as specified in RFC1866 and RFC2854. \(bu Maildir as specified in <URL:http://www.qmail.org/qmail-manual-html/man5/maildir.html> and - <URL:http://cr.yp.to/proto/maildir.html>. + <URL:http://cr.yp.to/proto/maildir.html>\&. .TP 0.2i \(bu The mbox mail storage format as specified in - <URL:http://www.qmail.org/qmail-manual-html/man5/mbox.html>. + <URL:http://www.qmail.org/qmail-manual-html/man5/mbox.html>\&. .TP 0.2i \(bu Registered MIME media types as specified in RFC2048. @@ -966,7 +130,7 @@ WAP/WML as defined by the WAP Forum. Reports of bugs should be sent via e-mail to the \fBPyGopherd\fR bug-tracking system (BTS) at <pygopherd@bugs.complete.org> or submitted online -using the Web interface at <URL:http://bugs.complete.org/>. +using the Web interface at <URL:http://bugs.complete.org/>\&. .PP The Web site also lists all current bugs, where you can check their status or contribute to fixing them. @@ -1026,7 +190,7 @@ homepage via either Gopher or HTTP: \fBPyGopherd\fR may also be downloaded using Subversion. Additionally, the distributed tar.gz may be updated with a simple "svn update" command; it is ready to go. For information on getting -\fBPyGopherd\fR with Subversion, please visit <URL:http://svn.complete.org/>. +\fBPyGopherd\fR with Subversion, please visit <URL:http://svn.complete.org/>\&. .SH "SEE ALSO" .PP python (1). diff --git a/doc/pygopherd.html b/doc/pygopherd.html deleted file mode 100644 index 8d4f4f9..0000000 --- a/doc/pygopherd.html +++ /dev/null @@ -1,2496 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML -><HEAD -><TITLE ->PyGopherd Manual

I. PyGopherd Manual

Table of Contents
pygopherd -- Multiprotocol Information Server

pygopherd

Name

PyGopherd -- Multiprotocol Information Server

Synopsis

pygopherd [configfile]

Description

Welcome to PyGopherd. In a nutshell, PyGopherd - is a modern dynamic - multi-protocol hierarchical information server with a pluggable - modularized extension system, - full flexible caching, virtual files and - folders, and autodetection of file types -- all with support for - standardized yet extensible per-document metadata. Whew! Read on for - information on this what all these buzzwords mean. -

Features

Here are some of PyGopherd's features: -

  • Provides built-in support for multiple protocols: - HTTP (Web), Gopher+, Gopher (RFC1436), Enhanced Gopher0, - and WAP (mobile phones). Protocols can be enabled or - disabled as desired. -

  • Provides protocol autodetection. That is, - PyGopherd can listen for all the above protocols - on a single port and will - automatically respond using the protocol it detects the - client is using. Practical effects of this are that you - can, for instance, give out a single URL and have it - viewable normally on desktop Web browsers and in WAP - mode on mobile phones -- and appropriately in various - Gopher browsers. -

  • Metadata and site links can be entered in a - variety of formats, including full UMN dotfile metadata - formats as well as Bucktooth gophermap files. Moreover, - gophermap files are not limited to Gopher protocols, and - can be used for all protocols. -

  • Support for inter-protocol linking (linking - from Gopher sites to web sites)

  • Virtual folder system lets you serve up - anything as if it were regular files and directories. - PyGopherd comes with the following virtual folder systems - built in:

    • Can present any Unix MBOX, MMDF box, MH - directory, Maildir directory, or Babyl mailbox as a - virtual folder, the contents of which are the - messages in the mailbox. -

    • Can use a configurable separator to - split a file into multiple parts, the first line of each - becoming the name for the virtual folder.

    • Can peek inside a ZIP file and serve it - up as first-class site citizens -- metadata can even be - stored in the ZIP files. -

    • Can serve up the contents of a dictd - server as a filesystem. -

  • Modular, extensible design: you can use PyGopherd's own - PYG extension format, or UMN- or Bucktooth-style - executables. -

  • Runs on any platform supported by Python 2.2 or 2.3. - This includes virtually every past and current flavor of - Unix (Linux, *BSD, Solaris, SunOS), Windows, MacOS 9.x - and X, and more. Some features may not be available on - non-Unix platforms. -

  • Runs on any platform supported by Java 1.1 - via the Jython Python implementation.

  • Tunable server types via configuration - directive -- forking or threading.

  • Secure design with support for chrooted execution.

  • Feature-complete, full implementations of: - Gopher0 (RFC1435), Gopher+, HTTP, and WAP.

  • Support for automatically finding the titles - of HTML documents for presentation in a directory.

  • Versatile configuration file format is both - extensible and nicely complementary of the module system.

  • Protocol-independant, handler-dependant - caching. This increases performance by letting handlers - cache dynamically-generated information -- currently used by - the directory handlers. This can improve performance of - directories by several orders of magnitude. Because this is - a handler cache only, all protococls share the single - cache. Since the processing time for the protocols is - negligable, this works out very well.

  • Autosensing of MIME types and gopher0 item - types. Both are completely configurable. MIME type - detection is done using a standard mime.types file, and - gopher0 types are calculated by using a configurable - regexp-based MIME-to-gophertype map.

  • Heavy support of regular expressions in configuration.

  • ProtocolMultiplexer and HandlerMultiplexer - let you choose only those protocols and handlers that you - wish your server to support and the order in which they are - tried when a request comes in. -

  • Full logging via syslog.


About Gopher

PyGopherd started life as a server for the Gopher Internet - protocol. With Gopher, you can mount a filesystem (viewing files and - folders as if they were local), - browse Gopherspace with a web browser, - download files, and be interactive with searching. -

But this is only part of the story. The world of Gopher is more - expansive than this. There are two major gopher protocols: Gopher0 - (also known as RFC1436) and Gopher+. Gopher0 is a small, simple, - lightweight protocol that is very functional yet also extremely easy - to implement. Gopher0 clients can be easily places in small embedded - devices or in massive environments like a modern web browser. -

Gopher+ is based on Gopher0 but extends it by providing document - metadata such as file size and MIME type. Gopher+ allows all sorts of - neat features, such as configurable metadata (serving up a bunch of - photos? Add a Subject field to your metadata to let - a customized photo - browser display who is pictured) and multiple - views of a file (let the - user select to view your photos as PNG or JPEG). -

Quick Start

If you have already installed PyGopherd system-wide, or your - administrator has done that for you, your task for setting up - PyGopherd for the first time is quite simple. You just need - to set up your configuration file, make your folder directory, - and run it! -

You can quickly set up your configuration file. The - distribution includes two files of interest: - conf/pygopherd.conf and - conf/mime.types. Debian users will find - the configuration file pre-installed in - /etc/pygopherd/pygopherd.conf and the - mime.types file provided by the system - already. -

Open up pygopherd.conf in your editor and - adjust to suit. The file is heavily commented and you can - refer to it for detailed information. Some settings to take a - look at include: detach, - pidfile, port, - usechroot, setuid, - setgid, and root. - These may or may not work at their defaults for you. The - remaining ones should be fine for a basic setup. -

Invoke PyGopherd with pygopherd - path/to/configfile (or - /etc/init.d/pygopherd start on Debian). - Place some files in the location specified by the - root directive in the config file and - you're ready to run! -

Installation

If you are reading this document via the "man" command, it is likely - that you have no installation tasks to perform; your system administra- - tor has already installed PyGopherd. If you need to install it yourself, you - have three options: a system-wide installation with Debian, system-wide - installation with other systems, and a single-user installation. You - can download the latest version of PyGopherd - from - http://quux.org/devel/gopher/pygopherd/ -

Debian System-Wide Installation

If you are tracking Debian unstable, you may install - PyGopherd by simply running this command as root: -

apt-get install pygopherd -

If you are not tracking Debian unstable, download the .deb - package from the PyGopherd website and then run - dpkg -i to install the downloaded - package. Then, skip to the configuration section below. - You will use /etc/init.d/pygopherd start - to start the program. -


Other System-Wide Installation

Download the tar.gz version of the package from the website. Make - sure you have Python 2.2 or above installed; if now, download and - install it from http://www.python.org/. Then run these - commands: -

	  tar -zxvf pygopherd-x.y.z.tar.gz
-	  cd pygopherd-x.y.z
-	  python2.2 setup.py
-	

Some systems will use python or - python2.3 in place of - python2.2. -

Next, proceed to configuration. Make sure that the - /etc/pygopherd/pygopherd.conf file - names valid users (setuid and - setgid options) and a valid document - root (root option). -

You will type pygopherd to invoke the - program. -


Single-Account Installation

Download the tar.gz version of the package from the website. Make - sure you have Python 2.2 or above installed; if now, download and - install it from http://www.python.org/. Then run these - commands: -

	  tar -zxvf pygopherd-z.y.z.tar.gz
-	  cd pygopherd-x.y.z
-	

Modify conf/pygopherd.conf as follows: -

  • Set usechroot = no

  • Comment out (add a # sign to the start of - the line) the pidfile, - setuid, and - setgid lines.

  • Set root to osomething appropriate.

  • Set port to a number - greater than 1024.

When you want to run PyGopherd, you will issue the - cd command as above and then type - PYTHONPATH=. bin/pygopherd. There is no - installation step necessary. -

Configuration

PyGopherd is regulated by a configuratoin file normally - stored in /etc/pygopherd/pygopherd.conf. - You can specify an alternate configuration file on the command - line. The PyGopherd distribution ships - with a sample pygopherd.conf file that - thoroughly documents the configuration file options and - settings. -

Options

All PyGopherd configuratoin is done via the configuration - file. Therefore, the program has only one command-line - option: -

configfile

This option argument specifies the location - of the configuration file that PyGopherd is to use.

Handlers

PyGopherd defines several handlers which are responsible for - finding data on your server and presenting it to the user. The - handlers are used to generate things like links to other documents and - directory listings. They are also responsible for serving up regular - files and even virtual folders. -

Handlers are specified with the handlers - option in pygopherd.conf. This option is - a list of handlers to use. For each request that arrives, - PyGopherd will ask each handler in - turn whether or not it can handle the request, and will handle the - request according to the first handler that is capable of doing so. - If no handlers can handle the request, a file not found error is - generated. See the example configuration file for an example. -

The remaining parts of this section describe the different - handlers that ship with PyGopherd. Please note that some - versions of this manual may show the handlers in all caps; - however, their names are not all caps and are case-sensitive. -

dir.DirHandler

This handler is a basic one that generates menus based - on the contents of a directory. It is used for - directories that contain neither a - gophermap file nor UMN-style links - files, or situations where you have no need for either - of those. -

This handler simply reads the contents of your on-disk - directory, determines the appropriate types of each file, - and sends the result to the client. The descriptions of - each item are usually set to the filename, but the - html.HTMLFileTitleHandler may override - that. -


gophermap.BuckGophermapHandler

This handler is used to generate directory listings - based on gophermap files. It will - not read the directory on-disk, instead serving content - from the gophermap file only. - Gophermaps are useful if you want to present a directory - in which the files do not frequently change and there is - general information to present. Overall, if you only - wish to present information particular to certain files, - you should consider using the abstract feature of - UMN.UMNDirHandler. -

The gophermap files contain two - types of lines, which are described here using the same - convention normally used for command line arguments. In - this section, the symbol \t will be used to indicate a - tab character, Control-I. -

full line of informational - text

gophertypeDESCRIPTION [\tselector [\thost [\tport]]]

Note: spaces shown above are for clarity only and should - not actually be present in your file. -

The informational text must not contain any tab - characters, but may contain spaces. Informational text - will be rendered with gopher type - i, which will cause it to be - displayed on a client's screen at its particular - position in the file. -

The second type of line represents a link to a file or - directory. It begins with a single-character Gopher - type (see Gopher Item Types below) followed immediately - by a description and a tab character. There is no space - or other separator between the gopher type and the - description. The description may contain spaces but not - tabs. -

The remaining arguments are optional, but only to the - extent that arguments may be omitted only if all - arguments after them are also omitted. These arguments - are: -

selector

The selector is - the name of the file on the server. If it begins - with a slash, it is an absolute path; otherwise, - it is interpreted relative to the directory that - the gophermap file is in. If no selector is - specified, the description is also used as the - selector. -

host

The host - specifies the host on which this resource is - located. If not specified, defaults to the - current server. -

port

The port - specifies the port on which the resource is - located. If not specified, defaults to the port - the current server is listening on. -

An example of a gophermap to help illustrate the concept - is included with the PyGopherd distribution in the - file examples/gophermap. -


file.CompressedFileHandler

In order to save space, you might want to store - documents on-disk in a compressed format. But then - clients would ordinarily have to decompress the files - themselves. It would be nice to have the server - automatically decompress the files on the fly, sending - that result to the client. That's where - file.CompressedFileHandler comes - in. -

This handler will take compressed files, pipe them - through your chosen decompression program, and send the - result directly to clients -- completely transparently. -

To use this handler, set the - decompressors option in the - configuration file. This option defines a mapping from - MIME encodings (as defined with the - encoding option) to decompression - programs. Files that are not encoded, or which have an - encoding that does not occur in the - decompressors map, will not be - decompressed by this handler. -

Please see the sample configuration file for more - examples and details about the configuration of this - handler. -


file.FileHandler

The file.FileHandler is just that - -- its duty is to serve up regular files to clients. -


html.HTMLFileTitleHandler

This handler is used when generating directories and - will set the description of HTML files to the HTML title - defined in them rather than let it be the default - filename. Other than that, it has no effect. UMN - gopherd implements a similar policy. -


mbox handlers

There are four mailbox handlers: -

  • mbox.MaildirFolderHandler

  • mbox.MaildirMessageHandler

  • mbox.MBoxMessageHandler

  • mbox.MBoxFolderHandler

These four handlers provide a unique "virtual folder" - service. They allow you to present mailboxes as if they - were folders, the items of the folders being the - messages in the mailbox, organized by subject. This is - useful for presenting mail archives or just making - e-mail accessible in a nice and easy fashion. -

To use these handlers, all you have to do is enable them - in your handlers section. They - will automatically detect requests for mailboxes and - handle them appropriately. -

The different handlers are for traditional Unix mbox - mailboxes (all messages in a single file) and new - qmail-stype Maildir mailboxes. You can enable only the - two handlers for the specific mailbox type that you use, - if desired. -


pyg.PYGHandler

PYG (short for PYGopherd) is a mechanism that provides a - tremendous amount of flexibility. Rather than just - letting you execute a script like other Gopher or HTTP - servers, PYGs are actually loaded up into PyGopherd and - become fully-capable first-class virtual handlers. Yet - they need not be known ahead of time, and are loaded - dynamically. -

With a PYG handler, you can generate gopher directories, - handle searches, generate files, and more on the fly. - You can create entire virtual directory trees (for - instance, to interface with NNTP servers or with DICT - servers), and access them all using the standard Gopher - protocol. All of this without having to modify even one - line of PyGopherd code. -

If enabled, the pyg.PYGHandler will - look for files with the extension .pyg that are marked - executable. If found, they will be loaded and run as - PYGs. -

Please note: this module provides the capability to - execute arbitrary code. Please consider the security - ramifications of that before enabling it. -

See the virtual.Virtual handler for - more information about passing data to your scripts at - runtime. -

At present, documentation on writing PYGs is not - provides, but you may find examples in the - pygfarm directory included with the - PyGopherd distribution. -


scriptexec.ExecHandler

This handler implements "old-style" script execution; - that is, executing arbitrary programs and piping the - result to the client. It is, for the most part, - compatible with both scripts written for UMN gopherd and - the Bucktooth gopher server. If enabled, it will - execute any file that is marked executable in the - filesystem. It will normally list scripts as returning - plain text, but you may create a custom link to the - script that defines it as returning whatever kind of - file you desire. Unlike PYGs, this type must be known - in advance. -

The scriptexec.ExecHandler will set - environment variables for your scripts to use. They are - as follows: -

SERVER_NAME

The name of this server as defined in - the configuration file or detected from the - operating system.

SERVER_PORT

The port this server is listening on.

REMOTE_ADDR

The IP address of the client.

REMOTE_PORT

The port number of the client.

REMOTE_HOST

The same value as REMOTE_ADDR

SELECTOR

The file that was requested; that is, - the relative path to this script. If the selector - included additional parameters after a |, they - will be included in this string as well. -

REQUEST

The "base" part of the selector; that - is, the part leading up to the |.

SEARCHREQUEST

Included only if the client specified - search data, this is used if the client is - searching for something. -

See the virtual.Virtual handler for - more information about passing data to your scripts at - runtime. -

Please note: this module provides the capability to - execute arbitrary code. Please consider the security - ramifications of that before enabling it. -


UMN.UMNDirHandler

This is one of the most powerful workhorse handlers in - PyGopherd. It is designed to emulate most of the ways - in which the UMN gopherd distribution generates - directories, even going so far as to be bug-compatible - in some cases. Generating directories with this handler - is often the best general-purpose way to make nice - directories in gopherspace. -

The remainder of the description of the - UMN.UMNDirHandler, except for the - Abstracts and Info section, is lifted directly from the - original UMN gopherd documentation, with light editing, - because this handler implements it so exactly that there - was no point in rewriting all that documentation :-) -

Links

You can override the default view of a directory as - generated by dir.DirHandler by - creating what are known as Links in - the data tree. -

The ability to make links to other hosts is how gopher - distributes itself among multiple hosts. There are two - different ways to make a link. The first and simplest is - to create a link file that contains the data needed by the - server. By default all files in the gopher data directory - starting with a period are taken to be link files. A link - file can contain multiple links. To define a link you - need to put five lines in a link file that define the - needed characteristics for the document. Here is an - example of a link. -

Name=Cheese Ball Recipes
-Numb=1
-Type=1
-Port=150
-Path=1/Moo/Cheesy
-Host=zippy.micro.umn.edu
-	  

The Name= line is what the user will see when cruising - through the database. In this case the name is "Cheese - Ball Recipes". The "Type=" defines what kind of document - this object is. For a list of all defined types, see - Gopher Item Types below. For Gopher+ and HTTP, a MIME - type is also used, which is determined automatically based - on the type you specify. -

The "Path=" line contains the selector string that the - client will use to retrieve the actual document. The - Numb= specifies that this entry should be presented first - in the directory list (instead of being alphabetized). - The "Numb=" line is optional. If it is present it cannot - be the last line of the link. The "Port=" and "Host=" - lines specify a fully qualified domain name (FQDN) and a - port respectively. You may substitute a plus '+' for - these two parameters if you wish. The server will insert - the current hostname and the current port when it sees a - plus in either of these two fields. -

An easy way to retrieve links is to use the Curses - Gopher Client. By pressing '=' You can get information - suitable for inclusion in a link file. -

Overriding Defaults

The server looks for a directory called - .cap when parsing a directory. The - server then checks to see if the .cap - directory contains a file with the same name as the file - it's parsing. If this file exists then the server will - open it for reading. The server parses this file just - like a link file. However, instead of making a new - object, the parameters inside the - .cap/ file are used to override any - of the server supplied default values. -

For instance, say you wanted to change the Title of a text - file for gopher, but don't want to change the filename. - You also don't want it alphabetized, instead you want it - second in the directory listing. You could make a - set-aside file in the .cap directory with the same - filename that contained the following lines: -

Name=New Long Cool Name
-Numb=2
-	  

An alternative to .cap files are - extended link files. They work just the same as the files - described in Links above, but have a somewhat abbreviated - format. As an example, if the name of the file was - file-to-change, then you could create - a file called .names with the - following contents: -

Path=./file-to-change
-Name=New Long Cool Name
-Numb=2
-	  

Adding Cool Links

One cool thing you can do with .Links is to add neato - services to your gopher server. Adding a link like this: -

Name=Cool ftp directory
-Type=h
-Path=/URL:ftp://hostname/path/
-Host=+
-Port=+
- 
-Name=Cool web site
-Type=h
-Path=/URL:http://hostname/
-Host=+
-Port=+
-	  

Will allow you to link in any FTP or Web site to your - gopher. (See url.URLHandler for more details.) -

You can easily add a finger site to your gopher server thusly: -

Name=Finger information
-Type=0
-Path=lindner
-Host=mudhoney.micro.umn.edu
-Port=79
-	  

Hiding an Entry

This kind of trick may be necessary in some cases, - and thus for - object "fred", the overriding .names file entry would be: -

 Type=X
- Path=./fred
-	  

by overriding default type to be "X". This kind of - hideouts may be usefull, when for some reason there are - symlinks (or whatever) in the directory at which - PyGopherd looks at, and those entries are not desired to - be shown at all. -

Abstracts and Info

Many modern gopher server maintainers like to intersperse - gopher directory listings with other information -- often, - additional information about the contents of files in the - directory. The gophermap system provides one way to do - that, and abstracts used with UMN gopher directories - provides another. -

Subject to the abstract_headers and - abstract_entries configuration file - options, this feature allows you to define that extra - information. You can do that by simply creating a file - named filename.abstract right - alongside the regular file in your directory. The file - will be interpreted as the abstract. For a directory, - create a file named .abstract in the - directory. Simple as that! -


url.HTMLURLHandler

PyGopherd provides ways for you to link to pages outside - Gopherspace -- that is, web pages, FTP sites, and the like. - This is accomplished according to the Links - to URL specification (see Conforming To below for - details). In order to link to a URL (EXCEPT gopher URLs) - from a menu, you create a link of type h (regardless of the - actual type of the resource that you are linking to) in your - gophermap or - .Links - file that looks like this: -

/URL:http://www.complete.org/
-	

Modern Gopher clients that follow the Links to URL - specification will automatically follow that link when you - select it. The rest need some help, and that's where this - handler comes in. -

For Gopher clients that do not follow the Links to URL - specification, the url.HTMLURLHandler - will automatically generate an HTML document for them on the - fly. This document includes a refresh code that will send - them to the proper page. You should not disable this - handler. -


url.URLTypeRewriter

Some people wish to serve HTML documents from their Gopher - server. One problem with that is that links in Gopherspace - include an extra type character at the beginning, whereas - links in HTTP do not. This handler will remove the extra - type character from HTTP requests that come in, allowing a - single relative-to-root link to work for both. -


virtual.Virtual

This handler is not intended to ever be used directly, but - is used by many other handlers such as the mbox support, PYG - handlers, and others. It is used to generate virtual - entries in the directory hierarchy -- that is, entries that - look normal to a client, but do not actually correspond to a - file on disk. -

One special feature of the - virtual.Virtual handler is that you can - send information to it at runtime in a manner similar to a - CGI script on the web. You do this by adding a question - mark after the regular selector, followed by any arbitrary - data that you wish to have sent to the virtual request - handler. -


ZIP.ZIPHandler

Using zip.ZIPHandler, you can save space on your server by - converting part or all of your site into a ZIP file. - PyGopherd can use the contents of that ZIP file as the - contents of your site -- completely transparently. -

The ZIP file handler must be enabled in the configuration - file for this to work. -

Gopher Item Types

When you construct links to files via - .Links or gophermap - files, or modify the mapping in the - configuration file, you will need to know these. Items - bearing the "not implemented" text are not served up by - PyGopherd as it ships, generally due to requirements of - customized per-site software, but may be served up via PYG - extension modules or other gopher servers. -

This list was prepared based on RFC1436, the UMN gopherd(1) manpage, - and best current practices. -

0

Plain text file

1

Directory

2

CSO phone book server (not implemented by PyGopherd)

3

Error condition; text that follows is plain text

4

Macintosh file, BinHex format

5

DOS binary archive (not implemented by - PyGopherd; use type 9 instead)

6

uuencoded file; not directly generated by - PyGopherd automatically, but can be linked to - manually. Most gopher clients will handle this better - as type 1. -

7

Search

8

Telnet link

9

Binary file

+

Redundant server (not implemented by PyGopherd)

c

Calendar (not implemented by PyGopherd)

e

Event (not implemented by PyGopherd)

g

GIF-format graphic

h

HTML file

I

Any kind of graphic file other than GIF

i

Informational - text included in a directory that is displayed but does not - link to any actual file.

M

MIME multipart/mixed file

s

Any kind of sound file

T

tn3270 link

X, -

UMN-specific -- signifies that this entry should not be - displayed in a directory entry, but may be accessed via a - direct link. This value is never transmitted in any Gopher - protocol. -

Conforming To

Bugs

Reports of bugs should be sent via e-mail to the PyGopherd - bug-tracking system (BTS) at - <pygopherd@bugs.complete.org> or submitted online - using the Web interface at http://bugs.complete.org/. -

The Web site also lists all current bugs, where you can check their - status or contribute to fixing them. -

Copyright

PyGopherd is Copyright (C) 2002, 2003 John Goerzen. -

This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; version 2 of the - License. -

This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. -

You should have received a copy of the GNU General Public License - along with this program; if not, write to: -

Free Software Foundation, Inc.
-59 Temple Place
-Suite 330
-Boston, MA  02111-1307
-USA
-      

Author

PyGopherd, its libraries, documentation, and all included - files (except where noted) was written by John Goerzen - <jgoerzen@complete.org> - and copyright is held as stated in the - Copyright section. -

Portions of this manual (specifically relating to certian UMN gopherd - features and characteristics that PyGopherd emulates) are modified - versions of the original - gopherd(1) manpage accompanying the UMN gopher distribution. That - document is distributed under the same terms as this, and - bears the following copyright notices: -

Copyright (C) 1991-2000  University of Minnesota
-Copyright (C) 2000-2002  John Goerzen and other developers
-      

PyGopherd may be downloaded, and information found, from its - homepage via either Gopher or HTTP: -

gopher://quux.org/1/devel/gopher/pygopherd

http://quux.org/devel/gopher/pygopherd

PyGopherd may also be downloaded using Subversion. Additionally, - the distributed tar.gz may be updated with a simple "svn update" - command; it is ready to go. For information on getting - PyGopherd with Subversion, please visit http://svn.complete.org/. -

See Also

python (1). -

\ No newline at end of file diff --git a/doc/pygopherd.pdf b/doc/pygopherd.pdf index efd4663..cb2bc02 100644 Binary files a/doc/pygopherd.pdf and b/doc/pygopherd.pdf differ diff --git a/doc/pygopherd.ps b/doc/pygopherd.ps index f2402c4..ff76cba 100644 Binary files a/doc/pygopherd.ps and b/doc/pygopherd.ps differ diff --git a/doc/pygopherd.sgml b/doc/pygopherd.sgml index 576eb2e..e14b20c 100644 --- a/doc/pygopherd.sgml +++ b/doc/pygopherd.sgml @@ -1,4 +1,3 @@ - @@ -203,7 +202,7 @@ Debian System-Wide Installation - If you are tracking Debian unstable, you may install + You may install &PyGopherd; by simply running this command as root: @@ -211,21 +210,13 @@ apt-get install pygopherd - - If you are not tracking Debian unstable, download the .deb - package from the &PyGopherd; website and then run - dpkg -i to install the downloaded - package. Then, skip to the configuration section below. - You will use /etc/init.d/pygopherd start - to start the program. - Other System-Wide Installation Download the tar.gz version of the package from the website. Make - sure you have Python 2.2 or above installed; if not, download and + sure you have Python 3.7 or above installed; if not, download and install it from . Then run these commands: @@ -234,14 +225,9 @@ tar -zxvf pygopherd-x.y.z.tar.gz cd pygopherd-x.y.z - python2.2 setup.py + python3 setup.py - - Some systems will use python or - python2.3 in place of - python2.2. - Next, proceed to configuration. Make sure that the /etc/pygopherd/pygopherd.conf file @@ -278,12 +264,6 @@ Set usechroot = no - Comment out (add a # sign to the start of - the line) the pidfile, - setuid, and - setgid lines. - - Set root to something appropriate. @@ -1100,7 +1080,6 @@ Path=./fred -