Bleeding Edge
Contents
Contributed Stuff
Themes:
ThemeMarket/Heavy - custimized Black Theme for my Rock Magazine completely redesign for 1.9, but not yet uploaded!
ThemeMarket/sinorca4moin - Theme for our Extranet, Update Services and Intranet (did just some minor fixes and updates)
ThemeMarket/SimpleMente - some small fixes, etcetera
Macros:
MacroMarket/RSSReader - ATOM/RSS Feedreader
MacroMarket/CategoryCloud - Show Category as Keyword Cloud (Blog Cloud)
MacroMarket/YouTube - Shows YouTube Video or a Videobar
MacroMarket/ShowTweets - Display Twitter Messages (Tweets)
MacroMarket/BlikiSummary - A very simple RecentChanges
MacroMarket/CollectListsCategory - modified Version of the Macro MacroMarket/CollectLists not needed anymore in Version 1.9, see MacroMarket/DictColumns
Patches:
Modified MonthCalendar to work together with Sidebar
Upcoming Stuff
Need to be first cleaned up...
Modified Include Macro to add optional filter for categories. Include.py here a diff include.py
New RockHeavy MoinMoin Theme for 1.9, see http://rock.heavy.ch
Modified Moniker Theme still work in progress
Macro to Display Licence Information
Modified Macro Navigation
(Modified Macro CollectLists for Categories
add yourself to the copyright line Integration of Piwik Web Analytics Reports
Creating a modified Version of the Macro MonthCalendarTopList; MonthCalendarUpcommingList.I want only show upcoming events, and not older ones. The Macro should need anyway some refactoring to be more moinmoin 1.8 / 1.9 compliant. I'll do that in the near future... at the moment it works for 1.8.x
Development
Documentation
Sourcecode
Plugins
Those are my favorite/used 3parties plugins...
MacroMarket/FormCreate & ActionMarket/FormSubmit using as a contact form and the possibility to upload some files for non-wiki users
MacroMarket/BlikiSummary - using as a quick summary about updates on my site
ActionMarket/PdfAction - sometimes better then normal print/pdf stuff
MacroMarket/CollectLists - using for an adressbook, but the definition lists are not well (to say it nice) supported with the gui editor and that makes it hard for gui-editor-fans to use this feature
ActionMarket/MonthCal2ics (export MoinMoin MonthCalendar to ics)
And those are the builtin macros...
FullSearchCached HelpOnSearching
Themes
I using those themes (currently with 1.8.x; updating soon to 1.9)
http://moinmo.in/ThemeMarket/sinorca4moin (css modified version) - for intranet / extranet stuff
http://moinmo.in/ThemeMarket/Moniker (css modified version) - blog / homepage
http://moinmo.in/ThemeMarket/Heavy (own theme based on Gugiel) - news / calendar ezine
http://moinmo.in/ThemeMarket/Mandarin (css modified version) - homepages
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
- server / application (webfaction specific) =
- custom application, listen on port xy (ngnix proxy in the front, proxy back to my local running ngnix server with uwsgi)
- static app, without php/.htaccess/etcetera... just for serving the static content (htdocs)
nginx = nginx.conf (only necessary modules compiled
uwsgi = uwsgi.xml (just pip install uwsgi; like more than mod_wsgi/apache 'coz its really faster, lower memory (rss), etcetera 2
wsgi = moin.wsgi
- python 2.7.x
script = moinmoin.sh (for starting, stopping, etcetra... just some bash stuff, not perfect but works for me)
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
Limit Search
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 = strippedFor 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 -->
"""
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
If time permits I would like to write an tutorial how to install moinmoin on webfaction with ngnix & uwsgi, well we see
(1)see here for example: http://nichol.as/benchmark-of-python-web-servers (2)

