wikiserverconfig.py
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
Tue, 05 Jul 2011 20:07:18 +0200
changeset 5785 62202e5435e2
parent 5716 5b262b81c236
permissions -rw-r--r--
Catch iand display all SaveErrors when revert failed, not just RevertError and
Unchanged.

Fixes http://moinmo.in/MoinMoinBugs/SaveError%20on%20revert%20due%20to%20BadContent
     1 """
     2     Standalone server configuration, you can either use this file or
     3     commandline options to configure server options.
     4 """
     5 import os
     6 
     7 from MoinMoin.script.server.standalone import DefaultConfig
     8 
     9 
    10 class LocalConfig(DefaultConfig):
    11     # where the static data is served from - you can either use:
    12     # docs = True  # serve the builtin static data from MoinMoin/web/static/htdocs/
    13     # docs = '/where/ever/you/like/to/keep/htdocs'  # serve it from the given path
    14     # docs = False  # do not serve static files at all (will not work except
    15     #               # you serve them in some other working way)
    16     #docs = True
    17 
    18     # if you start the server as root, the standalone server can change
    19     # to this user and group, e.g. 'www-data'
    20     #user = None
    21     #group = None
    22 
    23     # How to debug? Your options:
    24     # debug = 'off' # for production wikis, exceptions are logged
    25     # debug = 'web' # show traceback in the browser, offer debug console,
    26     #               # this makes use of a built-in debugger (werkzeug.debug)
    27     # debug = 'external' # don't catch Exceptions, so some external debugger gets them
    28     # CAUTION: Do not use anything but 'off' for production environments as it
    29     #          might disclose sensitive informations and even enable doing evil
    30     #          things from some debugger's web interface!
    31     # For convenience, the default behaviour (see below) is to read the
    32     # environment variable MOIN_DEBUGGER. If not set, it means the same as 'off'.
    33     #debug = os.environ.get('MOIN_DEBUGGER', 'off')
    34 
    35     # should the exception evaluation feature be enabled?
    36     #use_evalex = True
    37 
    38     # Werkzeug run_simple arguments below here:
    39 
    40     # use '' for all interfaces or "1.2.3.4" for some specific IP
    41     hostname = 'localhost'
    42     # if you use port < 1024, you need to start as root
    43     port = 8080
    44 
    45     # either multi-thread or multi-process (not both):
    46     # threaded = True, processes = 1 is usually what you want
    47     # threaded = False, processes = 10 (for example) can be rather slow
    48     # thus, if you need a forking server, maybe rather use apache/mod-wsgi!
    49     #threaded = True
    50     #processes = 1
    51 
    52     # automatic code reloader - needs testing!
    53     #use_reloader = False
    54     #extra_files = None
    55     #reloader_interval = 1
    56 
    57     # we can't use static_files to replace our own middleware setup for moin's
    58     # static files, because we also need the setup with other servers (like
    59     # apache), not just when using werkzeug's run_simple server.
    60     # But you can use it if you need to serve other static files you just need
    61     # with the standalone wikiserver.
    62     #static_files = None
    63 
    64 
    65 # DEVELOPERS! Do not add your configuration items there,
    66 # you could accidentally commit them! Instead, create a
    67 # wikiserverconfig_local.py file containing this:
    68 #
    69 # from wikiserverconfig import LocalConfig
    70 #
    71 # class Config(LocalConfig):
    72 #     configuration_item_1 = 'value1'
    73 #
    74 
    75 try:
    76     from wikiserverconfig_local import Config
    77 except ImportError, err:
    78     if not str(err).endswith('wikiserverconfig_local'):
    79         raise
    80     Config = LocalConfig