Debian Codegraph @

conf/local.conf

raw symbols SCIP
1 ######################################################################
2 # LOCAL DEVELOPMENT QUICKSTART SETTINGS
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.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 = localhost
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 = 7070
44
45 # Type of server to run. Valid options are ForkingTCPServer
46 # and ThreadingTCPServer. ForkingTCPServer is highly recommended
47 # for now.
48
49 servertype = ThreadingTCPServer
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 = no
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 = yes
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 = ./testdata/demo.crt
131 tls_keyfile = ./testdata/demo.key
132
133 ##################################################
134 # Filesystem and MIME
135 ##################################################
136
137 # Where the documents are stored.
138
139 root = ./testdata
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 = file
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 ZIP.ZIPHandler,
306 file.CompressedFileHandler, file.FileHandler,
307 url.URLTypeRewriter]
308
309 ##################################################
310 # Decompressing file handler
311 ##################################################
312
313 [handlers.file.CompressedFileHandler]
314
315 # Decompressors is a map from an encoding (as specified in the
316 # pygopherd section above) to a decompression program.
317 # The decompression program must
318 # accept the input in its stdin and write the decompressed output
319 # to stdout.
320 #
321 # If you do not want to decompress things automatically for your
322 # clients, you might wish to NOT use this handler.
323 #
324 # Note: this feature is probably NOT compatible with chroot unless
325 # you take extra precautions.
326
327 # We enable no decompressors by default... you'll need to do that.
328
329 # decompressors = {}
330
331 decompressors = {'bzip2': 'bzcat',
332 'gzip' : 'zcat',
333 'compress' : 'zcat'}
334
335 # Regexp to match against filenames pending decompression.
336 # The default will let ALL files be decompressed.
337
338 decompresspatt = .*
339
340 # You can be more restrictive:
341
342 # decompresspatt = \.txt\.(bz2|gz|Z)$
343
344
345 ##################################################
346 # Directory handler
347 ##################################################
348
349 [handlers.dir.DirHandler]
350 # A regular expression of files to ignore. These files
351 # will not be presented in lists of files to clients,
352 # but if clients know the exact path to the files, they can
353 # still be requested.
354 #
355 # This pattern is matched against the requested selector.
356 # Selectors are guaranteed to begin with a slash by this point.
357 # and never end with a slash unless they consist solely of a slash.
358 #
359 # By default, we ignore files starting with a period, gophermap
360 # files, and files ending with a tilde.
361 #
362 # The default emulates UMN's default plus buck. Please note:
363 # UMNDirHandler implicitly will keep all files starting with a dot out of
364 # directory listings. If you exclude these files explicitly in ignorepatt,
365 # then not only will they not show up, but the handler will also not scan
366 # them for links and the like.
367 #
368 # A buck-only server might like:
369 #
370 # ignorepatt = ~$|/\.|/gophermap$
371
372 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$|~$
373
374 # Expiration time, in seconds, for the cache.
375 # Set to 0 to disable caching entirely.
376
377 cachetime = 0
378
379 # Name of the cahe file. Must be set to something even if the cachetime
380 # is zero. In that case, this filename will not be used but for the conf
381 # file to parse, it must still be set.
382
383 cachefile = .cache.pygopherd.dir
384
385 ##################################################
386 # UMN Directory Handler
387 ##################################################
388
389 [handlers.UMN.UMNDirHandler]
390
391 # Extension stripping behavior. When a file from a directory
392 # is presented in a menu, and no name is given, what to do?
393 # For instance, given a file Welcome.txt and pygopherd.tar.gz:
394 #
395 # If extstrip is none, present Welcome.txt and pygopherd.tar.gz in the
396 # menu.
397 #
398 # If extstrip is nonencoded, modify only those files that do not
399 # have encodings. (If CompressedFileHandler is used, modify only
400 # those files that to not have *HANDLED* encodings.)
401 # If gzip is NOT a handled encoding, you'd get names Welcome and
402 # pygopherd.tar.gz. If gzip IS a handled encoding, you'd get
403 # Welcome and pygopherd.
404 #
405 # If extstrip is full, modify all modifyable names. Welcome.txt ->
406 # Welcome and pygopherd.tar.gz -> pygopherd.
407
408 # extstrip = none
409 extstrip = nonencoded
410 # extstrip = full
411
412 [handlers.ZIP.ZIPHandler]
413 ##################################################
414 # ZIP file handler
415 ##################################################
416
417 # Even if it's listed in the available handlers, it's disabled here by
418 # default.
419
420 enabled = true
421
422 pattern = \.zip$
423
424 ######################################################################
425 # PROTOCOLS
426 ######################################################################
427
428 ##################################################
429 # Protocol Multiplexer
430 ##################################################
431
432 [protocols.ProtocolMultiplexer]
433
434 # A list of the protocols to consider for each request.
435 # The protocols are tried in the order listed.
436
437 protocols = [wap.WAPProtocol, gemini.GeminiProtocol,
438 http.HTTPProtocol, http.HTTPSProtocol,
439 spartan.SpartanProtocol,
440 gopherp.GopherPlusProtocol, gopherp.SecureGopherPlusProtocol,
441 rfc1436.GopherProtocol, rfc1436.SecureGopherProtocol]
442
443 ##################################################
444 # Gopher+ Protocol
445 ##################################################
446
447 [protocols.gopherp.GopherPlusProtocol]
448 # The name and e-mail of the administrator
449 admin = Unconfigured Pygopherd Admin <[email protected]>
450
451 ##################################################
452 # HTTP Protocol
453 ##################################################
454
455 [protocols.http.HTTPProtocol]
456 iconmapping = {'h' : 'text.gif',
457 '0' : 'text.gif',
458 '4' : 'binhex.gif',
459 's' : 'sound1.gif',
460 'g' : 'image3.gif',
461 'I' : 'image3.gif',
462 'M' : 'text.gif',
463 '9' : 'binary.gif',
464 '1' : 'folder.gif',
465 '7' : 'folder.gif',
466 'i' : 'blank.gif'}
467
468 # You can use this option to put something at the top of each HTML
469 # page generated.
470 #
471 # The following tokens will be interpolated:
472 #
473 # GOPHERURL -- the Gopher URL for this page.
474 #
475
476 pagetopper = Welcome to Gopherspace! You are browsing Gopher through
477 a Web interface right now. You can use most browsers or Gopher
478 clients to browse Gopher natively. If your browser supports it,
479 <A HREF="GOPHERURL">try clicking here</A> to see this page
480 in Gopher directly. To find Gopher browsers,
481 <A HREF="https://en.wikipedia.org/wiki/Gopher_(protocol)#Client_software">click
482 here</A>.<HR>
483
484 ##################################################
485 # WAP Protocol
486 ##################################################
487
488 [protocols.wap.WAPProtocol]
489
490 # waptop is the URL to access with WAP devices. The default, /wap, means
491 # that accessing http://sitename.com/wap will bring up your site in WAP
492 # mode.
493 #
494 # PyGopherd can autodetect WAP from some phones, so this is not always
495 # necessary.
496
497 waptop = /wap
498
499 ##################################################
500 # Gemini Protocol
501 ##################################################
502
503 [protocols.gemini.GeminiProtocol]
504 # Note that the gemini protocol *requires* the TLS section to also be enabled.
505
506 footer = => https://www.github.com/michael-lazar/pygopherd Generated by PyGopherd
507
508 ##################################################
509 # Spartan Protocol
510 ##################################################
511
512 [protocols.gemini.SpartanProtocol]
513
514 footer = => https://www.github.com/michael-lazar/pygopherd Generated by PyGopherd