Bleeding Edge

Contributed Stuff

Themes:

Macros:

Patches:

Upcoming Stuff

Need to be first cleaned up... :-(

Development

Documentation

Sourcecode

Plugins

Those are my favorite/used 3parties plugins...

And those are the builtin macros...

Themes

I using those themes (currently with 1.8.x; updating soon to 1.9)

Configuration

Hosting

Running my privat wikis on webfaction.com (shared hosting) with a simple hosting plan (around 10$ a month) and some bussiness stuff on debian / ubuntu.

Here is my configuration1

MoinMoin 1.9.x behind a nginx

Edit your moin.wsgi file and change the wsgi application:

application = make_application(shared=False)

and add a param "trusted_proxies" with your current proxy ip:

from MoinMoin.web.serving import ProxyTrust

application = make_application(shared=False, trusted_proxies=['127.0.0.1',])

for more help see MoinMoin 1.9 Source Code

You can configure your MoinMoin that the search works only if it has a minimum lenght and don't accept regular express (using too much memories on my system). You just have to modify the source from MoinMoin (action/fullsearch.py).

Original MoinMoin/action/fullsearch.py:

   163     # check for sensible search term
   164     stripped = needle.strip()
   165     if len(stripped) == 0:
   166         request.theme.add_msg(_('Please use a more selective search term instead '
   167                 'of {{{"%s"}}}', wiki=True) % wikiutil.escape(needle), "error")
   168         Page(request, pagename).send_page()
   169         return
   170     needle = stripped

For example, the whole search term needs to contain atleast 3 chars (see line 165)

     # check for sensible search term
    stripped = needle.strip()
    lstripped = stripped.lower()
    if (len(lstripped) < 3) or ('regex:' in lstripped) or ('r:' in lstripped) or ('*' in lstripped):
        request.theme.add_msg(_('Please use a more selective search term instead of {{{"%s"}}}', wiki=True) % wikiutil.escape(needle), "error")
        Page(request, pagename).send_page()
        return
    needle = stripped

logrotate

I'm not sure if it is usefull for anybody, but I just configure logrotate to rotate the main moinmoin logfiles, e.g. edit-log and event-log.

logrotate.conf

monthly
rotate 12
create
minsize 5M

# rock
/home/moin/var/data/rock/event-log {
        size 5M
        nocreate
}
/home/moin/var/data/rock/edit-log {
        size 5M
        nocreate
}

script for starting logrotate (while stopping moinmoin):

/home/moin/bin/moinmoin stop
wait
echo "Starting logfile rotation"
logrotate -s /home/moin/etc/logrotate.status /home/moin/etc/logrotate.conf
wait
/home/moin/bin/moinmoin start

<!> Drawback is, that you will loose your page visits (hitcounts) on moinmoin and also the RecentChanges.. so maybe not good for everybody :-)

Statistics

I use Piwik for Web Analytics. For this I need first to setup this PHP/MySQL application (in this example under piwik.wikwiki.ch) and then add to wikiconfig or every farmwiki the page_footer2. you always need to change the idsite=x to match the configuration in your piwik site configuration.

Example in my wikiconfig.py/MyFarm.py:

    page_footer2 = """
                    <!-- Piwik -->
<div><a href="http://piwik.org" title="Open source analytics" onclick="window.open(this.href);return(false);">
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.wikiwiki.ch/" : "http://statistik.wikiwiki.ch/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
piwik_action_name = '';
piwik_idsite = 2;
piwik_url = pkBaseURL + "piwik.php";
piwik_log(piwik_action_name, piwik_idsite, piwik_url);
</script>
<object><noscript><p>Open source analytics <img src="http://piwik.wikiwiki.ch/piwik.php?idsite=2" style="border:0" alt=""/></p></noscript></object></a></div>
<!-- End Piwik Tag -->
    """

Screenshot of Piwik: attachment:screenshot-piwik.png

Speed Up the MissingPage

We have a big wiki, where we use also use an hierarchical page structured approach. It can easily happen that a page contains around 1000 sub pages. to add then a new sub pages it's takes around 5-20s to load first the missin page (from the underlay). the problem is the included macro with call the action LikePages. This is very slow and it seems the problem lays how it calculating/finding the matches... my solution was just to add a new MissingPage page and removing the macro LikePages. Not nice but working for me :-)


  1. If time permits I would like to write an tutorial how to install moinmoin on webfaction with ngnix & uwsgi, well we see :-) (1)

  2. see here for example: http://nichol.as/benchmark-of-python-web-servers (2)

MoinMoin: MarcelHäfner/Bleeding Edge (last edited 2011-10-11 15:20:20 by MarcelHäfner)