annotate MoinMoin/config/__init__.py @ 6133:a6283e189869 tip

fixup: remove nonexisting passlib.utils._blowfish this was removed by the passlib 1.7.1 upgrade.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 01 Jun 2017 18:10:19 +0200
parents 25900eaeb864
children
rev   line source
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
2 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
3 MoinMoin - site-wide configuration defaults (NOT per single wiki!)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
4
1918
bb2e053067fb fixing copyright headers: remove umlauts (encoding troubles), make epydoc compatible, reformat
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1795
diff changeset
5 @copyright: 2005-2006 MoinMoin:ThomasWaldmann
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
6 @license: GNU GPL, see COPYING for details.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
7 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
8 import re
1582
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
9 from MoinMoin import version
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
10
1795
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
11 # unicode: set the char types (upper, lower, digits, spaces)
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
12 from MoinMoin.util.chartypes import *
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
13
3338
5f660b3c1cd7 moved browser_supported_images to config and exchanged it
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3110
diff changeset
14 # List of image types browser do support regulary
4735
5eccbe592847 fix pep8 issue
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4734
diff changeset
15 browser_supported_images = ('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', )
3338
5f660b3c1cd7 moved browser_supported_images to config and exchanged it
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3110
diff changeset
16
3339
a07ac5a0811e moved definition of text mimetype for parsers into config
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3338
diff changeset
17 # Parser to use mimetype text
a07ac5a0811e moved definition of text mimetype for parsers into config
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3338
diff changeset
18 parser_text_mimetype = ('plain', 'csv', 'rst', 'docbook', 'latex', 'tex', 'html', 'css',
a07ac5a0811e moved definition of text mimetype for parsers into config
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3338
diff changeset
19 'xml', 'python', 'perl', 'php', 'ruby', 'javascript',
a07ac5a0811e moved definition of text mimetype for parsers into config
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3338
diff changeset
20 'cplusplus', 'java', 'pascal', 'diff', 'gettext', 'xslt', 'creole', )
a07ac5a0811e moved definition of text mimetype for parsers into config
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3338
diff changeset
21
1011
58f5af49cd03 move config and multiconfig to config/ package, see HINT in CHANGES
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 734
diff changeset
22 # When creating files, we use e.g. 0666 & config.umask for the mode:
58f5af49cd03 move config and multiconfig to config/ package, see HINT in CHANGES
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 734
diff changeset
23 umask = 0770
58f5af49cd03 move config and multiconfig to config/ package, see HINT in CHANGES
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 734
diff changeset
24
5922
25900eaeb864 passlib integration - enhanced password hash security
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5369
diff changeset
25 # list of acceptable password hashing schemes for cfg.password_scheme,
25900eaeb864 passlib integration - enhanced password hash security
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5369
diff changeset
26 # here we only give reasonably good schemes, which is passlib (if we
25900eaeb864 passlib integration - enhanced password hash security
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5369
diff changeset
27 # have passlib) and ssha (if we only have builtin stuff):
25900eaeb864 passlib integration - enhanced password hash security
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5369
diff changeset
28 password_schemes_configurable = ['{PASSLIB}', '{SSHA}', ]
25900eaeb864 passlib integration - enhanced password hash security
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5369
diff changeset
29
25900eaeb864 passlib integration - enhanced password hash security
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5369
diff changeset
30 # ordered list of supported password hashing schemes, best (passlib) should be
25900eaeb864 passlib integration - enhanced password hash security
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5369
diff changeset
31 # first, best builtin one should be second. this is what we support if we
25900eaeb864 passlib integration - enhanced password hash security
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5369
diff changeset
32 # encounter it in user profiles:
25900eaeb864 passlib integration - enhanced password hash security
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5369
diff changeset
33 password_schemes_supported = password_schemes_configurable + ['{SHA}', '{APR1}', '{MD5}', '{DES}', ]
25900eaeb864 passlib integration - enhanced password hash security
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5369
diff changeset
34
1582
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
35 # Default value for the static stuff URL prefix (css, img, js).
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
36 # Caution:
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
37 # * do NOT use this directly, it is only the DEFAULT value to be used by
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
38 # server Config classes and by multiconfig.py for request.cfg.
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
39 # * must NOT end with '/'!
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
40 # * some servers expect '/' at beginning and only 1 level deep.
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
41 url_prefix_static = '/moin_static' + version.release_short
f37b49b6313d url_prefix_static: move default to MoinMoin.config, use matching defaults for Twisted/standalone
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1011
diff changeset
42
1795
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
43 # Threads flag - if you write a moin server that use threads, import
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
44 # config in the server and set this flag to True.
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
45 use_threads = False
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
46
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
47 # Charset - we support only 'utf-8'. While older encodings might work,
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
48 # we don't have the resources to test them, and there is no real
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
49 # benefit for the user. IMPORTANT: use only lowercase 'utf-8'!
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
50 charset = 'utf-8'
94887c1c1e8f direct import from chartypes, reorder config.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1582
diff changeset
51
2250
07fdbda38be2 move split_regex to config (so it is compiled only once)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2187
diff changeset
52 # Regex to find lower->upper transitions (word boundaries in WikiNames), used by split_title
2251
4197965b0820 fix: use re.UNICODE for split_regex
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2250
diff changeset
53 split_regex = re.compile('([%s])([%s])' % (chars_lower, chars_upper), re.UNICODE)
2250
07fdbda38be2 move split_regex to config (so it is compiled only once)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2187
diff changeset
54
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
55 # Invalid characters - invisible characters that should not be in page
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
56 # names. Prevent user confusion and wiki abuse, e.g u'\u202aFrontPage'.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
57 page_invalid_chars_regex = re.compile(
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
58 ur"""
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
59 \u0000 | # NULL
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
60
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
61 # Bidi control characters
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
62 \u202A | # LRE
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
63 \u202B | # RLE
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
64 \u202C | # PDF
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
65 \u202D | # LRM
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
66 \u202E # RLM
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
67 """,
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
68 re.UNICODE | re.VERBOSE
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
69 )
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
70
1922
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
71 # used for wikiutil.clean_input
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
72 clean_input_translation_map = {
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
73 # these chars will be replaced by blanks
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
74 ord(u'\t'): u' ',
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
75 ord(u'\r'): u' ',
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
76 ord(u'\n'): u' ',
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
77 }
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
78 for c in u'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f' \
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
79 '\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f':
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
80 # these chars will be removed
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
81 clean_input_translation_map[ord(c)] = None
2187
15c11fe8f6b2 config/multiconfig: minor cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1949
diff changeset
82 del c
1922
f486526720c5 renamed wikiutil.clean_comment > clean_input, moved translation map to config
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
83
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
84 # Other stuff
3052
1d3e65884337 copy moin wiki parser and its tests from 1.6 branch (cs 2558:3e3a549b49f0), keep _heading_repl from 1.7, update interwiki map to make tests happy
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2251
diff changeset
85 url_schemas = ['http', 'https', 'ftp', 'file',
1d3e65884337 copy moin wiki parser and its tests from 1.6 branch (cs 2558:3e3a549b49f0), keep _heading_repl from 1.7, update interwiki map to make tests happy
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2251
diff changeset
86 'mailto', 'nntp', 'news',
4672
357ad7160d15 add mumble protocol (nice and good quality F/OSS VOIP conference chat software)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3621
diff changeset
87 'ssh', 'telnet', 'irc', 'ircs', 'xmpp', 'mumble',
5121
939ff5ed921a Add apt protocol to url_schemas
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4930
diff changeset
88 'webcal', 'ed2k', 'apt', 'rootz',
4930
de0f87166f1c add gopher protocol to url_schemas
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4735
diff changeset
89 'gopher',
3508
87c26058d9c0 enable notes: protocol for URLs (for Lotus Notes)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3339
diff changeset
90 'notes',
5369
31c27d72ad9c config.__init__: rtp, rtcp added to url_schemas
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 5366
diff changeset
91 'rtp', 'rtsp', 'rtcp',
3052
1d3e65884337 copy moin wiki parser and its tests from 1.6 branch (cs 2558:3e3a549b49f0), keep _heading_repl from 1.7, update interwiki map to make tests happy
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2251
diff changeset
92 ]
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
93
734
bf2435e61f97 moved smileys from MoinMoin.config to theme, fixed smiley text_python caching bug
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 729
diff changeset
94 smileys = (r"X-( :D <:( :o :( :) B) :)) ;) /!\ <!> (!) :-? :\ >:> |) " +
bf2435e61f97 moved smileys from MoinMoin.config to theme, fixed smiley text_python caching bug
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 729
diff changeset
95 r":-( :-) B-) :-)) ;-) |-) (./) {OK} {X} {i} {1} {2} {3} {*} {o}").split()