[FrontPage] [TitleIndex] [WordIndex

HelpContents > HelpForAdministrators > HelpOnConfiguration

This page should help you with configuring an already installed MoinMoin wiki. If you have not installed one yet please go to HelpOnInstalling.

General

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.

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:

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 -*-

Values using unicode strings can be recognized by their default value being u"...." or ur"..." (the u means unicode) or when the description explicitly tells [unicode].

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

3. Customization of user preferences

You can predefine, disable or remove several options in the user preferences, see HelpOnConfiguration/UserPreferences.

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 can be located anywhere, you just have make sure it can be imported by moin - it is a good idea to add the directory where it resides as first element to sys.path (this is the list of pathes python uses when searching for importable stuff). sys.path setup is done early, usually in the server adaptor script you use (e.g. moin.cgi or moin.wsgi) - see the comments in the script for details.

General notes on wiki/farmconfig.py structure:

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

from MoinMoin.config.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...

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.config.multiconfig import DefaultConfig
class FarmConfig(DefaultConfig):
    url_prefix = '/wiki'
    show_hosts = True
    underlay_dir = '/where/ever/common/underlay'
    # ...

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 = False
    sitename = u'MoinMaster'
    interwikiname = 'MoinMaster'
    data_dir = '/org/de.wikiwikiweb.moinmaster/data/'
    # ...

Overview of Configuration Options

The following table contains default values and a short description for most 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.

(!) You can also have a look at MoinMoin/config/multiconfig.py, class DefaultConfig for further information (that file has the builtin default configuration).

Variable name

Default

Description

DesktopEdition

False

if True, give all local users special powers - only use this for a local desktop wiki!

SecurityPolicy

None

Class object hook for implementing security restrictions

acl_...

...

wiki-wide access control list definition (see HelpOnAccessControlLists)

actions_excluded

['xmlrpc', 'CopyPage', 'MyPages']

Exclude unwanted actions (list of strings)

allow_xslt

False

if True, enables 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 False)

anonymous_session_lifetime

None

Lifetime in hours of the session cookie for anonymous users. See HelpOnSessions.

antispam_master_url

"http://master.moinmo.in/?action=xmlrpc2"

where antispam security policy fetches spam pattern updates (if it is enabled)

auth

[MoinAuth()]

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

auth_methods_trusted

['http', 'xmlrpc_applytoken']

authentication methods for which users should be included in the special "Trusted" ACL group.

bang_meta

True

if True, enable !NoWikiName markup

cache_dir

'<data_dir>/cache'

Path to the farm wide cache directory.

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_*

...

Change domain, path and lifetime of moin's session cookie, see HelpOnSessions.

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 directory with the Docbook to HTML XSLT files (optional, used by the docbook parser). The default value is correct for Debian Etch.

edit_bar

['Edit', ..., 'ActionsMenu']

list of edit bar entries

editor_default

'text'

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

editor_force

False

if True, force using the default editor

editor_ui

'freechoice'

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

editor_quickhelp

{'wiki':"...", ...}

Quickhelp provided at the bottom of edit pages. To customize, specify a dictionary with key matching default_markup (e.g. 'wiki') and give a string value containing wiki markup

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

history_count

(100, 200)

number of revisions shown for info/history action (default_count_shown, max_count_shown)

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, see HelpOnThemes.

html_pagetitle

None

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

interwikiname

None

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

interwiki_preferred

[]

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

language_default

'en'

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

language_ignore_browser

False

if True, 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]

log_reverse_dns_lookups

True

if True, do a reverse DNS lookup on page SAVE. If your DNS is broken, set this to False to speed up SAVE.

log_timing

False

if True, add timing infos to the log output to analyse load conditions

mail_...

...

Sending and receiving of email, see /EmailSupport.

mimetypes_xss_protect

['text/html', ...]

"content-disposition: inline" isn't used for them when a user downloads such attachments

mimetypes_embed

[...]

mimetypes that can be embedded by EmbedObject macro

navi_bar

[u'RecentChanges',
u'FindPage',
u'HelpContents',]

Most important page names. Users can add more names in their quick links in user preferences. 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

False

if True, display links to non-existing pages with a question mark by default, like in the original wiki (can be changed in userprefs)

page_category_regex

ur'(?P<all>Category(?P<key>\S+))'

Pagenames exactly matching this regex are regarded as Wiki categories [Unicode]

page_credits

[...]

list with html fragments with logos or strings for crediting.

page_dict_regex

ur'(?P<all>(?P<key>\S+)Dict)'

Pagenames exactly matching this regex are regarded as pages containing variable dictionary definitions [Unicode]

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

ur'(?P<all>(?P<key>\S+)Group)'

Pagenames exactly matching this regex are regarded as pages containing group definitions [Unicode]

page_header* / page_footer*

...

Custom HTML markup sent by the theme, see HelpOnThemes.

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 of {'iconname': (url, title, icon-img-key), ...}. Available only in classic theme.

page_license_enabled

False

if True, 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

ur'(?P<all>(?P<key>\S+)Template)'

Pagenames exactly matching this regex are regarded as pages containing templates for new pages [Unicode]

password_checker

func(username, password)

checks whether a password is acceptable (default check is length >= 6, at least 4 different chars, no keyboard sequence, not username used somehow (you can switch this off by using None)

quicklinks_default

[]

List of preset quicklinks for a newly created user accounts. Existing accounts are not affected by this option whereas changes in navi_bar do always affect existing accounts. Preset quicklinks can be removed by the user in the user preferences menu, navi_bar settings not.

refresh

None

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

rss_cache

60

suggested caching time for RecentChanges RSS, in seconds

search_results_per_page

25

Number of hits shown per page in the search results

secrets

'...'

Long, random, secret string used by some subsystems (Default: auto-generate from some other config settings)

session_handler

DefaultSessionHandler()

Session handler, see HelpOnSessions

shared_intermap

None

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

show_hosts

True

if True, show host names and IPs. Set to False to hide them.

show_interwiki

False

if True, let the theme display your interwiki name

show_names

True

if True, show user names in the revision history and on RecentChanges. Set to False to hide them.

show_section_numbers

0

1 to show section numbers in headings by default

show_timings

False

if True, show some timing values at bottom of a page

show_version

False

if True, show moin's version at the bottom of a page

sistersites

[]

list of tuples ('WikiName', 'sisterpagelist_fetch_url')

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

[(media, csshref), ...]

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

subscribed_pages_default

[]

List of pagenames used for presetting page subscriptions for newly created user accounts.

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 HelpOnSuperUser.

supplementation_page

False

if True, show a link to the supplementation page in the theme

supplementation_page_name

u'Discussion'

default name of the supplementation (sub)page [unicode]

supplementation_page_template

u'DiscussionTemplate'

default template used for creation of the supplementation page [unicode]

surge_*

...

Surge protection tries to deny clients causing too much load/traffic, see /SurgeProtection.

textchas*

...

Spam protection setup using site-specific questions/answers, see HelpOnTextChas.

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

traceback_show

True

if True, show debug tracebacks to users when moin crashes

traceback_log_dir

None

Directory to store tracebacks or None.

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

unzip_attachments_count

101

max. number of files which are extracted from the zip file

unzip_attachments_space

200000000

max. total amount of bytes can be used to unzip files [bytes]

unzip_single_file_size

2000000

max. size of a single file in the archive which will be extracted [bytes]

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_static

'/moin_static170'

used as the base URL for icons, css, etc. - includes the moin version number and changes on every release. This replaces the deprecated and sometimes confusing url_prefix = '/wiki' setting.

url_prefix_action

None

Use 'action' to enable action URL generation to be compatible with robots.txt. It will generate .../action/info/PageName?action=info then. Recommended for internet wikis.

userprefs_disabled

[]

Disable the listed user preferences plugins

user_autocreate

False

if True, user accounts are created automatically (see HelpOnAuthentication).

user_dir

<data_dir>/user

share user data between multiple wikis. See HelpOnUserHandling

user_email_unique

True

if True, check email addresses for uniqueness and don't accept duplicates.

user_jid_unique

True

if True, check Jabber IDs for uniqueness and don't accept duplicates.

user_homewiki

Self

interwiki name of the 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.

user_checkbox_* / user_form_*

...

Disable / remove / set defaults for user preferences, see /UserPreferences.

xapian_*

...

Configuration of the Xapian based indexed search, see HelpOnXapian.

Some values can only be set from MoinMoin/config/__init__.py (part of the moin 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 <!> Do not change config.charset. It is not tested and we can't support this.

lowerletters

ucs-2 lowercase letters

Lowercase letters, used to define what is a WikiName

smileys

[...]

a list of smiley markups moin supports - image and image sizes are defined in the theme code.

umask

0770

umask used by moin, the default gives rights to owner and group, but not to world.

upperletters

ucs-2 uppercase letters

uppercase letters, used to define what is a WikiName

url_schemas

['http', 'ftp', ...]

URL schemas you want to have recognized

Related Topics


HelpForDevelopers HelpForUsers


2018-04-20 12:04