• Diff for "HelpOnConfiguration"

Differences between revisions 1 and 2

Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
##language:en ## Please edit system and help pages ONLY in the moinmaster wiki! For more
## information, please see MoinMaster:MoinPagesEditorGroup.
##master-page:None
##master-date:None
#acl MoinPagesEditorGroup:read,write,delete,revert All:read
#format wiki
#language en
Line 7: Line 13:
 * HelpOnAccessControlLists (permissions/users control)
Line 8: Line 15:

'''Index'''
 * /FileAttachments
 * /ApacheVoodoo
 * /SurgeProtection
 * /UserPreferences (user preferences to disable/remove)

'''Contents'''
Line 12: Line 23:
== Configuration of MoinMoin ==

MoinMoin is configured by changing the `moin_config.py` file, which normally sits besides your `moin.cgi` driver script. `moin_config.py` is imported by the MoinMoin main code early in a request cycle and is found because the current directory (i.e. that of `moin.cgi`) is part of the Python system path. Consequently, `moin_config.py` can sit anywhere in your `PYTHONPATH`.

=== Overview of configuration options ===

The following table contains default values and a short description for all configuration variables. Most of these can be left at their defaults, those you need to change with every installation are listed in the sample `moin_config.py` that comes with the distribution.
= Configuring a single wiki =

If you run a single wiki, you should not copy the file `farmconfig.py` into your configuration directory (remove it and the `.pyc` file, if it is there). Without farmconfig, moin uses the default `wikiconfig.py`

`wikiconfig.py` normally is located besides your `moin.cgi` driver script. If you need to make a custom install, it can be located anywhere, but you must add the path to the directory where it is located to your Python system path in your server script. See the "System Path Configuration" section in your server script.

== Wiki configuration file structure ==

General notes on wiki/farmconfig.py structure:
{{{
# -*- coding: iso-8859-1 -*-

from MoinMoin.multiconfig import DefaultConfig

class Config(DefaultConfig):

    sitename = u'MyWiki' # u means that it will be converted to Unicode
    interwikiname = 'MyWiki'
    data_dir = '/where/ever/mywiki/data/'
    underlay_dir = '/where/ever/mywiki/underlay/'
    
    # More settings follow...
}}}

 * First, you must define the coding of the config file. The default setting is suited for Latin ("western") languages only, for international setup, read next section. If you don't define the coding, you can't use non-ascii characters.

 * Next we import moin's internal default configuration. The default configuration includes values for all options, so we don't have to define all values, just what we want to customize.

 * Then we define a new configuration class called "Config" and inherit all settings from the default configuration we imported. Note that the class name must be "Config".

 * Next lines are the configuration options for the Config class. Note that each line must be indented by 4 spaces, tabs are not allowed. Moin will not run if you use wrong indentation.

 * A common configuration item is `sitename` - in most cases you don't want your wiki to have the default "Untitled Wiki" name. You can define any name you like in any language, but before you do that, read next section on unicode options.

 * If you followed the install instructions, the wiki will run without any other change, but you might want to change some values, like `data_dir`, `data_underlay_dir` `acl_rights_before` and more. For most cases, setting all the values in the supplied `wikiconfig.py` file is enough.

 * Anything we do not define simply stays at moin's internal defaults which we inherited from Default''''''Config.

= Unicode options =

 <!> '''Important: to use unicode values, you must setup a correct coding line in the first line of your configuration file. Check that your editor is configured correctly.'''

Certain options '''must''' use unicode values. For example, the site name could contain German umlauts or French accents or be in Chinese or Hebrew. Because of this, you must use unicode strings for those items. Unicode strings are defined by prefixing the letter `u` to the string. Here are some examples:

{{{
    # Site name, used by default for wiki name-logo [Unicode]
    sitename = u"Jürgen's Wiki"
    # another example:
    sitename = u'הוויקי של יורגן'
}}}

Read the comments in the configuration file - they tell you which options must use Unicode values.

Notes:

 * You can't mix different encodings in the same file. If your coding line says `iso-8859-1`, all your characters, the whole file content, must be in that encoding.

 * If you use utf-8 encoding (or plain ascii), you don't have to use unicode strings, moin will decode your string correctly for you. New in 1.3.2.

= International Setup =

The default configuration file shipped with moin uses `iso-8859-1` coding. This is fine for Latin languages like English or German, but not usable for non-latin languages. If you want to have non-latin characters in your configuration items, use utf-8 coding for the config file.

Set the first line of all configuration files to this line:
{{{
# -*- coding: utf-8 -*-
}}}

 /!\ You need a text editor being capable of (and also really using) utf-8 encoding for editing the config files.

Values using unicode strings (international users might want to change them):
 * sitename
 * logo_string
 * page_front_page
 * navi_bar
 * page_category_regex
 * page_dict_regex
 * page_group_regex
 * page_template_regex
 * page_license_page - New in 1.3.2
 * page_local_spelling_words - New in 1.3.2
 * acl_rights_default - New in 1.3.2
 * acl_rights_before - New in 1.3.2
 * acl_rights_after - New in 1.3.2
 * mail_from - New in 1.5.0

For ready made configuration in your language, see MoinMoin:ConfigMarket. Read also the section about unicode options.

= Configuration of multiple wikis =

The moinmoin wiki engine is capable of handling multiple wikis using a single installation, a single set of configuration files and a single server process. Especially for persistent environments like twisted, this is necessary, because the twisted server will permanently run on a specific IP address and TCP port number. So for virtual hosting of multiple domains (wikis) on the same IP and port, we need the wiki engine to permanently load multiple configs at the same time and choose the right of them when handling a request for a specific URL.

To be able to choose the right config, moin uses config variable `wikis` located in the file `farmconfig.py` - it simply contains a list of pairs `(wikiname, url-regex)`. Please only use valid python identifiers for `wikiname` (to be exact: `identifier ::= (letter|"_") (letter | digit | "_")*` - just try with a simple word if you didn't understand that grammar rule). When processing a request for some URL, moin searches through this list and tries to match the url-regex against the current URL. If it doesn't match, it simply proceeds to the next pair. If it does match, moin loads a configuration file named `<wikiname>.py` (usually from the same directory) that contains the configuration for that wiki.

`farmconfig.py` in the distribution archive has some sample entries for a wiki farm running multiple wikis. You need to adapt it to match your needs if you want to run multiple wikis.

/!\ For simpler writing of these help pages, we will call such a `<wikiname>.py` configuration file simply `wikiconfig.py`, of course you have to use the filename you chose.

Of course you have already adapted the `wikis` setting in `farmconfig.py` (see above), so we only give some hints how you can save some work. Please also read the single wiki configuration hints, because it explains config inheritance.

We now use the class-based configuration to be able to configure the common settings of your wikis at a single place: in the base configuration class (see `farmconfig.py` for an example):

'''farmconfig.py''':
{{{
# -*- coding: iso-8859-1 -*-
# farmconfig.py:
from MoinMoin.multiconfig import DefaultConfig
class FarmConfig(DefaultConfig):
    url_prefix = '/wiki'
    show_hosts = 1
    underlay_dir = '/where/ever/common/underlay'
    # ...
}}}

 Explanation:
  * first we import the default config, like we do when configuring a single wiki
  * now we define a new farm config class - and inherit from the default config
  * then we change everything that our farm wikis have in common, leaving out the settings that they need to be different
  * this Farm''''''Config class will now be used by the config files of the wikis instead of moin's internal Default''''''Config class, see below:

The configs of your individual wikis then only keep the settings that need to be different (like the logo, or the data directory or ACL settings). Everything else they get by inheriting from the base configuration class, see `moinmaster.py` for a sample.

'''moinmaster.py''':
{{{
# -*- coding: iso-8859-1 -*-
# moinmaster.py:
from farmconfig import FarmConfig
class Config(FarmConfig):
    show_hosts = 0
    sitename = u'MoinMaster'
    interwikiname = 'MoinMaster'
    data_dir = '/org/de.wikiwikiweb.moinmaster/data/'
    # ...
}}}

 Explanation:
  * see single wiki configuration, the only difference is that we inherit from Farm''''''Config (that inherited from Default''''''Config) instead of directly using Default''''''Config
  * now we override show_hosts to be 0 - we want it for most wikis in our farm, but not for this one
  * we also override sitename, interwikiname and data_dir (the usual stuff)

= Overview of configuration options =

The following table contains default values and a short description for all configuration variables. Most of these can be left at their defaults, those you need to change with every installation are listed in the sample `wikiconfig.py` that comes with the distribution.

/!\ Starting with moin 1.3.1, some options must use unicode strings. Read the section about unicode options.
Line 21: Line 170:
|| Log''''''Store || 'text:editlog' || ''Experimental, keep the default'' ||
|| S
ecurity''''''Policy || None || class object hook for implementing security restrictions ||
|| acl_enabled (& acl_...) || 0 || ''true'' to enable Access Control Lists - fine grained page access rights settings (see HelpOnAccessControlLists) ||
|| allow_extended_names || 1 || ''true'' to enable {{{["non-standard wikiname"]}}} markup ||
|| allow_subpages || 1 || ''true'' to enable hierarchical wiki features (see HelpOnEditing/SubPages) ||
|| allow_numeric_entities || 1 || if ''true'', numeric entities like `&#8364;` for &#8364; are not escaped, but &amp; and stuff still is ||
|| allow_x
slt || 0|| ''true'' to enable XSLT processing via 4Suite (note that this enables anyone with enough know-how to insert '''arbitrary HTML''' into your wiki, which is why it defaults to 0) ||
|| allowed_actions || [] || allow unsafe actions (list of strings) ||
|| Security''''''Policy || None || Class object hook for implementing security restrictions ||
|| acl_... || ... || wiki-wide access control list definition (see HelpOnAccessControlLists) ||
|| allow_xslt || 0|| True to enable XSLT processing via 4Suite (note that this enables anyone with enough know-how to insert '''arbitrary HTML''' into your wiki, which is why it defaults to 0) ||
|| actions_excluded || [] || Exclude unwanted actions (list of strings) ||
Line 30: Line 175:
|| auth_http_enabled || 0 || ''true'' to enable moin using the username of a user already authenticated by http basic auth ||
|| backtick_meta || 1 || ''true'' to enable {{{`inline literal`}}} markup ||
|| bang_meta || 0 || ''true'' to enable {{{!NoWikiName}}} markup ||
|| auth || [moin_cookie] || list of auth functions, to be called in this order (see HelpOnAuthentication) ||
|| bang_meta || 1 || enable {{{!NoWikiName}}} markup ||
Line 34: Line 178:
|| changed_time_fmt || '%H:%M' || Time format used on RecentChanges  for page edits within the last 24 hours ||
|| charset || 'iso-8859-1' || The encoding / character set your system uses ||
|| char
t_options || None || if you have gdchart, use something like chart_options = {'width': 720, 'height': 540} ||
|| check_i18n || 0 || Set to 1 only in development systems, or on a translator's system ||
|| changed_time_fmt || '%H:%M' || Time format used on RecentChanges for page edits within the last 24 hours ||
|| chart_options || None || If you have gdchart, use something like chart_options = {'width': 720, 'height': 540} ||
|| cookie_domain || None || farmconfig: use this domain for the MoinMoin cookie ||
|| cookie_path || None || farmconfig: use this path for the MoinMoin cookie ||
Line 39: Line 183:
|| data_dir || './data/' || Path to the data directory, the default is OK if you place the data directory right besides your `moin.cgi` || || data_dir || './data/' || Path to the data directory containing your (locally made) wiki pages. ||
|| data_underlay_dir || './underlay/' || Path to the underlay directory containing distribution system and help pages. ||
Line 42: Line 187:
|| default_lang || 'en' || default language for page contents, and also the default user language if not set by other means ||
Line 44: Line 188:
|| docbook_html_dir || '...' || Path to the docbook html directory (optional, used by the docbook parser). The default value is correct for Debian Sarge. ||
|| editor_default || 'text' || Editor to use by default, 'text' or 'gui' ||
|| editor_ui || 'freechoice' || Editor choice shown on the user interface, 'freechoice' or 'theonepreferred' ||
|| editor_force || False || Force using the default editor ||
Line 45: Line 193:
|| edit_rows || 30 || Default height of the edit box || || edit_rows || 20 || Default height of the edit box ||
|| hacks || {} || for use by moin development ||
Line 47: Line 196:
|| html_head || '' || Additional <HEAD> tags for all pages (see HelpOnSkins) ||
|| html_head_queries || ''META-Tag with "NOINDEX,NOFOLLOW" for robots'' || Additional <HEAD> tags for edit and action pages (`html_head` is sent, too; see HelpOnSkins) ||
|| html_head || "" || Additional <HEAD> tags for all pages (see HelpOnSkins) ||
|| html_head_posts || robots: noindex,nofollow || Additional <HEAD> tags for POST requests ||
|| html_head_index || robots: index,follow || Additional <HEAD> tags for some few index pages ||
|| html_head_normal || robots: index,nofollow || Additional <HEAD> tags for most normal pages ||
|| html_head_queries || robots: noindex,nofollow || Additional <HEAD> tags for requests with query strings, like actions ||
Line 50: Line 202:
|| httpd_docs || './wiki-moinmoin' || directory with public files, when using the stand-alone server ||
|| httpd_host || 'localhost' || hostname of the stand-alone server ||
|| httpd_port || 8080 || port of the stand-alone server ||
|| httpd_user || 'nobody' || user to run the stand-alone server under (UNIX only) ||
|| interwiki_preferred || `[]` || In dialogues, show those wikis at the top of the list. ||
Line 55: Line 204:
|| logo_string || '<img src="%s" border="0" alt="%s">' % (logo_url, sitename) || The '''img''' tag used to format the logo display in the upper-left corner of a page and used in RSS documents ||
|| logo_url || ''MoinMoin logo'' || The URL path to the logo used by `logo_string` above ||
|| lowerletters || ''Latin 1 alphabetic characters and digits'' || Lowercase letters, used to define what is a WikiName ||
|| mail_from || None || `From:` header used in sent mails ||
|| language_default || 'en' || Default language for user interface and page content, see HelpOnLanguages!||
|| language_ignore_browser || False || Ignore user's browser language settings, see HelpOnLanguages!||
|| logo_string || sitename || The wiki logo top of page, HTML is allowed (`<img>` is possible as well) [Unicode] ||
|| lupy_search || False || use the lupy indexing search engine ||
|| mail_from || None || `From:` header used in sent mails, e.g. mail_from = u'Jürgen Wiki <[email protected]>'. See /EmailSupport.||
Line 60: Line 210:
|| mail_smarthost || None || IP or domain name of an SMTP-enabled server; note that email features (notification, mailing of login data) works only if this variable is set ||
|| max_macro_size || 50 || Maximum size of some macro pages in KB, especially used to limits the size of RecentChanges; use `0` to disable that feature ||
|| navi_bar || list of default quick links || Most important links in text form (these links can be over-ridden by the user's quick links); to link to any URL, use a free-form link of the form "`[url text]`" ||
|| mail_smarthost || None || IPv4 address or hostname of an SMTP-enabled server (with optional `:port` appendix, defaults to 25). Note that email features (notification, mailing of login data) works only if this variable is set. ||
|| mail_sendmail || None || If set to e.g. '/usr/sbin/sendmail -t -i', use this sendmail command to send mail. Default is to send mail by an internal function using SMTP. ||
|| navi_bar || [u'%(page_front_page)s', u'Recent''''''Changes', u'Find''''''Page', u'Help''''''Contents',] || Most important page names. Users can add more names in their quick links in UserPreferences. To link to URL, use `u"[url link title]"`, to use a shortened name for long page name, use `u"[LongLongPageName title]"`. To use page names with spaces, use `u"[page_name_with_spaces any title]"` [list of Unicode strings] ||
Line 64: Line 214:
|| page_category_regex || '^Category[A-Z]' || Pagenames containing a match for this regex are regarded as Wiki categories ||
|| page_credits || MoinMoin and PythonPowered || html fragment with logos or strings for crediting ||
|| page_dict_regex || '[a-z]Dict$' || Pagenames containing a match for this regex are regarded as containing variable dictionary definitions ||
|| page_footer1 || '' || Custom HTML markup sent ''before'' the system footer (see HelpOnSkins) ||
|| page_footer2 || '' || Custom HTML markup sent ''after'' the system footer (see HelpOnSkins) ||
|| page_form_regex || '[a-z]Form$' || Pagenames containing a match for this regex are regarded as containing form definitions ||
|| page_front_page || 'FrontPage' || Name of the front page ||
|| page_group_regex || '[a
-z]Group$' || Pagenames containing a match for this regex are regarded as containing group definitions ||
|| page_header1 || '' || Custom HTML markup sent ''before'' the system header / title area (see HelpOnSkins) ||
|| page_header2 || '' || Custom HTML markup sent ''after'' the system header / title area (see HelpOnSkins) ||
|| page_iconbar || ["view", ...] || list of icons to show in iconbar ||
|| page_icons_table || dict || dict of {'iconname': (url, title, icon-img-key), ...} ||
|| page_category_regex || u'^Category[A-Z]' || Pagenames containing a match for this regex are regarded as Wiki categories [Unicode] ||
|| page_credits || [...] || list with html fragments with logos or strings for crediting. ||
|| page_dict_regex || u'[a-z0-9]Dict$' || Pagenames containing a match for this regex are regarded as containing variable dictionary definitions [Unicode] ||
|| page_footer1 || "" || Custom HTML markup sent ''before'' the system footer (see HelpOnSkins) ||
|| page_footer2 || "" || Custom HTML markup sent ''after'' the system footer (see HelpOnSkins) ||
|| page_front_page || u'HelpOnLanguages' || Name of the front page. We don't expect you to keep the default. Just read HelpOnLanguages in case you're wondering... [Unicode] ||
|| page_group_regex || u
'[a-z0-9]Group$' || Pagenames containing a match for this regex are regarded as containing group definitions [Unicode] ||
|| page_header1 || "" || Custom HTML markup sent ''before'' the system header / title area (see HelpOnSkins) ||
|| page_header2 || "" || Custom HTML markup sent ''after'' the system header / title area (see HelpOnSkins) ||
|| page_iconbar || ["view", ...] || list of icons to show in iconbar, valid values are only those in page_icons_table. Available only in classic theme. ||
|| page_icons_table || dict || dict of {'iconname': (url, title, icon-img-key), ...}. Available only in classic theme. ||
Line 77: Line 226:
|| page_license_page || 'WikiLicense' || Page linked from the license hint. ||
|| page_local_spelling_words || 'LocalSpellingWords' || Name of the page containing user-provided spellchecker words ||
|| page_template_regex || '[a-z]Template$' || Pagenames containing a match for this regex are regarded as templates for new pages ||
|| page_license_page || u'WikiLicense' || Page linked from the license hint. [Unicode] ||
|| page_local_spelling_words || u'LocalSpellingWords' || Name of the page containing user-provided spellchecker words [Unicode] ||
|| page_template_regex || u'[a-z0-9]Template$' || Pagenames containing a match for this regex are regarded as templates for new pages [Unicode] ||
Line 81: Line 230:
|| shared_intermap || None || path to a file containing global InterWiki definitions (or a list of such filenames) ||
|| show_hosts || 1 || ''true'' to show hostname in RecentChanges ||
|| show_section_numbers || 1 || ''true'' to show section numbers in headings by default ||
|| show_timings || 0 || shows some timing values at bottom of page - used for development ||
|| show_version || 0 || show MoinMoin's version at the bottom of each page ||
|| sitename || 'An Unnamed MoinMoin Wiki' || Short description of your wiki site, displayed below the logo on each page, and used in RSS documents as the channel title ||
|| smileys || {} || User-defined smileys (a dict with the markup as the key and a tuple of width, height, border, image name as the value) ||
|| theme_default || 'classic' || the name of the theme that is used by default (see HelpOnThemes) ||
|| theme_force || False || if True, do not allow to change the theme ||
|| shared_intermap || None || Path to a file containing global InterWiki definitions (or a list of such filenames) ||
|| show_hosts || 1 || Disable this option to hide host names and IPs ||
|| show_interwiki || 0 || Enable this option to let the theme display your interwiki name ||
|| show_login || 1 || Disable this option to get login/logout action removed ||
|| show_names || 1 || Disable this option to hide names from the info view and RecentChanges (this was previously done by show_hosts) ||
|| show_section_numbers || 0 || True to show section numbers in headings by default ||
|| show_timings || 0 || Shows some timing values at bottom of page - used for development ||
|| show_version || 0 || Show MoinMoin's version at the bottom of each page ||
|| sitename || u'Untitled Wiki' || Short description of your wiki site, displayed below the logo on each page, and used in RSS documents as the channel title [Unicode] ||
|| stylesheets || [] || List of tuples (media, csshref) to insert after theme css, before user css ||
|| superuser || [] || List of trusted user names with wiki system administration super powers (not to be confused with ACL admin rights!). Used for e.g. making full backups, software installation, language installation via SystemPagesSetup and more. See also HelpOnPackageInstaller.||
|| theme_default || 'modern' || the name of the theme that is used by default (see HelpOnThemes) ||
|| theme_force || False || If True, do not allow to change the theme ||
Line 93: Line 246:
|| url_mappings || {} || lookup table to remap URL prefixes (dict of {{{'prefix': 'replacement'}}}); especially useful in intranets, when whole trees of externally hosted documents move around ||
|| url_prefix || '/wiki' || used as the base URL for icons, css, etc. ||
|| unzip_attachments_count || 51 ||the number of files which are extracted from the zip file||
|| unzip_attachments_space || 200MB ||this total amount of bytes can be used to unzip files.||
|| unzip_single_file_size || 2MB ||size of a single file in the archive which will be extracted||
|| user_autocreate || False || If set to True user accounts are created automatically (see HelpOnAuthentication). ||
|| user_checkbox_defaults || dict || Sets the default settings of the UserPreferences checkboxes. See /UserPreferences or `multiconfig.py` for the default settings. Example: `user_checkbox_defaults = {'edit_on_doubleclick': 0}` ||
|| user_checkbox_disable || `[]` || a list of checkbox names to be disabled in the UserPreferences. A disabled checkbox is displayed greyedout and uses the default value set in `user_checkbox_defaults`. ||
|| user_checkbox_fields || `[...]` || list of checkbox items, see /UserPreferences or `multiconfig.py` ||
|| user_checkbox_remove || `[]` || a list of checkbox names to be removed from the UserPreferences. A removed checkbox uses the default value set in `user_checkbox_defaults`. See /UserPreferences ||
|| user_email_unique || True || check emails for uniqueness and don't accept duplicates. ||
|| user_form_defaults|| `[]` || a list of form defaults for UserPreferences. See /UserPreferences ||
|| user_form_disable || `[]` || a list of form field names to be disabled in the UserPreferences. A disabled field is displayed greyedout and uses the default value set in `user_form_defaults`. See /UserPreferences ||
|| user_form_fields || `[...]` || list of userprefs form items, see /UserPreferences or `multiconfig.py` ||
|| user_form_remove || `[]` || a list of form field names to be removed from the UserPreferences. A removed form field uses the default value set in `user_form_defaults`. See /UserPreferences ||
|| user_homewiki || `Self` || farmconfig: wiki where the user home pages are located (useful if you have ''many'' users). You could even link to nonwiki "user pages" if the wiki username is in the target URL. ||
|| xmlrpc_putpage_enabled || `False` || True to enable wikirpc's putPage call writing to the given pagename. When False, it always writes to PutPageTestPage instead of the given pagename. ||
|| xmlrpc_putpage_trusted_only || `True` || Require users using putPage call to be in Trusted group (usually achieved by http auth). ||

Some values can only be set from MoinMoin/config.py (part of the MoinMoin code and thus GLOBALLY changing behaviour of all your wikis), but not from the individual wiki's config - you should only touch them if you know what you are doing:
|| charset || 'utf-8' || the encoding / character set used by the wiki ||
|| lowerletters || ''ucs-2 lowercase letters'' || Lowercase letters, used to define what is a WikiName ||
|| smileys || {} || user-defined smileys (a dict with the markup as the key and a tuple of width, height, border, image name as the value) ||
Line 94: Line 270:
|| upperletters || ''Latin 1 alphabetic characters'' || Uppercase letters, used to define what is a WikiName ||
|| url_mappings || {} || lookup table to remap URL prefixes (dict of {{{'prefix': 'replacement'}}}); especially useful in intranets, when whole trees of externally hosted documents move around ||
|| url_prefix || '/wiki' || Used as the base URL for all public documents served by the wiki, especially the image files for the icons ||
|| url_schemas || [] || additional URL schemas you want to have recognized (list of strings) ||


=== Changing character sets ===

If you want to use MoinMoin with a character set other than Latin-1, you might or even have to change the default character sets for WikiName``s in "moin_config.py". A safe default is US-ASCII, i.e. {{{
upperletters = "A-Z"
lowerletters = "0-9a-z"
}}}

With that setting, you need to set "`allow_extended_names=1`" and use the special markup for extended WikiName``s `["extended name"]` to get any names with characters outside the core latin alphabet.

[[Anchor(file-attachments)]]
=== File attachments ===

The [wiki:Self:HelpOnActions/AttachFile AttachFile action] enables a page to have multiple attached files.
Since file uploads could be abused for DoS (Denial of Service) attacks, `AttachFile` is an action that may be enabled by the wiki administrator. To do this, add "`allowed_actions = ['AttachFile']`" to your configuration file.

If you wiki has (or is expected to have) many file attachments, there is an option which will eliminate the CGI overhead associated with each retrieval of an attachment file.

There are two storage/retrieval models for file attachments:
 1. Attachments are stored "privately" and can only be retrieved via a CGI GET (via URLs like `http://myorg.org/mywiki/<SomePage>?action=AttachFile&do=get&target=filename.ext`).
 1. Attachments are stored into a directory directly accessible by the web server, and can thus be served directly by the webserver, without any invocation of MoinMoin (leading to URLs like `http://myorg.org/mywikiattach/<Somepage>/attachments/filename.ext`).

If the efficiency of serving file attachments is a concern, the second option is preferable, but it also requires additional configuration steps and possibly more rights on the host machine. Because of this, the first option is the default; attachments are stored in the "...mywiki/data/pages/" directory, with paths like "`...mywiki/data/pages/<pagename>/attachments/<filename>`".

The MoinMoin ''attachments'' configuration option allows you to move the directory structure used to store attachments to another location. Unless you have a reason for doing so, there is no need to use a different location. Using a different location may be more work and more risk, as all the existing attachments must be copied to the new location. The following instructions are for Apache servers and assume you intend to leave the attachment files in their existing location and your original installation used the name "mywiki".

The first step is to tell Apache that it has another Alias directory from which it can serve files. Review the changes you made to the httpd.conf (or commonhttpd.conf) file during the Moin``Moin installation and find the Script``Alias statement similar to the following:
{{{
    ScriptAlias /mywiki ".../mywiki/moin.cgi"
}}}
Create an Alias statement similar to the Script``Alias statement above, replacing the ''/mywiki'' URI with ''/mywikiattach/'' and replacing ''moin.cgi'' with ''data/pages/''.
{{{
    Alias /mywikiattach/ ".../mywiki/data/pages/"
}}}
Be sure to note the differences in the trailing slashes between the two statements, they must be entered exactly as shown above. If you are making this change to a running system, you must restart Apache to have the change take effect.

The second step is to tell MoinMoin to let Apache do the work of fetching file attachments. To do this,
you need to add an `attachments` option to .../mywiki/moin_config.py. The 'attachment' option is a dictionary of two values: {{{
attachments = {
    'dir': '.../mywiki/data/pages',
    'url': '/mywikiattach',
}
}}}
Moin``Moin must still do the work of uploading file attachments. The ''dir'' value above tells Moin``Moin where to store attachments; note this is the same as the path in the new Apache Alias statement but without the trailing "/". The ''url'' value tells Moin``Moin how to retrieve the attachments; this matches the URI in the Alias statement but again without the trailing "/".

After you have completed the configuration changes, test by uploading an attachment for WikiSandBox. Then modify the WikiSandBox page to display the uploaded image or download the file. If there were existing attachments before this change, verify the old attachments are still available. Finally, review the Apache ''access.log'' file to verify you have a log entry showing the expected file access:

  * ''"...GET /mywikiattach/Wiki``Sand``Box/attachments/mypix.jpg HTTP/1.1..."''.
|| upperletters || ''ucs-2 uppercase letters'' || uppercase letters, used to define what is a WikiName ||
|| url_schemas || `[]` || additional URL schemas you want to have recognized (list of strings; e.g. `['ldap', 'imap']`) ||

= Special options =

[[Anchor(character-set)]]
== Character Set ==

Moin uses unicode internally, and `utf-8` for external output and input, like pages, html output and translation files. The external character set is defined in `config.charset` to `utf-8`. This setting is fine for all languages, as any character can be encoded in utf-8. You should not change this value, although technically it is possible.
 
 <!> '''Do not change `config.charset`. It is not tested and we can't support this.'''

HelpContents > HelpOnAdministration > HelpOnConfiguration

Subtopics

Contents

1. Configuring a single wiki

If you run a single wiki, you should not copy the file farmconfig.py into your configuration directory (remove it and the .pyc file, if it is there). Without farmconfig, moin uses the default wikiconfig.py

wikiconfig.py normally is located besides your moin.cgi driver script. If you need to make a custom install, it can be located anywhere, but you must add the path to the directory where it is located to your Python system path in your server script. See the "System Path Configuration" section in your server script.

1.1. Wiki configuration file structure

General notes on wiki/farmconfig.py structure:

# -*- coding: iso-8859-1 -*-

from MoinMoin.multiconfig import DefaultConfig

class Config(DefaultConfig):

    sitename = u'MyWiki'   # u means that it will be converted to Unicode
    interwikiname = 'MyWiki'
    data_dir = '/where/ever/mywiki/data/'
    underlay_dir = '/where/ever/mywiki/underlay/'
    
    # More settings follow...
  • First, you must define the coding of the config file. The default setting is suited for Latin ("western") languages only, for international setup, read next section. If you don't define the coding, you can't use non-ascii characters.
  • Next we import moin's internal default configuration. The default configuration includes values for all options, so we don't have to define all values, just what we want to customize.
  • Then we define a new configuration class called "Config" and inherit all settings from the default configuration we imported. Note that the class name must be "Config".
  • Next lines are the configuration options for the Config class. Note that each line must be indented by 4 spaces, tabs are not allowed. Moin will not run if you use wrong indentation.
  • A common configuration item is sitename - in most cases you don't want your wiki to have the default "Untitled Wiki" name. You can define any name you like in any language, but before you do that, read next section on unicode options.

  • If you followed the install instructions, the wiki will run without any other change, but you might want to change some values, like data_dir, data_underlay_dir acl_rights_before and more. For most cases, setting all the values in the supplied wikiconfig.py file is enough.

  • Anything we do not define simply stays at moin's internal defaults which we inherited from DefaultConfig.

2. Unicode options

  • <!> Important: to use unicode values, you must setup a correct coding line in the first line of your configuration file. Check that your editor is configured correctly.

Certain options must use unicode values. For example, the site name could contain German umlauts or French accents or be in Chinese or Hebrew. Because of this, you must use unicode strings for those items. Unicode strings are defined by prefixing the letter u to the string. Here are some examples:

    # Site name, used by default for wiki name-logo [Unicode]
    sitename = u"Jürgen's Wiki"
    # another example:
    sitename = u'הוויקי של יורגן'

Read the comments in the configuration file - they tell you which options must use Unicode values.

Notes:

  • You can't mix different encodings in the same file. If your coding line says iso-8859-1, all your characters, the whole file content, must be in that encoding.

  • If you use utf-8 encoding (or plain ascii), you don't have to use unicode strings, moin will decode your string correctly for you. New in 1.3.2.

3. International Setup

The default configuration file shipped with moin uses iso-8859-1 coding. This is fine for Latin languages like English or German, but not usable for non-latin languages. If you want to have non-latin characters in your configuration items, use utf-8 coding for the config file.

Set the first line of all configuration files to this line:

# -*- coding: utf-8 -*-
  • /!\ You need a text editor being capable of (and also really using) utf-8 encoding for editing the config files.

Values using unicode strings (international users might want to change them):

  • sitename
  • logo_string
  • page_front_page
  • navi_bar
  • page_category_regex
  • page_dict_regex
  • page_group_regex
  • page_template_regex
  • page_license_page - New in 1.3.2
  • page_local_spelling_words - New in 1.3.2
  • acl_rights_default - New in 1.3.2
  • acl_rights_before - New in 1.3.2
  • acl_rights_after - New in 1.3.2
  • mail_from - New in 1.5.0

For ready made configuration in your language, see ConfigMarket. Read also the section about unicode options.

4. Configuration of multiple wikis

The moinmoin wiki engine is capable of handling multiple wikis using a single installation, a single set of configuration files and a single server process. Especially for persistent environments like twisted, this is necessary, because the twisted server will permanently run on a specific IP address and TCP port number. So for virtual hosting of multiple domains (wikis) on the same IP and port, we need the wiki engine to permanently load multiple configs at the same time and choose the right of them when handling a request for a specific URL.

To be able to choose the right config, moin uses config variable wikis located in the file farmconfig.py - it simply contains a list of pairs (wikiname, url-regex). Please only use valid python identifiers for wikiname (to be exact: identifier ::= (letter|"_") (letter | digit | "_")* - just try with a simple word if you didn't understand that grammar rule). When processing a request for some URL, moin searches through this list and tries to match the url-regex against the current URL. If it doesn't match, it simply proceeds to the next pair. If it does match, moin loads a configuration file named <wikiname>.py (usually from the same directory) that contains the configuration for that wiki.

farmconfig.py in the distribution archive has some sample entries for a wiki farm running multiple wikis. You need to adapt it to match your needs if you want to run multiple wikis.

/!\ For simpler writing of these help pages, we will call such a <wikiname>.py configuration file simply wikiconfig.py, of course you have to use the filename you chose.

Of course you have already adapted the wikis setting in farmconfig.py (see above), so we only give some hints how you can save some work. Please also read the single wiki configuration hints, because it explains config inheritance.

We now use the class-based configuration to be able to configure the common settings of your wikis at a single place: in the base configuration class (see farmconfig.py for an example):

farmconfig.py:

# -*- coding: iso-8859-1 -*-
# farmconfig.py:
from MoinMoin.multiconfig import DefaultConfig
class FarmConfig(DefaultConfig):
    url_prefix = '/wiki'
    show_hosts = 1
    underlay_dir = '/where/ever/common/underlay'
    # ...
  • Explanation:
    • first we import the default config, like we do when configuring a single wiki
    • now we define a new farm config class - and inherit from the default config
    • then we change everything that our farm wikis have in common, leaving out the settings that they need to be different
    • this FarmConfig class will now be used by the config files of the wikis instead of moin's internal DefaultConfig class, see below:

The configs of your individual wikis then only keep the settings that need to be different (like the logo, or the data directory or ACL settings). Everything else they get by inheriting from the base configuration class, see moinmaster.py for a sample.

moinmaster.py:

# -*- coding: iso-8859-1 -*-
# moinmaster.py:
from farmconfig import FarmConfig
class Config(FarmConfig):
    show_hosts = 0
    sitename = u'MoinMaster'
    interwikiname = 'MoinMaster'
    data_dir = '/org/de.wikiwikiweb.moinmaster/data/'
    # ...
  • Explanation:
    • see single wiki configuration, the only difference is that we inherit from FarmConfig (that inherited from DefaultConfig) instead of directly using DefaultConfig

    • now we override show_hosts to be 0 - we want it for most wikis in our farm, but not for this one
    • we also override sitename, interwikiname and data_dir (the usual stuff)

5. Overview of configuration options

The following table contains default values and a short description for all configuration variables. Most of these can be left at their defaults, those you need to change with every installation are listed in the sample wikiconfig.py that comes with the distribution.

/!\ Starting with moin 1.3.1, some options must use unicode strings. Read the section about unicode options.

Variable name

Default

Description

SecurityPolicy

None

Class object hook for implementing security restrictions

acl_...

...

wiki-wide access control list definition (see HelpOnAccessControlLists)

allow_xslt

0

True to enable XSLT processing via 4Suite (note that this enables anyone with enough know-how to insert arbitrary HTML into your wiki, which is why it defaults to 0)

actions_excluded

[]

Exclude unwanted actions (list of strings)

attachments

None

If None, send attachments via CGI; else this has to be a dictionary with the path to attachment storage (key dir) and the equivalent URL prefix to that same dir (key url)

auth

[moin_cookie]

list of auth functions, to be called in this order (see HelpOnAuthentication)

bang_meta

1

enable !NoWikiName markup

caching_formats

['text_html']

output formats that are cached; set to [] to turn off caching (useful for development)

changed_time_fmt

'%H:%M'

Time format used on RecentChanges for page edits within the last 24 hours

chart_options

None

If you have gdchart, use something like chart_options = {'width': 720, 'height': 540}

cookie_domain

None

farmconfig: use this domain for the MoinMoin cookie

cookie_path

None

farmconfig: use this path for the MoinMoin cookie

cookie_lifetime

12

12 hours from now until the MoinMoin cookie expires and you get logged out

data_dir

'./data/'

Path to the data directory containing your (locally made) wiki pages.

data_underlay_dir

'./underlay/'

Path to the underlay directory containing distribution system and help pages.

date_fmt

'%Y-%m-%d'

System date format, used mostly in RecentChanges

datetime_fmt

'%Y-%m-%d %H:%M:%S'

Default format for dates and times (when the user has no preferences or chose the "default" date format)

default_markup

'wiki'

Default page parser / format (name of module in MoinMoin.parser)

docbook_html_dir

'...'

Path to the docbook html directory (optional, used by the docbook parser). The default value is correct for Debian Sarge.

editor_default

'text'

Editor to use by default, 'text' or 'gui'

editor_ui

'freechoice'

Editor choice shown on the user interface, 'freechoice' or 'theonepreferred'

editor_force

False

Force using the default editor

edit_locking

'warn 10'

Editor locking policy: None, 'warn <timeout in minutes>', or 'lock <timeout in minutes>'

edit_rows

20

Default height of the edit box

hacks

{}

for use by moin development

hosts_deny

[]

List of denied IPs; if an IP ends with a dot, it denies a whole subnet (class A, B or C)

html_head

""

Additional <HEAD> tags for all pages (see HelpOnSkins)

html_head_posts

robots: noindex,nofollow

Additional <HEAD> tags for POST requests

html_head_index

robots: index,follow

Additional <HEAD> tags for some few index pages

html_head_normal

robots: index,nofollow

Additional <HEAD> tags for most normal pages

html_head_queries

robots: noindex,nofollow

Additional <HEAD> tags for requests with query strings, like actions

html_pagetitle

None

Allows you to set a specific HTML page title (if not set, it defaults to the value of sitename)

interwiki_preferred

[]

In dialogues, show those wikis at the top of the list.

interwikiname

None

InterWiki name (prefix, moniker) of the site, or None

language_default

'en'

Default language for user interface and page content, see HelpOnLanguages!

language_ignore_browser

False

Ignore user's browser language settings, see HelpOnLanguages!

logo_string

sitename

The wiki logo top of page, HTML is allowed (<img> is possible as well) [Unicode]

lupy_search

False

use the lupy indexing search engine

mail_from

None

From: header used in sent mails, e.g. mail_from = u'Jürgen Wiki <[email protected]>'. See /EmailSupport.

mail_login

None

"user pwd" if you need to use SMTP AUTH

mail_smarthost

None

IPv4 address or hostname of an SMTP-enabled server (with optional :port appendix, defaults to 25). Note that email features (notification, mailing of login data) works only if this variable is set.

mail_sendmail

None

If set to e.g. '/usr/sbin/sendmail -t -i', use this sendmail command to send mail. Default is to send mail by an internal function using SMTP.

navi_bar

[u'%(page_front_page)s', u'RecentChanges', u'FindPage', u'HelpContents',]

Most important page names. Users can add more names in their quick links in UserPreferences. To link to URL, use u"[url link title]", to use a shortened name for long page name, use u"[LongLongPageName title]". To use page names with spaces, use u"[page_name_with_spaces any title]" [list of Unicode strings]

nonexist_qm

0

Default for displaying WantedPages with a question mark, like in the original wiki (changeable by the user)

page_category_regex

u'^Category[A-Z]'

Pagenames containing a match for this regex are regarded as Wiki categories [Unicode]

page_credits

[...]

list with html fragments with logos or strings for crediting.

page_dict_regex

u'[a-z0-9]Dict$'

Pagenames containing a match for this regex are regarded as containing variable dictionary definitions [Unicode]

page_footer1

""

Custom HTML markup sent before the system footer (see HelpOnSkins)

page_footer2

""

Custom HTML markup sent after the system footer (see HelpOnSkins)

page_front_page

u'HelpOnLanguages'

Name of the front page. We don't expect you to keep the default. Just read HelpOnLanguages in case you're wondering... [Unicode]

page_group_regex

u'[a-z0-9]Group$'

Pagenames containing a match for this regex are regarded as containing group definitions [Unicode]

page_header1

""

Custom HTML markup sent before the system header / title area (see HelpOnSkins)

page_header2

""

Custom HTML markup sent after the system header / title area (see HelpOnSkins)

page_iconbar

["view", ...]

list of icons to show in iconbar, valid values are only those in page_icons_table. Available only in classic theme.

page_icons_table

dict

dict of {'iconname': (url, title, icon-img-key), ...}. Available only in classic theme.

page_license_enabled

0

Show a license hint in page editor.

page_license_page

u'WikiLicense'

Page linked from the license hint. [Unicode]

page_local_spelling_words

u'LocalSpellingWords'

Name of the page containing user-provided spellchecker words [Unicode]

page_template_regex

u'[a-z0-9]Template$'

Pagenames containing a match for this regex are regarded as templates for new pages [Unicode]

refresh

None

refresh = (minimum_delay_s, targets_allowed) enables use of #refresh 5 PageName processing instruction, targets_allowed must be either 'internal' or 'external'

shared_intermap

None

Path to a file containing global InterWiki definitions (or a list of such filenames)

show_hosts

1

Disable this option to hide host names and IPs

show_interwiki

0

Enable this option to let the theme display your interwiki name

show_login

1

Disable this option to get login/logout action removed

show_names

1

Disable this option to hide names from the info view and RecentChanges (this was previously done by show_hosts)

show_section_numbers

0

True to show section numbers in headings by default

show_timings

0

Shows some timing values at bottom of page - used for development

show_version

0

Show MoinMoin's version at the bottom of each page

sitename

u'Untitled Wiki'

Short description of your wiki site, displayed below the logo on each page, and used in RSS documents as the channel title [Unicode]

stylesheets

[]

List of tuples (media, csshref) to insert after theme css, before user css

superuser

[]

List of trusted user names with wiki system administration super powers (not to be confused with ACL admin rights!). Used for e.g. making full backups, software installation, language installation via SystemPagesSetup and more. See also HelpOnPackageInstaller.

theme_default

'modern'

the name of the theme that is used by default (see HelpOnThemes)

theme_force

False

If True, do not allow to change the theme

trail_size

5

Number of pages in the trail of visited pages

tz_offset

0.0

default time zone offset in hours from UTC

ua_spiders

...|google|wget|...

A regex of HTTP_USER_AGENTs that should be excluded from logging

url_mappings

{}

lookup table to remap URL prefixes (dict of 'prefix': 'replacement'); especially useful in intranets, when whole trees of externally hosted documents move around

url_prefix

'/wiki'

used as the base URL for icons, css, etc.

unzip_attachments_count

51

the number of files which are extracted from the zip file

unzip_attachments_space

200MB

this total amount of bytes can be used to unzip files.

unzip_single_file_size

2MB

size of a single file in the archive which will be extracted

user_autocreate

False

If set to True user accounts are created automatically (see HelpOnAuthentication).

user_checkbox_defaults

dict

Sets the default settings of the UserPreferences checkboxes. See /UserPreferences or multiconfig.py for the default settings. Example: user_checkbox_defaults = {'edit_on_doubleclick': 0}

user_checkbox_disable

[]

a list of checkbox names to be disabled in the UserPreferences. A disabled checkbox is displayed greyedout and uses the default value set in user_checkbox_defaults.

user_checkbox_fields

[...]

list of checkbox items, see /UserPreferences or multiconfig.py

user_checkbox_remove

[]

a list of checkbox names to be removed from the UserPreferences. A removed checkbox uses the default value set in user_checkbox_defaults. See /UserPreferences

user_email_unique

True

check emails for uniqueness and don't accept duplicates.

user_form_defaults

[]

a list of form defaults for UserPreferences. See /UserPreferences

user_form_disable

[]

a list of form field names to be disabled in the UserPreferences. A disabled field is displayed greyedout and uses the default value set in user_form_defaults. See /UserPreferences

user_form_fields

[...]

list of userprefs form items, see /UserPreferences or multiconfig.py

user_form_remove

[]

a list of form field names to be removed from the UserPreferences. A removed form field uses the default value set in user_form_defaults. See /UserPreferences

user_homewiki

Self

farmconfig: wiki where the user home pages are located (useful if you have many users). You could even link to nonwiki "user pages" if the wiki username is in the target URL.

xmlrpc_putpage_enabled

False

True to enable wikirpc's putPage call writing to the given pagename. When False, it always writes to PutPageTestPage instead of the given pagename.

xmlrpc_putpage_trusted_only

True

Require users using putPage call to be in Trusted group (usually achieved by http auth).

Some values can only be set from MoinMoin/config.py (part of the MoinMoin code and thus GLOBALLY changing behaviour of all your wikis), but not from the individual wiki's config - you should only touch them if you know what you are doing:

charset

'utf-8'

the encoding / character set used by the wiki

lowerletters

ucs-2 lowercase letters

Lowercase letters, used to define what is a WikiName

smileys

{}

user-defined smileys (a dict with the markup as the key and a tuple of width, height, border, image name as the value)

umask

0770

umask used on all open(), mkdir() and similar calls

upperletters

ucs-2 uppercase letters

uppercase letters, used to define what is a WikiName

url_schemas

[]

additional URL schemas you want to have recognized (list of strings; e.g. ['ldap', 'imap'])

6. Special options

6.1. Character Set

Moin uses unicode internally, and utf-8 for external output and input, like pages, html output and translation files. The external character set is defined in config.charset to utf-8. This setting is fine for all languages, as any character can be encoded in utf-8. You should not change this value, although technically it is possible.

  • <!> Do not change config.charset. It is not tested and we can't support this.