Exemplo n.º 1
0
 def __init__(self, dbconfig = None, autocreate = False):
     MoinAuth.__init__(self)
     
     self.dbconfig = dbconfig
     self.autocreate = autocreate
     
     self.phpass = phpass.PasswordHash()
Exemplo n.º 2
0
    def __init__(self, dbconfig=None, autocreate=False):
        MoinAuth.__init__(self)

        self.dbconfig = dbconfig
        self.autocreate = autocreate

        self.phpass = phpass.PasswordHash()
Exemplo n.º 3
0
class Config(FarmConfig):
    logo_string = u'<img src="/images/noctis-logo-100.png" alt="Noctis logo">'
    #logo_string = u'<a href="http://www.homeworld2complex.com/index1.htm"><img src="http://www.homeworld2complex.com/images/H2C700x525.jpg" width="350" height="263" alt="April Fools!"></a>'

    # basic options (you normally need to change these)
    sitename = u'AlopexWiki'  # [Unicode]
    interwikiname = u'AlopexWiki'  # [Unicode]

    # name of entry page / front page [Unicode], choose one of those:

    # a) if most wiki content is in a single language
    #page_front_page = u"MyStartingPage"

    # b) if wiki content is maintained in many languages
    page_front_page = u"FrontPage"

    data_dir = '/srv/www/alopex.li/moindata/'
    data_underlay_dir = '/usr/share/moin/underlay/'
    #acl_rights_default = u'Known:read TrustedEditorGroup:read,write,delete,revert All:read AdminGroup:read,write,delete,revert,admin'
    acl_rights_default = u'AdminGroup:read,write,delete,revert,admin TrustedEditorGroup:read,write,delete,revert Known:read All:read'

    #auth = [MoinAuth()]
    auth = [MoinAuth(), OpenIDAuth()]
    # Must be >0 for openid
    cookie_lifetime = (1, 12)

    # Fast search
    xapian_search = True

    # Favicon
    html_head = '''<link rel="shortcut icon" href="/noctis-favicon.ico"> '''
Exemplo n.º 4
0
 class Config(wikiconfig.Config):
     from MoinMoin.auth.ldap_login import LDAPAuth
     from MoinMoin.auth import MoinAuth
     #ToDo get these vars from the test environment
     server_uri = 'ldap://127.0.0.1:3890'
     base_dn = 'ou=testing,dc=example,dc=org'
     ldap_auth = LDAPAuth(server_uri=server_uri,
                          base_dn=base_dn,
                          autocreate=True)
     moin_auth = MoinAuth()
     auth = [ldap_auth, moin_auth]
Exemplo n.º 5
0
class Config(multiconfig.DefaultConfig):

    # Critical setup  ---------------------------------------------------

    # Directory containing THIS wikiconfig:
    wikiconfig_dir = os.path.abspath(os.path.dirname(__file__))

    # We assume that this config file is located in the instance directory, like:
    # instance_dir/
    #              wikiconfig.py
    #              data/
    #              underlay/
    # If that's not true, feel free to just set instance_dir to the real path
    # where data/ and underlay/ is located:
    #instance_dir = '/where/ever/your/instance/is'
    instance_dir = wikiconfig_dir

    # Where your own wiki pages are (make regular backups of this directory):
    data_dir = os.path.join(instance_dir, 'data', '')  # path with trailing /

    # Where system and help pages are (you may exclude this from backup):
    data_underlay_dir = os.path.join(instance_dir, 'underlay',
                                     '')  # path with trailing /

    # The URL prefix we use to access the static stuff (img, css, js).
    # Note: moin runs a static file server at url_prefix_static path (relative
    # to the script url).
    # If you run your wiki script at the root of your site (/), just do NOT
    # use this setting and it will automatically work.
    # If you run your wiki script at /mywiki, you need to use this:
    #url_prefix_static = '/mywiki' + url_prefix_static
    url_prefix_static = '/moin_static197_20140407'

    # Wiki identity ----------------------------------------------------

    # Site name, used by default for wiki name-logo [Unicode]
    sitename = u'志愿百科'

    # Wiki logo. You can use an image, text or both. [Unicode]
    # For no logo or text, use '' - the default is to show the sitename.
    # See also url_prefix setting below!
    logo_string = u'<a href="/志愿百科"><img src="/moin_static197_20140407/ngowiki/img/sitelogo.png" alt="Site Logo"></a>'

    # name of entry page / front page [Unicode], choose one of those:

    # a) if most wiki content is in a single language
    #page_front_page = u"MyStartingPage"

    # b) if wiki content is maintained in many languages
    page_front_page = u'志愿百科'

    # The interwiki name used in interwiki links
    #interwikiname = u'UntitledWiki'
    # Show the interwiki name (and link it to page_front_page) in the Theme,
    # nice for farm setups or when your logo does not show the wiki's name.
    #show_interwiki = 1

    # Security ----------------------------------------------------------

    # This is checked by some rather critical and potentially harmful actions,
    # like despam or PackageInstaller action:
    superuser = [
        u"administrator",
    ]

    # IMPORTANT: grant yourself admin rights! replace YourName with
    # your user name. See HelpOnAccessControlLists for more help.
    # All acl_rights_xxx options must use unicode [Unicode]
    acl_rights_before = u"administrator:read,write,delete,revert,admin All:read"

    # The default (ENABLED) password_checker will keep users from choosing too
    # short or too easy passwords. If you don't like this and your site has
    # rather low security requirements, feel free to DISABLE the checker by:
    #password_checker = None # None means "don't do any password strength checks"

    # Link spam protection for public wikis (Uncomment to enable)
    # Needs a reliable internet connection.
    from MoinMoin.security.antispam import SecurityPolicy

    from MoinMoin.auth import MoinAuth
    from MoinMoin.auth.openid import OpenIDQWAuth
    auth = [MoinAuth(), OpenIDQWAuth()]
    #auth = [OpenIDQWAuth(), MoinAuth()]
    cookie_lifetime = (2, 12)
    qq_app_id = 101195180
    wb_app_key = 3720383348

    # Mail --------------------------------------------------------------

    # Configure to enable subscribing to pages (disabled by default)
    # or sending forgotten passwords.

    # SMTP server, e.g. "mail.provider.com" (None to disable mail)
    #mail_smarthost = ""

    # The return address, e.g u"Jrgen Wiki <*****@*****.**>" [Unicode]
    #mail_from = u""

    # "user pwd" if you need to use SMTP AUTH
    #mail_login = ""

    # User interface ----------------------------------------------------

    # Add your wikis important pages at the end. It is not recommended to
    # remove the default links.  Leave room for user links - don't use
    # more than 6 short items.
    # You MUST use Unicode strings here, but you need not use localized
    # page names for system and help pages, those will be used automatically
    # according to the user selected language. [Unicode]
    navi_bar = [
        # If you want to show your page_front_page here:
        #u'%(page_front_page)s',
        u'RecentChanges',
        u'FindPage',
        u'HelpContents',
    ]

    # The default theme anonymous or new users get
    theme_default = 'ngowiki'

    # Language options --------------------------------------------------

    # See http://moinmo.in/ConfigMarket for configuration in
    # YOUR language that other people contributed.

    # The main wiki language, set the direction of the wiki pages
    language_default = 'zh'
    language_ignore_browser = True

    # the following regexes should match the complete name when used in free text
    # the group 'all' shall match all, while the group 'key' shall match the key only
    # e.g. CategoryFoo -> group 'all' ==  CategoryFoo, group 'key' == Foo
    # moin's code will add ^ / $ at beginning / end when needed
    # You must use Unicode strings here [Unicode]
    page_category_regex = ur'(?P<all>(?P<prefix>Category)?(?P<key>\S+)(?(prefix)|类))'
    page_dict_regex = ur'(?P<all>(?P<key>\S+)(Dict|字典))'
    page_group_regex = ur'(?P<all>(?P<key>\S+)(Group|组))'
    page_template_regex = ur'(?P<all>(?P<key>\S+)(Template|模板))'

    # Content options ---------------------------------------------------

    # Show users hostnames in RecentChanges
    show_hosts = 1

    # Enable graphical charts, requires gdchart.
    #chart_options = {'width': 600, 'height': 300}

    surge_action_limits = None
Exemplo n.º 6
0
class FarmConfig(DefaultConfig):
    from MoinMoin.auth import MoinAuth
    # use ExternalCookie, also allow the usual moin login
    auth = [ExternalCookie(), MoinAuth()]
Exemplo n.º 7
0
class Config(FarmConfig):

    # Wiki identity ----------------------------------------------------

    # Site name, used by default for wiki name-logo [Unicode]
    sitename = u'Python Wiki'
    # Wiki logo. You can use an image, text or both. [Unicode]
    # Example: u'<img src="/wiki/mywiki.png" alt="My Wiki">My Wiki'
    # For no logo or text, use ''
    #logo_string = sitename
    logo_string = '</a><a href="http://www.python.org"><img src="/wiki/europython/img/python-logo.gif" alt="Python" ></a><a name="logo">'

    theme_default = 'europython'

    # The interwiki name used in interwiki links
    interwikiname = None

    # Critical setup  ---------------------------------------------------

    # Misconfiguration here will render your wiki unusable. Check that
    # all directories are accessible by the web server or moin server.

    # If you encounter problems, try to set data_dir and data_underlay_dir
    # to absolute paths.

    # Where your mutable wiki pages are. You want to make regular
    # backups of this directory.
    data_dir = '/data/moin/instances/python/data/'

    # Security ----------------------------------------------------------

    # mvl 110304 add openid. requires anonymous sessions
    auth = [MoinAuth(), OpenIDAuth()]
    cookie_lifetime = (1, 12)
    superuser = ['EWDurbin']

    # Security critical actions (disabled by default)
    # Uncomment to enable options you like.

    # IMPORTANT: grant yourself admin rights! replace YourName with
    # your user name. See HelpOnAccessControlLists for more help.
    acl_rights_before = u"BlockedUsersGroup: AdminGroup:read,write,delete,revert,admin"

    # Only users in the NewUsersGroup may edit pages, since we're simply
    # getting too much spam and vandalism. MAL 2014-05-31
    acl_rights_default = u"EditorsGroup:read,write,delete,revert All:read"

    # Link spam protection for public wikis (Uncomment to enable)
    # Needs a reliable internet connection.
    from MoinMoin.security.antispam import SecurityPolicy

    # Enable textchas.
    textchas_disabled_group = u"TrustedEditorsGroup"
    textchas = {
        'en': {
            #u"How many words are in this question?": ur" *(7|(?i)seven) *",
            #u"What is Abraham Lincoln's first name?": ur" *(?i)abraham *",
            #u"What does Python's interactive prompt look like?": ur" *>>> *",
            u"What is van Rossum's first name?": ur" *(?i)guido *",
            u"Which foundation protects the Python IP?":
            ur" *(?i)(psf|python +software +foundation|python +software|python +foundation) *",
            u"x = 1; x += 1; x ==": ur" *(?i)(2|two) *",
            u"x = 2; x /= 2; x ==": ur" *(?i)(1|1.0|one) *",
            u"l = [1,2,3]; l.remove(1); l[0] ==": ur" *(?i)(2|two) *",
            u"l = [1,2,3]; del l[1]; l[0] ==": ur" *(?i)(1|one) *",
            u"s = 'guido'; s[3:5] ==": ur" *['\"]?(?i)do['\"]? *",
            u"PyPI is also called": ur" *(?i)(cheese *shop) *",
            u"The cheeseshop is also called": ur" *(?i)(py *pi) *",
        },
    }

    # Mail --------------------------------------------------------------

    # User interface ----------------------------------------------------

    # Add your wikis important pages at the end. It is not recommended to
    # remove the default links.  Leave room for user links - don't use
    # more than 6 short items.
    # You MUST use Unicode strings here, but you need not use localized
    # page names for system and help pages, those will be used automatically
    # according to the user selected language. [Unicode]
    navi_bar = [
        # Will use page_front_page, (default FrontPage)
        u'%(page_front_page)s',
        u'RecentChanges',
        u'FindPage',
        u'HelpContents',
    ]

    page_footer2 = '<p style="text-align: center; font-size: 85%"><a href="/moin/FrontPage#use">Unable to edit the page? See the FrontPage for instructions.</a></p>'

    # Language options --------------------------------------------------

    # See http://moinmoin.wikiwikiweb.de/ConfigMarket for configuration in
    # YOUR language that other people contributed.

    # The main wiki language, set the direction of the wiki pages
    default_lang = 'en'

    # Content options ---------------------------------------------------

    # Show users hostnames in RecentChanges
    show_hosts = 1

    # Enumerate headlines?
    show_section_numbers = 0

    # Charts size, require gdchart (Set to None to disable).
    chart_options = {'width': 600, 'height': 300}
Exemplo n.º 8
0
 class Config(wikiconfig.Config):
     from MoinMoin.auth import MoinAuth
     auth = [MoinAuth()]