annotate wikiserverconfig.py @ 6076:f4ec84967c27

add colon to make log_attempt even more parseable
author 'Karl O. Pinc' <kop@meme.com>
date Mon, 15 Sep 2014 22:10:45 -0500
parents 5b262b81c236
children
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
5716
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
9
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
10 class LocalConfig(DefaultConfig):
5716
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
11 # where the static data is served from - you can either use:
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
12 # docs = True # serve the builtin static data from MoinMoin/web/static/htdocs/
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
13 # docs = '/where/ever/you/like/to/keep/htdocs' # serve it from the given path
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
14 # docs = False # do not serve static files at all (will not work except
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
15 # # you serve them in some other working way)
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
16 #docs = True
3495
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
17
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
18 # 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
19 # to this user and group, e.g. 'www-data'
5716
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
20 #user = None
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
21 #group = None
3495
be29346a6aa3 add wikiserverconfig sample for the standalone server configuration
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
22
4621
7000bf88e348 MOIN_DEBUGGER=off/web/external
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4618
diff changeset
23 # How to debug? Your options:
7000bf88e348 MOIN_DEBUGGER=off/web/external
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4618
diff changeset
24 # debug = 'off' # for production wikis, exceptions are logged
7000bf88e348 MOIN_DEBUGGER=off/web/external
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4618
diff changeset
25 # debug = 'web' # show traceback in the browser, offer debug console,
7000bf88e348 MOIN_DEBUGGER=off/web/external
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4618
diff changeset
26 # # this makes use of a built-in debugger (werkzeug.debug)
7000bf88e348 MOIN_DEBUGGER=off/web/external
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4618
diff changeset
27 # debug = 'external' # don't catch Exceptions, so some external debugger gets them
7000bf88e348 MOIN_DEBUGGER=off/web/external
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4618
diff changeset
28 # CAUTION: Do not use anything but 'off' for production environments as it
7000bf88e348 MOIN_DEBUGGER=off/web/external
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4618
diff changeset
29 # might disclose sensitive informations and even enable doing evil
7000bf88e348 MOIN_DEBUGGER=off/web/external
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4618
diff changeset
30 # things from some debugger's web interface!
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
31 # For convenience, the default behaviour (see below) is to read the
4621
7000bf88e348 MOIN_DEBUGGER=off/web/external
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4618
diff changeset
32 # environment variable MOIN_DEBUGGER. If not set, it means the same as 'off'.
5716
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
33 #debug = os.environ.get('MOIN_DEBUGGER', 'off')
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
34
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
35 # should the exception evaluation feature be enabled?
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
36 #use_evalex = True
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
37
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
38 # Werkzeug run_simple arguments below here:
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
39
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
40 # use '' for all interfaces or "1.2.3.4" for some specific IP
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
41 hostname = 'localhost'
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
42 # if you use port < 1024, you need to start as root
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
43 port = 8080
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
44
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
45 # either multi-thread or multi-process (not both):
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
46 # threaded = True, processes = 1 is usually what you want
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
47 # threaded = False, processes = 10 (for example) can be rather slow
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
48 # thus, if you need a forking server, maybe rather use apache/mod-wsgi!
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
49 #threaded = True
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
50 #processes = 1
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
51
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
52 # automatic code reloader - needs testing!
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
53 #use_reloader = False
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
54 #extra_files = None
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
55 #reloader_interval = 1
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
56
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
57 # we can't use static_files to replace our own middleware setup for moin's
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
58 # static files, because we also need the setup with other servers (like
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
59 # apache), not just when using werkzeug's run_simple server.
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
60 # But you can use it if you need to serve other static files you just need
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
61 # with the standalone wikiserver.
5b262b81c236 updated wikiserverconfig.py from internal defaults, sync the one in toplevel dir and the one in wiki/server/ - fixes hostname setting
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4960
diff changeset
62 #static_files = None
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
63
4960
2a024d3e418f simplify wikiserver configuration by using same names as werkzeug's run_simple
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4621
diff changeset
64
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
65 # 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
66 # 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
67 # 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
68 #
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
69 # 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
70 #
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
71 # 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
72 # 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
73 #
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
74
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
75 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
76 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
77 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
78 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
79 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
80 Config = LocalConfig