annotate wikiserverconfig.py @ 4618:0e7c007f8ed9

handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 01 Mar 2009 15:07:39 +0100
parents e7f1cf9eeb96
children 7000bf88e348
rev   line source
3495
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
1 """
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
2 Standalone server configuration, you can either use this file or
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
3 commandline options to configure server options.
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4 """
4605
edb6cb2cac43 Environment variable MOIN_DEBUGGER=True will enable werkzeug's debugger for the standalone wikiserver
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3495
diff changeset
5 import os
3495
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
6
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
7 from MoinMoin.script.server.standalone import DefaultConfig
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
8
4618
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
9 class LocalConfig(DefaultConfig):
3495
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
10 port = 8080 # if you use port < 1024, you need to start as root
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
11
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
12 # if you start the server as root, the standalone server can change
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
13 # to this user and group, e.g. 'www-data'
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
14 #user = ''
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
15 #group = ''
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
16
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
17 # use '' for all interface or "1.2.3.4" for some specific IP
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
18 #interface = 'localhost'
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
19
4613
e7f1cf9eeb96 Static file serving built-in (see details below).
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4605
diff changeset
20 # where the static data is served from - you can either use:
e7f1cf9eeb96 Static file serving built-in (see details below).
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4605
diff changeset
21 # docs = True # serve the builtin static data from MoinMoin/web/static/htdocs
e7f1cf9eeb96 Static file serving built-in (see details below).
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4605
diff changeset
22 # docs = '/where/ever/you/like/to/keep/htdocs' # serve it from the given path
e7f1cf9eeb96 Static file serving built-in (see details below).
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4605
diff changeset
23 # docs = False # do not serve static files at all (will not work except
e7f1cf9eeb96 Static file serving built-in (see details below).
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4605
diff changeset
24 # # you serve them in some other working way)
e7f1cf9eeb96 Static file serving built-in (see details below).
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4605
diff changeset
25 docs = True
3495
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
26
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
27 # tuning options:
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
28 #serverClass = 'ThreadPoolServer'
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
29 #threadLimit = 10
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
30 #requestQueueSize = 50
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
31
4605
edb6cb2cac43 Environment variable MOIN_DEBUGGER=True will enable werkzeug's debugger for the standalone wikiserver
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3495
diff changeset
32 # Use werkzeug's debugging middleware?
edb6cb2cac43 Environment variable MOIN_DEBUGGER=True will enable werkzeug's debugger for the standalone wikiserver
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3495
diff changeset
33 # debug can be either set to True or False to directly enable/disable
edb6cb2cac43 Environment variable MOIN_DEBUGGER=True will enable werkzeug's debugger for the standalone wikiserver
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3495
diff changeset
34 # the debugger.
edb6cb2cac43 Environment variable MOIN_DEBUGGER=True will enable werkzeug's debugger for the standalone wikiserver
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3495
diff changeset
35 # CAUTION: Do not use True for production environments as it might disclose
edb6cb2cac43 Environment variable MOIN_DEBUGGER=True will enable werkzeug's debugger for the standalone wikiserver
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3495
diff changeset
36 # sensitive informations and even enable doing evil things from the
edb6cb2cac43 Environment variable MOIN_DEBUGGER=True will enable werkzeug's debugger for the standalone wikiserver
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3495
diff changeset
37 # debugger's web interface!
edb6cb2cac43 Environment variable MOIN_DEBUGGER=True will enable werkzeug's debugger for the standalone wikiserver
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3495
diff changeset
38 # For convenience, the default behaviour (see below) is to read the
edb6cb2cac43 Environment variable MOIN_DEBUGGER=True will enable werkzeug's debugger for the standalone wikiserver
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3495
diff changeset
39 # environment variable MOIN_DEBUGGER. Setting it to True will enable the
edb6cb2cac43 Environment variable MOIN_DEBUGGER=True will enable werkzeug's debugger for the standalone wikiserver
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3495
diff changeset
40 # debugger, anything else (or not setting it) will disable the debugger.
edb6cb2cac43 Environment variable MOIN_DEBUGGER=True will enable werkzeug's debugger for the standalone wikiserver
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3495
diff changeset
41 debug = os.environ.get('MOIN_DEBUGGER', 'False') == 'True'
edb6cb2cac43 Environment variable MOIN_DEBUGGER=True will enable werkzeug's debugger for the standalone wikiserver
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3495
diff changeset
42
4618
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
43 # DEVELOPERS! Do not add your configuration items there,
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
44 # you could accidentally commit them! Instead, create a
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
45 # wikiserverconfig_local.py file containing this:
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
46 #
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
47 # from wikiserverconfig import LocalConfig
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
48 #
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
49 # class Config(LocalConfig):
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
50 # configuration_item_1 = 'value1'
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
51 #
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
52
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
53 try:
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
54 from wikiserverconfig_local import Config
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
55 except ImportError, err:
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
56 if not str(err).endswith('wikiserverconfig_local'):
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
57 raise
0e7c007f8ed9 handle wikiserverconfig(_local) in the same way as wikiconfig(_local) (thanks to Raphael Bossek for the patch)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4613
diff changeset
58 Config = LocalConfig