/usr/share/doc/pygopherd/pygopherd.html is in pygopherd 2.0.18.3+nmu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>PyGopherd Manual</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><STYLE
TYPE="text/css"
>.synopsis, .classsynopsis {
background: #eeeeee;
border: solid 1px #aaaaaa;
padding: 0.5em;
}
.programlisting {
background: #eeeeff;
border: solid 1px #aaaaff;
padding: 0.5em;
}
.variablelist {
padding: 4px;
margin-left: 3em;
}
.navigation {
background: #ffeeee;
border: solid 1px #ffaaaa;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.navigation a {
color: #770000;
}
.navigation a:visited {
color: #550000;
}
.navigation .title {
font-size: 200%;
}</STYLE
></HEAD
><BODY
CLASS="REFERENCE"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="REFERENCE"
><A
NAME="PYGOPHERD"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="TITLE"
>I. PyGopherd Manual</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="pygopherd.html#AEN3"
>pygopherd</A
> -- Multiprotocol Information Server</DT
></DL
></DIV
></DIV
><H1
><A
NAME="AEN3"
></A
>pygopherd</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN15"
></A
><H2
>Name</H2
>PyGopherd -- Multiprotocol Information Server</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN18"
></A
><H2
>Synopsis</H2
><P
><B
CLASS="COMMAND"
>pygopherd</B
> [<VAR
CLASS="REPLACEABLE"
>configfile</VAR
>]</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="DESCRIPTION"
></A
><H2
>Description</H2
><P
> Welcome to <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>. In a nutshell, <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>
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.
</P
><DIV
CLASS="REFSECT2"
><A
NAME="DESCRIPTION.FEATURES"
></A
><H3
>Features</H3
><P
> Here are some of <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>'s features:
</P
><P
></P
><UL
><LI
><P
>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.
</P
></LI
><LI
><P
>Provides protocol autodetection. That is,
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> can listen for all the above protocols
<SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>on a single port</I
></SPAN
> 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.
</P
></LI
><LI
><P
>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.
</P
></LI
><LI
><P
>Support for inter-protocol linking (linking
from Gopher sites to web sites)</P
></LI
><LI
><P
>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:</P
><P
></P
><UL
><LI
><P
>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.
</P
></LI
><LI
><P
>Can use a configurable separator to
split a file into multiple parts, the first line of each
becoming the name for the virtual folder.</P
></LI
><LI
><P
>Can peek inside a ZIP file and serve it
up as first-class site citizens -- metadata can even be
stored in the ZIP files.
</P
></LI
><LI
><P
>Can serve up the contents of a dictd
server as a filesystem.
</P
></LI
></UL
></LI
><LI
><P
> Modular, extensible design: you can use PyGopherd's own
PYG extension format, or UMN- or Bucktooth-style
executables.
</P
></LI
><LI
><P
> 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.
</P
></LI
><LI
><P
>Runs on any platform supported by Java 1.1
via the Jython Python implementation.</P
></LI
><LI
><P
>Tunable server types via configuration
directive -- forking or threading.</P
></LI
><LI
><P
>Secure design with support for chrooted execution.</P
></LI
><LI
><P
>Feature-complete, full implementations of:
Gopher0 (RFC1435), Gopher+, HTTP, and WAP.</P
></LI
><LI
><P
>Support for automatically finding the titles
of HTML documents for presentation in a directory.</P
></LI
><LI
><P
>Versatile configuration file format is both
extensible and nicely complementary of the module system.</P
></LI
><LI
><P
>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.</P
></LI
><LI
><P
>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.</P
></LI
><LI
><P
>Heavy support of regular expressions in configuration.</P
></LI
><LI
><P
>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.
</P
></LI
><LI
><P
>Full logging via syslog.</P
></LI
></UL
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="DESCRIPTION.ABOUTGOPHER"
></A
><H3
>About Gopher</H3
><P
> <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> 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.
</P
><P
> 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.
</P
><P
> 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).
</P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="QUICKSTART"
></A
><H2
>Quick Start</H2
><P
> If you have already installed <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> system-wide, or your
administrator has done that for you, your task for setting up
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> for the first time is quite simple. You just need
to set up your configuration file, make your folder directory,
and run it!
</P
><P
> You can quickly set up your configuration file. The
distribution includes two files of interest:
<TT
CLASS="FILENAME"
>conf/pygopherd.conf</TT
> and
<TT
CLASS="FILENAME"
>conf/mime.types</TT
>. Debian users will find
the configuration file pre-installed in
<TT
CLASS="FILENAME"
>/etc/pygopherd/pygopherd.conf</TT
> and the
<TT
CLASS="FILENAME"
>mime.types</TT
> file provided by the system
already.
</P
><P
> Open up <TT
CLASS="FILENAME"
>pygopherd.conf</TT
> 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: <SPAN
CLASS="PROPERTY"
>detach</SPAN
>,
<SPAN
CLASS="PROPERTY"
>pidfile</SPAN
>, <SPAN
CLASS="PROPERTY"
>port</SPAN
>,
<SPAN
CLASS="PROPERTY"
>usechroot</SPAN
>, <SPAN
CLASS="PROPERTY"
>setuid</SPAN
>,
<SPAN
CLASS="PROPERTY"
>setgid</SPAN
>, and <SPAN
CLASS="PROPERTY"
>root</SPAN
>.
These may or may not work at their defaults for you. The
remaining ones should be fine for a basic setup.
</P
><P
> Invoke <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> with <B
CLASS="COMMAND"
>pygopherd
path/to/configfile</B
> (or
<B
CLASS="COMMAND"
>/etc/init.d/pygopherd start</B
> on Debian).
Place some files in the location specified by the
<SPAN
CLASS="PROPERTY"
>root</SPAN
> directive in the config file and
you're ready to run!
</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="INSTALLATION"
></A
><H2
>Installation</H2
><P
> 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 <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>. 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
<A
HREF="http://quux.org/devel/gopher/pygopherd/"
TARGET="_top"
>http://quux.org/devel/gopher/pygopherd/</A
>
</P
><DIV
CLASS="REFSECT2"
><A
NAME="INSTALLATION.DEBIAN"
></A
><H3
>Debian System-Wide Installation</H3
><P
> If you are tracking Debian unstable, you may install
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> by simply running this command as root:
</P
><P
> <B
CLASS="COMMAND"
>apt-get install pygopherd</B
>
</P
><P
> If you are not tracking Debian unstable, download the .deb
package from the <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> website and then run
<B
CLASS="COMMAND"
>dpkg -i</B
> to install the downloaded
package. Then, skip to the configuration section below.
You will use <B
CLASS="COMMAND"
>/etc/init.d/pygopherd start</B
>
to start the program.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="INSTALLATION.OTHER"
></A
><H3
>Other System-Wide Installation</H3
><P
> 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 <A
HREF="http://www.python.org/"
TARGET="_top"
>http://www.python.org/</A
>. Then run these
commands:
</P
><PRE
CLASS="PROGRAMLISTING"
> <B
CLASS="COMMAND"
>tar -zxvf pygopherd-x.y.z.tar.gz</B
>
<B
CLASS="COMMAND"
>cd pygopherd-x.y.z</B
>
<B
CLASS="COMMAND"
>python2.2 setup.py</B
>
</PRE
><P
> Some systems will use <B
CLASS="COMMAND"
>python</B
> or
<B
CLASS="COMMAND"
>python2.3</B
> in place of
<B
CLASS="COMMAND"
>python2.2</B
>.
</P
><P
> Next, proceed to configuration. Make sure that the
<TT
CLASS="FILENAME"
>/etc/pygopherd/pygopherd.conf</TT
> file
names valid users (<SPAN
CLASS="PROPERTY"
>setuid</SPAN
> and
<SPAN
CLASS="PROPERTY"
>setgid</SPAN
> options) and a valid document
root (<SPAN
CLASS="PROPERTY"
>root</SPAN
> option).
</P
><P
> You will type <TT
CLASS="FILENAME"
>pygopherd</TT
> to invoke the
program.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="INSTALLATION.SINGLE"
></A
><H3
>Single-Account Installation</H3
><P
> 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 <A
HREF="http://www.python.org/"
TARGET="_top"
>http://www.python.org/</A
>. Then run these
commands:
</P
><PRE
CLASS="PROGRAMLISTING"
> <B
CLASS="COMMAND"
>tar -zxvf pygopherd-z.y.z.tar.gz</B
>
<B
CLASS="COMMAND"
>cd pygopherd-x.y.z</B
>
</PRE
><P
> Modify <TT
CLASS="FILENAME"
>conf/pygopherd.conf</TT
> as follows:
</P
><P
></P
><UL
><LI
><P
>Set <SPAN
CLASS="PROPERTY"
>usechroot = no</SPAN
></P
></LI
><LI
><P
>Comment out (add a # sign to the start of
the line) the <SPAN
CLASS="PROPERTY"
>pidfile</SPAN
>,
<SPAN
CLASS="PROPERTY"
>setuid</SPAN
>, and
<SPAN
CLASS="PROPERTY"
>setgid</SPAN
> lines.</P
></LI
><LI
><P
>Set <SPAN
CLASS="PROPERTY"
>root</SPAN
> to osomething appropriate.</P
></LI
><LI
><P
>Set <SPAN
CLASS="PROPERTY"
>port</SPAN
> to a number
greater than 1024.</P
></LI
></UL
><P
> When you want to run <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>, you will issue the
<B
CLASS="COMMAND"
>cd</B
> command as above and then type
<B
CLASS="COMMAND"
>PYTHONPATH=. bin/pygopherd</B
>. There is no
installation step necessary.
</P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="CONFIGURATION"
></A
><H2
>Configuration</H2
><P
> <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> is regulated by a configuratoin file normally
stored in <TT
CLASS="FILENAME"
>/etc/pygopherd/pygopherd.conf</TT
>.
You can specify an alternate configuration file on the command
line. The <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> distribution ships
with a sample <TT
CLASS="FILENAME"
>pygopherd.conf</TT
> file that
thoroughly documents the configuration file options and
settings.
</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="OPTIONS"
></A
><H2
>Options</H2
><P
> All <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> configuratoin is done via the configuration
file. Therefore, the program has only one command-line
option:
</P
><P
></P
><TABLE
CLASS="variablelist"
BORDER="0"
CELLSPACING="0"
CELLPADDING="4"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN184"><SPAN
STYLE="white-space: nowrap"
><VAR
CLASS="REPLACEABLE"
>configfile</VAR
></SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>This option argument specifies the location
of the configuration file that <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> is to use.</P
></TD
></TR
></TBODY
></TABLE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="HANDLERS"
></A
><H2
>Handlers</H2
><P
> <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> 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.
</P
><P
> Handlers are specified with the <SPAN
CLASS="PROPERTY"
>handlers</SPAN
>
option in <TT
CLASS="FILENAME"
>pygopherd.conf</TT
>. This option is
a list of handlers to use. For each request that arrives,
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> 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.
</P
><P
> The remaining parts of this section describe the different
handlers that ship with <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>. 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.
</P
><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.DIRHANDLER"
></A
><H3
>dir.DirHandler</H3
><P
> 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
<TT
CLASS="FILENAME"
>gophermap</TT
> file nor UMN-style links
files, or situations where you have no need for either
of those.
</P
><P
> 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
<SPAN
CLASS="PROPERTY"
>html.HTMLFileTitleHandler</SPAN
> may override
that.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.BUCKGOPHERMAP"
></A
><H3
>gophermap.BuckGophermapHandler</H3
><P
> This handler is used to generate directory listings
based on <TT
CLASS="FILENAME"
>gophermap</TT
> files. It will
not read the directory on-disk, instead serving content
from the <TT
CLASS="FILENAME"
>gophermap</TT
> 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.
</P
><P
> The <TT
CLASS="FILENAME"
>gophermap</TT
> 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.
</P
><P
> <VAR
CLASS="REPLACEABLE"
>full line of informational
text</VAR
> </P
><P
> <VAR
CLASS="REPLACEABLE"
>gophertypeDESCRIPTION</VAR
> [\t<VAR
CLASS="REPLACEABLE"
>selector</VAR
> [\t<VAR
CLASS="REPLACEABLE"
>host</VAR
> [\t<VAR
CLASS="REPLACEABLE"
>port</VAR
>]]]</P
><P
> Note: spaces shown above are for clarity only and should
not actually be present in your file.
</P
><P
> The informational text must not contain any tab
characters, but may contain spaces. Informational text
will be rendered with gopher type
<SPAN
CLASS="PROPERTY"
>i</SPAN
>, which will cause it to be
displayed on a client's screen at its particular
position in the file.
</P
><P
> 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.
</P
><P
> 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:
</P
><P
></P
><TABLE
CLASS="variablelist"
BORDER="0"
CELLSPACING="0"
CELLPADDING="4"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN231"><SPAN
STYLE="white-space: nowrap"
><VAR
CLASS="REPLACEABLE"
>selector</VAR
></SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>The <SPAN
CLASS="PROPERTY"
>selector</SPAN
> 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.
</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN237"><SPAN
STYLE="white-space: nowrap"
><VAR
CLASS="REPLACEABLE"
>host</VAR
></SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>The <SPAN
CLASS="PROPERTY"
>host</SPAN
>
specifies the host on which this resource is
located. If not specified, defaults to the
current server.
</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN243"><SPAN
STYLE="white-space: nowrap"
><VAR
CLASS="REPLACEABLE"
>port</VAR
></SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>The <SPAN
CLASS="PROPERTY"
>port</SPAN
>
specifies the port on which the resource is
located. If not specified, defaults to the port
the current server is listening on.
</P
></TD
></TR
></TBODY
></TABLE
><P
> An example of a gophermap to help illustrate the concept
is included with the <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> distribution in the
file <TT
CLASS="FILENAME"
>examples/gophermap</TT
>.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.COMPRESSEDFILEHANDLER"
></A
><H3
>file.CompressedFileHandler</H3
><P
> 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
<SPAN
CLASS="PROPERTY"
>file.CompressedFileHandler</SPAN
> comes
in.
</P
><P
> This handler will take compressed files, pipe them
through your chosen decompression program, and send the
result directly to clients -- completely transparently.
</P
><P
> To use this handler, set the
<SPAN
CLASS="PROPERTY"
>decompressors</SPAN
> option in the
configuration file. This option defines a mapping from
MIME encodings (as defined with the
<SPAN
CLASS="PROPERTY"
>encoding</SPAN
> option) to decompression
programs. Files that are not encoded, or which have an
encoding that does not occur in the
<SPAN
CLASS="PROPERTY"
>decompressors</SPAN
> map, will not be
decompressed by this handler.
</P
><P
> Please see the sample configuration file for more
examples and details about the configuration of this
handler.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.FILEHANDLER"
></A
><H3
>file.FileHandler</H3
><P
> The <SPAN
CLASS="PROPERTY"
>file.FileHandler</SPAN
> is just that
-- its duty is to serve up regular files to clients.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.HTMLFILETITLEHANDLER"
></A
><H3
>html.HTMLFileTitleHandler</H3
><P
> 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.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.MAILBOXES"
></A
><H3
>mbox handlers</H3
><P
> There are four mailbox handlers:
</P
><P
></P
><UL
><LI
><P
>mbox.MaildirFolderHandler</P
></LI
><LI
><P
>mbox.MaildirMessageHandler</P
></LI
><LI
><P
>mbox.MBoxMessageHandler</P
></LI
><LI
><P
>mbox.MBoxFolderHandler</P
></LI
></UL
><P
> 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.
</P
><P
> To use these handlers, all you have to do is enable them
in your <SPAN
CLASS="PROPERTY"
>handlers</SPAN
> section. They
will automatically detect requests for mailboxes and
handle them appropriately.
</P
><P
> 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.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.PYGHANDLER"
></A
><H3
>pyg.PYGHandler</H3
><P
> 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.
</P
><P
> 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 <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> code.
</P
><P
> If enabled, the <SPAN
CLASS="PROPERTY"
>pyg.PYGHandler</SPAN
> will
look for files with the extension .pyg that are marked
executable. If found, they will be loaded and run as
PYGs.
</P
><P
> Please note: this module provides the capability to
execute arbitrary code. Please consider the security
ramifications of that before enabling it.
</P
><P
> See the <SPAN
CLASS="PROPERTY"
>virtual.Virtual</SPAN
> handler for
more information about passing data to your scripts at
runtime.
</P
><P
> At present, documentation on writing PYGs is not
provides, but you may find examples in the
<SPAN
CLASS="PROPERTY"
>pygfarm</SPAN
> directory included with the
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> distribution.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.EXECHANDLER"
></A
><H3
>scriptexec.ExecHandler</H3
><P
> 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.
</P
><P
> The <SPAN
CLASS="PROPERTY"
>scriptexec.ExecHandler</SPAN
> will set
environment variables for your scripts to use. They are
as follows:
</P
><P
></P
><TABLE
CLASS="variablelist"
BORDER="0"
CELLSPACING="0"
CELLPADDING="4"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN304"><SPAN
STYLE="white-space: nowrap"
>SERVER_NAME</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>The name of this server as defined in
the configuration file or detected from the
operating system.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN308"><SPAN
STYLE="white-space: nowrap"
>SERVER_PORT</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>The port this server is listening on.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN312"><SPAN
STYLE="white-space: nowrap"
>REMOTE_ADDR</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>The IP address of the client.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN316"><SPAN
STYLE="white-space: nowrap"
>REMOTE_PORT</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>The port number of the client.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN320"><SPAN
STYLE="white-space: nowrap"
>REMOTE_HOST</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>The same value as <SPAN
CLASS="PROPERTY"
>REMOTE_ADDR</SPAN
></P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN325"><SPAN
STYLE="white-space: nowrap"
>SELECTOR</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>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.
</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN329"><SPAN
STYLE="white-space: nowrap"
>REQUEST</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>The "base" part of the selector; that
is, the part leading up to the |.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN333"><SPAN
STYLE="white-space: nowrap"
>SEARCHREQUEST</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Included only if the client specified
search data, this is used if the client is
searching for something.
</P
></TD
></TR
></TBODY
></TABLE
><P
> See the <SPAN
CLASS="PROPERTY"
>virtual.Virtual</SPAN
> handler for
more information about passing data to your scripts at
runtime.
</P
><P
> Please note: this module provides the capability to
execute arbitrary code. Please consider the security
ramifications of that before enabling it.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.UMN"
></A
><H3
>UMN.UMNDirHandler</H3
><P
> This is one of the most powerful workhorse handlers in
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>. 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.
</P
><P
> The remainder of the description of the
<SPAN
CLASS="PROPERTY"
>UMN.UMNDirHandler</SPAN
>, 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 :-)
</P
><DIV
CLASS="REFSECT3"
><A
NAME="HANDLERS.UMN.LINKS"
></A
><H4
>Links</H4
><P
> You can override the default view of a directory as
generated by <SPAN
CLASS="PROPERTY"
>dir.DirHandler</SPAN
> by
creating what are known as <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>Links</I
></SPAN
> in
the data tree.
</P
><P
> 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.
</P
><PRE
CLASS="PROGRAMLISTING"
>Name=Cheese Ball Recipes
Numb=1
Type=1
Port=150
Path=1/Moo/Cheesy
Host=zippy.micro.umn.edu
</PRE
><P
> 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.
</P
><P
> 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.
</P
><P
>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.
</P
></DIV
><DIV
CLASS="REFSECT3"
><A
NAME="HANDLERS.UMN.OVERRIDING"
></A
><H4
>Overriding Defaults</H4
><P
> The server looks for a directory called
<TT
CLASS="FILENAME"
>.cap</TT
> when parsing a directory. The
server then checks to see if the <TT
CLASS="FILENAME"
>.cap</TT
>
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
<TT
CLASS="FILENAME"
>.cap/</TT
> file are used to override any
of the server supplied default values.
</P
><P
> 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 <TT
CLASS="FILENAME"
>.cap</TT
> directory with the same
filename that contained the following lines:
</P
><PRE
CLASS="PROGRAMLISTING"
>Name=New Long Cool Name
Numb=2
</PRE
><P
> An alternative to <TT
CLASS="FILENAME"
>.cap</TT
> 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
<TT
CLASS="FILENAME"
>file-to-change</TT
>, then you could create
a file called <TT
CLASS="FILENAME"
>.names</TT
> with the
following contents:
</P
><PRE
CLASS="PROGRAMLISTING"
>Path=./file-to-change
Name=New Long Cool Name
Numb=2
</PRE
></DIV
><DIV
CLASS="REFSECT3"
><A
NAME="HANDLERS.UMN.COOL"
></A
><H4
>Adding Cool Links</H4
><P
> One cool thing you can do with .Links is to add neato
services to your gopher server. Adding a link like this:
</P
><PRE
CLASS="PROGRAMLISTING"
>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=+
</PRE
><P
> Will allow you to link in any FTP or Web site to your
gopher. (See url.URLHandler for more details.)
</P
><P
> You can easily add a finger site to your gopher server thusly:
</P
><PRE
CLASS="PROGRAMLISTING"
>Name=Finger information
Type=0
Path=lindner
Host=mudhoney.micro.umn.edu
Port=79
</PRE
></DIV
><DIV
CLASS="REFSECT3"
><A
NAME="HANDLERS.UMN.HIDING"
></A
><H4
>Hiding an Entry</H4
><P
> This kind of trick may be necessary in some cases,
and thus for
object "fred", the overriding .names file entry would be:
</P
><PRE
CLASS="PROGRAMLISTING"
> Type=X
Path=./fred
</PRE
><P
> 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
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> looks at, and those entries are not desired to
be shown at all.
</P
></DIV
><DIV
CLASS="REFSECT3"
><A
NAME="HANDLERS.UMN.ABSTRACTS"
></A
><H4
>Abstracts and Info</H4
><P
> 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.
</P
><P
> Subject to the <SPAN
CLASS="PROPERTY"
>abstract_headers</SPAN
> and
<SPAN
CLASS="PROPERTY"
>abstract_entries</SPAN
> configuration file
options, this feature allows you to define that extra
information. You can do that by simply creating a file
named <TT
CLASS="FILENAME"
>filename.abstract</TT
> right
alongside the regular file in your directory. The file
will be interpreted as the abstract. For a directory,
create a file named <TT
CLASS="FILENAME"
>.abstract</TT
> in the
directory. Simple as that!
</P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.HTMLURLHANDLER"
></A
><H3
>url.HTMLURLHandler</H3
><P
> <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> 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 <A
HREF="http://lists.complete.org/gopher@complete.org/2002/02/msg00033.html.gz"
TARGET="_top"
>Links
to URL</A
> 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
<TT
CLASS="FILENAME"
>gophermap</TT
> or
<TT
CLASS="FILENAME"
>.Links</TT
>
file that looks like this:
</P
><PRE
CLASS="PROGRAMLISTING"
>/URL:http://www.complete.org/
</PRE
><P
> 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.
</P
><P
> For Gopher clients that do not follow the Links to URL
specification, the <SPAN
CLASS="PROPERTY"
>url.HTMLURLHandler</SPAN
>
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.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.URLTYPEREWRITER"
></A
><H3
>url.URLTypeRewriter</H3
><P
> 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.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.VIRTUAL"
></A
><H3
>virtual.Virtual</H3
><P
> 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.
</P
><P
> One special feature of the
<SPAN
CLASS="PROPERTY"
>virtual.Virtual</SPAN
> 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.
</P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="HANDLERS.ZIP"
></A
><H3
>ZIP.ZIPHandler</H3
><P
> Using zip.ZIPHandler, you can save space on your server by
converting part or all of your site into a ZIP file.
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> can use the contents of that ZIP file as the
contents of your site -- completely transparently.
</P
><P
> The ZIP file handler must be enabled in the configuration
file for this to work.
</P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="TYPES"
></A
><H2
>Gopher Item Types</H2
><P
> When you construct links to files via
<TT
CLASS="FILENAME"
>.Links</TT
> or <TT
CLASS="FILENAME"
>gophermap</TT
>
files, or modify the <SPAN
CLASS="PROPERTY"
>mapping</SPAN
> in the
configuration file, you will need to know these. Items
bearing the "not implemented" text are not served up by
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> 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.
</P
><P
> This list was prepared based on RFC1436, the UMN gopherd(1) manpage,
and best current practices.
</P
><P
></P
><TABLE
CLASS="variablelist"
BORDER="0"
CELLSPACING="0"
CELLPADDING="4"
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN424"><SPAN
STYLE="white-space: nowrap"
>0</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Plain text file</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN428"><SPAN
STYLE="white-space: nowrap"
>1</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Directory</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN432"><SPAN
STYLE="white-space: nowrap"
>2</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>CSO phone book server (not implemented by <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>)</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN437"><SPAN
STYLE="white-space: nowrap"
>3</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Error condition; text that follows is plain text</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN441"><SPAN
STYLE="white-space: nowrap"
>4</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Macintosh file, BinHex format</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN445"><SPAN
STYLE="white-space: nowrap"
>5</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>DOS binary archive (not implemented by
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>; use type 9 instead)</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN450"><SPAN
STYLE="white-space: nowrap"
>6</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>uuencoded file; not directly generated by
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> automatically, but can be linked to
manually. Most gopher clients will handle this better
as type 1.
</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN455"><SPAN
STYLE="white-space: nowrap"
>7</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Search</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN459"><SPAN
STYLE="white-space: nowrap"
>8</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Telnet link</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN463"><SPAN
STYLE="white-space: nowrap"
>9</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Binary file</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN467"><SPAN
STYLE="white-space: nowrap"
>+</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Redundant server (not implemented by <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>)</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN472"><SPAN
STYLE="white-space: nowrap"
>c</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Calendar (not implemented by <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>)</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN477"><SPAN
STYLE="white-space: nowrap"
>e</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Event (not implemented by <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>)</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN482"><SPAN
STYLE="white-space: nowrap"
>g</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>GIF-format graphic</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN486"><SPAN
STYLE="white-space: nowrap"
>h</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>HTML file</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN490"><SPAN
STYLE="white-space: nowrap"
>I</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Any kind of graphic file other than GIF</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN494"><SPAN
STYLE="white-space: nowrap"
>i</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Informational
text included in a directory that is displayed but does not
link to any actual file.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN498"><SPAN
STYLE="white-space: nowrap"
>M</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>MIME multipart/mixed file</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN502"><SPAN
STYLE="white-space: nowrap"
>s</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>Any kind of sound file</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN506"><SPAN
STYLE="white-space: nowrap"
>T</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>tn3270 link</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><A
NAME="AEN510"><SPAN
STYLE="white-space: nowrap"
>X</SPAN
>, <SPAN
STYLE="white-space: nowrap"
>-</SPAN
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
> 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.
</P
></TD
></TR
></TBODY
></TABLE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="CONFORMING"
></A
><H2
>Conforming To</H2
><P
></P
><UL
><LI
><P
> The Internet Gopher Protocol as specified in RFC1436
</P
></LI
><LI
><P
> The Gopher+ upward-compatible enhancements to the Internet Gopher
Protocol from the University of Minnesota as laid out at
<A
HREF="gopher://gopher.quux.org/0/Archives/mirrors/boombox.micro.umn.edu/pub/gopher/gopher_protocol/Gopher+/Gopher+.txt"
TARGET="_top"
>gopher://gopher.quux.org/0/Archives/mirrors/boombox.micro.umn.edu/pub/gopher/gopher_protocol/Gopher+/Gopher+.txt</A
>.
</P
></LI
><LI
><P
> The gophermap file format as originally implemented in the
Bucktooth gopher server and described at
<A
HREF="gopher://gopher.floodgap.com/0/buck/dbrowse%3Ffaquse%201"
TARGET="_top"
>gopher://gopher.floodgap.com/0/buck/dbrowse%3Ffaquse%201</A
>.
</P
></LI
><LI
><P
> The Links to URL specification as laid out by John Goerzen
at
<A
HREF="gopher://gopher.quux.org/0/Archives/Mailing%20Lists/gopher/gopher.2002-02%3f/MBOX-MESSAGE/34"
TARGET="_top"
>gopher://gopher.quux.org/0/Archives/Mailing%20Lists/gopher/gopher.2002-02%3f/MBOX-MESSAGE/34</A
>.
</P
></LI
><LI
><P
> The UMN format for specifying object attributes and links
with .cap, .Links, .abstract, and similar files as specified elsewhere
in this document and implemented by UMN gopherd.
</P
></LI
><LI
><P
> The PYG format for extensible Python gopher objects as created for
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>.</P
></LI
><LI
><P
> Hypertext Transfer Protocol HTTP/1.0 as specified in
RFC1945
</P
></LI
><LI
><P
> Hypertext Markup Language (HTML) 3.2 and 4.0
Transitional as specified in RFC1866 and RFC2854.
</P
></LI
><LI
><P
> Maildir as specified in
<A
HREF="http://www.qmail.org/qmail-manual-html/man5/maildir.html"
TARGET="_top"
>http://www.qmail.org/qmail-manual-html/man5/maildir.html</A
> and
<A
HREF="http://cr.yp.to/proto/maildir.html"
TARGET="_top"
>http://cr.yp.to/proto/maildir.html</A
>.
</P
></LI
><LI
><P
> The mbox mail storage format as specified in
<A
HREF="http://www.qmail.org/qmail-manual-html/man5/mbox.html"
TARGET="_top"
>http://www.qmail.org/qmail-manual-html/man5/mbox.html</A
>.
</P
></LI
><LI
><P
> Registered MIME media types as specified in RFC2048.
</P
></LI
><LI
><P
> Script execution conforming to both UMN standards as laid out in UMN
gopherd(1) and Bucktooth standards as specified at
<A
HREF="gopher://gopher.floodgap.com:70/0/buck/dbrowse%3ffaquse%202"
TARGET="_top"
>gopher://gopher.floodgap.com:70/0/buck/dbrowse%3ffaquse%202</A
>,
so far as each can be implemented consistent with secure
design principles.
</P
></LI
><LI
><P
> Standard Python 2.2.1 or above as implemented on
POSIX-compliant systems.
</P
></LI
><LI
><P
> WAP/WML as defined by the WAP Forum.</P
></LI
></UL
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="BUGS"
></A
><H2
>Bugs</H2
><P
> Reports of bugs should be sent via e-mail to the <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>
bug-tracking system (BTS) at
<CODE
CLASS="EMAIL"
><<A
HREF="mailto:pygopherd@bugs.complete.org"
>pygopherd@bugs.complete.org</A
>></CODE
> or submitted online
using the Web interface at <A
HREF="http://bugs.complete.org/"
TARGET="_top"
>http://bugs.complete.org/</A
>.
</P
><P
> The Web site also lists all current bugs, where you can check their
status or contribute to fixing them.
</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="COPYRIGHT"
></A
><H2
>Copyright</H2
><P
> <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> is Copyright (C) 2002, 2003 John Goerzen.
</P
><P
> 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.
</P
><P
> 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.
</P
><P
> You should have received a copy of the GNU General Public License
along with this program; if not, write to:
</P
><PRE
CLASS="PROGRAMLISTING"
>Free Software Foundation, Inc.
59 Temple Place
Suite 330
Boston, MA 02111-1307
USA
</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AUTHOR"
></A
><H2
>Author</H2
><P
> <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
>, its libraries, documentation, and all included
files (except where noted) was written by John Goerzen
<CODE
CLASS="EMAIL"
><<A
HREF="mailto:jgoerzen@complete.org"
>jgoerzen@complete.org</A
>></CODE
>
and copyright is held as stated in the
Copyright section.
</P
><P
> 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:
</P
><PRE
CLASS="PROGRAMLISTING"
>Copyright (C) 1991-2000 University of Minnesota
Copyright (C) 2000-2002 John Goerzen and other developers
</PRE
><P
> <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> may be downloaded, and information found, from its
homepage via either Gopher or HTTP:
</P
><P
> <A
HREF="gopher://quux.org/1/devel/gopher/pygopherd"
TARGET="_top"
>gopher://quux.org/1/devel/gopher/pygopherd</A
></P
><P
> <A
HREF="http://quux.org/devel/gopher/pygopherd"
TARGET="_top"
>http://quux.org/devel/gopher/pygopherd</A
></P
><P
> <SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> 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
<SPAN
CLASS="APPLICATION"
>PyGopherd</SPAN
> with Subversion, please visit <A
HREF="http://svn.complete.org/"
TARGET="_top"
>http://svn.complete.org/</A
>.
</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN586"
></A
><H2
>See Also</H2
><P
> python (1).
</P
></DIV
></DIV
></BODY
></HTML
>
|