New features:
* cfg.recovery_token_lifetime to determine how long the password recovery
token will be valid, default is 12 [h]. Check this setting to be adequate
before doing (global) password resets, so your users have enough time to
react before the toke times out!
* cfg.log_events_format can be used to configure the format of the records
written to <data_dir>/event-log:
0 = dot not create event-log entries (saves disk space, disk I/O)
1 = standard (like in moin <= 1.9.7) [default]
2 = extended (add infos about username, wikiname, url)
* add a tool to output the contents of the event-log to CSV:
moin export eventlog --file=output.csv
Output encoding is utf-8, columns are in this order:
time, event, username, ip, wikiname, pagename, url, referrer, ua
time: UNIX timestamp (float)
* reimplement cfg.log_timing - if True, emits INFO level log output like:
"timing: <REMOTE_ADDR> <URL> <REFERRER> <TIME> <SLOWNESS-INDICATOR>"
TIME is in seconds, the slowness indicator is "." for sub-second requests
or N times "!" for requests taking N seconds (so you easily can grep for
slow stuff).
* add "abuse" logging. this will log every attempt to login (successful ones
as well as unsuccessful ones). abuse logging is configured via the logging
configuration, see example in wiki/config/logging/abuse.
Currently, abuse logging is implemented for:
* authentication system
* "moin" auth
* "given" auth
* setuid (when superuser switches to another user)
* new user creation
* some security/ACL violations (xmlrpc and perhaps others not implemented)
* surge protection for authentication (currently only for MoinAuth):
a) surge protect by IP
This covers the case someone is trying to authenticate way too
often - we don't look at the username here, just at the remote IP
address. If surge protection kicks in for some specific IP, that IP
won't be able to try to authenticate any more until surge_lockout_time
is over.
Note: be careful with users behind proxies or NAT routers - these are
common and legitimate cases with (potentially lots of)
authentication requests coming from same IP.
if it is a trusted proxy, you can configure moin so it sees the
real remote IP address (not just the proxy's address).
b) surge protect by name
This covers the case someone is trying to authenticate for a
specific user name way too often (e.g. when someone tries to attack the
wiki admin's account). We don't look at the IP here, just at the user
name. If surge protection kicks in for some specific user name, that user
name will not be able to try to authenticate any more until
surge_lockout_time is over.
Note: this even covers widely distributed attacks against a user, but
you should only enable this if you are aware that the "real" user
also won't be able to authenticate while surge protection is active
(at least not using the account for that specific username).
Thus, there is some denial-of-service danger with this if the
attacker can guess or find your valid user names (which isn't too
difficult if your wiki is publicly readable).
This is bad, but technically hard to avoid.
Configuration (allowing 10 authentication attempts per hour):
surge_action_limits = {
...
'auth-ip': (10, 3600), same remote ip (any name)
'auth-name': (10, 3600), same name (any remote ip)
}
* backlinks performance tuning: the pagename in the theme has historically
been used to trigger a "linkto:ThisPage" search. While this is a nice
feature for human users of the wiki (esp. on category pages), it has one
big issue: as it is a normal link, stupid crawlers (ignoring "nofollow")
follow it and cause a lot of unneccessary load.
What moin shows in that "backlinks" place can now be configured in your
wiki config:
always render the backlink as in moin < 1.9.8 (bad bots causing high load!):
backlink_method = lambda cfg, req: 'backlink'
always render a simple link to same page, as in moin 2.0:
backlink_method = lambda cfg, req: 'pagelink'
logged-in users get the backlink, anon users/bots get a pagelink (default):
backlink_method = lambda cfg, req: 'backlink' if req.user.valid else 'pagelink'
logged-in users get the backlink, anon users/bots get simple text:
backlink_method = lambda cfg, req: 'backlink' if req.user.valid else 'text'
* AbandonedPages macro: check user agent to reduce load caused by bots
* RSS feed: check for bots and rather give them empty results than waste a
lot of time with them
* ldap_auth: support placeholders for basedn also, e.g. you could use:
base_dn='uid=%(username)s,ou=people,dc=company,dc=com'
* move or delete multiple attachments (see checkboxes and buttons on the
AttachFile view). Be careful: in the same way as you could delete a single
attachment with one click, you can now delete all attachments of a page
with one click (we don't ask for a 2nd confirmation, so think first).
* mailimport: use relative attachment link markup instead of absolute links,
enables some page renaming operations without needing to edit the markup.
* better caching and lookup optimizations for userprofile data:
* name, email, jid, openids -> userid lookups
* page subscriptions for notifications (as a consequence, determination of
subscribers when a page is saved is much faster now, esp. for wikis with
many users) - see also MoinMoinBugs/GetSubscribersSlow
* Notification template strings are now configurable via cfg.mail_notify_...
* page_text (this puts together the pieces for the mail body, used for all
changed / deleted / renamed page mail notifications)
* page_changed_subject, page_changed_intro
* page_deleted_subject, page_deleted_intro
* page_renamed_subject, page_renamed_intro
* att_added_subject, att_added_intro
* att_removed_subject, att_removed_intro
* user_created_subject, user_created_intro
* Best is to read HelpOnConfiguration and look at MoinMoin.config.multiconfig
to see the help text and the defaults.
* The defaults are chosen to be the same as the old hardcoded values, so the
translations keep working.
* If you overwrite the strings in your configuration moin will still try to
translate your strings, but it will only find translations if you add them
to the gettext catalogs, too.
* Examples:
a) notification mail body: you don't want the rendered diff, you don't
want to link to the diff, but to the full page view on your wiki.
original (default) value
mail_notify_page_text = '%(intro)s%(difflink)s\n\n%(comment)s%(diff)s'
put this in your wiki config
mail_notify_page_text = '%(intro)s%(pagelink)s\n\n%(comment)s'
b) notification mail subject:
original (default) value
mail_notify_page_changed_subject = '[%(sitename)s] %(trivial)sUpdate of "%(pagename)s" by %(username)s'
c) notification mail intro:
original (default) value
mail_notify_page_changed_intro = \
("Dear Wiki user,\n\n"
'You have subscribed to a wiki page or wiki category on "%(sitename)s" for change notification.\n\n'
'The "%(pagename)s" page has been changed by %(editor)s:\n')
Note: if you change "*_page_changed_*", you likely also want to change
"*_page_deleted_*" and "*_page_renamed_*", maybe even "*_att_added_*"
and "*_att_removed_*".
Fixes:
* security fix: XSS in useragents stats
* do not create empty pagedirs (with empty edit-log). To clean up all the
trash pagedirs, use moin ... maint cleanpage.
* page rename/delete, attachment add/remove email notifications work now
(somehow we had an event for this, but no code handling it)
* AttachFile do=get and do=view: send 404 status if file does not exist
* link rel="Alternate" links: rather use page.url than request.href, so
url_prefix_action gets used for the (print and raw) action URLs
* fixed wrong detection of UI language from accept-language header for not
logged-in users if the language identifier there was (partially) uppercase.
* fix Python 2.7.4/5 compatibility issue with rss_rc action using handler._out
* fix "moin import wikipage" timestamp confusion
* use 302 http status for redirect as some clients cache 301 redirects, but
the redirect might get changed or removed later (so it should not be
cached and we also can't really say it is permanent)
* fix crash when macro names contain non-ascii chars
* CopyPage action: fix NameError exception when TextCha was answered wrong
* docbook formatter: fix image URL generation, avoid script name duplication
* fix caching scope of name2id/openid2id caches (was: "wiki", now:
"userdir"). this is relevant for shared user_dir configurations.
* moin maint cleancache: cleans up openid2id cache now also
* "userdir" caching scope used for userid lookup caches (the previously used
name2id cache with "wiki" caching scope could have outdated data if you
share the user_dir between multiple wikis)
* catch "filename too long" exception if some crap URL refers to a too long
pagename that the filesystem can not represent. It is treated like a not
existing page then, so you don't get a traceback in your log file.
Other changes:
* rss_rc action (RSS feed) is now much faster / much less resource consuming
when requested for a specific single page. As we have a link to this in
every page's html output, this likely also lightens the load caused by bots
and search engine crawlers.
* tuned editlog.news() - only open/read log if there is new stuff in it after
last read position
* improve python2.5 compatibility (with_statement)
* add bingbot to ua_spiders
* upgraded bundled werkzeug to 0.8.3
* upgraded bundled passlib to 1.6.2
* upgraded bundled pygments to 1.6