209
class ConfigFunctionality(object):
210
""" Configuration base class with config class behaviour.
212
This class contains the functionality for the DefaultConfig
213
class for the benefit of the WikiConfig macro.
224
class DefaultConfig(object):
225
""" default config values
227
When adding new config attributes, PLEASE use a name with the TOPIC as prefix,
228
so it will sort naturally. E.g. use "actions_excluded", not "excluded_actions".
230
Also, please keep it (roughly) sorted (except if you have good reasons to group otherwise).
216
# attributes of this class that should not be shown
217
# in the WikiConfig() macro.
222
jabber_enabled = None
223
auth_can_logout = None
224
auth_have_login = None
225
auth_login_inputs = None
226
_site_plugin_lists = None
229
xapian_searchers = None
231
# will be lazily loaded by interwiki code when needed (?)
232
shared_intermap_files = None
233
DesktopEdition = False # True gives all local users special powers - ONLY use for MMDE style usage!
235
SecurityPolicy = None
237
acl_hierarchic = False # True to use hierarchical ACLs
238
# All acl_rights_* lines must use unicode!
239
acl_rights_default = u"Trusted:read,write,delete,revert Known:read,write,delete,revert All:read,write"
240
acl_rights_before = u""
241
acl_rights_after = u""
242
acl_rights_valid = ['read', 'write', 'delete', 'revert', 'admin']
244
actions_excluded = ['xmlrpc', # we do not want wiki admins unknowingly offering xmlrpc service
245
'MyPages', # only works when used with a non-default SecurityPolicy (e.g. autoadmin)
246
'CopyPage', # has questionable behaviour regarding subpages a user can't read, but can copy
249
antispam_master_url = "http://master.moinmo.in/?action=xmlrpc2"
251
auth = [authmodule.MoinAuth()]
252
# default to http and xmlrpc_applytoken to get old semantics
253
# xmlrpc_applytoken shall be removed once that code is changed
254
# to have proper session handling and use request.handle_auth()
255
auth_methods_trusted = ['http', 'xmlrpc_applytoken']
257
backup_compression = 'gz'
263
r"%(/)spages%(/)s.+%(/)scache%(/)s[^%(/)s]+$" % {'/': os.sep},
264
r"%(/)s(edit-lock|event-log|\.DS_Store)$" % {'/': os.sep},
266
backup_storage_dir = '/tmp'
267
backup_restore_target_dir = '/tmp'
270
caching_formats = ['text_html']
271
changed_time_fmt = '%H:%M'
273
# chars_{upper,lower,digits,spaces} see MoinMoin/util/chartypes.py
275
# if you have gdchart, add something like
276
# chart_options = {'width = 720, 'height': 540}
279
config_check_enabled = False
281
cookie_domain = None # use '.domain.tld" for a farm with hosts in that domain
282
cookie_path = None # use '/wikifarm" for a farm with pathes below that path
283
cookie_lifetime = 12 # 12 hours from now
286
data_underlay_dir = './underlay/'
288
date_fmt = '%Y-%m-%d'
289
datetime_fmt = '%Y-%m-%d %H:%M:%S'
291
default_markup = 'wiki'
292
docbook_html_dir = r"/usr/share/xml/docbook/stylesheet/nwalsh/html/" # correct for debian sarge
294
edit_bar = ['Edit', 'Comments', 'Discussion', 'Info', 'Subscribe', 'Quicklink', 'Attachments', 'ActionsMenu']
295
editor_default = 'text' # which editor is called when nothing is specified
296
editor_force = False # force using the default editor
297
editor_ui = 'freechoice' # which editor links are shown on user interface
299
# editor markup hints quickhelp
300
# MUST be in wiki markup, even if the help is not for the wiki parser!
302
Emphasis:: <<Verbatim('')>>''italics''<<Verbatim('')>>; <<Verbatim(''')>>'''bold'''<<Verbatim(''')>>; <<Verbatim(''''')>>'''''bold italics'''''<<Verbatim(''''')>>; <<Verbatim('')>>''mixed ''<<Verbatim(''')>>'''''bold'''<<Verbatim(''')>> and italics''<<Verbatim('')>>; <<Verbatim(----)>> horizontal rule.
303
Headings:: = Title 1 =; == Title 2 ==; === Title 3 ===; ==== Title 4 ====; ===== Title 5 =====.
304
Lists:: space and one of: * bullets; 1., a., A., i., I. numbered items; 1.#n start numbering at n; space alone indents.
305
Links:: <<Verbatim(JoinCapitalizedWords)>>; <<Verbatim([[target|linktext]])>>.
306
Tables:: || cell text |||| cell text spanning 2 columns ||; no trailing white space allowed after tables or titles.
308
(!) For more help, see HelpOnEditing or SyntaxReference.
312
Emphasis: *italic* **bold** ``monospace``
314
Headings: Heading 1 Heading 2 Heading 3
315
========= --------- ~~~~~~~~~
317
Horizontal rule: ----
319
Links: TrailingUnderscore_ `multi word with backticks`_ external_
321
.. _external: http://external-site.example.org/foo/
323
Lists: * bullets; 1., a. numbered items.
325
(!) For more help, see the
326
[[http://docutils.sourceforge.net/docs/user/rst/quickref.html|reStructuredText Quick Reference]].
329
Emphasis:: <<Verbatim(//)>>''italics''<<Verbatim(//)>>; <<Verbatim(**)>>'''bold'''<<Verbatim(**)>>; <<Verbatim(**//)>>'''''bold italics'''''<<Verbatim(//**)>>; <<Verbatim(//)>>''mixed ''<<Verbatim(**)>>'''''bold'''<<Verbatim(**)>> and italics''<<Verbatim(//)>>;
330
Horizontal Rule:: <<Verbatim(----)>>
331
Force Linebreak:: <<Verbatim(\\\\)>>
332
Headings:: = Title 1 =; == Title 2 ==; === Title 3 ===; ==== Title 4 ====; ===== Title 5 =====.
333
Lists:: * bullets; ** sub-bullets; # numbered items; ## numbered sub items.
334
Links:: <<Verbatim([[target]])>>; <<Verbatim([[target|linktext]])>>.
335
Tables:: |= header text | cell text | more cell text |;
337
(!) For more help, see HelpOnEditing or HelpOnCreoleSyntax.
340
edit_locking = 'warn 10' # None, 'warn <timeout mins>', 'lock <timeout mins>'
341
edit_ticketing = True
344
hacks = {} # { 'feature1': value1, ... }
345
# Configuration for features still in development.
346
# For boolean stuff just use config like this:
347
# hacks = { 'feature': True, ...}
348
# and in the code use:
349
# if cfg.hacks.get('feature', False): <doit>
350
# A non-existing hack key should ever mean False, None, "", [] or {}!
352
history_count = (100, 200) # (default_revisions_shown, max_revisions_shown)
357
html_head_queries = '''<meta name="robots" content="noindex,nofollow">\n'''
358
html_head_posts = '''<meta name="robots" content="noindex,nofollow">\n'''
359
html_head_index = '''<meta name="robots" content="index,follow">\n'''
360
html_head_normal = '''<meta name="robots" content="index,nofollow">\n'''
361
html_pagetitle = None
363
interwikiname = None # our own interwikiname. choose wisely and never change!
364
interwiki_preferred = [] # list of wiki names to show at top of interwiki list
366
language_default = 'en'
367
language_ignore_browser = False # ignore browser settings, use language_default
370
logo_string = None # can be either just some text or a piece of html shown as "logo"
372
log_reverse_dns_lookups = True # if we do reverse dns lookups for logging hostnames
373
# instead of just IPs
374
log_timing = False # log infos about timing of actions, good to analyze load conditions
376
mail_from = None # u'Juergen Wiki <noreply@jhwiki.org>'
377
mail_login = None # "user pwd" if you need to use SMTP AUTH when using your mail server
378
mail_smarthost = None # your SMTP mail server
379
mail_sendmail = None # "/usr/sbin/sendmail -t -i" to not use SMTP, but sendmail
381
mail_import_secret = "" # a shared secret also known to the mail importer xmlrpc script
382
mail_import_subpage_template = u"$from-$date-$subject" # used for mail import
383
mail_import_pagename_search = ['subject', 'to', ] # where to look for target pagename (and in which order)
384
mail_import_pagename_envelope = u"%s" # use u"+ %s/" to add "+ " and "/" automatically
385
mail_import_pagename_regex = r'\[\[([^\]]*)\]\]' # how to find/extract the pagename from the subject
386
mail_import_wiki_addrs = [] # the e-mail addresses for e-mails that should go into the wiki
388
# some dangerous mimetypes (we don't use "content-disposition: inline" for them when a user
389
# downloads such attachments, because the browser might execute e.g. Javascript contained
390
# in the HTML and steal your moin session cookie or do other nasty stuff)
391
mimetypes_xss_protect = [
393
'application/x-shockwave-flash',
394
'application/xhtml+xml',
399
'application/postscript',
402
'application/vnd.visio',
419
navi_bar = [u'RecentChanges', u'FindPage', u'HelpContents', ]
422
notification_bot_uri = None # uri of the jabber bot
424
# OpenID server support
425
openid_server_enabled = False
426
openid_server_restricted_users_group = None
427
openid_server_enable_user = False
430
# Feel free to add other credits, but PLEASE do NOT change or remove
431
# the following links - you help us by keeping them "as is":
432
'<a href="http://moinmo.in/" title="This site uses the MoinMoin Wiki software.">MoinMoin Powered</a>',
433
'<a href="http://moinmo.in/Python" title="MoinMoin is written in Python.">Python Powered</a>',
436
# if you think it can be maybe misunderstood as applying to content or topic of your wiki,
437
# feel free to remove this one:
438
'<a href="http://moinmo.in/GPL" title="MoinMoin is GPL licensed.">GPL licensed</a>',
440
# if you don't need/want to check the html output, feel free to remove this one:
441
'<a href="http://validator.w3.org/check?uri=referer" title="Click here to validate this page.">Valid HTML 4.01</a>',
444
# you can put some pieces of html at specific places into the theme output:
450
page_front_page = u'HelpOnLanguages' # this will make people choose a sane config
451
page_local_spelling_words = u'LocalSpellingWords'
453
# the following regexes should match the complete name when used in free text
454
# the group 'all' shall match all, while the group 'key' shall match the key only
455
# e.g. CategoryFoo -> group 'all' == CategoryFoo, group 'key' == Foo
456
# moin's code will add ^ / $ at beginning / end when needed
457
page_category_regex = ur'(?P<all>Category(?P<key>\S+))'
458
page_dict_regex = ur'(?P<all>(?P<key>\S+)Dict)'
459
page_group_regex = ur'(?P<all>(?P<key>\S+)Group)'
460
page_template_regex = ur'(?P<all>(?P<key>\S+)Template)'
462
page_license_enabled = False
463
page_license_page = u'WikiLicense'
465
# These icons will show in this order in the iconbar, unless they
466
# are not relevant, e.g email icon when the wiki is not configured
468
page_iconbar = ["up", "edit", "view", "diff", "info", "subscribe", "raw", "print", ]
470
# Standard buttons in the iconbar
472
# key pagekey, querystr dict, title, icon-key
473
'diff': ('page', {'action': 'diff'}, _("Diffs"), "diff"),
474
'info': ('page', {'action': 'info'}, _("Info"), "info"),
475
'edit': ('page', {'action': 'edit'}, _("Edit"), "edit"),
476
'unsubscribe': ('page', {'action': 'unsubscribe'}, _("UnSubscribe"), "unsubscribe"),
477
'subscribe': ('page', {'action': 'subscribe'}, _("Subscribe"), "subscribe"),
478
'raw': ('page', {'action': 'raw'}, _("Raw"), "raw"),
479
'xml': ('page', {'action': 'show', 'mimetype': 'text/xml'}, _("XML"), "xml"),
480
'print': ('page', {'action': 'print'}, _("Print"), "print"),
481
'view': ('page', {}, _("View"), "view"),
482
'up': ('page_parent_page', {}, _("Up"), "up"),
486
def password_checker(username, password):
487
""" Check if a password is secure enough.
488
We use a built-in check to get rid of the worst passwords.
490
We do NOT use cracklib / python-crack here any more because it is
491
not thread-safe (we experienced segmentation faults when using it).
493
If you don't want to check passwords, use password_checker = None.
495
@return: None if there is no problem with the password,
496
some string with an error msg, if the password is problematic.
500
# in any case, do a very simple built-in check to avoid the worst passwords
501
if len(password) < 6:
502
raise ValueError("Password too short.")
503
if len(set(password)) < 4:
504
raise ValueError("Password has not enough different characters.")
506
username_lower = username.lower()
507
password_lower = password.lower()
508
if username in password or password in username or \
509
username_lower in password_lower or password_lower in username_lower:
510
raise ValueError("Password too easy (containment).")
512
keyboards = (ur"`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./", # US kbd
513
ur"^1234567890ß“qwertzuiopļæ½+asdfghjklļæ½ļæ½#yxcvbnm,.-", # german kbd
514
) # add more keyboards!
515
for kbd in keyboards:
517
if password in kbd or password in rev_kbd or \
518
password_lower in kbd or password_lower in rev_kbd:
519
raise ValueError("Password too easy (kbd sequence)")
521
except ValueError, err:
524
password_checker = staticmethod(password_checker)
526
quicklinks_default = [] # preload user quicklinks with this page list
528
refresh = None # (minimum_delay, type), e.g.: (2, 'internal')
529
rss_cache = 60 # suggested caching time for RecentChanges RSS, in seconds
531
search_results_per_page = 25
533
session_handler = session.DefaultSessionHandler()
534
session_id_handler = session.MoinCookieSessionIDHandler()
536
shared_intermap = None # can be string or list of strings (filenames)
538
show_hosts = True # show hostnames on RecentChanges / info/history action
539
show_interwiki = False # show our interwiki name (usually in front of the page name)
540
show_names = True # show editor names on RecentChanges / info/history action
541
show_section_numbers = 0 # enumerate sections (headlines) by default?
542
show_timings = False # show some timing stats (usually in the footer)
543
show_version = False # show moin version info / (C) (depends on theme)
546
#('Self', 'http://localhost:8080/?action=sisterpages'),
547
#('EmacsWiki', 'http://www.emacswiki.org/cgi-bin/test?action=sisterpages'),
548
#('JspWiki', 'http://www.jspwiki.org/SisterSites.jsp'),
549
] # list of (sistersitename, sisterpagelistfetchurl)
552
sitename = u'Untitled Wiki' # Wiki identity
554
stylesheets = [] # list of tuples (media, csshref) to insert after theme css, before user css
556
_subscribable_events = None # A list of event types that user can subscribe to
557
subscribed_pages_default = [] # preload user subscribed pages with this page list
558
email_subscribed_events_default = [
559
PageChangedEvent.__name__,
560
PageRenamedEvent.__name__,
561
PageDeletedEvent.__name__,
562
PageCopiedEvent.__name__,
563
PageRevertedEvent.__name__,
564
FileAttachedEvent.__name__,
566
jabber_subscribed_events_default = []
568
superuser = [] # list of unicode user names that have super powers :)
570
supplementation_page = False # use supplementation pages (show a link in the theme)?
571
supplementation_page_name = u'Discussion' # name of suppl. subpage
572
supplementation_page_template = u'DiscussionTemplate' # name of template used to create suppl. pages
574
surge_action_limits = {# allow max. <count> <action> requests per <dt> secs
575
# action: (count, dt)
579
'raw': (20, 40), # some people use this for css
580
'AttachFile': (90, 60),
582
'fullsearch': (10, 120),
583
'edit': (30, 300), # can be lowered after making preview different from edit
587
surge_lockout_time = 3600 # secs you get locked out when you ignore warnings
589
textchas = None # a data structure with site-specific questions/answers, see HelpOnTextChas
590
textchas_disabled_group = None # e.g. u'NoTextChasGroup' if you are a member of this group, you don't get textchas
592
theme_default = 'modern'
595
traceback_show = True # if True, tracebacks are displayed in the web browser
596
traceback_log_dir = None # if set to a directory path, tracebacks are written to files there
598
trail_size = 5 # number of recently visited pagenames shown in the trail display
599
tz_offset = 0.0 # default time zone offset in hours from UTC
601
# a regex of HTTP_USER_AGENTS that should be excluded from logging
602
# and receive a FORBIDDEN for anything except viewing a page
603
# list must not contain 'java' because of twikidraw wanting to save drawing uses this useragent
604
ua_spiders = ('archiver|cfetch|charlotte|crawler|curl|gigabot|googlebot|heritrix|holmes|htdig|httrack|httpunit|'
605
'intelix|jeeves|larbin|leech|libwww-perl|linkbot|linkmap|linkwalk|litefinder|mercator|'
606
'microsoft.url.control|mirror| mj12bot|msnbot|msrbot|neomo|nutbot|omniexplorer|puf|robot|scooter|seekbot|'
607
'sherlock|slurp|sitecheck|snoopy|spider|teleport|twiceler|voilabot|voyager|webreaper|wget|yeti')
609
unzip_single_file_size = 2.0 * 1000 ** 2
610
unzip_attachments_space = 200.0 * 1000 ** 2
611
unzip_attachments_count = 101 # 1 zip file + 100 files contained in it
615
# url_prefix is DEPRECATED and not used any more by the code.
616
# it confused many people by its name and default value of '/wiki' to the
617
# wrong conclusion that it is the url of the wiki (the dynamic) stuff,
618
# but it was used to address the static stuff (images, css, js).
619
# Thus we use the more clear url_prefix_static ['/moin_staticVVV'] setting now.
620
# For a limited time, we still look at url_prefix - if it is not None, we
621
# copy the value to url_prefix_static to ease transition.
624
# includes the moin version number, so we can have a unlimited cache lifetime
625
# for the static stuff. if stuff changes on version upgrade, url will change
626
# immediately and we have no problem with stale caches.
627
url_prefix_static = config.url_prefix_static
628
url_prefix_local = None # if None, use same value as url_prefix_static.
629
# must be same site as wiki engine (for e.g. JS permissions)
631
# we could prefix actions to be able to exclude them by robots.txt:
632
#url_prefix_action = 'action' # no leading or trailing '/'
633
url_prefix_action = None # compatiblity
635
# allow disabling certain userpreferences plugins
636
userprefs_disabled = []
638
user_autocreate = False # do we auto-create user profiles
639
user_email_unique = True # do we check whether a user's email is unique?
640
user_jid_unique = True # do we check whether a user's email is unique?
642
user_homewiki = 'Self' # interwiki name for where user homepages are located
644
user_checkbox_fields = [
645
('mailto_author', lambda _: _('Publish my email (not my wiki homepage) in author info')),
646
('edit_on_doubleclick', lambda _: _('Open editor on double click')),
647
('remember_last_visit', lambda _: _('After login, jump to last visited page')),
648
('show_comments', lambda _: _('Show comment sections')),
649
('show_nonexist_qm', lambda _: _('Show question mark for non-existing pagelinks')),
650
('show_page_trail', lambda _: _('Show page trail')),
651
('show_toolbar', lambda _: _('Show icon toolbar')),
652
('show_topbottom', lambda _: _('Show top/bottom links in headings')),
653
('show_fancy_diff', lambda _: _('Show fancy diffs')),
654
('wikiname_add_spaces', lambda _: _('Add spaces to displayed wiki names')),
655
('remember_me', lambda _: _('Remember login information')),
657
('disabled', lambda _: _('Disable this account forever')),
658
# if an account is disabled, it may be used for looking up
659
# id -> username for page info and recent changes, but it
660
# is not usable for the user any more:
663
user_checkbox_defaults = {'mailto_author': 0,
664
'edit_on_doubleclick': 0,
665
'remember_last_visit': 0,
667
'show_nonexist_qm': nonexist_qm,
668
'show_page_trail': 1,
671
'show_fancy_diff': 1,
672
'wikiname_add_spaces': 0,
676
# don't let the user change those
677
# user_checkbox_disable = ['disabled']
678
user_checkbox_disable = []
680
# remove those checkboxes:
681
#user_checkbox_remove = ['edit_on_doubleclick', 'show_nonexist_qm', 'show_toolbar', 'show_topbottom',
682
# 'show_fancy_diff', 'wikiname_add_spaces', 'remember_me', 'disabled',]
683
user_checkbox_remove = []
686
('name', _('Name'), "text", "36", _("(Use FirstnameLastname)")),
687
('aliasname', _('Alias-Name'), "text", "36", ''),
688
('email', _('Email'), "text", "36", ''),
689
('jid', _('Jabber ID'), "text", "36", ''),
690
('css_url', _('User CSS URL'), "text", "40", _('(Leave it empty for disabling user CSS)')),
691
('edit_rows', _('Editor size'), "text", "3", ''),
694
user_form_defaults = {# key: default - do NOT remove keys from here!
705
# don't let the user change those, but show them:
706
#user_form_disable = ['name', 'aliasname', 'email',]
707
user_form_disable = []
709
# remove those completely:
710
#user_form_remove = ['password', 'password2', 'css_url', 'logout', 'create', 'account_sendmail',]
711
user_form_remove = []
713
# attributes we do NOT save to the userpref file
714
user_transient_fields = ['id', 'valid', 'may', 'auth_username', 'password', 'password2', 'auth_method', 'auth_attribs', ]
716
xapian_search = False
717
xapian_index_dir = None
718
xapian_stemming = False
719
xapian_index_history = False
234
721
def __init__(self, siteid):
235
722
""" Init Config instance """
671
1072
""" Make it possible to access a config object like a dict """
672
1073
return getattr(self, item)
675
class DefaultConfig(ConfigFunctionality):
676
""" Configuration base class with default config values
679
# Do not add anything into this class. Functionality must
680
# be added above to avoid having the methods show up in
681
# the WikiConfig macro. Settings must be added below to
682
# the options dictionary.
685
def _default_password_checker(cfg, request, username, password):
686
""" Check if a password is secure enough.
687
We use a built-in check to get rid of the worst passwords.
689
We do NOT use cracklib / python-crack here any more because it is
690
not thread-safe (we experienced segmentation faults when using it).
692
If you don't want to check passwords, use password_checker = None.
694
@return: None if there is no problem with the password,
695
some unicode object with an error msg, if the password is problematic.
698
# in any case, do a very simple built-in check to avoid the worst passwords
699
if len(password) < 6:
700
return _("Password is too short.")
701
if len(set(password)) < 4:
702
return _("Password has not enough different characters.")
704
username_lower = username.lower()
705
password_lower = password.lower()
706
if username in password or password in username or \
707
username_lower in password_lower or password_lower in username_lower:
708
return _("Password is too easy (password contains name or name contains password).")
710
keyboards = (ur"`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./", # US kbd
711
ur"^1234567890ß“qwertzuiopļæ½+asdfghjklļæ½ļæ½#yxcvbnm,.-", # german kbd
712
) # add more keyboards!
713
for kbd in keyboards:
715
if password in kbd or password in rev_kbd or \
716
password_lower in kbd or password_lower in rev_kbd:
717
return _("Password is too easy (keyboard sequence).")
721
class DefaultExpression(object):
722
def __init__(self, exprstr):
724
self.value = eval(exprstr)
728
# Options that are not prefixed automatically with their
729
# group name, see below (at the options dict) for more
730
# information on the layout of this structure.
732
options_no_group_name = {
733
# =========================================================================
734
'attachment_extension': ("Mapping of attachment extensions to actions", None,
736
('extensions_mapping',
737
{'.tdraw': {'modify': 'twikidraw'},
738
'.adraw': {'modify': 'anywikidraw'},
739
}, "file extension -> do -> action"),
741
# ==========================================================================
742
'datastruct': ('Datastruct settings', None, (
743
('dicts', lambda cfg, request: datastruct.WikiDicts(request),
744
"function f(cfg, request) that returns a backend which is used to access dicts definitions."),
745
('groups', lambda cfg, request: datastruct.WikiGroups(request),
746
"function f(cfg, request) that returns a backend which is used to access groups definitions."),
748
# ==========================================================================
749
'session': ('Session settings', "Session-related settings, see HelpOnSessions.", (
750
('session_service', DefaultExpression('web.session.FileSessionService()'),
751
"The session service."),
752
('cookie_name', None,
753
'The variable part of the session cookie name. (None = determine from URL, siteidmagic = use siteid, any other string = use that)'),
754
('cookie_secure', None,
755
'Use secure cookie. (None = auto-enable secure cookie for https, True = ever use secure cookie, False = never use secure cookie).'),
756
('cookie_httponly', False,
757
'Use a httponly cookie that can only be used by the server, not by clientside scripts.'),
758
('cookie_domain', None,
759
'Domain used in the session cookie. (None = do not specify domain).'),
760
('cookie_path', None,
761
'Path used in the session cookie (None = auto-detect). Please only set if you know exactly what you are doing.'),
762
('cookie_lifetime', (0, 12),
763
'Session lifetime [h] of (anonymous, logged-in) users (see HelpOnSessions for details).'),
765
# ==========================================================================
766
'auth': ('Authentication / Authorization / Security settings', None, (
768
"List of trusted user names with wiki system administration super powers (not to be confused with ACL admin rights!). Used for e.g. software installation, language installation via SystemPagesSetup and more. See also HelpOnSuperUser."),
769
('auth', DefaultExpression('[MoinAuth()]'),
770
"list of auth objects, to be called in this order (see HelpOnAuthentication)"),
771
('auth_methods_trusted', ['http', 'given', 'xmlrpc_applytoken'], # Note: 'http' auth method is currently just a redirect to 'given'
772
'authentication methods for which users should be included in the special "Trusted" ACL group.'),
773
('secrets', None, """Either a long shared secret string used for multiple purposes or a dict {"purpose": "longsecretstring", ...} for setting up different shared secrets for different purposes. If you don't setup own secret(s), a secret string will be auto-generated from other config settings."""),
776
"if True, give all local users special powers - ''only use this for a local desktop wiki!''"),
779
"Class object hook for implementing security restrictions or relaxations"),
781
['xmlrpc', # we do not want wiki admins unknowingly offering xmlrpc service
782
'MyPages', # only works when used with a non-default SecurityPolicy (e.g. autoadmin)
783
'CopyPage', # has questionable behaviour regarding subpages a user can't read, but can copy
785
"Exclude unwanted actions (list of strings)"),
787
('allow_xslt', False,
788
"if True, enables XSLT processing via 4Suite (note that this enables anyone with enough know-how to insert '''arbitrary HTML''' into your wiki, which is why it defaults to `False`)"),
790
('password_checker', DefaultExpression('_default_password_checker'),
791
'checks whether a password is acceptable (default check is length >= 6, at least 4 different chars, no keyboard sequence, not username used somehow (you can switch this off by using `None`)'),
794
# ==========================================================================
795
'spam_leech_dos': ('Anti-Spam/Leech/DOS',
796
'These settings help limiting ressource usage and avoiding abuse.',
798
('hosts_deny', [], "List of denied IPs; if an IP ends with a dot, it denies a whole subnet (class A, B or C)"),
799
('surge_action_limits',
800
{# allow max. <count> <action> requests per <dt> secs
801
# action: (count, dt)
802
'all': (30, 30), # all requests (except cache/AttachFile action) count for this limit
803
'default': (30, 60), # default limit for actions without a specific limit
806
'raw': (20, 40), # some people use this for css
808
'fullsearch': (10, 120),
809
'edit': (30, 300), # can be lowered after making preview different from edit
811
# The following actions are often used for images - to avoid pages with lots of images
812
# (like photo galleries) triggering surge protection, we assign rather high limits:
813
'AttachFile': (300, 30),
814
'cache': (600, 30), # cache action is very cheap/efficient
816
"Surge protection tries to deny clients causing too much load/traffic, see HelpOnConfiguration/SurgeProtection."),
817
('surge_lockout_time', 3600, "time [s] someone gets locked out when ignoring the warnings"),
820
"Spam protection setup using site-specific questions/answers, see HelpOnSpam."),
821
('textchas_disabled_group', None,
822
"Name of a group of trusted users who do not get asked !TextCha questions."),
824
('antispam_master_url', "http://master.moinmo.in/?action=xmlrpc2",
825
"where antispam security policy fetches spam pattern updates (if it is enabled)"),
827
# a regex of HTTP_USER_AGENTS that should be excluded from logging
828
# and receive a FORBIDDEN for anything except viewing a page
829
# list must not contain 'java' because of twikidraw wanting to save drawing uses this useragent
831
('archiver|cfetch|charlotte|crawler|curl|gigabot|googlebot|heritrix|holmes|htdig|httrack|httpunit|'
832
'intelix|jeeves|larbin|leech|libwww-perl|linkbot|linkmap|linkwalk|litefinder|mercator|'
833
'microsoft.url.control|mirror| mj12bot|msnbot|msrbot|neomo|nutbot|omniexplorer|puf|robot|scooter|seekbot|'
834
'sherlock|slurp|sitecheck|snoopy|spider|teleport|twiceler|voilabot|voyager|webreaper|wget|yeti'),
835
"A regex of HTTP_USER_AGENTs that should be excluded from logging and are not allowed to use actions."),
837
('unzip_single_file_size', 2.0 * 1000 ** 2,
838
"max. size of a single file in the archive which will be extracted [bytes]"),
839
('unzip_attachments_space', 200.0 * 1000 ** 2,
840
"max. total amount of bytes can be used to unzip files [bytes]"),
841
('unzip_attachments_count', 101,
842
"max. number of files which are extracted from the zip file"),
844
# ==========================================================================
845
'style': ('Style / Theme / UI related',
846
'These settings control how the wiki user interface will look like.',
848
('sitename', u'Untitled Wiki',
849
"Short description of your wiki site, displayed below the logo on each page, and used in RSS documents as the channel title [Unicode]"),
850
('interwikiname', None, "unique and stable InterWiki name (prefix, moniker) of the site [Unicode], or None"),
851
('logo_string', None, "The wiki logo top of page, HTML is allowed (`<img>` is possible as well) [Unicode]"),
852
('html_pagetitle', None, "Allows you to set a specific HTML page title (if None, it defaults to the value of `sitename`)"),
853
('navi_bar', [u'RecentChanges', u'FindPage', u'HelpContents', ],
854
'Most important page names. Users can add more names in their quick links in user preferences. To link to URL, use `u"[[url|link title]]"`, to use a shortened name for long page name, use `u"[[LongLongPageName|title]]"`. [list of Unicode strings]'),
856
('theme_default', 'modernized',
857
"the name of the theme that is used by default (see HelpOnThemes)"),
858
('theme_force', False,
859
"if True, do not allow to change the theme"),
862
"List of tuples (media, csshref) to insert after theme css, before user css, see HelpOnThemes."),
864
('supplementation_page', False,
865
"if True, show a link to the supplementation page in the theme"),
866
('supplementation_page_name', u'Discussion',
867
"default name of the supplementation (sub)page [unicode]"),
868
('supplementation_page_template', u'DiscussionTemplate',
869
"default template used for creation of the supplementation page [unicode]"),
871
('interwiki_preferred', [], "In dialogues, show those wikis at the top of the list."),
872
('sistersites', [], "list of tuples `('WikiName', 'sisterpagelist_fetch_url')`"),
875
"Number of pages in the trail of visited pages"),
877
('page_footer1', '', "Custom HTML markup sent ''before'' the system footer."),
878
('page_footer2', '', "Custom HTML markup sent ''after'' the system footer."),
879
('page_header1', '', "Custom HTML markup sent ''before'' the system header / title area but after the body tag."),
880
('page_header2', '', "Custom HTML markup sent ''after'' the system header / title area (and body tag)."),
882
('changed_time_fmt', '%H:%M', "Time format used on Recent``Changes for page edits within the last 24 hours"),
883
('date_fmt', '%Y-%m-%d', "System date format, used mostly in Recent``Changes"),
884
('datetime_fmt', '%Y-%m-%d %H:%M:%S', 'Default format for dates and times (when the user has no preferences or chose the "default" date format)'),
885
('chart_options', None, "If you have gdchart, use something like chart_options = {'width': 720, 'height': 540}"),
887
('edit_bar', ['Edit', 'Comments', 'Discussion', 'Info', 'Subscribe', 'Quicklink', 'Attachments', 'ActionsMenu'],
888
'list of edit bar entries'),
889
('history_count', (100, 200, 5, 10, 25, 50), "Number of revisions shown for info/history action (default_count_shown, max_count_shown, [other values shown as page size choices]). At least first two values (default and maximum) should be provided. If additional values are provided, user will be able to change number of items per page in the UI."),
890
('history_paging', True, "Enable paging functionality for info action's history display."),
893
"if True, show host names and IPs. Set to False to hide them."),
894
('show_interwiki', False,
895
"if True, let the theme display your interwiki name"),
897
"if True, show user names in the revision history and on Recent``Changes. Set to False to hide them."),
898
('show_section_numbers', False,
899
'show section numbers in headings by default'),
900
('show_timings', False, "show some timing values at bottom of a page"),
901
('show_version', False, "show moin's version at the bottom of a page"),
902
('show_rename_redirect', False, "if True, offer creation of redirect pages when renaming wiki pages"),
904
('packagepages_actions_excluded',
905
['setthemename', # related to questionable theme stuff, see below
906
'copythemefile', # maybe does not work, e.g. if no fs write permissions or real theme file path is unknown to moin
907
'installplugin', # code installation, potentially dangerous
908
'renamepage', # dangerous with hierarchical acls
909
'deletepage', # dangerous with hierarchical acls
910
'delattachment', # dangerous, no revisioning
912
'list with excluded package actions (e.g. because they are dangerous / questionable)'),
916
'<a href="http://moinmo.in/" title="This site uses the MoinMoin Wiki software.">MoinMoin Powered</a>',
917
'<a href="http://moinmo.in/Python" title="MoinMoin is written in Python.">Python Powered</a>',
918
'<a href="http://moinmo.in/GPL" title="MoinMoin is GPL licensed.">GPL licensed</a>',
919
'<a href="http://validator.w3.org/check?uri=referer" title="Click here to validate this page.">Valid HTML 4.01</a>',
921
'list with html fragments with logos or strings for crediting.'),
923
# These icons will show in this order in the iconbar, unless they
924
# are not relevant, e.g email icon when the wiki is not configured
926
('page_iconbar', ["up", "edit", "view", "diff", "info", "subscribe", "raw", "print", ],
927
'list of icons to show in iconbar, valid values are only those in page_icons_table. Available only in classic theme.'),
929
# Standard buttons in the iconbar
932
# key pagekey, querystr dict, title, icon-key
933
'diff': ('page', {'action': 'diff'}, _("Diffs"), "diff"),
934
'info': ('page', {'action': 'info'}, _("Info"), "info"),
935
'edit': ('page', {'action': 'edit'}, _("Edit"), "edit"),
936
'unsubscribe': ('page', {'action': 'unsubscribe'}, _("UnSubscribe"), "unsubscribe"),
937
'subscribe': ('page', {'action': 'subscribe'}, _("Subscribe"), "subscribe"),
938
'raw': ('page', {'action': 'raw'}, _("Raw"), "raw"),
939
'xml': ('page', {'action': 'show', 'mimetype': 'text/xml'}, _("XML"), "xml"),
940
'print': ('page', {'action': 'print'}, _("Print"), "print"),
941
'view': ('page', {}, _("View"), "view"),
942
'up': ('page_parent_page', {}, _("Up"), "up"),
944
"dict of {'iconname': (url, title, icon-img-key), ...}. Available only in classic theme."),
947
# ==========================================================================
948
'editor': ('Editor related', None, (
949
('editor_default', 'text', "Editor to use by default, 'text' or 'gui'"),
950
('editor_force', False, "if True, force using the default editor"),
951
('editor_ui', 'freechoice', "Editor choice shown on the user interface, 'freechoice' or 'theonepreferred'"),
952
('page_license_enabled', False, 'if True, show a license hint in page editor.'),
953
('page_license_page', u'WikiLicense', 'Page linked from the license hint. [Unicode]'),
954
('edit_locking', 'warn 10', "Editor locking policy: `None`, `'warn <timeout in minutes>'`, or `'lock <timeout in minutes>'`"),
955
('edit_ticketing', True, None),
956
('edit_rows', 20, "Default height of the edit box"),
959
# ==========================================================================
960
'paths': ('Paths', None, (
961
('data_dir', './data/', "Path to the data directory containing your (locally made) wiki pages."),
962
('data_underlay_dir', './underlay/', "Path to the underlay directory containing distribution system and help pages."),
963
('cache_dir', None, "Directory for caching, by default computed from `data_dir`/cache."),
964
('session_dir', None, "Directory for session storage, by default computed to be `cache_dir`/__session__."),
965
('user_dir', None, "Directory for user storage, by default computed to be `data_dir`/user."),
966
('plugin_dir', None, "Plugin directory, by default computed to be `data_dir`/plugin."),
967
('plugin_dirs', [], "Additional plugin directories."),
969
('docbook_html_dir', r"/usr/share/xml/docbook/stylesheet/nwalsh/html/",
970
'Path to the directory with the Docbook to HTML XSLT files (optional, used by the docbook parser). The default value is correct for Debian Etch.'),
971
('shared_intermap', None,
972
"Path to a file containing global InterWiki definitions (or a list of such filenames)"),
974
# ==========================================================================
975
'urls': ('URLs', None, (
976
# includes the moin version number, so we can have a unlimited cache lifetime
977
# for the static stuff. if stuff changes on version upgrade, url will change
978
# immediately and we have no problem with stale caches.
979
('url_prefix_static', config.url_prefix_static,
980
"used as the base URL for icons, css, etc. - includes the moin version number and changes on every release. This replaces the deprecated and sometimes confusing `url_prefix = '/wiki'` setting."),
981
('url_prefix_local', None,
982
"used as the base URL for some Javascript - set this to a URL on same server as the wiki if your url_prefix_static points to a different server."),
983
('url_prefix_fckeditor', None,
984
"used as the base URL for FCKeditor - similar to url_prefix_local, but just for FCKeditor."),
986
('url_prefix_action', None,
987
"Use 'action' to enable action URL generation to be compatible with robots.txt. It will generate .../action/info/PageName?action=info then. Recommended for internet wikis."),
989
('notification_bot_uri', None, "URI of the Jabber notification bot."),
992
"lookup table to remap URL prefixes (dict of {{{'prefix': 'replacement'}}}); especially useful in intranets, when whole trees of externally hosted documents move around"),
995
# ==========================================================================
996
'pages': ('Special page names', None, (
997
('page_front_page', u'LanguageSetup',
998
"Name of the front page. We don't expect you to keep the default. Just read LanguageSetup in case you're wondering... [Unicode]"),
1000
# the following regexes should match the complete name when used in free text
1001
# the group 'all' shall match all, while the group 'key' shall match the key only
1002
# e.g. CategoryFoo -> group 'all' == CategoryFoo, group 'key' == Foo
1003
# moin's code will add ^ / $ at beginning / end when needed
1004
('page_category_regex', ur'(?P<all>Category(?P<key>(?!Template)\S+))',
1005
'Pagenames exactly matching this regex are regarded as Wiki categories [Unicode]'),
1006
('page_dict_regex', ur'(?P<all>(?P<key>\S+)Dict)',
1007
'Pagenames exactly matching this regex are regarded as pages containing variable dictionary definitions [Unicode]'),
1008
('page_group_regex', ur'(?P<all>(?P<key>\S+)Group)',
1009
'Pagenames exactly matching this regex are regarded as pages containing group definitions [Unicode]'),
1010
('page_template_regex', ur'(?P<all>(?P<key>\S+)Template)',
1011
'Pagenames exactly matching this regex are regarded as pages containing templates for new pages [Unicode]'),
1013
('page_local_spelling_words', u'LocalSpellingWords',
1014
'Name of the page containing user-provided spellchecker words [Unicode]'),
1016
# ==========================================================================
1017
'user': ('User Preferences related', None, (
1018
('quicklinks_default', [],
1019
'List of preset quicklinks for a newly created user accounts. Existing accounts are not affected by this option whereas changes in navi_bar do always affect existing accounts. Preset quicklinks can be removed by the user in the user preferences menu, navi_bar settings not.'),
1020
('subscribed_pages_default', [],
1021
"List of pagenames used for presetting page subscriptions for newly created user accounts."),
1023
('email_subscribed_events_default',
1025
PageChangedEvent.__name__,
1026
PageRenamedEvent.__name__,
1027
PageDeletedEvent.__name__,
1028
PageCopiedEvent.__name__,
1029
PageRevertedEvent.__name__,
1030
FileAttachedEvent.__name__,
1032
('jabber_subscribed_events_default', [], None),
1035
"default time zone offset in hours from UTC"),
1037
('userprefs_disabled', [],
1038
"Disable the listed user preferences plugins."),
1040
# ==========================================================================
1041
'various': ('Various', None, (
1042
('bang_meta', True, 'if True, enable {{{!NoWikiName}}} markup'),
1043
('caching_formats', ['text_html'], "output formats that are cached; set to [] to turn off caching (useful for development)"),
1045
('config_check_enabled', False, "if True, check configuration for unknown settings."),
1047
('default_markup', 'wiki', 'Default page parser / format (name of module in `MoinMoin.parser`)'),
1049
('html_head', '', "Additional <HEAD> tags, see HelpOnThemes."),
1050
('html_head_queries', '<meta name="robots" content="noindex,nofollow">\n',
1051
"Additional <HEAD> tags for requests with query strings, like actions."),
1052
('html_head_posts', '<meta name="robots" content="noindex,nofollow">\n',
1053
"Additional <HEAD> tags for POST requests."),
1054
('html_head_index', '<meta name="robots" content="index,follow">\n',
1055
"Additional <HEAD> tags for some few index pages."),
1056
('html_head_normal', '<meta name="robots" content="index,nofollow">\n',
1057
"Additional <HEAD> tags for most normal pages."),
1059
('language_default', 'en', "Default language for user interface and page content, see HelpOnLanguages."),
1060
('language_ignore_browser', False, "if True, ignore user's browser language settings, see HelpOnLanguages."),
1062
('log_remote_addr', True,
1063
"if True, log the remote IP address (and maybe hostname)."),
1064
('log_reverse_dns_lookups', True,
1065
"if True, do a reverse DNS lookup on page SAVE. If your DNS is broken, set this to False to speed up SAVE."),
1066
('log_timing', False,
1067
"if True, add timing infos to the log output to analyse load conditions"),
1069
# some dangerous mimetypes (we don't use "content-disposition: inline" for them when a user
1070
# downloads such attachments, because the browser might execute e.g. Javascript contained
1071
# in the HTML and steal your moin session cookie or do other nasty stuff)
1072
('mimetypes_xss_protect',
1075
'application/x-shockwave-flash',
1076
'application/xhtml+xml',
1078
'"content-disposition: inline" isn\'t used for them when a user downloads such attachments'),
1082
'application/x-dvi',
1083
'application/postscript',
1086
'application/vnd.visio',
1090
'image/x-photoshop',
1101
'mimetypes that can be embedded by the [[HelpOnMacros/EmbedObject|EmbedObject macro]]'),
1104
"refresh = (minimum_delay_s, targets_allowed) enables use of `#refresh 5 PageName` processing instruction, targets_allowed must be either `'internal'` or `'external'`"),
1105
('rss_cache', 60, "suggested caching time for Recent''''''Changes RSS, in second"),
1107
('search_results_per_page', 25, "Number of hits shown per page in the search results"),
1109
('siteid', 'default', None),
1114
# The 'options' dict carries default MoinMoin options. The dict is a
1115
# group name to tuple mapping.
1116
# Each group tuple consists of the following items:
1117
# group section heading, group help text, option list
1119
# where each 'option list' is a tuple or list of option tuples
1121
# each option tuple consists of
1122
# option name, default value, help text
1124
# All the help texts will be displayed by the WikiConfigHelp() macro.
1126
# Unlike the options_no_group_name dict, option names in this dict
1127
# are automatically prefixed with "group name '_'" (i.e. the name of
1128
# the group they are in and an underscore), e.g. the 'hierarchic'
1129
# below creates an option called "acl_hierarchic".
1131
# If you need to add a complex default expression that results in an
1132
# object and should not be shown in the __repr__ form in WikiConfigHelp(),
1133
# you can use the DefaultExpression class, see 'auth' above for example.
1137
'acl': ('Access control lists',
1138
'ACLs control who may do what, see HelpOnAccessControlLists.',
1140
('hierarchic', False, 'True to use hierarchical ACLs'),
1141
('rights_default', u"Trusted:read,write,delete,revert Known:read,write,delete,revert All:read,write",
1142
"ACL used if no ACL is specified on the page"),
1143
('rights_before', u"",
1144
"ACL that is processed before the on-page/default ACL"),
1145
('rights_after', u"",
1146
"ACL that is processed after the on-page/default ACL"),
1147
('rights_valid', ['read', 'write', 'delete', 'revert', 'admin'],
1148
"Valid tokens for right sides of ACL entries."),
1151
'xapian': ('Xapian search', "Configuration of the Xapian based indexed search, see HelpOnXapian.", (
1153
"True to enable the fast, indexed search (based on the Xapian search library)"),
1155
"Directory where the Xapian search index is stored (None = auto-configure wiki local storage)"),
1157
"True to enable Xapian word stemmer usage for indexing / searching."),
1158
('index_history', False,
1159
"True to enable indexing of non-current page revisions."),
1162
'user': ('Users / User settings', None, (
1163
('email_unique', True,
1164
"if True, check email addresses for uniqueness and don't accept duplicates."),
1165
('jid_unique', True,
1166
"if True, check Jabber IDs for uniqueness and don't accept duplicates."),
1168
('homewiki', u'Self',
1169
"interwiki name of the wiki where the user home pages are located [Unicode] - useful if you have ''many'' users. You could even link to nonwiki \"user pages\" if the wiki username is in the target URL."),
1173
('mailto_author', lambda _: _('Publish my email (not my wiki homepage) in author info')),
1174
('edit_on_doubleclick', lambda _: _('Open editor on double click')),
1175
('remember_last_visit', lambda _: _('After login, jump to last visited page')),
1176
('show_comments', lambda _: _('Show comment sections')),
1177
('show_nonexist_qm', lambda _: _('Show question mark for non-existing pagelinks')),
1178
('show_page_trail', lambda _: _('Show page trail')),
1179
('show_toolbar', lambda _: _('Show icon toolbar')),
1180
('show_topbottom', lambda _: _('Show top/bottom links in headings')),
1181
('show_fancy_diff', lambda _: _('Show fancy diffs')),
1182
('wikiname_add_spaces', lambda _: _('Add spaces to displayed wiki names')),
1183
('remember_me', lambda _: _('Remember login information')),
1185
('disabled', lambda _: _('Disable this account forever')),
1186
# if an account is disabled, it may be used for looking up
1187
# id -> username for page info and recent changes, but it
1188
# is not usable for the user any more:
1190
"Describes user preferences, see HelpOnConfiguration/UserPreferences."),
1192
('checkbox_defaults',
1195
'edit_on_doubleclick': 1,
1196
'remember_last_visit': 0,
1198
'show_nonexist_qm': False,
1199
'show_page_trail': 1,
1201
'show_topbottom': 0,
1202
'show_fancy_diff': 1,
1203
'wikiname_add_spaces': 0,
1206
"Defaults for user preferences, see HelpOnConfiguration/UserPreferences."),
1208
('checkbox_disable', [],
1209
"Disable user preferences, see HelpOnConfiguration/UserPreferences."),
1211
('checkbox_remove', [],
1212
"Remove user preferences, see HelpOnConfiguration/UserPreferences."),
1216
('name', _('Name'), "text", "36", _("(Use FirstnameLastname)")),
1217
('aliasname', _('Alias-Name'), "text", "36", ''),
1218
('email', _('Email'), "text", "36", ''),
1219
('jid', _('Jabber ID'), "text", "36", ''),
1220
('css_url', _('User CSS URL'), "text", "40", _('(Leave it empty for disabling user CSS)')),
1221
('edit_rows', _('Editor size'), "text", "3", ''),
1226
{# key: default - do NOT remove keys from here!
1238
('form_disable', [], "list of field names used to disable user preferences form fields"),
1240
('form_remove', [], "list of field names used to remove user preferences form fields"),
1242
('transient_fields',
1243
['id', 'valid', 'may', 'auth_username', 'password', 'password2', 'auth_method', 'auth_attribs', ],
1244
"User object attributes that are not persisted to permanent storage (internal use)."),
1247
'openidrp': ('OpenID Relying Party',
1248
'These settings control the built-in OpenID Relying Party (client).',
1250
('allowed_op', [], "List of forced providers"),
1253
'openid_server': ('OpenID Server',
1254
'These settings control the built-in OpenID Identity Provider (server).',
1256
('enabled', False, "True to enable the built-in OpenID server."),
1257
('restricted_users_group', None, "If set to a group name, the group members are allowed to use the wiki as an OpenID provider. (None = allow for all users)"),
1258
('enable_user', False, "If True, the OpenIDUser processing instruction is allowed."),
1261
'mail': ('Mail settings',
1262
'These settings control outgoing and incoming email from and to the wiki.',
1264
('from', None, "Used as From: address for generated mail."),
1265
('login', None, "'username userpass' for SMTP server authentication (None = don't use auth)."),
1266
('smarthost', None, "Address of SMTP server to use for sending mail (None = don't use SMTP server)."),
1267
('sendmail', None, "sendmail command to use for sending mail (None = don't use sendmail)"),
1269
('import_subpage_template', u"$from-$date-$subject", "Create subpages using this template when importing mail."),
1270
('import_pagename_search', ['subject', 'to', ], "Where to look for target pagename specification."),
1271
('import_pagename_envelope', u"%s", "Use this to add some fixed prefix/postfix to the generated target pagename."),
1272
('import_pagename_regex', r'\[\[([^\]]*)\]\]', "Regular expression used to search for target pagename specification."),
1273
('import_wiki_addrs', [], "Target mail addresses to consider when importing mail"),
1276
'backup': ('Backup settings',
1277
'These settings control how the backup action works and who is allowed to use it.',
1279
('compression', 'gz', 'What compression to use for the backup ("gz" or "bz2").'),
1280
('users', [], 'List of trusted user names who are allowed to get a backup.'),
1281
('include', [], 'List of pathes to backup.'),
1282
('exclude', lambda self, filename: False, 'Function f(self, filename) that tells whether a file should be excluded from backup. By default, nothing is excluded.'),
1286
def _add_options_to_defconfig(opts, addgroup=True):
1287
for groupname in opts:
1288
group_short, group_doc, group_opts = opts[groupname]
1289
for name, default, doc in group_opts:
1291
name = groupname + '_' + name
1292
if isinstance(default, DefaultExpression):
1293
default = default.value
1294
setattr(DefaultConfig, name, default)
1296
_add_options_to_defconfig(options)
1297
_add_options_to_defconfig(options_no_group_name, False)
1299
1075
# remove the gettext pseudo function