Commit Graph

1616 Commits (e30725efa8f85a788540efcddb80acc3ba23c257)

Author SHA1 Message Date
Joey Hess 6fb6d51524 fix inverted test 2008-08-06 01:15:48 -04:00
Joey Hess 86660e9c82 external: Fix support for hooks called in an array context. 2008-08-06 01:05:44 -04:00
Joey Hess 9cb415f4a4 autoindex: Ignore internal pages, and take underlay directories into account. Also, avoid making index pages for directories that contain no files. 2008-08-06 00:04:05 -04:00
Joey Hess bf8558f346 save to real setup file, and rebuild/refresh 2008-08-05 20:11:56 -04:00
Joey Hess 83888b75f1 save the full path to the setup file 2008-08-05 20:11:23 -04:00
Joey Hess 46b3f54ab6 typo 2008-08-05 19:58:33 -04:00
Joey Hess 4b4bce5006 Revert "typo"
This reverts commit c8d3626c51.
2008-08-05 19:39:30 -04:00
Joey Hess 4b994ffed1 avoid forcing syslog setting
This avoids forcing the setting to 0 if it was not set at all.
2008-08-05 19:36:53 -04:00
Joey Hess c8d3626c51 typo 2008-08-05 19:30:09 -04:00
Joey Hess 6e2f9e97f3 Add simple patch to silence a warning when using monotone 2008-08-04 15:00:47 -04:00
Joey Hess e48f8ff8a9 hm 2008-08-04 14:53:11 -04:00
Joey Hess 0c3291d4f3 plugin enable/disable working and bugfixes 2008-08-03 22:16:38 -04:00
Joey Hess a4ce6550eb loosen qw regexp 2008-08-03 22:16:38 -04:00
Joey Hess 6d15912e8f work around strange problem with banned_users
Its value was being ignored. Some kind of formbuilder bug?
Anyway, prefixing all keys with a section seems like a good idea
generally, in case there's ever overlap.
2008-08-03 21:06:13 -04:00
Joey Hess 4b79a43db6 checkboxes back 2008-08-03 20:51:46 -04:00
Joey Hess 2a712c8817 use radio, not checkbox, for booleans
Had to do this due to one of CGI::FormBuilder's more annoying quirks -- it
loses the value of a checkbox field with only one option, always treating
it as checked.
2008-08-03 20:20:25 -04:00
Joey Hess 3905645342 add plugin safe/rebuild info (part 3 of 3) 2008-08-03 19:36:11 -04:00
Joey Hess 219afc3f9c support rebuild tristate
also some fixes to change minimisation logic
2008-08-03 18:23:17 -04:00
Joey Hess 018321f2c8 fix misc breakage from plugin safe/rebuild data addition 2008-08-03 18:17:13 -04:00
Joey Hess 39195de96e add plugin safe/rebuild info (part 2 of 3)
(brain.. melting..)
2008-08-03 17:20:21 -04:00
Joey Hess 1230e914b1 anonok is safe 2008-08-03 17:03:20 -04:00
Joey Hess 1a37848346 move plugin toggles to before config setting again 2008-08-03 16:58:16 -04:00
Joey Hess b7d6a49be4 ui improvements 2008-08-03 16:46:38 -04:00
Joey Hess aacec52a07 show force disabled plugins in advanced mode 2008-08-03 16:43:42 -04:00
Joey Hess 903213e63f add plugin safe/rebuild info (part 1 of 2)
too many plugins.. brain exploding..
2008-08-03 16:40:12 -04:00
Joey Hess 9e0cbb73fe plugin safe/rebuild controls 2008-08-03 16:23:41 -04:00
Joey Hess 4405cebd0a add advanced and basic modes 2008-08-03 14:57:24 -04:00
Joey Hess 5c0f539950 avoid adding extra disabled fields for arrays 2008-08-03 14:41:53 -04:00
Joey Hess d00f3edf13 properly support all types of data in arrays 2008-08-03 14:39:34 -04:00
Joey Hess 0f06504422 remove description_html, add link 2008-08-03 14:36:17 -04:00
Joey Hess 5ef45ca7e1 support arrays 2008-08-03 00:27:27 -04:00
Joey Hess d8b49840dd update 2008-08-02 23:59:40 -04:00
Joey Hess 7baa6320e0 rebuild detection 2008-08-02 23:32:40 -04:00
Joey Hess 8c02d670d0 pull values from form to config 2008-08-02 23:14:59 -04:00
Joey Hess f6babf662b fix syntax error with corrupt data
Just because it's supposed to be an integer or boolean doesn't mean the
vlaue really is..
2008-08-02 23:14:23 -04:00
Joey Hess 94c59d3254 collect a hash of shown fields
Need to do this to know what fields to take from CGI.
(Can't trust that only safe ones are sent..)
2008-08-02 23:06:25 -04:00
Joey Hess c762b65ce4 show unsafe options (RO) by default
Small data leak, but only to admins, and I think it's worth it to see the
stuff that cannot be configured.
2008-08-02 22:50:09 -04:00
Joey Hess 5dbd053da3 avoid syslog whining from broken plugins 2008-08-02 22:22:53 -04:00
Joey Hess 6f65cb1cbe avoid setting default value in websetup_force_plugins
This would make changes not be seen later.
2008-08-02 22:20:26 -04:00
Joey Hess 15341aed01 don't install demo external plugins by default 2008-08-02 16:53:20 -04:00
Joey Hess 4708aeceb3 websetup form display done 2008-08-02 16:41:37 -04:00
Joey Hess b0f4767448 basic form display done 2008-08-02 16:41:36 -04:00
Joey Hess 102f29e500 add description_html 2008-08-02 16:41:36 -04:00
Joey Hess 0b6dd9247b refactor 2008-08-02 16:41:35 -04:00
Joey Hess d3cad5d2ca relocate 2008-08-02 16:41:35 -04:00
Joey Hess 680cd2fbc3 skeleton of web setup plugin 2008-08-02 16:41:35 -04:00
Joey Hess 25c35b6e90 banned_users move to setup file, stage 1 2008-08-01 17:39:17 -04:00
Joey Hess 190a845fe1 hide deprecated values if empty after save 2008-08-01 17:39:17 -04:00
Joey Hess f41448d9ca rcs plugin loading reorg
Move rcs plugin load to loadplugins; move duplicate rcs detection logic out
of individual plugins and into loadplugins. Avoids checkconfig failing when
run twice.
2008-08-01 16:45:05 -04:00
Joey Hess bb394fdae8 admin prefs move to setup file, stage 1
The locked pages configuration is moving to a locked_pages option in the
setup file, and the allowed attachments configuration to
allowed_attachments. The admin prefs page can still be used for these, but
that's depreacted and will only be shown if there's currently a value.
2008-08-01 16:45:04 -04:00
Joey Hess 041923a89e Merge branch 'master' into autoconfig
Conflicts:

	IkiWiki/Plugin/git.pm
	debian/changelog
	po/ikiwiki.pot
2008-07-31 19:35:37 -04:00
Joey Hess f7b8f2297c Add test for old versions of git that don't support --cleanup=verbatim, and munge empty commit messages. 2008-07-31 19:23:54 -04:00
Joey Hess 6c8a8dd13b add guard against enabling multiple rcs plugins 2008-07-30 14:32:48 -04:00
Joey Hess 12c5786df4 Merge branch 'tova' into autoconfig
Conflicts:

	debian/changelog
2008-07-29 15:54:45 -04:00
Joey Hess f0090d8c57 check generated pages in
I considered not checking them in, or making the checkin configurable.
However, then they would remain not checked in if edited by a user, which is
probably not desired.

Note that passing undef as the username/ip to rcs_commit_staged may not
result in ideal behavior; the commit may seem to come from "anonymous" with
some revision control systems. Most of them handle it a bit better and just
have it come from whatever user is running the build.
2008-07-29 15:51:25 -04:00
Joey Hess a02c3f46ea initial draft 2008-07-29 15:39:01 -04:00
Joey Hess 37245a9988 add refresh hook 2008-07-29 15:04:34 -04:00
Joey Hess 73af360e99 fix cgiurl check 2008-07-27 19:21:56 -04:00
Joey Hess 9be28d7865 handle options with no value and no example value 2008-07-27 19:19:04 -04:00
Joey Hess 9607452346 typo 2008-07-27 16:11:06 -04:00
Joey Hess 950850f639 add new wiki to wikilist 2008-07-27 16:01:29 -04:00
Joey Hess 929a70a16d password prompt for admin user 2008-07-27 15:44:11 -04:00
Joey Hess c755bfd1d8 automator improvements 2008-07-27 15:16:03 -04:00
Joey Hess 3d4c32dace lose the ugly $rawsetup, use a function 2008-07-27 15:08:10 -04:00
Joey Hess 3d139e4312 rcs hook setup for the two I know 2008-07-27 01:50:43 -04:00
Joey Hess f28b57526c setup automator
"ikiwiki -setup /etc/ikiwiki/simple.setup"
can be used set up a new wiki in seconds
2008-07-27 01:39:11 -04:00
Joey Hess e1f7146041 avoid clobbering example diffurl 2008-07-27 00:54:15 -04:00
Joey Hess 4ef96e2d99 Merge branch 'master' into autoconfig 2008-07-26 23:22:42 -04:00
Joey Hess 618e3c1075 use new style error handling 2008-07-26 23:15:35 -04:00
Enrico Zini e3713772f7 Added cutpaste plugin.
I'm wondering if cutandpaste wouldn't be a better name.
2008-07-26 23:08:17 -04:00
Enrico Zini 02078c406c Handle the case when HTML got tidied.
This fixes debian bug #492529.
2008-07-26 23:05:57 -04:00
Joey Hess 6a64d13352 allow --dumpsetup to be used w/o specifying srcdir and destdir
shortcut tried to use srcdir in checkconfig; change it to not so this will
work.
2008-07-26 23:00:44 -04:00
Joey Hess 67a63e7860 fixups 2008-07-26 22:38:43 -04:00
Joey Hess 6154dd03cb finish with rcs plugin conversion 2008-07-26 22:28:18 -04:00
Joey Hess 14cd75746a Version control backends promoted to first-class plugins 2008-07-26 22:27:24 -04:00
Joey Hess 82f0facb62 fixups 2008-07-26 21:14:07 -04:00
Joey Hess 42ac4ec009 remove default values in getsetup
They were a bit confusing, since they did not actually set the default, and
example values are sufficient.
2008-07-26 21:07:15 -04:00
Joey Hess c83fd4a328 wrapper setup reorg
Flattened the wrapper setup, as this lets it be handled better by the
setup generation code.
2008-07-26 21:00:11 -04:00
Joey Hess 38618838c9 add example wrapper and fix formatting 2008-07-26 19:49:45 -04:00
Joey Hess cecd3bf725 historyurl can be undef 2008-07-26 19:37:25 -04:00
Joey Hess 8051316904 add missing setup options, tweak others' display 2008-07-26 19:28:15 -04:00
Joey Hess bb872ea1e8 filter out demo plugins 2008-07-26 19:11:31 -04:00
Joey Hess 52bbdbb1a5 load all plugins when generating setup 2008-07-26 19:10:11 -04:00
Joey Hess f892cc8c50 two typos 2008-07-26 19:05:52 -04:00
Joey Hess 477654003f clarify wording 2008-07-26 18:33:18 -04:00
Joey Hess 56b9b85e33 tla done too 2008-07-26 18:31:27 -04:00
Joey Hess 2bbe1bf9af move more settings out to rcs 2008-07-26 18:29:33 -04:00
Joey Hess 90b310b93c getsetup-ize svn and bzr 2008-07-26 18:26:56 -04:00
Joey Hess 21af3ae336 add folding 2008-07-26 18:14:21 -04:00
Joey Hess b277e00d4e add gensetup for hg 2008-07-26 18:13:16 -04:00
Joey Hess 66739016fa add gensetup for git 2008-07-26 18:10:01 -04:00
Joey Hess 9bcb649efe typos 2008-07-26 17:58:20 -04:00
Joey Hess 0e0ee9b2ce make monotone use hooks, add getsetup
Rather than every monotone rcs_ function calling check_config, just put it
in a checkconfig hook. (But the chdir still needs to be done by every
hook.)
2008-07-26 17:49:25 -04:00
Joey Hess cab1ac75c9 refactor 2008-07-26 15:43:25 -04:00
Joey Hess b073359b18 refactor 2008-07-26 15:39:41 -04:00
Joey Hess 1c00717cb2 can now dump fully functional setup files 2008-07-26 15:34:38 -04:00
Joey Hess cd029da493 typo 2008-07-26 14:56:10 -04:00
Joey Hess 26db34e1d6 adminemail may be undefined 2008-07-26 14:54:50 -04:00
Joey Hess 79f637a436 typo 2008-07-26 14:44:49 -04:00
Joey Hess 49e86d2562 turn booleans into questions 2008-07-26 14:43:47 -04:00
Joey Hess abab46f983 add info for all common setup file options, and most internal ones 2008-07-26 14:39:12 -04:00
Joey Hess 1ba84c3a6b predefine pingurl 2008-07-26 14:38:58 -04:00
Joey Hess c2507d33cb allow account_creation_password to not be defined 2008-07-26 14:02:36 -04:00
Joey Hess 6b19afb3ef fixes 2008-07-26 13:10:52 -04:00
Joey Hess 9169c3247f standardising and documenting getsetup 2008-07-26 13:07:48 -04:00
Joey Hess 255172215e fixes 2008-07-26 12:53:07 -04:00
Joey Hess 5bea644fdd add dumpsetup option; refactor 2008-07-26 12:46:31 -04:00
Joey Hess 62cd2e0a5d setup dumping improvements 2008-07-26 12:01:10 -04:00
Joey Hess e727d5b6e9 more formatting 2008-07-26 02:04:30 -04:00
Joey Hess fe2fe5aa4b improve formatting 2008-07-26 01:58:36 -04:00
Joey Hess 278ae9afea add ability to generate setup files
quite nice ones, too, with comments and everything
2008-07-26 01:35:26 -04:00
Joey Hess 0d7bc7402c fix plugin name 2008-07-26 00:45:32 -04:00
Joey Hess 426200b34a avoid fatal error in sanitize 2008-07-26 00:45:21 -04:00
Joey Hess 84c905ec20 finish adding getsetup hooks to plugins 2008-07-26 00:38:13 -04:00
Joey Hess d0bd30824e Merge branch 'master' into autoconfig 2008-07-25 19:27:15 -04:00
Joey Hess b7bf566f55 attachment: Use relative paths when inserting links. 2008-07-25 19:22:29 -04:00
Joey Hess 1f8b0460c3 added getsetup hooks for all plugins up to recentchanges 2008-07-25 18:05:55 -04:00
Joey Hess cf6c2f142f add getsetup
Also, avoid dying with a fatal error if multimarkdown is enabled and the
module doesh't load.
2008-07-25 17:52:00 -04:00
Joey Hess bf6198baf3 add getconfig for inline
Also, moved the pingurl getopt parsing to inline.
2008-07-25 17:24:52 -04:00
Joey Hess a71b9a1cf1 fix feed urls
The fix for colons involved adding "./" to some urls. Due to the weird way
inline called urlto, these snuck into feed urls and permalinks. Fix it by
adding an optional third parameter to urlto.
2008-07-25 16:16:44 -04:00
Jelmer Vernooij 3575798564 bzr: Version directories on the fly, ignore directories when retrieving
changes.

Now passes t/bazaar.t again.
2008-07-25 20:13:45 +02:00
Joey Hess c401cf4f0c Merge commit 'jelmer/master' 2008-07-25 12:03:34 -04:00
Joey Hess 89e0de5bc4 improved, possibly faster getelementsbyclass by willu 2008-07-25 01:43:37 -04:00
Joey Hess 99b59f2d62 toggle: Fix incompatability between javascript and webkit. 2008-07-25 01:24:20 -04:00
Jelmer Vernooij 7538d356c8 Support staging commands in bzr backend. 2008-07-24 22:43:57 +02:00
Joey Hess 58e2b2c99c mercurial: Add support for rename, delete, and also diff. (William Uther) 2008-07-24 14:17:04 -04:00
Joey Hess c2f621cb1c fix encoding issues with link conversion
Have to convert link text to page name going in.
And on the way out, need to replace spaces with underscores in the link
text, which is not normally done with titles.
2008-07-24 12:36:10 -04:00
Joey Hess 8b3d2ab0bc test suite and partial fix for encoding issues in link renaming 2008-07-23 21:04:11 -04:00
Joey Hess c9961ab1e9 add todo 2008-07-23 19:38:09 -04:00
Joey Hess 762bf0b887 foldage 2008-07-23 19:25:46 -04:00
Joey Hess 985a34b09e fixup editpage links on rename 2008-07-23 19:20:11 -04:00
Joey Hess 7befc6deb3 link fixup on rename working 2008-07-23 19:12:05 -04:00
Joey Hess 4918c164e8 preserve case of subpage 2008-07-23 19:03:37 -04:00
Joey Hess 8b063a24d9 case preservation 2008-07-23 18:57:27 -04:00
Joey Hess 4691a2ad39 add renamepage hooks
Implemented for regular wikilinks, with a test suite.
2008-07-23 18:14:20 -04:00
Joey Hess 96dab37a8e Merge branch 'master' into tova 2008-07-23 17:34:01 -04:00
Gabriel McManus d9062864ee Rebuild pages that change their type.
Previously, if a page changed its type but not its mtime
(e.g. mv page.txt page.mdwn), then it would not be rebuilt.

Now, check if the source of a page has changed,
in which case force a rebuild of that page.
(cherry picked from commit b6a3b8a683fed7a7f6d77a5b3f2dfbd14c849843)
2008-07-23 16:00:26 -04:00
Joey Hess 335a6a59e6 Merge branch 'master' into tova 2008-07-23 15:00:07 -04:00
Joey Hess 1d1767192c attachment: Do not escape _ when determining attachment filenames. 2008-07-23 14:58:39 -04:00
Joey Hess 29f32d0ba3 add a list of broken links after the rename 2008-07-22 20:30:54 -04:00
Joey Hess 1c9a3cb82b add a rename summary 2008-07-22 20:17:03 -04:00
Joey Hess d76c10cba2 Split out error messages from editpage.tmpl into several separate templates. 2008-07-22 19:58:34 -04:00
Joey Hess 2b9615194e fix gettext 2008-07-22 19:44:31 -04:00
Joey Hess 421559b230 edit page fixup in postrename 2008-07-22 18:17:11 -04:00
Joey Hess 89b3bb7e38 check for absolute paths 2008-07-22 17:38:31 -04:00
Joey Hess 9776bbf853 Don't allow uploading an attachment with the same name as an existing page, to avoid confusion. 2008-07-22 17:12:20 -04:00
Joey Hess 114e20e948 typo 2008-07-22 17:03:28 -04:00
Joey Hess cbddb5a4b8 add rcs_commit_staged and rcs_rename
Implemented for git and svn so far.

Note that rcs_commit_staged does assume that the rcs has the ability to
"stage" multiple changes for a later commit. Support for this varies, but
all we really care about is staging removals and renames, which, AFAIK, all
modern rcs's support.
2008-07-22 16:14:33 -04:00
Joey Hess cf9620074a qualifiy 2008-07-22 15:07:07 -04:00
Joey Hess bac47cdecd make message a bit more generic 2008-07-22 15:06:59 -04:00
Joey Hess cbf1c8b810 rename checks improvements 2008-07-22 14:01:23 -04:00
Joey Hess 569d31d875 permission checking improvements
Break out into function so it can be done up-front before confirmation too.
2008-07-22 13:29:54 -04:00
Joey Hess ac1226031e avoid uninitialised value 2008-07-22 13:23:11 -04:00
Joey Hess a3e16cd29f really add 2008-07-21 22:44:37 -04:00
Joey Hess 0c9fe2f99c use check_canattach
As noted, this may be overkill..
2008-07-21 22:44:19 -04:00
Joey Hess f9cbe871ad factor out check_canattach
Other plugins will need to use this.
2008-07-21 22:41:31 -04:00
Joey Hess 96c529826d skeleton rename plugin 2008-07-21 22:30:43 -04:00
Joey Hess ed05e40566 error if nothing selected 2008-07-21 22:11:24 -04:00
Joey Hess 6e243a45e5 probably redundant symlink check 2008-07-21 21:57:58 -04:00
Joey Hess 9d5c9ce258 Merge branch 'master' into tova 2008-07-21 21:23:58 -04:00
Joey Hess c2a2f71508 Add allow_symlinks_before_srcdir config setting
can be used to avoid a security check that is a good safe default, but
problimatic overkill in some situations.

I decided to underdocument this, because the option looks ugly, and I don't
want people randomly turning it on because it looks like a good idea. So if
you need it, you'll get an error message mentioning how to fix it.
2008-07-21 18:33:09 -04:00
Joey Hess e630e7507e Avoid troublesome abs_path calls in wrapper setup
As documented in the forum post.
2008-07-21 18:26:14 -04:00
Joey Hess 18d2403647 Merge branch 'master' into tova
Conflicts:

	debian/changelog
2008-07-21 17:27:50 -04:00
Simon McVittie 09a5cdbb34 Don't prepend tagbase to tags if they start with "./" or "/".
That syntax made little sense previously, and this allows sites to put
"most" of their tags under $tagbase.
2008-07-21 22:02:55 +01:00
Joey Hess 97e21ae21c don't show an error if the image is missing, instead, a broken link 2008-07-21 16:53:52 -04:00
Joey Hess 7910f1c352 remove debugging 2008-07-21 16:53:46 -04:00
Joey Hess d724a26754 avoid internal error message when img uses just-deleted page
I think this used to be a fatal error, not just inline error, so I don't
know why it was never noticed, but if a page that an img directive mentions
gets deleted, bestlink() returns a file that no longer exists, and
srcfile() throws an error.

Note that bestlink's behavior of returning a deleted file could be
considered buggy. But, if it's changed to not do that, the page with the img
on it is not updated at all when the file is removed.
2008-07-21 16:38:40 -04:00
Joey Hess d9af10a1be typos 2008-07-21 16:21:59 -04:00
Joey Hess 90de84b442 typos 2008-07-21 16:21:46 -04:00
Joey Hess b182f5e573 need to untaint.. 2008-07-21 16:20:02 -04:00
Joey Hess 2461ce0de6 a few bugfixes
Including a check the the file is in the srcdir, as opposed to some other
directory.
2008-07-21 16:18:28 -04:00
Joey Hess af9c5e4bba support for removing attachments 2008-07-21 15:02:29 -04:00
Joey Hess a1df39ed4a simplified confirmation form
also, there's no titlepage conversion issues
2008-07-21 14:22:57 -04:00
Joey Hess b1b5860b29 touchups 2008-07-21 14:03:39 -04:00
Joey Hess 494e7ab8ba redirect after removal 2008-07-21 13:53:34 -04:00
Joey Hess c924c76bd8 basically, removal works
Still need to consider all the edge cases..
2008-07-21 13:50:12 -04:00
Joey Hess c6d1ae33d2 All rcs backends need to implement rcs_remove
(Done for svn, git.)
2008-07-21 13:41:17 -04:00
Joey Hess a204f86786 form tweaks; use title 2008-07-21 13:31:58 -04:00
Joey Hess b286ce04cb implemented form state saving and retrieval
This is overkill for delete, since it's only used on Cancel. But it will be
crucial for rename, so as to restore any pending edits after renaming a
page.
2008-07-21 13:23:07 -04:00
Joey Hess 8e7b31a19c basic removal form skeleton 2008-07-21 12:54:23 -04:00
Joey Hess 46617c23f4 rename skeleton.pm
Add '.example' so it's not installed with the other plugins.
2008-07-21 07:49:28 -04:00
Gabriel McManus e3b0584a49 Use correct term prefixes when searching.
The Z term prefix is for stemming and shouldn't be used here.
X is for custom fields.
2008-07-19 13:23:02 -04:00
Joey Hess 2c9ab7065e mark old web commits as from web 2008-07-17 19:25:10 -04:00
Joey Hess e8a11957df fix web commit determination 2008-07-17 19:23:00 -04:00
Joey Hess afd3126e55 dummy up an email address for web commits
Not doing so breaks cia and other things that try to parse a username out
of the email address.
2008-07-17 19:12:34 -04:00
Joey Hess 1b318dacbd git: Fix parsing of git logs with no commit messages at all. 2008-07-17 16:53:54 -04:00
Joey Hess f66eddccc6 change how web commits are specified
The trailer line was a bit complex and ugly;
I think it's better to just put "(web)" after the user
name.

This has a side effect of making web commits with no messages
have a completly empty commit message. Use --cleanup=verbatim
to force git to accept such.
2008-07-17 16:35:18 -04:00
Joey Hess ac62a47ea4 git: Put web committer name/openid/address in the git author field
The committer's email address is not used (because leaking email addresses
is not liked by many users). Closes: #451023

A "Web-commit" trailer is added, to allow telling the difference between
web commits and direct commits.
2008-07-17 16:17:15 -04:00
Joey Hess 584f3e3061 Add a postscan hook.
* Add a postscan hook.
* search: Use postscan hook, avoid updating index when previewing.
2008-07-17 16:17:15 -04:00
Joey Hess c4f124d78a fix pos setting
What was really going on is that expanding a smiley modified the string and
reset the match process. Force set pos so it continues on from the expanded
smiley.
2008-07-17 13:11:47 -04:00
Joey Hess df3a8b183c smiley escaping fixes
Smileys need to be double-escaped to work, since the smiley plugin runs as
a sanitize hook, and markdown helpfully removes one level of escapes first.

There were some bugs in the smiley handling code that made escaped smileys
still be expanded. After unescaping a smiley, it needed to move pos forward
past it or the next pass would expand it.

Also, once the m//g got to the end, it seemed to loop back through and make
one more pass (a difference in perl 5.10's regexp exngine? I observed that
pos was undefined when this happened, so added a `last unless defined pos`.
2008-07-17 12:34:38 -04:00
Joey Hess 3096c8ea69 formatting etc 2008-07-16 17:43:42 -04:00
Joey Hess 2c05a34be1 Merge commit 'intrigeri/pedigree' 2008-07-16 17:31:15 -04:00
intrigeri 35668b87d3 pedigree rename to parentlinks: rename/adapt everything
* Renamed to parentlinks every single variable or function called
  pedigree
* Removed the parentlinks function from Render.pm
* Enabled the new parentlinks plugin by default
* Adapted testsuite and documentation to reflate the above facts

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-15 16:25:39 +02:00
intrigeri 486f460132 pedigree rename to parentlinks: renamed files, to start with
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-15 16:09:40 +02:00
intrigeri 55000fd779 pedigree: rewrote with different design
(and updated testsuite + docs accordingly)

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-15 13:06:52 +02:00
Joey Hess 2696e0c6db fixes 2008-07-14 23:00:29 -04:00
Joey Hess 76bda69a92 use prune to delete rendered files
This handles deleting empty directories too.
2008-07-14 22:45:12 -04:00
Simon McVittie b29d11b3c6 Fix aggregateinternal migration so it skips expired entries, and deletes output 2008-07-15 03:24:05 +01:00
Joey Hess af48316b1d Merge commit 'smcv/aggregateinternal' into aggregateinternal
Conflicts:

	IkiWiki/Plugin/aggregate.pm
2008-07-14 20:15:08 -04:00
Simon McVittie 302bb836f2 Use _aggregated as extension for internalized aggregation 2008-07-15 01:04:29 +01:00
Joey Hess 51bf0ea529 changes to debug message printing 2008-07-14 19:43:45 -04:00
Simon McVittie 50a5ab3c4e Add aggregateinternal mode to ikiwiki-transition.
Usage:
1. Update all pagespecs that use aggregated pages to use internal()
2. ikiwiki-transition aggregateinternal $srcdir $htmlext
   (where $srcdir and $htmlext are the srcdir and htmlext options in
   your .setup file)
3. Add aggregateinternal to your .setup file
4. Rebuild the wiki
2008-07-14 23:39:22 +01:00
Simon McVittie 18b3e970ff Merge commit 'origin/master' into aggregateinternal 2008-07-14 23:34:07 +01:00
intrigeri b391b5a80b pedigree: added DISTANCE loop variable
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-14 14:52:34 +02:00
intrigeri b857b229d8 pedigree: fix RELDEPTH in PEDIGREE_BUT_ROOT...
... at least when it's not used in the same template as
PEDIGREE_BUT_TWO_OLDEST (see Known bugs section in pedigree.mdwn for
details)

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-14 14:25:42 +02:00
intrigeri df42a5ef21 pedigree: added _but_root & _but_two_oldest loops
... after having learned a bit of Perl, knocked my head against
Perl references and arrays of hashes, tried to use some nice
functionnal programming constructs - no success - to make things
more generic... I'm back to the roots, with this simple code :)

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-13 22:03:22 +02:00
intrigeri 16cf69477d pedigree: fixed misc bugs
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-13 22:03:06 +02:00
intrigeri f32369f669 added new plugin: pedigree
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-13 22:02:23 +02:00
Joey Hess ffc99f5904 switch preprocess hooks to use error function 2008-07-13 15:05:34 -04:00
Joey Hess 0b140ed1c8 avoid hardlinking files owned by others
If hardlinks are enabled, it would hardlink files from the underlay. That
was sorta annoying if you tried to edit by hand for some reason, so let's
not. Files that are hardlinked should be rare enough that a few extra stats
won't hurt.
2008-07-12 23:31:27 -04:00
Joey Hess e3c0e49774 only htmlize errors when cgi is actually running 2008-07-12 23:23:25 -04:00
Joey Hess e4e3d7e2d4 convert fatal error to warning
Since perlmagick is not a hard dep, and goodstuff is enabled by default,
imgs should not crash builds
2008-07-12 20:21:42 -04:00
Simon McVittie bed1f1037a Add missing requirement of IkiWiki::render before starting to render things 2008-07-12 22:52:46 +01:00
Simon McVittie 5c0896e674 Make aggregated items be internal pages if --aggregateinternal is used.
This addresses <http://ikiwiki.info/todo/aggregate_to_internal_pages/>
in a simple way. With this approach, a flag day is required, on which all
users of aggregated pages start to inline them using the internal() pagespec;
after that, the aggregateinternal option can safely be switched on in the
setup file (and the old aggregated pages can be deleted by hand).
2008-07-12 18:15:11 +01:00
Simon McVittie 9a184badf5 Stop prepending urn:uuid: to guids that look like UUIDs 2008-07-12 17:34:40 +01:00
Simon McVittie 415c8e0cb5 Rename [[!inline atomid="..."]] to [[!inline guid="..."]] to be consistent with [[!meta guid="..."]], which also outputs an Atom <id> 2008-07-12 17:12:37 +01:00
Simon McVittie 2bd8ada5a6 Accept [[!inline ... atomid="..."]] and use it to populate the feed's Atom <id>.
This is often the same as the feed's <link> (in which case it can be omitted) but sometimes it's a urn:uuid: URN instead.
2008-07-12 17:09:41 +01:00
Joey Hess f707d62481 Merge commit 'smcv/master' 2008-07-12 12:02:57 -04:00
Joey Hess d101269bde Move yesno function out of inline and into IkiWiki core, not exported. 2008-07-12 12:01:22 -04:00
Simon McVittie 1f26a1bf16 Bug fix: use &IkiWiki::pagetitle rather than nonexistent &pagetitle in meta plugin, so that PageSpecs with title(...) work again 2008-07-12 16:44:55 +01:00
Joey Hess ca30d95a78 rename uuid to guid 2008-07-12 10:59:45 -04:00
Joey Hess 37471e92d9 elide temp var 2008-07-12 10:49:12 -04:00
Simon McVittie 9c6444bf68 meta plugin: if uuid looks like it is in fact a UUID, prepend "urn:uuid" (otherwise leave it alone, so we can assign non-UUID <id>s to Atom items to avoid planet-flooding) 2008-07-11 23:57:47 +01:00
Simon McVittie e767f18867 inline plugin: if meta plugin is also enabled, and has collected a uuid for a page, then pass it into the rssitem/atomitem templates 2008-07-11 23:44:12 +01:00
Simon McVittie 9b34b879e2 meta plugin: also collect [[!meta uuid="..."]] 2008-07-11 23:42:38 +01:00
Joey Hess d73d4fed03 rename beautify_url to stress it only works on the path component 2008-07-11 10:33:41 -04:00
Joey Hess d5de560f50 beautify url recentchanges_link redirs to
This ensures that the same link is reached as is used on pages,
so browsers will know that the link on pages has been visited, and color it
appropriately.
2008-07-11 09:44:47 -04:00
Joey Hess 4e1d7d8ff2 fix use ordering
The recent setup revamp exposed some latent bugs in use/package ordering
that caused some symbols to not the exported into the correct scope.
2008-07-11 06:09:34 -04:00
Joey Hess 598a8ce1f7 whitespace 2008-07-11 06:09:34 -04:00
Joey Hess 3879c56e71 Fixes creation of pages when clicking on WikiLinks starting with "/". 2008-07-10 15:36:18 -04:00
Joey Hess dcab5e2e48 template: Add support for a BASENAME variable. 2008-07-10 15:25:42 -04:00
Joey Hess 5d26ded381 work around CGI::Session constructor issues
The constructor can fail with a useless error message if module fail to
load. Work around this by evaling it, and checking for failures, and
printing CGI::Session->errstr to get a more useful message.
2008-07-10 13:17:56 -04:00
Joey Hess aa1f0080a8 clarifications, comments 2008-07-09 22:47:06 -04:00
Joey Hess 4e02dead14 Make it possible to load setup files w/o running them. Code needing to do so can call IkiWiki::Setup::load, and the values will be loaded into %IkiWiki::Setup::setup. 2008-07-09 22:39:26 -04:00
Joey Hess 06709cdf31 improve error message if virus checker fails w/o output 2008-07-09 16:53:03 -04:00
Joey Hess 2449c596af otl: Support utf-8 files. (Recai Oktaş) 2008-07-08 20:52:30 -04:00
Joey Hess ad02f69836 attachment: Support perl 5.8's buggy version of CGI.pm.
This is truely horribly disgusting. CGI::tmpFileName, in current perls, is
an undocumented function (which should be a clue..) that takes the original
filename of an uploaded attachment, and returns the name of the tempfile
that CGI has stored it in.

In old perls, though, CGI::tmpFileName does not take a filename. It takes
a key from the object's {'.tmpfiles'} hash. This key is something
crazy like '*Fh::fh00001group' -- apparently the stringification of a
filehandle object.

Just to add to the fun, tmpFileName doesn't take the key, it expects a
refernce to the key. Argh?!

But the fun doesn't stop there, because in perl 5.8, CGI.pm is also broken
in two other ways. The upload() method is supposed to return a filehandle
to the temp file. It doesn't. The param() method is supposed to return
a filehandle to the temp file, that stringifies to the original filename.
It returns just the original filename, no filehandle.

Combine all these bugs, and you end up with this disgusting commit. Since
I have no way to get the filehandle, I *need* to get the tempfile name.
If I had the filehandle, I could probably pass it into tmpFileName, and
it might strigify to the right key name. But I don't, so the only way to
determine the key is to grub through the .tmpfiles hash ourselves.

And finally, one the temp file name is discovered, a filehandle can finally
be obtained by (re)opening it.

I recommend that this commit be reverted when perl 5.8 is a mercifully
faded memory.

I'm really, really, really glad I'm actually being paid for working on
this right now!
2008-07-08 18:10:53 -04:00
Joey Hess 2e5785907d explicitly set form type to multipart
This is the default in unstable's formbuilder, but not in stable's,
and CGI multipart is needed for fule uploads.
2008-07-08 17:18:02 -04:00
Joey Hess 22839215fb check for tempfile being empty 2008-07-08 16:21:01 -04:00
Joey Hess 6f3c980e2b undef $fh before opening 2008-07-08 12:16:36 -04:00
Joey Hess 66f35e30dc another try at dealing with CGI.pm problem
open the temp file if all attempts to get a fd fail
2008-07-08 11:25:30 -04:00
Joey Hess 71f10579c0 attachment: Support old versions of CGI.pm that lack an upload method. 2008-07-08 10:42:58 -04:00
Joey Hess f156308aef attachment: Fix an uninitialised value warning when editing a page that currently has no attachments. 2008-07-08 09:40:46 -04:00
Joey Hess dbbc1e4040 minor improvements 2008-07-07 01:54:28 -04:00
Gabriel McManus 7b8f4d2d06 search: generate configuration files once only when rebuilding 2008-07-07 01:53:06 -04:00
Joey Hess 2f3a279f68 add virus checking to attachments plugin 2008-07-06 17:36:26 -04:00
Joey Hess 788c1e9eca avoid uninitialised value warnings 2008-07-06 17:35:50 -04:00
Joey Hess 6e2dc2b1fd avoid uninitialised value 2008-07-06 17:00:35 -04:00
Joey Hess 05124f9a86 editpage escaping fixes
* The editpage form now uses the raw page name, not the page title, in its
  'page' cgi parameter. Using the title was ambiguous and made it
  impossible to tell between some pages, like "foo/bar" and "foo__47__bar",
  sometimes causing the wrong page to be edited.
* This change means that some edit links need to be updated.
  Force a rebuild on upgrade to this version.
* Above change also allowed really fixing escaped slashes from the blogpost
  form.
2008-07-06 15:52:04 -04:00
Joey Hess ca6d9da279 link to pagespec/attachment 2008-07-02 18:22:49 -04:00
Joey Hess c150590e27 factor out glob2re 2008-07-02 18:22:49 -04:00
Joey Hess 84e6c4fa66 add mimetype checking 2008-07-02 18:22:49 -04:00
Joey Hess ba707cdcd9 add user and ip support to attachment pagespecs 2008-07-02 16:33:35 -04:00
Joey Hess edfbd7e1aa toggle: Add javascript to top of page, not to end. This avoids flicker since closed toggles will not be displayed as the page is loading. 2008-07-02 16:14:18 -04:00
Joey Hess 1289beb53b xhtml fixes 2008-07-02 16:08:48 -04:00
Joey Hess 895faed642 toggle: Add support for toggles that are open by default.
Also fix to work in preview mode.
2008-07-02 16:02:01 -04:00
Joey Hess d593533af5 attachments interface visibility toggling 2008-07-02 15:42:32 -04:00
Joey Hess e998235240 export javascript, and support default-open toggles 2008-07-02 15:33:52 -04:00
Joey Hess ed25c2abf2 fixes 2008-07-01 20:35:54 -04:00
Joey Hess 883da338a4 some fit and finish fixes 2008-07-01 19:05:15 -04:00
Joey Hess 0abaf5aaae only show one sig fig 2008-07-01 18:41:30 -04:00
Joey Hess e8a13c32ba display human sizes 2008-07-01 18:40:42 -04:00
Joey Hess 8441d31535 add both kinds of links 2008-07-01 18:08:31 -04:00
Joey Hess c1e9e121b7 basic attachment list 2008-07-01 17:19:38 -04:00
Joey Hess 14cb2b0869 save attachments when page is saved too
A user might specify an attachment, but not click the upload button,
and just save the whole page instead.
2008-07-01 16:13:47 -04:00
Joey Hess 1405006fbf check attachments in and refresh 2008-07-01 15:35:01 -04:00
Joey Hess e87c3ae6df add allowed attachments field to admin prefs 2008-07-01 14:02:30 -04:00
Joey Hess 00962f589a minor optimisation 2008-07-01 13:51:22 -04:00
Joey Hess d7ca2f8f9b fix expensive move code path 2008-07-01 13:48:07 -04:00
Joey Hess 7cd40ea4eb better approach for cgi upload disabling
Make it a config setting, this way subtle load order issues don't come into
play. (As much?)
2008-07-01 13:43:32 -04:00
Joey Hess 5aee8d937d bugfixes 2008-07-01 13:39:02 -04:00
Joey Hess a78a981792 attachment location
Put the attachment in a subdir of the page it's attached to,
unless that page is an "index" page.
2008-07-01 13:31:09 -04:00
Joey Hess b4296a4943 simplification 2008-07-01 13:31:03 -04:00
Joey Hess de6ed410bc reorder
canedit should fail first as it's a less expensive and harder to pass test
2008-07-01 13:22:11 -04:00
Joey Hess dbf23748dd call check_canedit
Needed to prevent uploads of locked pages as attachments.
2008-07-01 13:20:42 -04:00
Joey Hess cec45b69da bugfix; support pagetype of "0" 2008-07-01 00:43:19 -04:00
Joey Hess 4fa115fdb5 copy the attachment into srcdir 2008-07-01 00:42:42 -04:00
Joey Hess 0f8ea7ecca break out fast_file_copy 2008-07-01 00:42:23 -04:00
Joey Hess 49514f39f6 fix some messages 2008-06-30 23:32:08 -04:00
Joey Hess b01ee9b3b3 add an ispage limit 2008-06-30 23:17:01 -04:00
Joey Hess 622033f5d6 minor improvements 2008-06-30 23:04:37 -04:00
Joey Hess 0a37c45f32 basic attachment plugin, unfinished
Currently includes UI, and a few tests of the attachment, as well as the
framework to extend pagespecs to test attachments. Does not actually save
the file yet.
2008-06-30 22:58:33 -04:00
Joey Hess dbab5e9b85 disable cgi uploads earlier
This allows plugins that want to enable uploads to do so by changing the
value of $CGI::DISABLE_UPLOADS at some point before the cgi hook is run.
2008-06-30 21:13:41 -04:00
Joey Hess e1d9747be1 remove unused editpage title
The title was set to editpage, but then always changed.
And some code tested for this. Remove this dead code.
2008-06-30 20:33:39 -04:00
Joey Hess 8e43bc0e0f Configure CGI.pm to disable file uploads by default. 2008-06-30 20:01:10 -04:00
Joey Hess b66f9a1981 call format hooks when generating page previews
* toc: Revert change in 2.45 that made it run at sanitize time. This breaks
  use of toc in a sidebar.
* Call format hooks when generating page previews, thus fixing toc display
  there, as well as fixing inlins to again display in page previews, since
  it's started using format hooks. This also allows several other things,
  like embed, that use format hooks, to work during page preview time.
* Format hooks should not rely on getting an entire html document, as they
  will only get the body during page preview.
* toggle: Deal with preview mode when adding javascript.
2008-06-28 23:08:24 -04:00
Joey Hess 00503f25cd smiley: Generate links relative to the destpage. (Fixes a reversion from 2.41.) 2008-06-28 16:58:43 -04:00
Joey Hess 17a09ef88e pagesources might not be populated 2008-06-24 20:47:15 -04:00
Joey Hess 7fbbcc1615 only convert urls if the module is installed 2008-06-24 20:38:41 -04:00
Joey Hess a4d693f659 formatting 2008-06-24 20:35:21 -04:00
Joey Hess 532d4b0d5f rename to txt 2008-06-24 20:33:41 -04:00
Joey Hess 3f6d3f3be8 initial version 2008-06-24 20:33:03 -04:00
Bernd Zeimetz 4a9567595a Disable handling of "bare" links by the creole plugin.
This change needs libtext-wikicreole-perl (>= 0.05-2).
Also removing custom link function, there's no need for it -
if it is not defined, the unmodified markup will be returned.
2008-06-24 16:52:23 -04:00
Bernd Zeimetz b16c43a440 `template` option for aggregate.pm.
Allows to specify the template file which is used to
create the html pages.
2008-06-21 16:23:39 -04:00
Joey Hess 1b6b4da3a3 avoid creole parsing wikilinks
ikiwiki already does, and escaped links should not be processed by creole
after ikiwiki de-escapes them
2008-06-19 19:54:46 -04:00
Joey Hess 98095ccac4 creole: New plugin from Bernd Zeimetz. Closes: #486930 2008-06-19 19:11:18 -04:00
Joey Hess bd7edfd9ca textile: The Text::Textile perl module has some regexps that fail if input is flagged as utf-8, but contains invalid characters such as 0x92. To prevent it from crashing, re-encode the content before calling it, which will ensure that it's really utf-8. 2008-06-16 15:43:37 -04:00
Joey Hess 4da54999de meta: Store "description" in pagestate for use by other plugins.
map: Support show=description.
2008-06-15 19:08:50 -04:00
Joey Hess ebb2b9cbda bugfixes for show=title
Can't sort by titles; the tree building logic requires that the list be
sorted by page name.

Setting linktext => $page is not the same as omitting it entirely. So some
contortions to only set linktext when the page name is not being shown.
2008-06-15 19:08:24 -04:00
Joey Hess ce029bfe04 check that parent hash exists, to avoid creating it 2008-06-15 18:10:47 -04:00
Joey Hess 069b10cc6a note about titles and dependencies 2008-06-15 18:09:46 -04:00
Joey Hess 78a7f6938f style changes
Reindented, moved a TODO from page to code, trimmed some unnecessary
comments, and simplified the use of mkstemp.
2008-06-15 16:26:15 -04:00
Joey Hess a7a1d00e1c initial add 2008-06-15 16:25:18 -04:00
Joey Hess 71d984b310 map: Add a "show" parameter. "show=title" can be used to display page titles, rather than the default page name. Based on a patch from Jaldhar H. Vyas, Closes: #484510 2008-06-15 16:11:11 -04:00
Joey Hess 5807f1de04 fix two build bugs
* ikiwiki-mass-rebuild: Make group list comparison more robust.
* search: Work around xapian bug #486138 by only stemming locales
  in a whitelist.
2008-06-13 13:05:44 -04:00
Joey Hess ecfb14f7d1 Don't generate empty title attributes, etc, and allow setting defaults for class and id too. 2008-06-08 00:02:33 -04:00
Joey Hess f6b47b0d1c img: Support captions. 2008-06-07 23:45:40 -04:00
Joey Hess 3215b5a982 finishing touches on the new search plugin
- Add a Help link.
- If the pageterm is too long, hash it.
2008-06-04 15:24:28 -04:00
Joey Hess a3d8f4904e set rebuild before loading plugins
This fixes a recent minor reversion caused by loading plugins earlier than
the messages are printed. Some plugins might check if rebuild is set.
2008-06-04 15:22:41 -04:00
Joey Hess ea5da19189 fix uninitialized value problem
This occurred when a plugin, loaded earlier, filled out a template in its
checkconfig, before recentchanges's checkconfig had run. Since such a
template won't be a recentchanges template, just test for the value being
uninitialized and skip processing.
2008-06-04 15:00:24 -04:00
Joey Hess e4119f048c The search interface now allows searching for a page by title ("title:foo"), as well as for pages that contain a given link ("link:bar"). 2008-06-04 14:13:21 -04:00
Joey Hess 319e2c94de it's not $title, try the other variable 2008-06-04 13:41:15 -04:00
Joey Hess 295e958da5 don't use meta title
Using the title obscured path info, and made search results look
inconsistent. Since nothing else uses the title like that, it didn't make
sense for search to.
2008-06-04 13:12:10 -04:00
Joey Hess bf9829352b have the xapian stemmer use a language based on LANG 2008-06-04 02:41:02 -04:00
Joey Hess 27376abb3c also decode html entities in the title 2008-06-04 01:50:51 -04:00
Joey Hess 4a51e384eb decode html entities 2008-06-04 01:34:26 -04:00
Joey Hess 9976c31aca fix clearing index on page deletion 2008-06-04 01:28:35 -04:00
Joey Hess 1dddec0ba9 Pass a destpage parameter to the sanitize hook.
Because the search plugin needed it, also because it's one of the few
plugins that didn't already have it.

I also considered adding it to htmlize, but I really cannot imagine caring
what the destpage is when htmlizing. (I'll probably be poven wrong later.)
2008-06-04 01:24:23 -04:00
Joey Hess 1546b48b97 move indexing to sanitize hook
I think this will give better results overall.

I made %IkiWiki::preprocessing accessible and used it to avoid indexing
at unnecessary points.
2008-06-04 00:58:46 -04:00
Joey Hess ce826411b2 more search improvements 2008-06-04 00:38:40 -04:00
Joey Hess aefe5dd9cb more substr fixes 2008-06-04 00:25:56 -04:00
Joey Hess fab1333b67 Filter hooks are no longer called during the scan phase. This will prevent wikilinks added by filters from being scanned properly. But no known filter hook does that, and calling filters unncessarily during scan slowed down complex filters such as the one used to update the xapian index. 2008-06-04 00:15:15 -04:00
Joey Hess 53b188ed35 add a colon to disambiguate
The omega docs suggest doing this if the term may contain upper case, which
it could here.
2008-06-03 23:59:25 -04:00
Joey Hess 9c717d0873 avoid warning
"substr outside of string"
2008-06-03 23:58:19 -04:00
Joey Hess 7fc29119db use "U" term
this seems to be the thing to use for a unique id
2008-06-03 23:56:45 -04:00
Joey Hess 3ba723d79a don't loop forever 2008-06-03 23:55:00 -04:00
Joey Hess 6b7d90d88a fixed most of the xapian todos 2008-06-03 23:52:56 -04:00
Joey Hess 18b0aa1f13 prettify page names, and drop the redunadant url display 2008-06-03 22:11:33 -04:00
Joey Hess 02357b0b32 fix toindex 2008-06-03 21:59:21 -04:00
Joey Hess 44fde6cbff first pass at doing xapian indexing
Still some TODOs to fill in.
2008-06-03 21:14:56 -04:00
Joey Hess 8a6a5320ed search: Converted to use xapian-omega.
Everything is done except for the actual indexing. I plan to do incremental
indexing as pages change.
2008-06-03 15:29:54 -04:00
Joey Hess 99e5e6dd08 inline: The optimisation in 2.41 broke nested inlines. Detect those and avoid overoptimising. 2008-05-31 15:10:23 -04:00
Joey Hess 0a35e8a352 haiku: Generate valid xhtml. 2008-05-30 19:10:58 -04:00
Joey Hess e943812dc9 hashed password support, and empty password security fix
This implements the previously documented hashed password support.

While implementing that, I noticed a security hole, which this commit
also fixes..
2008-05-30 17:35:34 -04:00
Joey Hess 9d93029f01 teximg: If the log isn't written, avoid ugly error messages. 2008-05-29 19:29:40 -04:00
Joey Hess b0a7b2f3d7 teximg: Fix logurl. 2008-05-29 19:28:46 -04:00
Joey Hess d5d56a24bd When calling decode_utf8 on known-problimatic content in aggregate, explicitly pass 0 (FB_DEFAULT) as the second parameter. Apparently perl 5.8 needs this to avoid crashing on malformed utf-8, despite its docs saying it is the default. 2008-05-28 15:38:04 -04:00
Thomas Schwinge 1e16ab178d Avoid ``uninitialized value'' warning when there actually is no difference between the two versions. 2008-05-25 14:25:34 -04:00
Joey Hess f6f25758a8 Perls older than 5.10 need to use the old method of decoding utf-8 in CGI values. Neither method will work for all versions of perl, so check version number at runtime. 2008-05-21 15:30:56 -04:00
Joey Hess 9a8a67f078 display an error message if CGI::Session fails to load 2008-05-21 15:15:11 -04:00
Joey Hess 0bf5248427 git: Skip over signed-off-by and similar lines in commit messages when generating recentchanges. 2008-05-15 18:03:44 -04:00
Joey Hess 8a888a8fed inline: Display a message if the 'pages' parameter is missing, before it just expanded to nothing. 2008-05-15 17:22:54 -04:00
Joey Hess 833610a5b4 orphans: As a special case, the toplevel index page is never considered an orphaned page. 2008-05-15 16:47:44 -04:00
Joey Hess fba4a198b5 mdwn: Add a multimarkdown setup file option. 2008-05-13 12:43:25 -04:00
Joey Hess fb3d5b4800 Fixes for behavior changes in perl 5.10's CGI
Something has changed in CGI.pm in perl 5.10. It used to not care
if STDIN was opened using :utf8, but now it'll mis-encode utf-8 values
when used that way by ikiwiki. Now I have to binmode(STDIN) before
instantiating the CGI object.

In 57bba4dac1, I changed from decoding
CGI::Formbuilder fields to utf-8, to decoding cgi parameters before setting
up the form object. As of perl 5.10, that approach no longer has any effect
(reason unknown). To get correctly encoded values in FormBuilder forms,
they must once again be decoded after the form is set up.

As noted in 57bba4da, this can cause one set of problems for
formbuilder_setup hooks if decode_form_utf8 is called before the hooks, and
a different set if it's called after. To avoid both sets of problems, call
it both before and after. (Only remaining problem is the sheer ugliness and
inefficiency of that..)

I think that these changes will also work with older perl versions, but I
haven't checked.

Also, in the case of the poll plugin, the cgi parameter needs to be
explcitly decoded before it is used to handle utf-8 values. (This may have
always been broken, not sure if it's related to perl 5.10 or not.)
2008-05-12 20:44:22 -04:00
Joey Hess 489a6fc8bf paste-o 2008-05-08 16:12:09 -04:00
Joey Hess a50fb83394 add --delete-bucket option 2008-05-08 16:11:39 -04:00
Joey Hess b7950d8d01 load plugins before printing messages
This allows plugins to getopt and change what is done before an incorrect
line is printed.
2008-05-08 16:08:02 -04:00
Joey Hess b8d81b7b7f amazon s3 index file improvements
Turns out duplicate index files do not need to be stored when usedirs is in
use, just when it's not. Ikiwiki is quite consistent about using page/ when
usedirs is in use. (The only exception is the search plugin, which needs
fixing.)

This also includes significant code cleanup, removal of a incorrect special
case for empty files, and addition of a workaround for a bug in the amazon
perl module.
2008-05-08 15:51:09 -04:00
Joey Hess 8861af53db simplify key determination code 2008-05-08 13:00:05 -04:00
Joey Hess 71c6cddcb0 remove debugging 2008-05-07 23:58:01 -04:00
Joey Hess 0850cde5a6 implemented pruning, s3 support now complete-ish 2008-05-07 23:51:25 -04:00
Joey Hess db30d61f59 forgot to add.. 2008-05-07 23:39:52 -04:00
Joey Hess 9e6a4ccfdd amazon s3 support implemented and kinda working
pruning not yet implemented, however
2008-05-07 23:15:43 -04:00
Joey Hess ec866f8370 Optimised file statting code when scanning for modified pages; cut the number of system calls in half. (Still room for improvement.) 2008-05-07 14:11:56 -04:00
Joey Hess b144831e46 pinger/pingee now tested and working 2008-05-06 19:06:53 -04:00
Joey Hess 457de90f5f POSIX::setsid is not exported per default 2008-05-06 18:41:56 -04:00
Joey Hess 1f88cad3a2 aggregate: Add support for web-based triggering of aggregation for people stuck on shared hosting without cron. (Sheesh.) Enabled via the `aggregate_webtrigger` configuration optiom. 2008-05-05 20:20:45 -04:00
Joey Hess f06267fc3b git: Put -- before the filename when calling git rev-list to avoid warning message when the file doesn't exist. 2008-05-02 13:03:42 -04:00
Joey Hess b2dea99417 Fix ugly display when editing a page that has vanished.
srcfile now has an optional second parameter to avoid it throwing an error
if the source file does not exist.
2008-05-02 13:02:07 -04:00
Joey Hess 9fca7f2f8b avoid uninitialised value 2008-05-02 13:01:51 -04:00
Joey Hess 6f852e88e3 anonk: Add anonok_pagespec configuration setting that can be used to allow anonymous users to edit only matching pages. Closes: #478892 2008-05-01 14:58:23 -04:00
Joey Hess bb51e81762 img: Support a title attribute, will be passed through to html. Closes: #478718 2008-04-30 12:58:36 -04:00
Joey Hess 9652cdfe2e toc: Add the table of contents at sanitize time, rather than at format time. This allows the toc to be displayed when previewing an edit. It also avoids headers in the page template from showing up in the toc. 2008-04-26 15:13:01 -04:00
Joey Hess b698bf2408 Use bzr --quiet to avoid it outputting stuff and messing up http headers. (Scott Bronson) 2008-04-10 17:44:40 -04:00
Joey Hess e4395a567b Fix broken rcs_update for bzr. (Scott Bronson) 2008-04-10 17:41:43 -04:00
Joey Hess 72b5ef2c5f Fix CSRF attacks against the preferences and edit forms. Closes: #475445
The fix involved embedding the session id in the forms, and not allowing the
forms to be submitted if the embedded id does not match the session id.

In the case of the preferences form, if the session id is not embedded,
then the CGI parameters are cleared. This avoids a secondary attack where the
link to the preferences form prefills password or other fields, and
the user hits "submit" without noticing these prefilled values.

In the case of the editpage form, the anonok plugin can allow anyone to edit,
and so I chose not to guard against CSRF attacks against users who are not
logged in. Otherwise, it also embeds the session id and checks it.

For page editing, I assume that the user will notice if content or commit
message is changed because of CGI parameters, and won't blndly hit save page.
So I didn't block those CGI paramters. (It's even possible to use those CGI
parameters, for good, not for evil, I guess..)

The only other CSRF attack I can think of in ikiwiki involves the poll plugin.
It's certianly possible to set up a link that causes the user to unknowingly
vote in a poll. However, the poll plugin is not intended to be used for things
that people would want to attack, since anyone can after all edit the poll page
and fill in any values they like. So this "attack" is ignorable.
2008-04-10 16:35:30 -04:00
Joey Hess 04e7467807 need to handle urls to images the same
Also, simplified finding the url to the top of the site.
2008-04-03 16:37:05 -04:00
Manoj Srivastava c207086282 Bug#473987: [PATCH] Links relative to baseurl mangled in atom/rss feeds
tag 473987 +patch
thanks
Hi,

The issue is that we need to convert relative links to absolute
ones for atom and rss feeds -- but there are two types of
relative links. The first kind, relative to the current
document ( href="some/path") is handled correctly. The second
kind of relative url is is relative to the http server
base (href="/semi-abs/path"), and that broke.

It broke because we just prepended the url of the current
document to the href (http://host/path/to/this-doc/ + link),
which gave us, in the first place:
 http://host/path/to/this-doc/some/path        [correct], and
 http://host/path/to/this-doc//semi-abs/path   [wrong]

The fix is to calculate the base for the http server (the base of
the wiki does not help, since the base of the wiki can be
different from the base of the http server -- I have, for example,
"url => http://host.name.mine/blog/manoj/"), and prepend that to
the relative references that start with a /.

This has been tested.

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2008-04-03 16:27:29 -04:00
Joey Hess de8c34df59 aggregate: Correct a mistake in the code that dummy up a guid for feeds lacking one. 2008-04-03 02:36:01 -04:00
Joey Hess f6bd81db15 Added a hardlink option in the setup file, useful if the source and dest are on the same filesystem and the wiki includes large media files, which would normally be copied, wasting time and space. 2008-03-29 21:02:47 -04:00
Joey Hess cb8d1c8642 revert destpage part of f7bdc2385
destpage does not normally need to be worried about when creating other files
as part of the process of rendering a page. Using destpage results in
inlined pages creating two copies of such files. It works to not use destpage
in this case because the inlining page depends on the source page, so if the
source page is modified or deleted the inlining page will be updated.
2008-03-23 20:01:26 -04:00
Joey Hess d2911a20a6 inline: Allow the "feedshow" parameter to take values greater than the value for "show". 2008-03-23 17:39:03 -04:00
Joey Hess 1c2f59239f typos 2008-03-21 19:09:29 -04:00
martin f. krafft e3624de63c Allow external plugins to return no value
Instead of using the XML-RPC v2 extension <nil/>, which Perl's
XML::RPC::Parser does not (yet) support (Joey's patch is pending), we
agreed on a sentinel: {'null':''}, that is, a hash with a single key
"null" pointing to the empty string.

The Python proxy automatically converts None appropriately and raises an
exception if a hook function should, by weird coincidence, attempt to
return {'null':''}.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2008-03-21 15:07:10 -04:00
Joey Hess 14b3e645a8 work around perl warning 2008-03-21 05:08:04 -04:00
Joey Hess 42b6a6178c delete inline data after it's used 2008-03-21 04:51:14 -04:00
Joey Hess f937c1fb80 crazy optimisation to work around slow markdown
Markdown is slow. Especially if it has to process an enormous page. The
most common enormous page is currently the recentchanges page, which gets
processed a lot, and contains very little actual markdown. Most of it is a
big <div>, which markdown skips ... slowly.

This is a rather sick optimisation to work around markdown's speed issues.
Now inline inserts a small, dummy div, allows markdown to quickly render
the actual page content, then replaces the dummy with the actual inlined
pages later.

Results: Rendering just a recentchanges page, with diffs included, dropped
from 4.5 seconds to 2.7 seconds on my laptop. Building the entire wiki
dropped from 46.6 seconds to 39.5 seconds.

(It would be better if inline were a *post*-processor directive.)
2008-03-21 04:48:26 -04:00
Joey Hess 0b9e849aba process smilies in a sanitize hook
I had to move it to sanitize so all the markup is htmlized, so it can scan
for <pre> and <code>.
2008-03-21 03:16:28 -04:00
Joey Hess cd6055a893 another fix
I'm suprised that the second m//g didn't seem to clobber @-, but I don't
want to rely on that, so preserve it beforehand.
2008-03-21 02:57:34 -04:00
Joey Hess 88b5a0ece5 various fixes and simplifications 2008-03-21 02:55:14 -04:00
Joey Hess 44824dba1b smiley: Detect smileys inside pre and tags, and do not expand. 2008-03-21 02:43:20 -04:00
Joey Hess 628467125c Close meta tag for redir properly. 2008-03-21 00:24:06 -04:00
Joey Hess c92e9b34ec Store userinfo in network byte order for easy portability. (Old files will be automatically converted.) 2008-03-19 22:46:51 -04:00
Joey Hess 9f3788e2a2 optimisation, only load openid module when signing in
This makes the CGI about .2 seconds faster when editing pages etc.
2008-03-19 21:12:18 -04:00
Joey Hess d85c9660c5 fix setstate
Same fix as in d7f1292c31
2008-03-19 15:49:37 -04:00
Joey Hess 6eb3cf7e76 make setargv take an array
for consistentcy with getargv, which returns one
2008-03-19 15:49:00 -04:00
Joey Hess d7f1292c31 fix setvar
It was incorrectly setting the value to the number of items in @_, ie,
always 1.
2008-03-19 15:18:38 -04:00
Joey Hess f003e97d10 getargv needs to return a list reference
xml rpc only allows functions to return a single value, no lists. So getargv
needs to return a list reference, which means that the caller will see an xml
rpc array.
2008-03-19 15:12:59 -04:00
Joey Hess 52e16d4ec9 * Record new pages in %pagesources temporarily when previewing so that
things that need to know the page source or type can query it from there.
  Fixes previewing of tables when creating a new page.
2008-03-17 21:28:31 -04:00
Joey Hess ba480baa9e * external: Add getargv and setargv methods to allow access to ikiwiki's
@ARGV.
2008-03-15 14:19:49 -04:00
Joey Hess 5a7a89ffc5 * htmltidy: Pass --markup yes, in case tidy's config file disabled it. 2008-03-15 13:58:08 -04:00
Joey Hess e7ce86db11 * external: Fix support of XML::RPC::fault. 2008-03-15 13:49:22 -04:00
Joey Hess 7b6686ce70 * Fix expiry of old recentchanges changeset pages. 2008-03-14 18:55:17 -04:00
Joey Hess 16299dbae8 load HTML::Entities at top
Used in several subs, not all of which load it on demand, this seems simpler.
2008-03-14 18:43:54 -04:00
Joey Hess bc2671082b no need to use HTML::Entities, as it's loaded on demand by code below 2008-03-12 18:52:33 -04:00
Joey Hess 99c65a4c0e * Use absolute url for feedurl when filling out the feed templates.
Closes: #470530
2008-03-12 18:49:41 -04:00
Joey Hess 862ca19eb1 truncate recentchangesdiffs after 200 lines
This works around a perl crasher bug, and also avoids bloating pages
with enormous diffs.

rcs_recentchanges modified to return a list in an array context.
2008-03-12 15:45:10 -04:00
Joey Hess 3dc979470e use git show to get the diff
If a diff of the firsst commit in a git repo was requested, it would fail and
print to stderr since first^ isn't valid. Using git show will always work.
2008-03-12 14:44:20 -04:00