2dd9e2b4b22d029f591827ff6ba7816d7063e3ba
[matthijs/projects/wipi.git] / conf / farmconfig.py
1 # -*- coding: utf-8 -*-
2 # IMPORTANT! This encoding (charset) setting MUST be correct!
3
4 """
5     MoinMoin - Configuration for a wiki farm
6
7     Note that there are more config options than you'll find in
8     the version of this file that is installed by default; see
9     the module MoinMoin.config.multiconfig for a full list of names and their
10     default values.
11
12     Also, the URL http://moinmo.in/HelpOnConfiguration has
13     a list of config options.
14 """
15
16
17 # Wikis in your farm --------------------------------------------------
18
19 # If you run multiple wikis, you need this list of pairs (wikiname, url
20 # regular expression). moin processes that list and tries to match the
21 # regular expression against the URL of this request - until it matches.
22 # Then it loads the <wikiname>.py config for handling that request.
23
24 # Important:
25 #  * the left part is the wikiname enclosed in double quotes
26 #  * the left part must be a valid python module name, so better use only
27 #    lower letters "a-z" and "_". Do not use blanks or "-" there!!!
28 #  * the right part is the url re, use r"..." for it
29 #  * the right part does NOT include "http://" nor "https://" at the beginning
30 #  * in the right part ".*" means "everything". Just "*" does not work like
31 #    for filenames on the shell / commandline, you must use ".*" as it is a RE.
32 #  * in the right part, "^" means "beginning" and "$" means "end"
33
34 wikis = [
35     # Standalone server needs the port e.g. localhost:8000
36     # Twisted server can now use the port, too.
37
38     # wikiname,     url regular expression (no protocol)
39     # ---------------------------------------------------------------
40     ("extinction", r"http://extinction.evolution-events.nl/wipi"),
41     ("exodus", r"http://exodus.evolution-events.nl/wipi"),
42     ("deadfoxjunction", r"http://deadfoxjunction.evolution-events.nl/wipi"),
43     # Pretend we're also available at /. In reality, only the /Site pages are
44     # available there due to lighttpd rewriting. Due to proper setting of
45     # script-name by lighttpd and the url_mappings setting below all links
46     # still work too!
47     ("exodus", r"http://exodus.evolution-events.nl"),
48     ("deadfoxjunction", r"http://deadfoxjunction.evolution-events.nl"),
49 ]
50
51
52 # Common configuration for all wikis ----------------------------------
53
54 # Everything that should be configured the same way should go here,
55 # anything else that should be different should go to the single wiki's
56 # config.
57 # In that single wiki's config, we will use the class FarmConfig we define
58 # below as the base config settings and only override what's different.
59 #
60 # In exactly the same way, we first include MoinMoin's Config Defaults here -
61 # this is to get everything to sane defaults, so we need to change only what
62 # we like to have different:
63
64 from MoinMoin.config.multiconfig import DefaultConfig
65
66 # Now we subclass this DefaultConfig. This means that we inherit every setting
67 # from the DefaultConfig, except those we explicitely define different.
68
69 # Local setting, defined by matthijs for easy moving of data. It didn't work
70 # to define this in the FarmConfig class, so just put it here..
71 import os
72 data_dir_root = os.path.join(os.environ['SITE_DIR'], 'data', 'wipi')
73
74 class FarmConfig(DefaultConfig):
75
76     # Critical setup  ---------------------------------------------------
77
78     # Where read-only system and help page are. You might want to share
79     # this directory between several wikis. When you update MoinMoin,
80     # you can safely replace the underlay directory with a new one. This
81     # directory is part of MoinMoin distribution, you don't have to
82     # backup it.
83     data_underlay_dir = data_dir_root + '/underlay/'
84
85     # Override the default data_dir/plugin path for plugins, which doesn't
86     # make sense. We don't want to have per-wiki plugins anyway and stuffing
87     # code in the datadir is weird.
88     plugin_dir = os.path.join(os.path.dirname(__file__), os.path.pardir, 'plugin')
89
90     # The URL prefix we use to access the static stuff (img, css, js).
91     # NOT touching this is maybe the best way to handle this setting as moin
92     # uses a good internal default (something like '/moin_static163' for moin
93     # version 1.6.3).
94     # For Twisted and standalone server, the default will automatically work.
95     # For others, you should make a matching server config (e.g. an Apache
96     # Alias definition pointing to the directory with the static stuff).
97     url_prefix_static = '/wipi/static'
98
99
100     # Security ----------------------------------------------------------
101
102     # Link spam protection for public wikis (uncomment to enable).
103     # Needs a reliable internet connection.
104     #from MoinMoin.security.antispam import SecurityPolicy
105
106     acl_hierarchic = True
107
108     # Give users all rights, but don't give any rights to anonymous users
109     acl_rights_default = u""
110     acl_rights_before = u"Known:read,write,delete,revert,admin"
111
112     # Mail --------------------------------------------------------------
113
114     # Not configured
115
116
117     # User interface ----------------------------------------------------
118
119     # Add your wikis important pages at the end. It is not recommended to
120     # remove the default links.  Leave room for user links - don't use
121     # more than 6 short items.
122     # You MUST use Unicode strings here, but you need not use localized
123     # page names for system and help pages, those will be used automatically
124     # according to the user selected language. [Unicode]
125     navi_bar = [
126         u'RecentChanges',
127         u'FindPage',
128         u'HelpContents',
129     ]
130
131     # Always use the proxy. Specific configs define a proxy_theme_mapping,
132     # which maps specific paths to a corresponding theme.
133     theme_default = 'proxy'
134     theme_force = True
135
136     # Language options --------------------------------------------------
137
138     # The main wiki language, set the direction of the wiki pages
139     language_default = 'en'
140
141     # You must use Unicode strings here [Unicode]
142     page_category_regex = u'^Category[A-Z]'
143     page_dict_regex = u'[a-z]Dict$'
144     page_group_regex = u'[a-z]Group$'
145     page_template_regex = u'[a-z]Template$'
146
147     # Content options ---------------------------------------------------
148
149     # name of entry page
150     page_front_page = u"Start"
151
152     # Show users hostnames in RecentChanges
153     show_hosts = 1
154
155     # Show the interwiki name (and link it to page_front_page) in the Theme,
156     # nice for farm setups or when your logo does not show the wiki's name.
157     show_interwiki = 1
158     logo_string = u''
159
160     # The GUI WYSISYG editor is not installed with Debian.
161     # See /usr/share/doc/$(cdbs_curpkg)/README.Debian for more info
162     editor_force = True
163     editor_default = 'text'  # internal default, just for completeness
164     # Require a comment on page changes. This needs a patched moinmoin.
165     require_comment = True
166
167     # Authentication
168     from auth.phpbb_login import phpbb_login # This comes from plugin
169     from dbsettings import phpbb_dbhost, phpbb_dbuser, phpbb_dbpass, phpbb_dbname
170     phpbb = phpbb_login(
171         name    = 'phpbb',
172         dbhost  = phpbb_dbhost,
173         dbuser  = phpbb_dbuser,
174         dbpass  = phpbb_dbpass,
175         dbname  = phpbb_dbname,
176         hint    = "Hier kunnen bestuursleden van Evolution Events inloggen om wijzigingen te maken."
177     )
178     auth = [phpbb]
179
180     user_autocreate = True
181
182     # All urls that would be generated below /wipi/Site can be pointed to
183     # /Site instead, since lighttpd maps /Site to the wipis as well.
184     url_mappings = {'/wipi/Site' : '/Site'}
185
186     
187 # vim: set ts=8 sts=4 sw=4 expandtab: