[FrontPage]

Hacking MoinMoin

Installazione

Si supponga che nginx sia già in esecuzione e che uwsgi sia già installato. Si suppone inoltre che nginx sia in esecuzione come utente www. Si scarichi la versione 1.9.8 di MoinMoin e la si estragga in una directory a scelta, in questo esempio /usr/local/www/unit_moinmoin.

Configurazione di uwsgi

Si salvi la configurazione di uwsgi per la wiki, ad esempio in /usr/local/etc/uwsgi/unit_moinmoin.ini.

   1 [uwsgi]
   2 socket = /tmp/unit_moinmoin.sock
   3 chmod-socket = 660
   4 
   5 chdir = /usr/local/www/unit_moinmoin
   6 wsgi-file = moin.wsgi
   7 
   8 master
   9 workers = 2
  10 max-requests = 200
  11 harakiri = 30
  12 die-on-term

Si avvii il demone con uwsgi -T --ini /usr/local/etc/uwsgi/unit_moinmoin.ini.

Configurazione di nginx

Aggiungere al blocco server desiderato la direttiva

location / {
    uwsgi_pass /tmp/unit_moinmoin.sock;
    include uwsgi_params;
}

location  = /favicon.ico  {
    alias  /usr/local/www/unit_moinmoin/static/favicon.ico;
}

location  ~ ^/moin_static[0-9]+/(.*)  {
    alias  /usr/local/www/unit_moinmoin/static/$1;
}

Quindi ricaricare la configurazione come usuale.

Configurazione di MoinMoin

   1     # Wiki identity ----------------------------------------------------
   2 
   3     # Site name, used by default for wiki name-logo [Unicode]
   4     sitename = u'Unit'
   5 
   6     # Wiki logo. You can use an image, text or both. [Unicode]
   7     # For no logo or text, use '' - the default is to show the sitename.
   8     # See also url_prefix setting below!
   9     logo_string = u'<img src="%s/common/moinmoin.png" alt="MoinMoin Logo">' % url_prefix_static
  10 
  11     # name of entry page / front page [Unicode], choose one of those:
  12 
  13     # a) if most wiki content is in a single language
  14     #page_front_page = u"MyStartingPage"
  15 
  16     # b) if wiki content is maintained in many languages
  17     page_front_page = u"FrontPage"
  18 
  19     # The interwiki name used in interwiki links
  20     #interwikiname = u'UntitledWiki'
  21     # Show the interwiki name (and link it to page_front_page) in the Theme,
  22     # nice for farm setups or when your logo does not show the wiki's name.
  23     #show_interwiki = 1

(↓ da rivedere)

   1     # Security ----------------------------------------------------------
   2 
   3     # This is checked by some rather critical and potentially harmful actions,
   4     # like despam or PackageInstaller action:
   5     superuser = [u"crudo", ]
   6 
   7     # IMPORTANT: grant yourself admin rights! replace YourName with
   8     # your user name. See HelpOnAccessControlLists for more help.
   9     # All acl_rights_xxx options must use unicode [Unicode]
  10     acl_rights_before = u"crudo:read,write,delete,revert,admin EditorsGroup:read,write,delete,revert All:read"
  11 
  12     # The default (ENABLED) password_checker will keep users from choosing too
  13     # short or too easy passwords. If you don't like this and your site has
  14     # rather low security requirements, feel free to DISABLE the checker by:
  15     #password_checker = None # None means "don't do any password strength checks"
  16 
  17     # Link spam protection for public wikis (Uncomment to enable)
  18     # Needs a reliable internet connection.
  19     #from MoinMoin.security.antispam import SecurityPolicy

2024-11-06 23:21