| 1 | ###################################################################### |
| 2 | # OVERALL SETTINGS FOR PYGOPHERD |
| 3 | ###################################################################### |
| 4 | |
| 5 | [pygopherd] |
| 6 | |
| 7 | ################################################## |
| 8 | # Operating System / Overall Behavior |
| 9 | ################################################## |
| 10 | |
| 11 | # Set this to true if you want the server to "detach" itself; that is, |
| 12 | # to go into the background after it starts. |
| 13 | |
| 14 | detach = no |
| 15 | |
| 16 | # If you want gopherd to write a PID file, set this to the location |
| 17 | # where you want it. Otherwise, comment out this line. |
| 18 | |
| 19 | pidfile = /var/run/pygopherd/pygopherd.pid |
| 20 | |
| 21 | ################################################## |
| 22 | # Network |
| 23 | ################################################## |
| 24 | |
| 25 | # The server name to present to the world. If you do not specify it |
| 26 | # here, Pygopherd will attempt to figure it out automatically. |
| 27 | # This is used only to present to clients. It does not control |
| 28 | # where the server listens. |
| 29 | # |
| 30 | # servername = gopher.example.com |
| 31 | |
| 32 | # The interface on which to listen. It should be an IP address or |
| 33 | # a domain name. If specified, pygopherd will attempt to listen to |
| 34 | # the specified port on only this interface -- useful if you are doing |
| 35 | # virtual hosting. If not specified, pygopherd will listen on all |
| 36 | # interfaces the OS provides. If in doubt, do not specify this. |
| 37 | # |
| 38 | # interface = gopher.example.com |
| 39 | |
| 40 | # What port to listen on. If not running as root, this must be |
| 41 | # greater than 1024. |
| 42 | |
| 43 | port = 70 |
| 44 | |
| 45 | # Type of server to run. Valid options are ForkingTCPServer |
| 46 | # and ThreadingTCPServer. ForkingTCPServer is highly recommended |
| 47 | # for now. |
| 48 | |
| 49 | servertype = ForkingTCPServer |
| 50 | |
| 51 | # What port to *say* we're listening on. Most people should NOT |
| 52 | # specify this. You might want to if you are using firewalling or |
| 53 | # port forwarding and the port number is different to the world than |
| 54 | # it is locally. |
| 55 | |
| 56 | # advertisedport = 70 |
| 57 | |
| 58 | # Do we timeout on client conections? HIGHLY RECOMMENDED! |
| 59 | # Value is given in seconds. If given, any read or write that makes |
| 60 | # no progress in this number of seconds will time out. |
| 61 | |
| 62 | timeout = 60 |
| 63 | |
| 64 | ################################################## |
| 65 | # Data Handling |
| 66 | ################################################## |
| 67 | |
| 68 | # You can add a header to every directory by creating a |
| 69 | # .abstract file in that directory and filling it with the |
| 70 | # information you like. This will then be rendered as a header |
| 71 | # for the directory. This option controls this feature. Note: |
| 72 | # for this to work, you must define a mapping to ABSTRACT in eaexts |
| 73 | # below. |
| 74 | |
| 75 | abstract_headers = on |
| 76 | |
| 77 | # Individual files and folders can also have abstracts. You can |
| 78 | # choose to have pygopherd render these abstracts in the directory |
| 79 | # listing itself -- they'll appear beneath the menu name for the file. |
| 80 | # You can set this option to any of three values: |
| 81 | # |
| 82 | # always -- always render these abstracts. |
| 83 | # unsupported -- render them only for protocols that do not natively |
| 84 | # support abstracts. Gopher+ is the only protocol that natively |
| 85 | # supports them currently. |
| 86 | # never -- never render these abstracts. |
| 87 | |
| 88 | abstract_entries = always |
| 89 | |
| 90 | ################################################## |
| 91 | # Error handling |
| 92 | ################################################## |
| 93 | |
| 94 | # If there is an error, you can decide whether or not to log a full |
| 95 | # backtrace. A full backtrace will usually be needed to find the |
| 96 | # problem. |
| 97 | |
| 98 | tracebacks = yes |
| 99 | |
| 100 | ################################################## |
| 101 | # Security |
| 102 | ################################################## |
| 103 | |
| 104 | ## Whether or not to use chroot. |
| 105 | # This option is only valid if you are running pygopherd as root! |
| 106 | |
| 107 | usechroot = yes |
| 108 | |
| 109 | ## Username and groupname to setreuid/setregid to. Valid only if |
| 110 | ## starting pygopherd as root. Comment out if you don't want this |
| 111 | ## functionality. NOTE: DO NOT RUN AS ROOT UNLESS YOU USE THESE! BAD BAD BAD! |
| 112 | |
| 113 | #setuid = gopher |
| 114 | #setgid = gopher |
| 115 | |
| 116 | ################################################## |
| 117 | # TLS |
| 118 | ################################################## |
| 119 | |
| 120 | # Enable TLS by sniffing the first byte of the client request for the start of |
| 121 | # a TLS handshake. This allows both TLS and plaintext requests to be served |
| 122 | # over the same port. |
| 123 | |
| 124 | enable_tls = no |
| 125 | |
| 126 | # File paths to the server certificate and keyfile in PEM format. These are |
| 127 | # required if TLS is enabled. When using chroot, the certificates will be |
| 128 | # loaded while root privileges are still active. |
| 129 | # |
| 130 | # tls_certfile = |
| 131 | # tls_keyfile = |
| 132 | |
| 133 | ################################################## |
| 134 | # Filesystem and MIME |
| 135 | ################################################## |
| 136 | |
| 137 | # Where the documents are stored. |
| 138 | |
| 139 | root = /var/gopher |
| 140 | |
| 141 | # Location of a file to use to figure out MIME types. You can |
| 142 | # specify multiple files here -- just separate them with a colon. |
| 143 | # ALL of them that are found will be read. |
| 144 | |
| 145 | mimetypes = ./conf/mime.types:/etc/pygopherd/mime.types:/etc/mime.types |
| 146 | |
| 147 | # Encodings. You can use the default with the following syntax. The |
| 148 | # mimetypex.encodings_map is {'.Z': 'compress', '.gz': 'gzip'}. |
| 149 | # |
| 150 | # For ease of use in the config file, we specify this as a list of |
| 151 | # tuples. You can convert any hash to a list of tuples by using .items() |
| 152 | |
| 153 | # encoding = mimetypes.encodings_map.items() |
| 154 | |
| 155 | # You can override the default entirely (ie, to remove those) like this: |
| 156 | |
| 157 | # encoding = {'.bz2' : 'bzip2', '.gz' : 'gzip'}.items() |
| 158 | # Or the same thing: |
| 159 | # encoding = [('.bz2', 'bzip2'), ('.gz', 'gzip')] |
| 160 | |
| 161 | # Or, you can extend the default like so: |
| 162 | |
| 163 | encoding = list(mimetypes.encodings_map.items()) + \ |
| 164 | list({'.bz2' : 'bzip2', |
| 165 | '.tal': 'tal.TALFileHandler' |
| 166 | }.items()) |
| 167 | |
| 168 | ###################################################################### |
| 169 | # Logging |
| 170 | ###################################################################### |
| 171 | |
| 172 | [logger] |
| 173 | |
| 174 | # Log method to use. One of: |
| 175 | # syslog -- use Unix syslog facility |
| 176 | # file -- log to standard output (future capability for logging to other |
| 177 | # files) |
| 178 | # none -- no logging |
| 179 | |
| 180 | logmethod = syslog |
| 181 | |
| 182 | # If you enable syslog, you will need to define these as well: |
| 183 | |
| 184 | # priority -- one of the following (listed in order of high to low): |
| 185 | # LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, |
| 186 | # LOG_INFO, LOG_DEBUG |
| 187 | |
| 188 | priority = LOG_INFO |
| 189 | |
| 190 | # Facility -- one of the following: |
| 191 | # LOG_KERN, LOG_USER, LOG_MAIL, LOG_DAEMON, LOG_AUTH, LOG_LPR, LOG_NEWS, |
| 192 | # LOG_UUCP, LOG_CRON, LOG_LOCAL0 - LOG_LOCAL7 |
| 193 | |
| 194 | facility = LOG_LOCAL3 |
| 195 | |
| 196 | |
| 197 | |
| 198 | ###################################################################### |
| 199 | # GOPHER OBJECTS |
| 200 | ###################################################################### |
| 201 | |
| 202 | # Settings for gopher objects |
| 203 | |
| 204 | [GopherEntry] |
| 205 | |
| 206 | # Use this MIME type if no other type is found. |
| 207 | defaultmimetype = text/plain |
| 208 | |
| 209 | # Mapping from MIME types to gopher0 single-character types. |
| 210 | # This is a list of lists. The first entry in each list is a |
| 211 | # regexp to match and the second is the result. |
| 212 | # |
| 213 | # Please have a .* at the end to map all unknown types to a certain |
| 214 | # character. For best results, that character should be nicely |
| 215 | # corresponding to the defaultmimetype. |
| 216 | |
| 217 | mapping = [['text/html', 'h'], |
| 218 | ['text/.+', '0'], |
| 219 | ['application/mac-binhex40', '4'], |
| 220 | ['audio/.+', 's'], |
| 221 | ['image/gif', 'g'], |
| 222 | ['image/.+', 'I'], |
| 223 | ['application/gopher-menu', '1'], |
| 224 | ['application/gopher\\+-menu', '1'], |
| 225 | ['multipart/mixed', 'M'], |
| 226 | ['application/.+', '9'], |
| 227 | ['.*', '0'] |
| 228 | ] |
| 229 | |
| 230 | # This is used by the system to generate Extended Attribute (EA), aka |
| 231 | # Gopher+ blocks for a file. Basically, with the setup shown below, |
| 232 | # you can create "filename.txt.abstract" to define the abstract |
| 233 | # property for filename.txt. If you do that, you will probably want |
| 234 | # to add these properties to ignorepatt below. The list is a mapping |
| 235 | # from an extension to a block name. |
| 236 | # |
| 237 | # Sample for UMN compatibility: |
| 238 | # |
| 239 | eaexts = {'.abstract' : 'ABSTRACT', |
| 240 | '.keywords' : 'KEYWORDS', |
| 241 | '.ask' : 'ASK', |
| 242 | '.3d' : '3D'} |
| 243 | # |
| 244 | # If you want to disable this capability, use this: |
| 245 | # |
| 246 | |
| 247 | # eaexts = {} |
| 248 | |
| 249 | |
| 250 | ###################################################################### |
| 251 | # HANDLERS |
| 252 | ###################################################################### |
| 253 | |
| 254 | ################################################## |
| 255 | # Handler multiplexer |
| 256 | ################################################## |
| 257 | |
| 258 | [handlers.HandlerMultiplexer] |
| 259 | |
| 260 | # A list of the handlers to consider. The handlers |
| 261 | # are tried in the order listed. |
| 262 | # |
| 263 | # |
| 264 | ### Suggested settings: |
| 265 | # Note: the UMNDirHandler will handle all directories, even if they |
| 266 | # do not have UMN-specific files, so you do not need to list the |
| 267 | # dirhandler in this case. |
| 268 | # |
| 269 | # Warning: scriptexec and pyg can execute arbitrary code stored in |
| 270 | # your path. Don't enable unless you know what you're doing! |
| 271 | # |
| 272 | # For UMN emulation: (full UMN featureset excluding scriptexec, no others) |
| 273 | # |
| 274 | # handlers = [url.HTMLURLHandler, UMN.UMNDirHandler, |
| 275 | # html.HTMLFileTitleHandler, |
| 276 | # mbox.MBoxMessageHandler, mbox.MBoxFolderHandler, |
| 277 | # file.CompressedFileHandler, file.FileHandler] |
| 278 | # |
| 279 | # For Bucktooth emulation: (full Buck featureset excluding scriptexec) |
| 280 | # |
| 281 | #handlers = [gophermap.BuckGophermapHandler, url.HTMLURLHandler, |
| 282 | # file.FileHandler, dir.DirHandler] |
| 283 | # |
| 284 | # For full Pygopherd featureset excluding scripts, compression, and PYG. |
| 285 | # Supports both UMN and Bucktooth featuresets. This is the default |
| 286 | # configuration for Pygopherd because it is secure yet versatile. |
| 287 | # |
| 288 | |
| 289 | handlers = [url.HTMLURLHandler, gophermap.BuckGophermapHandler, |
| 290 | mbox.MaildirFolderHandler, mbox.MaildirMessageHandler, |
| 291 | UMN.UMNDirHandler, html.HTMLFileTitleHandler, |
| 292 | mbox.MBoxMessageHandler, mbox.MBoxFolderHandler, |
| 293 | file.FileHandler] |
| 294 | |
| 295 | # For full Pygopherd featureset including scripts and PYG. Same as |
| 296 | # above but adds scripts, decompression, and PYG execution. |
| 297 | |
| 298 | #handlers = [url.HTMLURLHandler, gophermap.BuckGophermapHandler, |
| 299 | # mbox.MaildirFolderHandler, mbox.MaildirMessageHandler, |
| 300 | # UMN.UMNDirHandler, |
| 301 | # tal.TALFileHandler, |
| 302 | # html.HTMLFileTitleHandler, |
| 303 | # mbox.MBoxMessageHandler, mbox.MBoxFolderHandler, |
| 304 | # pyg.PYGHandler, scriptexec.ExecHandler, |
| 305 | # file.CompressedFileHandler, file.FileHandler, |
| 306 | # url.URLTypeRewriter] |
| 307 | |
| 308 | ################################################## |
| 309 | # Decompressing file handler |
| 310 | ################################################## |
| 311 | |
| 312 | [handlers.file.CompressedFileHandler] |
| 313 | |
| 314 | # Decompressors is a map from an encoding (as specified in the |
| 315 | # pygopherd section above) to a decompression program. |
| 316 | # The decompression program must |
| 317 | # accept the input in its stdin and write the decompressed output |
| 318 | # to stdout. |
| 319 | # |
| 320 | # If you do not want to decompress things automatically for your |
| 321 | # clients, you might wish to NOT use this handler. |
| 322 | # |
| 323 | # Note: this feature is probably NOT compatible with chroot unless |
| 324 | # you take extra precautions. |
| 325 | |
| 326 | # We enable no decompressors by default... you'll need to do that. |
| 327 | |
| 328 | decompressors = {} |
| 329 | |
| 330 | #decompressors = {'bzip2': 'bzcat', |
| 331 | # 'gzip' : 'zcat', |
| 332 | # 'compress' : 'zcat'} |
| 333 | |
| 334 | # Regexp to match against filenames pending decompression. |
| 335 | # The default will let ALL files be decompressed. |
| 336 | |
| 337 | decompresspatt = .* |
| 338 | |
| 339 | # You can be more restrictive: |
| 340 | |
| 341 | # decompresspatt = \.txt\.(bz2|gz|Z)$ |
| 342 | |
| 343 | |
| 344 | ################################################## |
| 345 | # Directory handler |
| 346 | ################################################## |
| 347 | |
| 348 | [handlers.dir.DirHandler] |
| 349 | # A regular expression of files to ignore. These files |
| 350 | # will not be presented in lists of files to clients, |
| 351 | # but if clients know the exact path to the files, they can |
| 352 | # still be requested. |
| 353 | # |
| 354 | # This pattern is matched against the requested selector. |
| 355 | # Selectors are guaranteed to begin with a slash by this point. |
| 356 | # and never end with a slash unless they consist solely of a slash. |
| 357 | # |
| 358 | # By default, we ignore files starting with a period, gophermap |
| 359 | # files, and files ending with a tilde. |
| 360 | # |
| 361 | # The default emulates UMN's default plus buck. Please note: |
| 362 | # UMNDirHandler implicitly will keep all files starting with a dot out of |
| 363 | # directory listings. If you exclude these files explicitly in ignorepatt, |
| 364 | # then not only will they not show up, but the handler will also not scan |
| 365 | # them for links and the like. |
| 366 | # |
| 367 | # A buck-only server might like: |
| 368 | # |
| 369 | # ignorepatt = ~$|/\.|/gophermap$ |
| 370 | |
| 371 | ignorepatt = /.cap$|/lost\+found$|/lib$|/bin$|/etc$|/dev$|~$|/\.cache|/\.forward$|/\.message$|/\.hushlogin$|/\.kermrc$|/\.notar$|/\.where$|/veronica.ctl$|/robots.txt$|/nohup.out$|/gophermap$|\.abstract$|\.keyboards$|\.ask|\.3d$|~$ |
| 372 | |
| 373 | # Expiration time, in seconds, for the cache. |
| 374 | # Set to 0 to disable caching entirely. |
| 375 | |
| 376 | cachetime = 180 |
| 377 | |
| 378 | # Name of the cahe file. Must be set to something even if the cachetime |
| 379 | # is zero. In that case, this filename will not be used but for the conf |
| 380 | # file to parse, it must still be set. |
| 381 | |
| 382 | cachefile = .cache.pygopherd.dir |
| 383 | |
| 384 | ################################################## |
| 385 | # UMN Directory Handler |
| 386 | ################################################## |
| 387 | |
| 388 | [handlers.UMN.UMNDirHandler] |
| 389 | |
| 390 | # Extension stripping behavior. When a file from a directory |
| 391 | # is presented in a menu, and no name is given, what to do? |
| 392 | # For instance, given a file Welcome.txt and pygopherd.tar.gz: |
| 393 | # |
| 394 | # If extstrip is none, present Welcome.txt and pygopherd.tar.gz in the |
| 395 | # menu. |
| 396 | # |
| 397 | # If extstrip is nonencoded, modify only those files that do not |
| 398 | # have encodings. (If CompressedFileHandler is used, modify only |
| 399 | # those files that to not have *HANDLED* encodings.) |
| 400 | # If gzip is NOT a handled encoding, you'd get names Welcome and |
| 401 | # pygopherd.tar.gz. If gzip IS a handled encoding, you'd get |
| 402 | # Welcome and pygopherd. |
| 403 | # |
| 404 | # If extstrip is full, modify all modifyable names. Welcome.txt -> |
| 405 | # Welcome and pygopherd.tar.gz -> pygopherd. |
| 406 | |
| 407 | # extstrip = none |
| 408 | extstrip = nonencoded |
| 409 | # extstrip = full |
| 410 | |
| 411 | [handlers.ZIP.ZIPHandler] |
| 412 | ################################################## |
| 413 | # ZIP file handler |
| 414 | ################################################## |
| 415 | |
| 416 | # Even if it's listed in the available handlers, it's disabled here by |
| 417 | # default. |
| 418 | |
| 419 | enabled = false |
| 420 | |
| 421 | pattern = \.zip$ |
| 422 | |
| 423 | ###################################################################### |
| 424 | # PROTOCOLS |
| 425 | ###################################################################### |
| 426 | |
| 427 | ################################################## |
| 428 | # Protocol Multiplexer |
| 429 | ################################################## |
| 430 | |
| 431 | [protocols.ProtocolMultiplexer] |
| 432 | |
| 433 | # A list of the protocols to consider for each request. |
| 434 | # The protocols are tried in the order listed. |
| 435 | |
| 436 | protocols = [wap.WAPProtocol, gemini.GeminiProtocol, |
| 437 | http.HTTPProtocol, http.HTTPSProtocol, |
| 438 | spartan.SpartanProtocol, |
| 439 | gopherp.GopherPlusProtocol, gopherp.SecureGopherPlusProtocol, |
| 440 | rfc1436.GopherProtocol, rfc1436.SecureGopherProtocol] |
| 441 | |
| 442 | ################################################## |
| 443 | # Gopher+ Protocol |
| 444 | ################################################## |
| 445 | |
| 446 | [protocols.gopherp.GopherPlusProtocol] |
| 447 | # The name and e-mail of the administrator |
| 448 | admin = Unconfigured Pygopherd Admin <[email protected]> |
| 449 | |
| 450 | ################################################## |
| 451 | # HTTP Protocol |
| 452 | ################################################## |
| 453 | |
| 454 | [protocols.http.HTTPProtocol] |
| 455 | iconmapping = {'h' : 'text.gif', |
| 456 | '0' : 'text.gif', |
| 457 | '4' : 'binhex.gif', |
| 458 | 's' : 'sound1.gif', |
| 459 | 'g' : 'image3.gif', |
| 460 | 'I' : 'image3.gif', |
| 461 | 'M' : 'text.gif', |
| 462 | '9' : 'binary.gif', |
| 463 | '1' : 'folder.gif', |
| 464 | '7' : 'folder.gif', |
| 465 | 'i' : 'blank.gif'} |
| 466 | |
| 467 | # You can use this option to put something at the top of each HTML |
| 468 | # page generated. |
| 469 | # |
| 470 | # The following tokens will be interpolated: |
| 471 | # |
| 472 | # GOPHERURL -- the Gopher URL for this page. |
| 473 | # |
| 474 | |
| 475 | pagetopper = Welcome to Gopherspace! You are browsing Gopher through |
| 476 | a Web interface right now. You can use most browsers or Gopher |
| 477 | clients to browse Gopher natively. If your browser supports it, |
| 478 | <A HREF="GOPHERURL">try clicking here</A> to see this page |
| 479 | in Gopher directly. To find Gopher browsers, |
| 480 | <A HREF="https://en.wikipedia.org/wiki/Gopher_(protocol)#Client_software">click |
| 481 | here</A>.<HR> |
| 482 | |
| 483 | ################################################## |
| 484 | # WAP Protocol |
| 485 | ################################################## |
| 486 | |
| 487 | [protocols.wap.WAPProtocol] |
| 488 | |
| 489 | # waptop is the URL to access with WAP devices. The default, /wap, means |
| 490 | # that accessing http://sitename.com/wap will bring up your site in WAP |
| 491 | # mode. |
| 492 | # |
| 493 | # PyGopherd can autodetect WAP from some phones, so this is not always |
| 494 | # necessary. |
| 495 | |
| 496 | waptop = /wap |
| 497 | |
| 498 | ################################################## |
| 499 | # Gemini Protocol |
| 500 | ################################################## |
| 501 | |
| 502 | [protocols.gemini.GeminiProtocol] |
| 503 | # Note that the gemini protocol *requires* the TLS section to also be enabled. |
| 504 | |
| 505 | footer = => https://www.github.com/michael-lazar/pygopherd Generated by PyGopherd |
| 506 | |
| 507 | ################################################## |
| 508 | # Spartan Protocol |
| 509 | ################################################## |
| 510 | |
| 511 | [protocols.gemini.SpartanProtocol] |
| 512 | |
| 513 | footer = => https://www.github.com/michael-lazar/pygopherd Generated by PyGopherd |
| 514 |