annotate wikiconfig.py @ 4720:9a26c69ccf5a

merged moin/1.8
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 01 May 2009 21:36:12 +0200
parents fb5abe50c6d2 913bb9697449
children 25c99926e6aa
rev   line source
1597
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
2 """MoinMoin Desktop Edition (MMDE) - Configuration
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
3
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4 ONLY to be used for MMDE - if you run a personal wiki on your notebook or PC.
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
5
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
6 This is NOT intended for internet or server or multiuser use due to relaxed security settings!
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
7 """
4624
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
8
1599
c001386fc59b fix moin.py and wikiconfig.py, move MMDE wikiconfig.py to toplevel dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1597
diff changeset
9 import sys, os
4624
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
10
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
11 from MoinMoin.config import multiconfig, url_prefix_static
1597
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
12
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2244
diff changeset
13
4624
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
14 class LocalConfig(multiconfig.DefaultConfig):
1597
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
15 # vvv DON'T TOUCH THIS EXCEPT IF YOU KNOW WHAT YOU DO vvv
4624
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
16 # Directory containing THIS wikiconfig:
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
17 wikiconfig_dir = os.path.abspath(os.path.dirname(__file__))
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
18
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
19 # We assume this structure for a simple "unpack and run" scenario:
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
20 # wikiconfig.py
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
21 # wiki/
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
22 # data/
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
23 # underlay/
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
24 # If that's not true, feel free to just set instance_dir to the real path
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
25 # where data/ and underlay/ is located:
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
26 #instance_dir = '/where/ever/your/instance/is'
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
27 instance_dir = os.path.join(wikiconfig_dir, 'wiki')
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
28
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
29 # Where your own wiki pages are (make regular backups of this directory):
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
30 data_dir = os.path.join(instance_dir, 'data', '') # path with trailing /
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
31
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
32 # Where system and help pages are (you may exclude this from backup):
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
33 data_underlay_dir = os.path.join(instance_dir, 'underlay', '') # path with trailing /
1597
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
34
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
35 DesktopEdition = True # give all local users full powers
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
36 acl_rights_default = u"All:read,write,delete,revert,admin"
1602
f5773070c915 mmde: disable surge protection
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1600
diff changeset
37 surge_action_limits = None # no surge protection
1597
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
38 sitename = u'MoinMoin DesktopEdition'
4624
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
39 logo_string = u'<img src="%s/common/moinmoin.png" alt="MoinMoin Logo">' % url_prefix_static
1597
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
40 page_front_page = u'FrontPage' # change to some better value
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
41 # ^^^ DON'T TOUCH THIS EXCEPT IF YOU KNOW WHAT YOU DO ^^^
bbe187af4fc0 integrated MMDE (build scripts need more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
42
3423
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
43 # Add your configuration items here.
3873
e5a9570d3001 secrets configuration refactored - see the snippet for an example usage
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3762
diff changeset
44 secrets = 'This string is NOT a secret, please make up your own, long, random secret string!'
3423
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
45
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
46
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
47 # DEVELOPERS! Do not add your configuration items there,
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
48 # you could accidentally commit them! Instead, create a
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
49 # wikiconfig_local.py file containing this:
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
50 #
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
51 # from wikiconfig import LocalConfig
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
52 #
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
53 # class Config(LocalConfig):
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
54 # configuration_item_1 = 'value1'
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
55 #
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
56
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
57 try:
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
58 from wikiconfig_local import Config
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
59 except ImportError, err:
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
60 if not str(err).endswith('wikiconfig_local'):
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
61 raise
6fa56b0f0de4 re-add wikiconfig_local a bit differently
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3173
diff changeset
62 Config = LocalConfig
4624
fb5abe50c6d2 wikiconfig/farmconfig: improve values for data(_underlay)_dir, make logo work automatically, fix wiki regex samples in farmconfig
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4549
diff changeset
63