Commit Graph

1296 Commits (7a8ea68fc0bba9f75ba81a9547d359f42e31caa4)

Author SHA1 Message Date
Joey Hess 7cc14ddf44 fix handling of wrappergroup option
Had forgot to include it in the option list.
2008-11-26 13:28:16 -05:00
Joey Hess a2a63a096b Spanish translation update from Victor Moral. 1997-08-14 07:20:02 -04:00
Joey Hess a493752a4d French translation update from Philippe Batailler. Closes: #506250 2008-11-19 17:30:21 -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 767bf9c483 Change deb dependencies to list Text::Markdown before markdown (really this time). 2008-11-17 18:46:20 -05:00
Joey Hess 2e6157e977 don't need libxml-atom-perl now 2008-11-17 14:40:24 -05:00
Joey Hess c0f4735f1f adding htmlbalance; housekeeping
Used the contrib version of the plugin page since it seemed better than the
other one.
2008-11-17 14:09:53 -05:00
Joey Hess 31a1a3215b releasing version 2.70 2008-11-12 18:01:46 -05:00
Joey Hess 716560b7f1 check for invalid utf-8, and toss it back to avoid crashes
Since ikiwiki uses open :utf8, perl assumes that files contain valid utf-8.
If it turns out to be malformed it may later crash while processing strings
read from them, with 'Malformed UTF-8 character (fatal)'.

As at least a quick fix, use utf8::valid as soon as data is read, and if
it's not valid, call encode_utf8 on the string, thus clearing the utf-8
flag. This may cause follow-on encoding problems, but will avoid this
crash, and the input file was broken anyway, so GIGO is a reasonable
response. (I looked at calling decode_utf8 after, but it seemed to cause
more trouble than it was worth. BTW, use open ':encoding(utf8)' avaoids
this problem, but the corrupted data later causes Storable to crash when
writing the index.)

This is a quick fix, clearly imperfect:
- It might be better to explicitly call decode_utf8 when reading files,
  rather than using the IO layer.
- Data read other than by readfile() can still sneak in bad utf-8. While
  ikiwiki does very little file input not using it, stdin for the CGI
  would be one way.
2008-11-12 17:30:54 -05: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 d1b22b2524 lockwiki changes
* Stop busy-waiting in lockwiki, as this could delay ikiwiki from waking up
  for up to one second. The bailout code is no longer needed.
* Remove support for unused optional wait parameter from lockwiki.
2008-11-11 15:54:52 -05:00
Joey Hess 6611f3a2d9 bzr: Fix dates for recentchanges. 2008-11-11 13:44:47 -05:00
Joey Hess 6049fac46e typo 2008-11-10 21:43:59 -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 7f80e52543 Fix the link() pagespec to match links that are internally recorded as absolute.
This fixes a problem exposed by the recent change to tags
(a2839de936). That recorded tag links as
absolute by including a leading slash in the link. The same could also be
done with an absolute wikilink.

In either case, link() would not match such links, unless the leading slash
was included in the link to match. But that's not right, because pagespecs
match absolute by default. So strip the leading slash.

Note that to keep any existing `link(/foo)` pagespecs working after this
change, the leading slash is removed from there, too.
2008-11-09 15:31:57 -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 2e00af6096 releasing version 2.68 2008-11-03 16:42:06 -05:00
Joey Hess 936e016de9 reorg 2008-10-31 17:22:55 -04:00
Joey Hess 163790a3f9 typo 2008-10-31 17:21:22 -04: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 6d445cdaca fix --setup --render
In this mode, rebuild mode should not be on
2008-10-30 14:59:37 -04:00
Joey Hess 26e1fe2021 Preserve syslog setting when doing `ikiwiki -setup foo -dumpsetup bar`
The syslog value from the setup file is purposfully ignored when doing
ikiwiki -setup, so that it will output to stdout (while generating wrappers
that do use the syslog). But that caused -dumpsetup to not preserve
the syslog value from the setup file.
2008-10-29 14:28:55 -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 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 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 8821ba3a59 Optimise the no-op post-commit hook in the web edit case by skipping loading plugins. (Particularly a win when using external plugins.) 2008-10-23 14:08:45 -04:00
Joey Hess 534f714478 Updated Danish translation from Jonas Smedegaard. Closes: #503117 2008-10-23 13:45:06 -04:00
Joey Hess 479d65faa0 Updated Spanish translation from the ever vigilant Victor Moral. 2008-10-22 12:33:28 -04:00
Joey Hess e75818572f function injection overhaul
Add an inject function, that can be used by plugins that want to replace
one of ikiwiki's functions with their own version. (This is a scary thing
that grubs through the symbol table, and replaces all exported occurances
of a function with the injected version.)

external: RPC functions can be injected to replace exported functions.

Removed the stupid displaytime hook, and use injection instead.
2008-10-21 17:57:19 -04:00
Joey Hess a2839de936 tag: When tagpage is set, force the links created by tagging to point at the toplevel tagpage, and not closer subpages.
The html links already went there, but internally the links were not
recorded as absolute, which could cause confusing backlinks etc.

For example, with tagbase=tags, if blog/tags/bar existed and blog/foo was
tagged bar, it would link to /tags/bar. But, the link would be recorded
simply as a link to tags/bar, and so later blog/tags/bar would appear to
have the backlink.
2008-10-20 18:17:03 -04:00
Joey Hess 5e52bfb2e7 inline: Only the last feed link was put on the page, fix this to include all feed links. So rss will be included along with atom, and pages with multiple feeds will get links added for all feeds. 2008-10-20 15:25:45 -04:00
Joey Hess 423fae6f18 Use the pure perl Data::Dumper when generating setup files to ensure that utf-8 characters are written out as such, and not as the encoded perl strings the C Data::Dumper produces.
Note that the text produced by the C version was interpreted fine
when ikiwiki loaded the setup file. But it was not user-friendly.
2008-10-19 21:23:48 -04:00
Joey Hess 3e992b758b Fix issue with utf-8 in wikiname breaking session cookies, by entity-encoding the wikiname in the session cookie. 2008-10-19 21:07:12 -04:00
Joey Hess 2b569f99d9 fix relativedate timezone inclusion
The machine parseable date needs to include a timezone.

Also, simplified the interface for date display.
2008-10-19 19:21:44 -04:00
Joey Hess ac8eb2844f Updated French translation. Closes: #502694 2008-10-19 12:59:35 -04:00
Joey Hess 35c56622ea tweak recentchanges permalink code
Need to handle the case where url is not set.
2008-10-17 21:54:42 -04:00
Joey Hess 7390a7a072 relativedate: New javascript-alicious plugin that makes all dates display relative, in a very nice way, if I say so myself. 2008-10-17 20:47:32 -04:00
Joey Hess 79b376f991 Add an underlay for javascript, and add ikiwiki.js containing some utility code.
* Add an underlay for javascript, and add ikiwiki.js containing some utility
  code.
* toggle: Stop embedding the full toggle code on each page using it, and
  move it to toggle.js in the javascript underlay.
2008-10-17 20:28:18 -04:00
Joey Hess de65a62501 releasing version 2.67 2008-10-17 13:17:31 -04:00
Joey Hess f36080ae02 aggregate: Avoid bug that caused immediate expiration of items with a date in the future. 2008-10-16 18:20:16 -04:00
Joey Hess b8f4b9c799 inline: Use the feed's description in the rss and atom links. Closes: #502113 2008-10-15 14:45:28 -04:00
Joey Hess c39112e6ef inline: Allow MTIME to be used in inlinepage.tmpl. 2008-10-14 15:00:46 -04:00
Joey Hess 3b27af4a29 Pass HTTPS variable through the wrapper so that CGI->https can be used by plugins. Closes: #502047 2008-10-13 12:32:16 -04:00
Joey Hess cd305909d3 document google plugin 2008-10-10 17:13:33 -04:00
Joey Hess a473cb2f74 orphans: Fix unquoted page name in regexp. 2008-10-09 19:09:16 -04:00
Joey Hess d3ca495e61 lockedit: Support specifying which users (and IP addresses) a page is locked for. This supports most of the ACL type things users have been wanting to be done. Closes: #443346 (It does not control who can read a page, but that's out of scope for ikiwiki.) 2008-10-08 17:47:38 -04:00
Joey Hess 781760bfee Updated Spanish translation from Victor Moral. 2008-10-07 11:51:52 -04:00
Joey Hess fea76a11bc remove: Avoid $_ breakage. (Stupid, stupid perl.)
This avoids another one of those $_ scoping issues where a deep call to a
function that changes $_ clobbers the array that is being looped over.
2008-10-06 16:10:47 -04:00
Joey Hess 836a522c81 releasing version 2.66 2008-10-05 19:24:38 -04:00
Joey Hess a7626cec4a fix lintian warning 2008-10-05 19:17:24 -04:00
Joey Hess 92989a3f6c make set -e 2008-10-05 19:17:16 -04:00
Joey Hess 49992eb2ce Updated French translation. Closes: #500929 2008-10-02 14:03:04 -04:00
Joey Hess 3b47dae9ca remove, rename: Allow acting on attachments as a page is being created. 2008-10-02 12:53:53 -04:00
Joey Hess c945952381 attachment: Support adding attachments to pages even as they are being created. 2008-10-02 12:48:06 -04:00
Joey Hess bf386e22f5 inline: Fix handling of rootpage that doesn't exist.
It makes sense to use bestlink to determine which page rootpage refers to,
but if no page matches, just use the raw value.
2008-10-01 17:29:03 -04:00
Joey Hess 85ec27ab58 Merge branch 'master' into tova
Conflicts:

	debian/changelog
2008-09-30 21:04:22 -04:00
Joey Hess 0651e86a4c httpauth: Document that ikiwiki.cgi has to be in a directory subject to authentication. Closes: #500524 2008-09-30 21:03:51 -04:00
Joey Hess 4c635fe225 update 2008-09-29 19:02:02 -04:00
Joey Hess a9d7c5453a Add indexpages option
This is the easy part of supporting foo/index.mdwn sources for page foo.

Note that if foo.mdwn exists too, there will be a warning about multiple
sources for the same page, and which is used is indeterminate.

indexpages should also cause web based editing to create index source pages
by default; this and other fallout of the option not yet implemented.
2008-09-29 17:30:30 -04:00
Joey Hess 2ff3c8aee7 editpage: Be more aggressive (and less buggy) about cleaning up temporary files rendered during page preview. 2008-09-27 18:02:33 -04:00
Joey Hess a5d3acd37c Add %wikistate, which is like %pagestate except not specific to a given page, and is preserved across rebuilds. 2008-09-27 16:45:27 -04:00
Joey Hess 61426a7186 Reorganize index file, add a format version field.
Upgrades to the new index format should be transparent.

The version field is 3, because 1 was the old textual index, 2 was the
pre-versioned format.

This also includes some efficiency improvements to index loading, by
not copying a hash and using a reference.
2008-09-27 16:35:56 -04:00
Joey Hess 55a0361a47 template: Make edit link for new templates ensure the page is located under toplevel templates directory. 2008-09-27 15:18:36 -04:00
Joey Hess 67f38832aa htmltidy robustness fixes
* htmltidy: Avoid returning undef if tidy fails. Also avoid returning the
  untidied content if tidy crashes. In either case, it seems best to tidy
  the content to nothing.
* htmltidy: Avoid spewing tidy errors to stderr.
2008-09-27 14:27:42 -04:00
Joey Hess 9ec9d6901d Export pagetitle, titlepage, linkpage. 2008-09-27 14:27:42 -04:00
Joey Hess 3b39e93699 Beautify urls used in various places. (smcv) 2008-09-27 13:03:21 -04:00
Joey Hess 748fc2fcd4 typo 2008-09-27 11:53:55 -04:00
Joey Hess 60a80be0b3 Epand usage message and add --help. Closes: #500344 2008-09-27 11:17:19 -04:00
Joey Hess 89256ab870 htmlscrubber: Add a config setting that can be used to disable the scrubber acting on a set of pages. 2008-09-26 18:07:37 -04:00
Joey Hess bce2a34c19 tag: Make edit link for new tags ensure that the tags are created inside tagbase, when it's set. 2008-09-25 20:25:07 -04:00
Joey Hess 965f7310fe git: Fix handling of utf-8 filenames in recentchanges.
Seems that the problem is that once the \nnn coming from git is converted
to a single character, decode_utf8 decides that this is a standalone
character, and not part of a multibyte utf-8 sequence, and so does nothing.
I tried playing with the utf-8 flag, but that didn't work. Instead, use
decode("utf8"), which doesn't have the same qualms, and successfully
decodes the octets into a utf-8 character.

Rant:

Think for a minute about fact that any and every program that parses git-log,
or git-show, etc output to figure out what files were in a commit needs to
contain this snippet of code, to convert from git-log's wacky output to a
regular character set:

if ($file =~ m/^"(.*)"$/) {
	($file=$1) =~ s/\\([0-7]{1,3})/chr(oct($1))/eg;
}

(And it's only that "simple" if you don't care about filenames with
embedded \n or \t or other control characters.)

Does that strike anyone else as putting the parsing and conversion in the
wrong place (ie, in gitweb, ikiwiki, etc, etc)? Doesn't anyone who actually
uses git with utf-8 filenames get a bit pissed off at seeing \xxx\xxx
instead of the utf-8 in git-commit and other output?
2008-09-25 18:26:42 -04:00
Joey Hess e1ba137317 attachment: Add admin() pagespec to test if the uploading user is a wiki admin. 2008-09-25 16:49:30 -04:00
Joey Hess 093e815440 aggregate: Avoid uninitialized value warnings for pages with no recorded ctime.
I saw this in the wild, apparently a page was not present on disk, but was
in the aggregate db, and not marked as expired either. Not sure how that
happened, but such pages should get marked as expired since they have an
effectively zero ctime.
2008-09-25 15:38:51 -04:00
Joey Hess 3f5ba52ee0 recentchanges: Fix redirects to non-page files. 2008-09-25 13:46:12 -04:00
Joey Hess b127e86b35 releasing version 2.65 2008-09-24 18:14:09 -04:00
Joey Hess e00df8575f rename: Hide type field from rename form when renaming attachments. 2008-09-23 19:31:34 -04:00
Joey Hess e33bbb24e8 changelog 2008-09-23 19:28:05 -04:00
Joey Hess 8e0180d8ca rename, remove: Don't rely on a form parameter to tell whether the page should be treated as an attachment. 2008-09-23 17:41:05 -04:00
Joey Hess dfe55e8956 Add keepextension parameter to htmlize hook. (Willu) 2008-09-23 13:39:21 -04:00
Joey Hess 9cbcda14ac Print a debug message if a page has multiple source files. 2008-09-23 13:32:41 -04:00
Joey Hess 12eb585353 add missing page name sanity check 2008-09-20 22:48:22 -04:00
Joey Hess a6fc3b411f edittemplate patch from Willu
* edittemplate: Default new page file type to the same type as the template.
  (willu)
* edittemplate: Add "silent" parameter. (Willu)
* edittemplate: Link to template, to allow creating it. (Willu)
2008-09-20 16:19:09 -04:00
Joey Hess c51b304d90 Fix reversion in use of ikiwiki -verbose -setup with a setup file that enables syslog.
Setup output is once again output to stdout in this case.

Implemented by stashing the verbose/syslog values set in the setup file,
and using those values in the generated wrappers, but not allowing them to take
effect during the setup operation itself, so that command-line options,
appearing before or after -setup, are honored.

Also, some cleanups to how %config is generated for wrappers, removing some
fields that do not need to be recorded inside the wrapper.
2008-09-20 15:38:02 -04:00
Joey Hess 779c5214f3 progress: Display an error if the progress cannot be parsed, and allow the percent parameter to only optionally end with "%". 2008-09-19 13:09:50 -04:00
Joey Hess 89953e3e19 store ctime for use by expiry code
The expiry code does need to make sure to sort in ctime order, even if
expiring by count, so it expires the right ones.
2008-09-17 18:11:22 -04:00
Joey Hess 1cb4154bc8 aggregate: Support atom feeds with only a summary element, and no content elements. 2008-09-17 15:56:58 -04:00
Joey Hess da7c6eb1b4 editdiff: Broken since 2.62 due to wrong syntax, now fixed. 2008-09-17 14:34:02 -04:00
Joey Hess b540b263de aggregate: Allow expirecount to work on the first pass. (expireage still needs to wait for the pages to be rendered though) 2008-09-17 14:27:31 -04:00
Joey Hess 51f19ca4c8 releasing version 2.64 2008-09-14 17:15:38 -04:00
Joey Hess 0d6746a29f document code change in last commit 2008-09-14 13:57:37 -04:00
Joey Hess 0187c2ba0d Removed old redirecton pages from basewiki (helponformatting, markdown, openid, pagespec, preprocessordirective, subpage, wikilink). 2008-09-12 16:15:20 -04:00
Joey Hess e9468fd5eb Removed the obsolete blog page from the basewiki. ikiwiki/blog still remains, but is now deprecated too. 2008-09-11 20:15:25 -04:00
Joey Hess b9e8cb0dd1 license directive docs using basewiki license 2008-09-11 19:42:27 -04:00
Joey Hess bc7381c4f9 listdirectives: Enable use of the directives underlay. 2008-09-11 18:46:32 -04:00
Joey Hess 7d98c3d52b changelog 2008-09-11 18:32:19 -04:00
Joey Hess a87cfbcb8d Improve error message if external plugin fails to load. Closes: #498458 2008-09-11 01:41:55 -04:00