Commit Graph

1450 Commits (d18adfb1adedff996dfea9b20a3f1765addbec04)

Author SHA1 Message Date
Simon McVittie d18adfb1ad smcvpostcomment: indicate in form whether HTML and directives are allowed 2008-12-11 21:14:02 +00:00
Simon McVittie 1bd1b03766 smcvpostcomment: remove HTML if not allowed 2008-12-11 21:14:02 +00:00
Simon McVittie 660a4ef151 smcvpostcomment: always allow wikilinks, and do access control
wikilinks are harmless, so we might as well allow them.

Access control for this plugin is a bit odd, since we specifically
don't want to allow comments to be edited - so the check is whether the
user is allowed to edit a deliberately invalid page name,
page/commented/on[smcvpostcomment]. You can put smcvpostcomment(*)
or smcvpostcomment(some/subdir/*) in $config{anonok_pagespec}
or the opposite in $config{locked_pages} to allow "editing" (really
just posting) comments.
2008-12-11 21:14:02 +00:00
Simon McVittie 798dea2033 smcvpostcomment: reduce length of subject field 2008-12-11 21:14:02 +00:00
Simon McVittie 29862a8cc8 smcvpostcomment: explain what $fake is for 2008-12-11 21:14:01 +00:00
Simon McVittie 42b15f7633 smcvpostcomment: avoid warnings if form field 'body' is undef 2008-12-11 21:14:01 +00:00
Simon McVittie e65c7b73af smcvpostcomment: load inline plugin more forcibly 2008-12-11 21:14:01 +00:00
Simon McVittie 49835784d8 smcvpostcomment: use better names for special comment files 2008-12-11 21:14:01 +00:00
Simon McVittie bd8c4674a8 smcvpostcomment: use gettext where appropriate 2008-12-11 21:14:01 +00:00
Simon McVittie f77f7a02a6 Add initial version of a postcomment plugin (temporarily namespaced as smcvpostcomment) 2008-12-11 21:14:01 +00:00
Joey Hess b67632cdcd inline: Support feedfile option to change the filename of the feed generated. 2008-12-11 15:01:26 -05:00
Joey Hess 63eb9d834e inline: Support emptyfeeds=no option to skip generating empty feeds. 2008-12-11 14:04:38 -05:00
Joey Hess 38f5e3ba69 move feedpages application up
I wanted this nearer to the top, but decided to put it after the
add_depends. Reasoning: It's possible with a combinaton of feedpages and
show options to make @list and @feedlist contain completly differing sets
of pages. We want to add_depends all pages in both sets. We could combine
the two lists and add_depends that, but it's slightly more efficient to
defer reducing @feedlist, and add_depends whichever list is longer.
2008-12-11 13:58:40 -05:00
Joey Hess a990afd2f7 avoid uninitialized value warning 2008-11-18 13:46:03 -05:00
Joey Hess e307eeda3d html escaping complication
Can't escape things to entities if the template then escapes the entities.
(aggregate doesn't have this problem.)
2008-11-18 02:48:24 -05:00
Joey Hess 15269fed64 improve escaping of wikilinks and preprocessor directives
The old method failed for '[' x 3.
2008-11-18 02:43:17 -05:00
Joey Hess 75f262f44d call decode_utf8 inside eval
holger reported that decode_utf8 was crashing with perl 5.8.8. Earlier, I
thought that passing 0 to the function avoided this with old perls, but
that was apparently not enough, it still crashes. So, put it inside the
eval, so we can at least recover from it crashing.
2008-11-17 15:56:15 -05:00
Joey Hess 181bdbe1a9 use HTML::Entities 2008-11-17 14:27:11 -05:00
Joey Hess e8a945845b use perl modules up front
The old code actually did the same thing, just obfuscated -- since the eval
use wasn't quoted, it used the modules on load. Thus, the error (not to
mentioned the return) was bypassed, and it just failed on load.

But that seems like the right thing to do, really, so just made it clearer
that's what happens.
2008-11-17 14:19:15 -05:00
Simon McVittie e7a840ed9a htmlbalance: new plugin that balances tags by parsing and re-serializing 2008-11-17 10:46:21 +00:00
Joey Hess ecd4f0ee55 make unlockwiki drop the cgilock
This is necessary so that things that fork to the background,
like pinger, and inline ping, don't block other cgis from running.

Note that websetup also calls unlockwiki, before refreshing / rebuilding
the wiki. It makes perfect sense for that not to block other cgis.
2008-11-11 20:48:02 -05:00
Joey Hess eef8b966b3 O_CREATE needs mode 2008-11-11 15:53:55 -05:00
Joey Hess 9a48669f1e avoid multiple ikiwiki cgi processes piling up, eating all memory, and thrashing
Fixed by making the cgi wrapper wait on a cgilock.
If you had to set apache's MaxClients low to avoid ikiwiki thrashing
your server, you can now turn it up to a high value.

The downside to this is that a cgi call that doesn't need to call lockwiki
will be serialised by this so only one can run at a time. (For example,
do=search.) There are few such calls, and all of them call loadindex,
so each still eats gobs of memory, so serialising them still seems ok.
2008-11-11 15:40:04 -05:00
Joey Hess 6611f3a2d9 bzr: Fix dates for recentchanges. 2008-11-11 13:44:47 -05:00
Joey Hess 53752bcb5d remove redundant link munge
This is not needed now that tagpage returns a page name starting with a
slash.

(Also fixes a minor bug that the edit links started with double slashes due
to the hack.)
2008-11-10 21:47:29 -05:00
Joey Hess f8a09ba105 tag: Normalize tagbase so leading/trailing slashes in it don't break things. 2008-11-10 19:48:58 -05:00
Joey Hess f0e58faefa Add rel=nofollow to recentchanges_links for the same (weak) reasons it was earlier added to edit links. 2008-11-10 18:05:30 -05:00
Joey Hess 11d377af81 txt: Do not encode quotes when filtering the txt, as that broke later parsing of any directives on the page. 2008-11-06 20:49:18 -05:00
Joey Hess db5ea4d4f0 meta: Plugin is now enabled by default since the basewiki uses it. 2008-11-06 16:08:11 -05:00
Joey Hess ecf2399f4f aggregate: Try to query XML::Feed for the base url when derelevatising links. Since this needs the just released XML::Feed 0.3, as well as a not yet released XML::RSS, it will fall back to the old method if no xml:base info is available. 2008-11-06 16:05:10 -05:00
Joey Hess 42b4abee1d use error for two messages 2008-11-05 01:38:36 -05:00
Joey Hess d71caffb7b preprocess text before htmlizing it 2008-11-02 12:21:15 -05:00
Joey Hess bb841f94f4 format: New plugin, allows embedding differntly formatted text inside a page (ie, otl inside a mdwn page, or syntax highlighted code inside a page). 2008-10-31 16:42:20 -04:00
Joey Hess ae0a9d50be set ctime in --render mode if not known
Avoids some uninitialised value warnings.
2008-10-30 14:50:33 -04:00
Joey Hess 354d22e27b don't rely on plugin load order when determining generated directives
Instead, shortcuts will explicitly be marked as such when registered, and
listdirectives can filter them out.
2008-10-30 13:41:19 -04:00
Joey Hess 33a0e84ddb fix preview of shortcuts
Move shortcut processing back to checkconfig, and avoid it failing if the
srcdir is not defined.
2008-10-29 14:20:31 -04:00
Joey Hess 5b7677faba fix display of error msg 2008-10-29 13:38:26 -04:00
Joey Hess 8530e827b0 git: Allow [[sha1_commit]] to be used in the diffurl, to support cgit. 2008-10-27 14:45:54 -04:00
Joey Hess d3d3999410 do no-op post_commit test in wrapper
This speeds up web commits by 1/4th of a second or so, since perl does
not have to start up for the post commit hook.

perl's locking is completly FuBar, since it's impossible to tell what perl
flock() really does, and thus difficult to write code in other languages
that interoperates with perl's locking. (Let alone interoperating with
existing fcntl locking from perl...)

In this particular case, I think I was able to find a way to avoid the
insanity, mostly. The C code does a true flock(2), and if perl is using an
incompatable lock method that does not use the same locking primative at
the kernel level, then the C code's test will fail, and it will go ahead
and run the perl code. Then the perl code's test will test the right thing.

On Debian, at least lately, perl's flock() does a true flock(2), so the
optimisation does work.
2008-10-26 15:13:04 -04:00
Joey Hess 7ddea03684 move untrusted committer test into the wrapper
This saves around 1/4th second per trusted commit since ikiwiki
doesn't need to start up.
2008-10-26 14:03:18 -04:00
Joey Hess 4a7ac5c251 remember how to write C code
been a while!
2008-10-24 15:49:55 -04:00
Joey Hess 146192d5b0 the pre-receive wrapper needs to be suid after all
It needs to write to the user db.
2008-10-24 15:47:42 -04:00
Joey Hess 761dee41b1 export CALLER_UID 2008-10-24 15:46:29 -04:00
Joey Hess 739e2ca0b4 can't lock wiki due to permissions (probably)
luckily, don't really need to here
2008-10-24 15:02:54 -04:00
Joey Hess 1a883b3c50 include temp file for attachment change too 2008-10-24 13:44:03 -04:00
Joey Hess 0196e1f9fc updates 2008-10-24 13:29:41 -04:00
Joey Hess fbcb8553df really fix calls to check_can* 2008-10-24 13:29:30 -04:00
Joey Hess 85f4b99710 untrusted committers code seems to be fully working
Still need to investigate possible races, and test some more.
2008-10-23 18:05:57 -04:00
Joey Hess f349e4ef36 fix calls to check_*
These throw errors, do not have useful return codes.
2008-10-23 18:05:12 -04:00
Joey Hess ad9e443f22 check_canattach hooked up 2008-10-23 16:56:40 -04:00