Attachment 'farmconfig.py'

Download

   1 # -*- coding: iso-8859-1 -*-
   2 # IMPORTANT! This encoding (charset) setting MUST be correct! If you live in a
   3 # western country and you don't know that you use utf-8, you probably want to
   4 # use iso-8859-1 (or some other iso charset). If you use utf-8 (a Unicode
   5 # encoding) you MUST use: coding: utf-8
   6 # That setting must match the encoding your editor uses when you modify the
   7 # settings below. If it does not, special non-ASCII chars will be wrong.
   8 
   9 """
  10     MoinMoin - Configuration for a wiki farm
  11 
  12     If you run a single wiki only, you can keep the "wikis" list "as is"
  13     (it has a single rule mapping all requests to mywiki.py).
  14 
  15     Note that there are more config options than you'll find in
  16     the version of this file that is installed by default; see
  17     the module MoinMoin.config.multiconfig for a full list of names and their
  18     default values.
  19 
  20     Also, the URL http://moinmo.in/HelpOnConfiguration has
  21     a list of config options.
  22 """
  23 
  24 
  25 # Wikis in your farm --------------------------------------------------
  26 
  27 # If you run multiple wikis, you need this list of pairs (wikiname, url
  28 # regular expression). moin processes that list and tries to match the
  29 # regular expression against the URL of this request - until it matches.
  30 # Then it loads the <wikiname>.py config for handling that request.
  31 
  32 # Important:
  33 #  * the left part is the wikiname enclosed in double quotes
  34 #  * the left part must be a valid python module name, so better use only
  35 #    lower letters "a-z" and "_". Do not use blanks or "-" there!!!
  36 #  * the right part is the url re, use r"..." for it
  37 #  * the right part does NOT include "http://" nor "https://" at the beginning
  38 #  * in the right part ".*" means "everything". Just "*" does not work like
  39 #    for filenames on the shell / commandline, you must use ".*" as it is a RE.
  40 #  * in the right part, "^" means "beginning" and "$" means "end"
  41 
  42 wikis = [
  43     # Standalone server needs the port e.g. localhost:8000
  44     # Twisted server can now use the port, too.
  45 
  46     # wikiname,     url regular expression (no protocol)
  47     # ---------------------------------------------------------------
  48     #("profitwiki",  r".*"),   # this is ok for a single wiki   #bse 3-20-2007
  49     ("profitwiki",  r"^profitwiki.btv.ibm.com/profitwiki.*$"),    #to add infrawiki bse 4-4-2008
  50     ("infrawiki",  r"^profitwiki.btv.ibm.com/infrawiki.*$"),    #to add infrawiki bse 4-4-2008
  51     ("profitwiki",  r"^profitwiki/profitwiki.*$"),    #to add infrawiki bse 4-4-2008
  52     ("infrawiki",  r"^profitwiki/infrawiki.*$"),    #to add infrawiki bse 4-4-2008
  53     # for multiple wikis, do something like this:
  54     #("moinmoin",    r"^moinmo.in/.*$"),
  55     #("moinmaster",  r"^master.moinmo.in/.*$"),
  56 ]
  57 
  58 
  59 # Common configuration for all wikis ----------------------------------
  60 
  61 # Everything that should be configured the same way should go here,
  62 # anything else that should be different should go to the single wiki's
  63 # config.
  64 # In that single wiki's config, we will use the class FarmConfig we define
  65 # below as the base config settings and only override what's different.
  66 #
  67 # In exactly the same way, we first include MoinMoin's Config Defaults here -
  68 # this is to get everything to sane defaults, so we need to change only what
  69 # we like to have different:
  70 
  71 from MoinMoin.config.multiconfig import DefaultConfig
  72 
  73 # Now we subclass this DefaultConfig. This means that we inherit every setting
  74 # from the DefaultConfig, except those we explicitely define different.
  75 
  76 class FarmConfig(DefaultConfig):
  77 
  78     # Critical setup  ---------------------------------------------------
  79 
  80     # Misconfiguration here will render your wiki unusable. Check that
  81     # all directories are accessible by the web server or moin server.
  82 
  83     # If you encounter problems, try to set data_dir and data_underlay_dir
  84     # to absolute paths.
  85 
  86     # Where your mutable wiki pages are. You want to make regular
  87     # backups of this directory.
  88     #data_dir = './data/'   #bse 3-20-2007
  89 
  90     # Where read-only system and help page are. You might want to share
  91     # this directory between several wikis. When you update MoinMoin,
  92     # you can safely replace the underlay directory with a new one. This
  93     # directory is part of MoinMoin distribution, you don't have to
  94     # backup it.
  95     #data_underlay_dir = './underlay/'   #bse 3-20-2007
  96 
  97     # The URL prefix we use to access the static stuff (img, css, js).
  98     # NOT touching this is maybe the best way to handle this setting as moin
  99     # uses a good internal default (something like '/moin_static171' for moin
 100     # version 1.7.1).
 101     # For Twisted and standalone server, the default will automatically work.
 102     # For others, you should make a matching server config (e.g. an Apache
 103     # Alias definition pointing to the directory with the static stuff).
 104     #url_prefix_static = '/moin_static171'
 105 
 106 
 107     # Security ----------------------------------------------------------
 108 
 109     # This is checked by some rather critical and potentially harmful actions,
 110     # like despam or PackageInstaller action:
 111     superuser = [u"BrentElmer",u"brente@us.ibm.com" ]
 112 
 113     # IMPORTANT: grant yourself admin rights! replace YourName with
 114     # your user name. See HelpOnAccessControlLists for more help.
 115     # All acl_rights_xxx options must use unicode [Unicode]
 116     acl_rights_before = u"brente@us.ibm.com:read,write,delete,revert,admin"
 117 
 118     acl_rights_default = u'Known:read,write,delete,revert All:read'
 119  
 120     # Link spam protection for public wikis (uncomment to enable).
 121     # Needs a reliable internet connection.
 122     #from MoinMoin.security.antispam import SecurityPolicy
 123 
 124 
 125     # Mail --------------------------------------------------------------
 126 
 127     # Configure to enable subscribing to pages (disabled by default) or
 128     # sending forgotten passwords.
 129 
 130     # SMTP server, e.g. "mail.provider.com" (empty or None to disable mail)
 131     mail_smarthost = "na.relay.ibm.com"
 132 
 133     # The return address, e.g u"Jürgen Wiki <noreply@mywiki.org>" [Unicode]
 134     mail_from = u"Profit Wiki <noreply@profitwiki.com"
 135 
 136     # "user pwd" if you need to use SMTP AUTH
 137     #mail_login = ""
 138 
 139 
 140     # User interface ----------------------------------------------------
 141 
 142     # Add your wikis important pages at the end. It is not recommended to
 143     # remove the default links.  Leave room for user links - don't use
 144     # more than 6 short items.
 145     # You MUST use Unicode strings here, but you need not use localized
 146     # page names for system and help pages, those will be used automatically
 147     # according to the user selected language. [Unicode]
 148     navi_bar = [
 149         # If you want to show your page_front_page here:
 150         #u'%(page_front_page)s',
 151         u'RecentChanges',
 152         u'FindPage',
 153         u'HelpContents',
 154     ]
 155 
 156     # The default theme anonymous or new users get
 157     theme_default = 'modern'
 158 
 159 
 160     # Language options --------------------------------------------------
 161 
 162     # See http://moinmo.in/ConfigMarket for configuration in
 163     # YOUR language that other people contributed.
 164 
 165     # The main wiki language, set the direction of the wiki pages
 166     language_default = 'en'
 167 
 168     # the following regexes should match the complete name when used in free text
 169     # the group 'all' shall match all, while the group 'key' shall match the key only
 170     # e.g. CategoryFoo -> group 'all' ==  CategoryFoo, group 'key' == Foo
 171     # moin's code will add ^ / $ at beginning / end when needed
 172     # You must use Unicode strings here [Unicode]
 173     page_category_regex = ur'(?P<all>Category(?P<key>\S+))'
 174     page_dict_regex = ur'(?P<all>(?P<key>\S+)Dict)'
 175     page_group_regex = ur'(?P<all>(?P<key>\S+)Group)'
 176     page_template_regex = ur'(?P<all>(?P<key>\S+)Template)'
 177 
 178     # Content options ---------------------------------------------------
 179 
 180     # Show users hostnames in RecentChanges
 181     show_hosts = 1
 182 
 183     # Show the interwiki name (and link it to page_front_page) in the Theme,
 184     # nice for farm setups or when your logo does not show the wiki's name.
 185     show_interwiki = 1
 186     logo_string = u''
 187 
 188     # Enable graphical charts, requires gdchart.
 189     chart_options = {'width': 600, 'height': 300}   #bse 3-20-2007
 190 
 191     # The GUI WYSISYG editor is not installed with Debian.
 192     # See /usr/share/doc/$(cdbs_curpkg)/README.Debian for more info
 193     editor_force = True
 194     editor_default = 'text'  # internal default, just for completeness
 195 
 196     # See HelpOnAuthentication and HelpOnConfiguration for more infos.
 197 
 198     from MoinMoin.auth.ldap_login import LDAPAuth
 199     ldap_authenticator1 = LDAPAuth(
 200         # the values shown below are the DEFAULT values (you may remove them if you are happy with them),
 201         # the examples shown in the comments are typical for Active Directory (AD) or OpenLDAP.
 202         server_uri='ldap://bluepages.ibm.com:389',  # ldap / active directory server URI
 203                                         # use ldaps://server:636 url for ldaps,
 204                                         # use  ldap://server for ldap without tls (and set start_tls to 0),
 205         bind_dn='%(username)s',  # We can either use some fixed user and password for binding to LDAP.
 206                                   # use  ldap://server for ldap with tls (and set start_tls to 1 or 2).
 207 
 208         #bind_dn="l.search_s('ou=bluepages,o=ibm.com', ldap.SCOPE_SUBTREE, 'mail=%s' % '%(username)s)[0][0]",  # We can either use some fixed user and password for binding to LDAP.
 209                      # Be careful if you need a % char in those strings - as they are used as
 210                      # a format string, you have to write %% to get a single % in the end.
 211                      #bind_dn = 'binduser@example.org' # (AD)
 212                      #bind_dn = 'cn=admin,dc=example,dc=org' # (OpenLDAP)
 213                      #bind_pw = 'secret'
 214                      # or we can use the username and password we got from the user:
 215                      #bind_dn = '%(username)s@example.org' # DN we use for first bind (AD)
 216                      #bind_pw = '%(password)s' # password we use for first bind
 217                      # or we can bind anonymously (if that is supported by your directory).
 218                      # In any case, bind_dn and bind_pw must be defined.
 219         bind_pw='%(password)s',
 220         base_dn='ou=bluepages,o=ibm.com',  # base DN we use for searching
 221                      #base_dn = 'ou=SOMEUNIT,dc=example,dc=org'
 222         scope=2, # scope of the search we do (2 == ldap.SCOPE_SUBTREE)
 223         referrals=0, # LDAP REFERRALS (0 needed for AD)
 224         search_filter='(mail=%(username)s)',  # ldap filter used for searching:
 225                                              #search_filter = '(sAMAccountName=%(username)s)' # (AD)
 226                                              #search_filter = '(uid=%(username)s)' # (OpenLDAP)
 227                                              # you can also do more complex filtering like:
 228                                              # "(&(cn=%(username)s)(memberOf=CN=WikiUsers,OU=Groups,DC=example,DC=org))"
 229         # some attribute names we use to extract information from LDAP (if not None,
 230         # if None, the attribute won't be extracted from LDAP):
 231         givenname_attribute=None, # often 'givenName' - ldap attribute we get the first name from
 232         surname_attribute=None, # often 'sn' - ldap attribute we get the family name from
 233         aliasname_attribute=None, # often 'displayName' - ldap attribute we get the aliasname from
 234         email_attribute=None, # often 'mail' - ldap attribute we get the email address from
 235         email_callback=None, # callback function called to make up email address
 236         coding='utf-8', # coding used for ldap queries and result values
 237         timeout=10, # how long we wait for the ldap server [s]
 238         start_tls=0, # usage of Transport Layer Security 0 = No, 1 = Try, 2 = Required
 239         tls_cacertdir='',
 240         tls_cacertfile='',
 241         tls_certfile='',
 242         tls_keyfile='',
 243         tls_require_cert=0, # 0 == ldap.OPT_X_TLS_NEVER (needed for self-signed certs)
 244         bind_once=False, # set to True to only do one bind - useful if configured to bind as the user on the first attempt
 245     )
 246 
 247     auth = [ldap_authenticator1, ] # this is a list, you may have multiple ldap authenticators
 248                                    # as well as other authenticators
 249 
 250     cookie_lifetime = 1 # 1 hour after last access ldap login is required again
 251     user_autocreate = True
 252 
 253     # customize user preferences (optional, see MoinMoin/config/multiconfig for internal defaults)
 254     # you maybe want to use user_checkbox_remove, user_checkbox_defaults, user_form_defaults,
 255     # user_form_disable, user_form_remove.

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-02-05 13:38:17, 12.3 KB) [[attachment:farmconfig.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.