Commit Graph

3367 Commits (master)

Author SHA1 Message Date
Simon McVittie 490a1eca7b Always produce HTML5 doctype and new attributes, but not new elements
According to caniuse.com, a significant fraction of Web users are
still using Internet Explorer versions that do not support HTML5
sectioning elements. However, claiming we're XHTML 1.0 Strict
means we can't use features invented in the last 12 years, even if
they degrade gracefully in older browsers (like the role and placeholder
attributes).

This means our output is no longer valid according to any particular
DTD. Real browsers and other non-validator user-agents have never
cared about DTD compliance anyway, so I don't think this is a real loss.
2014-10-16 11:04:53 +01:00
Simon McVittie 17fccbca94 Do not pass ignored sid parameter to checksessionexpiry
checksessionexpiry's signature changed from
(CGI::Session, CGI->param('sid')) to (CGI, CGI::Session) in commit
985b229b, but editpage still passed the sid as a useless third
parameter, and this was later cargo-culted into remove, rename and
recentchanges.
2014-10-12 18:03:57 +01:00
Simon McVittie 4e2bfe1e17 comments: don't log remote IP address for signed-in users
The intention was that signed-in users (for instance via httpauth,
passwordauth or openid) are already adequately identified, but
there's nothing to indicate who an anonymous commenter is unless
their IP address is recorded.
2014-10-12 18:03:28 +01:00
Simon McVittie 33f60260b2 In html5 mode, generate a host- or protocol-relative <base> for the CGI
This increases the number of situations in which we do the right thing.
2014-10-05 23:49:37 +01:00
Simon McVittie 3b8da667cc Add reverse_proxy option which hard-codes cgiurl in CGI output
This solves several people's issues with the CGI trying to be
too clever when IkiWiki is placed behind a reverse-proxy.
2014-10-05 23:49:37 +01:00
Simon McVittie b0a35c817e Force use of $config{url} as top URL in w3mmode 2014-10-05 15:19:55 +01:00
Joey Hess 6294894f31 Fix crash that can occur when only_committed_changes is set and a file is deleted from the underlay.
srcfile_stat got called on a file from the underlay that no longer existed.

I am not 100% sure of the circumstances of that; I was able to reproduce
the bug but neglected to snapshot the tree, and then accidentially
got it to stop crashing. I know that a transient tag page got deleted using
the web interface to trigger the crash.

It seems that process_changed_files must have returned the file, despite it
being deleted. And since the file was not checked into git, it seems it
must have not been included in @IkiWiki::underlayfiles, which would have
caused process_changed_files to not return it.

I do not know why a transient tag page would not be in
@IkiWiki::underlayfiles. There is a bug here that I don't understand.

This is just a workaround -- run srcfile_stat such that it won't crash,
and if it is unable to stat a file, find_changed knows it's not changed,
so it's ok to skip it.

Also made find_new_files run srcfile_stat such that it won't crash, just
because I was there.
2014-09-26 18:55:09 -04:00
Simon McVittie eb4945a3bc img: raise an error if we cannot find the image's size
This happens for PDFs without ghostscript installed, for instance.
2014-09-16 10:00:40 +01:00
Simon McVittie 7f5c2cfa5a Merge branch 'ready/templatebody' 2014-09-15 21:52:03 +01:00
Simon McVittie c1b80c54fa Merge branch 'ready/autoindex-more-often' 2014-09-15 21:23:18 +01:00
Simon McVittie ea2ab6f885 Merge branch 'ready/more-magic' 2014-09-15 21:08:40 +01:00
Simon McVittie 9d928bd694 Merge remote-tracking branch 'jcflack/early-env' 2014-09-15 09:44:51 +01:00
Lafayette Chamber Singers Webmaster 29e80b4eed More cautious escaping of environment values.
Tightened the escaping per this review comment:
http://source.ikiwiki.branchable.com/?p=source.git;a=commitdiff;h=f35fc6a603b5473ce2c07bb0236e28e57f718315

(I didn't introduce a $tmp, as $val was local to that block already, and each
hex encoding is in its own C string literal to avoid consuming subsequent
chars that are valid hex digits.)
2014-09-14 20:07:43 -04:00
Lafayette Chamber Singers Webmaster bc4721da04 Installing ikiwiki on a shared-hosting server, there may be no access to
install prerequisite Perl modules in the systemwide locations. They may
have to be installed under the home directory, such as by using local::lib
(which is how the cPanel Perl-module installer works, on systems that use it).

For that to work, the local::lib-defined value for PERL5LIB must be in
the environment when Perl starts up. The former way %config{ENV} was handled
was too late, depending on the Perl code to unpack it from the storable and
put it into the environment.

Easy solution is to build the wrapper to repopulate the environment based on
%config{ENV} before ever exec'ing Perl (and then remove it from the storable
as there is nothing more that the Perl code will need to do with it).
2014-09-14 12:12:09 -04:00
Simon McVittie e3e6ca2777 pagestats: rename disp to show, and document it 2014-09-14 15:57:09 +01:00
Simon McVittie 89492a62a7 pagestats: consistent indentation 2014-09-14 15:51:22 +01:00
Louis cd5a24d8b4 pagestats: add disp parameter 2014-09-14 15:49:38 +01:00
Simon McVittie ab768a62c6 Rename show parameter of [[!inline]] and [[!pagestats]] to limit
The old name still works, if its value is numeric.

This name allows a non-numeric "show" to mean the same thing
it does for [[!map]] (show title, show description, etc.).
2014-09-14 15:15:27 +01:00
Simon McVittie 9be3f95116 Merge branch 'ready/imgforpdf-and-more' 2014-09-12 21:59:00 +01:00
Simon McVittie 669a5f5ecc Merge branch 'ready/chrysn/linkmapenhancement' 2014-09-12 21:57:04 +01:00
Simon McVittie 390f12a845 Merge branch 'ready/edittemplate2' 2014-09-12 21:54:13 +01:00
Simon McVittie dadde570a1 Merge branch 'ready/postform-no' 2014-09-12 21:46:04 +01:00
Simon McVittie 252804628d Merge branch 'ready/perf' 2014-09-12 21:45:04 +01:00
Simon McVittie a55752a7be Merge branch 'ready/comments' 2014-09-12 21:40:24 +01:00
Simon McVittie 2eea320b67 Merge branch 'ready/trail-sort' 2014-09-12 21:38:06 +01:00
Simon McVittie 77a2267dcf filecheck: accept MIME types that don't contain ';' 2014-09-10 09:00:20 +01:00
Antoine Beaupré feb21ebfac do not double-decode unicode in CGI forms
this works around a behavior change introduced in Encode.pm 2.53
shipped with the Perl 5.20 release described here:

http://ikiwiki.info/bugs/garbled_non-ascii_characters_in_body_in_web_interface/
2014-09-09 23:11:51 -04:00
Simon McVittie 26d62b386e edittemplate: use unambiguous RFC 3339 datestamps
These take into account the timezone offset (and convert it to UTC+0000)
rather than being in an unspecified timezone.
2014-09-01 09:01:07 +01:00
Simon McVittie 6806ddfdff Only provide time, not formatted_time, to edittemplate templates
I'm not sure what the use-case is for formatted_time, and chrysn
pointed out that for display in HTML, [[!date "<TMPL_VAR time>"]]
would be nicer.
2014-09-01 08:58:12 +01:00
Jonathon Anderson 9adee0a222 Provide the current time to edittemplate.
The `time` variable contains a fixed-format time, guaranteed suitable
for parsing by timedate.

The `formatted_time` variable contains the same time formatted by
IkiWiki::formattime.
2014-09-01 08:54:37 +01:00
Simon McVittie eb87dd177a Use Linux uuid facility instead of an external library if possible 2014-09-01 08:54:37 +01:00
Simon McVittie 4a11dc4d16 edittemplate: only generate a UUID on-demand
If the template doesn't use <TMPL_VAR UUID> there's no point in
incurring any cost.
2014-09-01 08:54:37 +01:00
Jonathon Anderson 7aa10a2952 Provide a UUID in edittemplate templates.
I want to make GUIDs for my RSS feeds that don't change when I move
pages around.  To that end, I've used UUID::Tiny to generate a
version 4 (random) UUID that is presented in a `uuid` variable in
the template.

At that point, you can do something like this:

    [[!meta guid="urn:uuid:<TMPL_VAR uuid>"]]
2014-09-01 08:54:37 +01:00
David Bremner adbc9cb8d6 Plugins::highlight: replace use of langdefdir with searchFile
In recent versions of highlight there can be more than one langdefdir.
This patch fixes the ensuing hilarity when the user adds a single
highlight lang definition and highlight.pm expects all definitions to
be in the same place.
2014-08-06 22:29:25 -03:00
David Bremner a55a20f5f8 cope with missing getConfDir in 3.18+ of highlight.
Unfortunately we have to try a couple things since the API changed
between 3.9 and 3.18
2014-08-06 22:28:32 -03:00
chrysn fa2a4d0db4 show resized img in preview using data: urls
in analogy to sparklines, this renders scaled imgs to
data:img/...;base64,... urls in preview mode.

if the image is already present on the server (eg because it was not
just inserted), the already rendered image is referenced instead.
2014-07-15 13:47:37 +02:00
chrysn a308b212ad img plugin: split resizing calculations and actual resizing
there is now a size calculating part (which chooses a final size) and a
scaling part (which triggers if the sizes calculated by the former
indicate a downscaling).

this solves the issue of unproportional upscalings
(bugs/image_rescaling_distorts_with_small_pictures).

also, "small" pdf files (or pdf files without explicit size settings),
which would not be converted under the old mechanism, now get rendered
to pngs.

this commit affects a unit test: while svgs were previously
unconditionally rendered to pngs, this now only happens on downscaling.
this is intentional -- while a small version of an svg graphic is
likely to be more compact when rendered (eg as a preview), a large
version would not have that benefit, and why convert something that
browsers basically can show and be inconsistend with how other images
are handled. the new unit test simply makes the original svg larger to
check for the same behaviros as before.
2014-07-15 13:44:22 +02:00
Simon McVittie 3f4a935740 trail: don't generate a costly dependency when forcing sort order
pagespec_match_list() makes the current page depend on the pagespec
being matched, so if you use [[!trailoptions sort="..."]] to force
a sort order, the trail ends up depending on internal(*) and is
rebuilt whenever anything changes. Add a new sort_pages() and use that
instead.
2014-07-11 22:08:08 +01:00
Louis f35b62d454 Calendar pages are now rebuilt when previous or next page have changed 2014-07-07 15:12:36 +02:00
Louis 492a22ac75 Making use of the transient plugin 2014-07-07 09:40:53 +02:00
Louis 59b46942e0 Added option `calendar_fill_gaps` 2014-07-05 14:14:57 +02:00
Louis 7f18c1ce48 Simplifying code
Thanks to review from http://ikiwiki.info/todo/calendar_autocreate/
2014-07-05 12:11:18 +02:00
Simon McVittie ef7c80258d comments: use comments_pagespec for authorization, not just UI 2014-07-04 23:27:43 +01:00
Simon McVittie 0357ad66ea inline: postform=no should take precedence over rootpage existing
If someone has explicitly disabled the postform, it seems reasonable
from a least-astonishment point of view for that to take precedence
over rootpage, even though that makes rootpage useless.

Also add a regression test; so far, this is all it tests.
2014-07-04 23:23:42 +01:00
Simon McVittie 17440ea301 Allow creation of transient index pages for directories outside srcdir
After this change autoindex creates index pages also for empty directories
included in underlays, but only if it isn't going to commit them to the
srcdir ($config{autoindex_commit} = 0).

Inspired by a patch from Tuomas Jormola.

Bug-Debian: http://bugs.debian.org/611068
2014-07-04 09:25:09 +01:00
Simon McVittie 3ba2ef1a54 autoindex: remove unnecessary special case for transient underlay
It's not clear that the transient underlay should be excluded from
indexing; see [[bugs/transient autocreated tagbase is not transient
autoindexed]].

In any case, the code that checks what directories might need indexes
specifically checks for the srcdir anyway, so the only effect this extra
check can have is negative (it could fail to notice files in the
transient underlay and attempt to recreate them unnecessarily).
2014-07-04 09:22:57 +01:00
Louis 2a5e8e72a0 calendar plugin: Autocreate archive pages if needed 2014-06-24 15:17:51 +02:00
chrysn bcc209eb5a add pagenumber parameter
this allows picking a page from a pdf. also, this enhances performance
greatly when rendering pdfs, as only the first page is rasterized.
(otherwise, imagemagick would treat the pdf as a list of images, work
with all of them, until finally only the first page gets saved). the
default parameter of 0 will select the single image contained in typical
image files anyway, so no specialcasing between single- and multifile
containers is needed.
2014-04-07 11:32:25 +02:00
chrysn 6cc43773e7 add pdf support to the img directive
this is trivial as pdf is supported by imagemagick, and just needs an
explicit mention to enable conversion.
2014-04-07 11:19:04 +02:00
chrysn 71b9ad33e0 set the file type parameter after reading the image
imagemagick, when reading an image, sets its magick parameter to
indicate the file type, overriding the explicitly set file type for
output if it is set at creation.

as a result, previously (with graphicsmagick-libmagick-dev-compat
1.3.18-1 providing Image::Magick), svg output files were not png,
neither svg, but mvg (imagemagick vector graphics).
2014-04-07 11:15:51 +02:00
Joey Hess 59cfb9b6d0 only_committed_changes could fail in a git repository merged with git merge -s ours. 2014-04-05 19:09:05 -04:00
Simon McVittie c04a26f3e7 Assume that every page has been scanned by the time the scan phase ends
This doesn't prevent memory from being used to track what we have
and haven't scanned, but it does make it temporary. The existing
%rendered hash, which is filled afterwards, will be larger than %scanned
in practice anyway: %scanned will contain an entry for each page
that changed, plus an entry for each template used by templatebody,
whereas %rendered will contain an entry for each page that changed
plus an entry for each page rendered due to links or dependencies.
2014-03-05 10:42:20 +00:00
Simon McVittie a9fc30b19c Track whether we're in the scan or render phase
In the scan phase, it's too early to match pagespecs or sort pages;
in the render phase, both of those are OK.

It would be possible to add phases later, renumbering them if necessary
to maintain numerical order.
2014-03-05 10:42:19 +00:00
Simon McVittie 7672014582 Add templatebody plugin and directive, and enable it by default
Also add a regression test for templatebody.
2014-03-05 10:42:19 +00:00
Simon McVittie cad753baf9 IkiWiki::Render: make 'scan' idempotent
If it does nothing when a page has already been scanned, we can use it
at any time to force a page to be scanned. In particular, the
templatebody plugin is going to need this.
2014-03-05 10:42:19 +00:00
Simon McVittie 24599e3cc9 In all=no conditionals, depend on the influences, not the test pagespec
Previously, if a page like `plugins/trail` contained a conditional like

    [[!if test="backlink(plugins/goodstuff)" all=no]]

(which it gets via `templates/gitbranch`), then the
[[plugins/conditional]] plugin would give `plugins/trail` a dependency on
`(backlink(plugins/goodstuff)) and plugins/trail`. This dependency is
useless: that pagespec can never match any page other than
`plugins/trail`, but if `plugins/trail` has been modified or deleted,
then it's going to be rendered or deleted *anyway*, so there's no point
in spending time evaluating match_backlink for it.

Conversely, the influences from the result were not taken into account,
so `plugins/trail` did not have the
`{ "plugins/goodstuff" => $DEPEND_LINKS }` dependency that it should.

Invert that, depending on the influences but not on the test.

Bug: http://ikiwiki.info/bugs/editing_gitbranch_template_is_really_slow/
2014-03-03 11:30:36 +00:00
Joey Hess ddc9441beb Merge remote-tracking branch 'remotes/smcv/ready/careful-eval' 2014-02-23 14:21:13 -04:00
Joey Hess c1fbd66c03 Merge remote-tracking branch 'remotes/smcv/ready/git-push-origin-master' 2014-02-23 14:19:39 -04:00
Joey Hess 204dcda88b Merge remote-tracking branch 'intrigeri/fix_diffurl_vs._cgit' 2014-02-23 14:13:53 -04:00
Joey Hess 9a99c4c6e2 Merge remote-tracking branch 'mhameed/html_lang_and_dir' 2014-02-23 14:06:40 -04:00
Simon McVittie bb359796b8 protect $@ whenever a block using $@ is non-trivial
As noted in the Try::Tiny man page, eval/$@ can be quite awkward in
corner cases, because $@ has the same properties and problems as C's
errno. While writing a regression test for definetemplate
in which it couldn't find an appropriate template, I received

    <span class="error">Error: failed to process template
    <span class="createlink">deftmpl</span> </span>

instead of the intended

    <span class="error">Error: failed to process template
    <span class="createlink">deftmpl</span> template deftmpl not
    found</span>

which turned out to be because the "catch"-analogous block called
gettext before it used $@, and gettext can call define_gettext,
which uses eval.

This commit alters all current "catch"-like blocks that use $@, except
those that just do trivial things with $@ (string interpolation, string
concatenation) and call a function (die, error, print, etc.)
2014-02-21 17:06:36 +00:00
Simon McVittie be3483fe9b git: explicitly specify the branch to push to origin
git's behaviour when doing "git push origin" is configurable, and the
default is going to change in 2.0. In particular, if you've set
push.default to "nothing", the regression test will warn:

fatal: You didn't specify any refspecs to push, and push.default
is "nothing".
'git push origin' failed:  at .../lib/IkiWiki/Plugin/git.pm line 220.
2014-02-21 16:39:17 +00:00
Tuomas Jormola dc53ca18f2 Bug#737121: ikiwiki: [PATCH] Implement configuration option to set the user agent string for outbound HTTP requests
Package: ikiwiki
Version: 3.20140125
Severity: wishlist

By default, LWP::UserAgent used by IkiWiki to perform outbound HTTP
requests sends the string "libwww-perl/<version number>" as User-Agent
header in HTTP requests. Some blogging platforms have blacklisted the
user agent and won't serve any content for clients using this user agent
string. With IkiWiki configuration option "useragent" it's now possible
to define a custom string that is used for the value of the User-Agent
header.
2014-02-01 16:53:33 -04:00
Joey Hess a8d7a99979 osm: Escape name parameter. Closes: #731797 2014-01-15 15:53:51 -04:00
Joey Hess fe1a69e11a inline: Allow overriding the title of the feed. Closes: #735123 Thanks, Christophe Rhodes 2014-01-13 17:06:29 -04:00
Joey Hess bc99b3174c add void prototype 2014-01-02 12:24:26 -04:00
intrigeri d52774dd45 Do not UTF8-escape "/" in Git's diffurl: cgit does not support this. 2013-12-31 01:47:10 +00:00
Joey Hess a2fb23286f aggregrate: Fix several bugs in handling of empty and colliding titles when generating filenames. 2013-12-28 20:02:22 -04:00
Joey Hess bfc13b9070 osm: Remove invalid use of charset on embedded javascript tags. Closes: #731197 2013-12-03 12:42:04 -04:00
Joey Hess 6d95bd7e02 typo 2013-11-18 16:35:51 -04:00
Joey Hess 002a97ffcd search: Added googlesearch option, which makes it search google rather than using the internal xapain database. (googlesearch plugin is too hard to turn on when xapain databases corrupt themselves, which happens all too frequently). 2013-11-17 16:37:18 -04:00
Joey Hess 81aa58e7ca comments: Write pending moderation comments to the transient underlay to avoid conflict with only_committed_changes. 2013-11-17 13:07:00 -04:00
Joey Hess e11a87acfa autoindex and tag use transient underlay when not committing, so do not need to disable only_committed_changes 2013-11-17 12:51:20 -04:00
Joey Hess 7dd110ba51 disable only_committed_changes when uncommitted files are created by plugins 2013-11-17 00:04:05 -04:00
Joey Hess 3cc260c775 minor opt 2013-11-16 20:51:09 -04:00
Joey Hess 49e0841ad5 guard against lastrev being "" just in case 2013-11-16 20:49:57 -04:00
Joey Hess 441002e3e6 deal with the case where oldrev is the same as newrev 2013-11-16 20:48:23 -04:00
Joey Hess 727d39b92a fix eq 2013-11-16 18:56:39 -04:00
Joey Hess 654530fa8b Added only_committed_changes config setting, which speeds up wiki refresh by querying git to find the files that were changed, rather than looking at the work tree. Not enabled by default as it can break some setups where not all files get committed to git. 2013-11-16 17:26:20 -04:00
Joey Hess 2f8bafb709 poll: Fix behavior of poll buttons when inlined. 2013-11-13 22:06:02 -04:00
Mesar Hameed 062b196f51 Add two template variables, expose html language code and language direction. 2013-10-14 12:47:48 +02:00
Joey Hess db6f258745 fix new perl warning 2013-08-30 22:33:11 -04:00
Amitai Schlair d844a3487e cookiejar is now a core config setting. 2013-08-03 09:55:54 -04:00
Amitai Schlair 462d8f8015 Honor proxy env vars and reliably honor cookiejar. 2013-07-27 08:12:01 -04:00
Joey Hess 4c88a4d9d8 Merge remote-tracking branch 'schmonz/fancypodcast' 2013-07-21 13:51:35 -04:00
Joey Hess 7d938559cb calendar: Display the popup mouseover when there is only 1 page for a given day, for better UI consistency. 2013-07-19 18:54:32 -04:00
Amitai Schlair 5c0a18e75a Merge branch 'master' into fancypodcast
Conflicts:
	doc/todo/fancypodcast.mdwn
2013-07-17 16:49:46 -04:00
Amitai Schlair 97d0c09a18 Show author in addition to feedname, if different.
While here, mollify http://validator.w3.org/feed/ and
s/dcterms:creator/dc:creator/g, which happens to make rss2email see
and do nice things with authors.
2013-07-17 16:38:08 -04:00
Joey Hess 946af13ae6 Pass --no-edit when used with git 1.7.8 and newer.
Not sure if this is needed to avoid it trying to run an editor. Probably
there is never a controlling terminal and probably git notices and does
nothing. But I'm just copying what I have in git-annex assistant here.

(Although with a much worse git version comparion, that only really works due
to luck.)
2013-07-10 21:52:49 -04:00
Joey Hess b162563dc1 Deal with git behavior change in 1.7.8 and newer that broke support for commits with an empty commit message. 2013-07-10 21:50:18 -04:00
Joey Hess 87f46582f5 Fix committing attachments when using svn. 2013-07-10 18:23:09 -04:00
Joey Hess 46e0c5742c optimize for common case where list is not changed 2013-07-10 17:40:33 -04:00
Joey Hess acb07ef416 Fix crash that could occur when a needsbuild hook returned a file that does not exist.
I saw this happen with calendar, when it wanted to update a page, that
had a calendar on it, but the page had just been deleted. This caused
srcfile_stat to crash.
2013-07-10 17:02:24 -04:00
Joey Hess c849a9f409 openid: Automatically upgrade openid_realm to https when accessed via https. 2013-06-29 13:31:47 -04:00
Amitai Schlair 844710c0da Merge branch 'master' into fancypodcast 2013-06-27 00:50:17 -04:00
Amitai Schlair b25f7700bd Instead of hacking back to $link, just provide it. 2013-06-27 00:21:20 -04:00
Joey Hess c5f9b01662 osm: Remove trailing slash from KML maps icon. 2013-06-23 14:14:52 -04:00
Joey Hess b8d65da266 calendar: When there are multiple pages for a given day, they're displayed in a popup on mouseover. Thanks, Louis 2013-06-23 14:11:39 -04:00
Joey Hess 5038f36cba Merge branch 'restrict-comment-formats' of git://rtime.felk.cvut.cz/sojka/ikiwiki 2013-06-23 14:04:42 -04:00
Changaco e51169132a fix encoding issue in blogspam plugin
RPC::XML uses ascii as default encoding, we have to tell it to use utf8.

Without this, ikiwiki returns "failed to get response from blogspam server"
every time a non-ascii character is used in a content that needs checking.
2013-06-23 14:01:59 -04:00
Joey Hess 07d39ce5bf bzr: bzr rm no longer has a --force option, remove 2013-05-18 16:33:32 -04:00
Joey Hess 9e4f0efe44 notifyemail: Fix bug that caused duplicate emails to be sent when site was rebuilt. 2013-05-18 16:26:48 -04:00
Joey Hess 67ebaf15d7 theme: Now <TMPL_IF THEME_$NAME> can be used in all templates when a theme is enabled. 2013-05-16 22:20:56 -04:00
Amitai Schlair d33b31f706 Merge branch 'master' into fancypodcast 2013-05-12 19:16:50 -04:00
Joey Hess 6c09c3e646 meta: Fix anchors used to link to the page's license and copyright. Closes: #706437 2013-04-30 13:35:04 -04:00
Amitai Schlair 137ed653ea Merge branch 'master' into fancypodcast
Conflicts:
	doc/todo/fancypodcast.mdwn
2013-03-17 15:01:13 -04:00
Michal Sojka c42fd7d758 Add configuration to restrict the formats allowed for comments
I want to write my blog posts in a convenient format (Emacs org mode)
but do not want commenters to be able to use this format for security
reasons. This patch allows to configure which formats are allowed for
writing comments.

Effectively, it restricts the formats enabled with add_plugin to those
mentioned in comments_allowformats. If this is empty, all formats are
allowed, which is the behavior without this patch.
2013-03-05 11:00:29 +01:00
Joey Hess b1a721942d Merge remote-tracking branch 'smcv/ready/map' 2013-03-04 18:29:58 -04:00
Joey Hess 8c8aa3fe47 Detect plugins with a broken getsetup and warn. 2013-03-04 13:19:05 -04:00
Joey Hess 1d6eb13e2b Add missing plugin section, and deal with missing sections with a warning. 2013-03-04 13:03:34 -04:00
Simon McVittie af8712cfac map: postprocess to collapse useless </ul><ul> sequences
This re-fixes the same bug as 2d5c2f30, but without introducing
malformed HTML in some situations. This is not a very elegant
solution, but it has the advantage of passing more tests.
2013-02-24 13:10:24 +00:00
Simon McVittie 3f27a97336 Optionally add indentation to maps
This makes them easier to debug by showing the structure. Sample output
when $spaces is set to 4 spaces:

<div class='map'>
<ul>
    <li>
    <a href="../alpha" class="mapparent">alpha</a>
        <ul>
        <li>
        <a href="../alpha/1" class="mapitem">1</a>
        </li>
        </ul>
    </li>
    <li>
    <a href="../beta" class="mapitem">beta</a>
    </li>
</ul>
</div>
2013-02-24 13:10:24 +00:00
Simon McVittie ce1c7a3eab Revert "map: don't create useless </ul><ul> sequences"
This reverts commit 2d5c2f301c.
2013-02-24 13:10:24 +00:00
Amitai Schlair 4b6ea05ac8 Catch up rsspage to atompage. Validates. 2013-02-22 12:54:16 -05:00
Amitai Schlair d77ee60b15 Render fancy podcast enclosures.
Simple podcast feeds didn't have content tags and I made sure to
keep it that way. This may be unnecessarily conservative. Changing
the behavior to include empty content tags might be fine, but I
don't want to think about it right now, I just want my tests to
keep passing!

The new fancy-podcast tests are copy-pasted-edited from the
simple-podcast tests. These tests shall be refactored.
2013-02-20 21:16:19 -05:00
Amitai Schlair a629b276b2 Extract genenclosure(). No functional change intended. 2013-02-20 20:53:50 -05:00
Amitai Schlair 3d2be49420 Make enclosures absolute (in feeds they have to be). 2013-02-20 19:14:20 -05:00
Amitai Schlair c3b17740ae Document that last enclosure wins. 2013-02-19 20:22:47 -05:00
Amitai Schlair 0e278c4a84 Make enclosure follow WikiLink LinkingRules. 2013-02-19 20:22:46 -05:00
Amitai Schlair 546da9bac7 Make [[!meta enclosure=foo.mp3]] "work" for HTML. 2013-02-19 20:22:46 -05:00
Joey Hess 480d6f93c1 highlight: Now adds a span with class highlight-<extension> around highlighted content, allowing for language-specific css styling. 2013-02-12 11:27:29 -04:00
Amitai Schlair 91b477c087 Fix diffurl links (cvsweb expects unescaped '/'). 2013-02-02 14:11:15 -05:00
Amitai Schlair 0f3f809a45 Merge branch 'master' into cvs 2013-02-02 13:02:26 -05:00
Joey Hess 82114f4451 Deal with empty diffurl in configuration. 2013-01-29 08:12:56 +11:00
Amitai Schlair b30cacdf8d Fix longstanding bug (chdir to nonexistent dirs).
In test, set up the post-commit hook for more realism (and bugs!).
To make wrappers work in test, set PERL5LIB, and allow the wrappee's
path to be overridden. Meta-test that post-commit is really hooked
up by verifying that content is getting generated in destdir.

About the longstanding bug, which as far as I know was harmless:
CVS can't operate outside a srcdir, so we're always setting $CWD.
"local $CWD" restores the previous value when we go out of scope.
Usually that's correct. But if we're removing the last file from a
directory, the post-commit hook will exec in a working directory
that's about to not exist (CVS will prune it).

The fix: chdir() manually in cvs_runcvs(), so we can selectively
not chdir() back.
2013-01-27 22:09:57 -05:00
Amitai Schlair 64370885cc Merge branch 'master' into cvs 2013-01-25 08:47:17 -05:00
Joey Hess e5d82ef868 trail: Avoid massive slowdown caused by pagetemplate hook when displaying dynamic cgi pages, which cannot use trail anyway.
This seemed to be due to the pagetemplate hook calling prerender. I've
observed this making it take *minutes* for the signin page to be displayed.
ltracing ikiwiki showed it was matching pagespecs a lot.

It may be that this is still a speed pain point when rendering pages, not
just for CGI. So more work may be needed here.
2013-01-24 10:40:35 +11:00
Joey Hess 37cf511f06 poll: Add expandable option to allow users to easily add new choices to a poll. 2013-01-10 12:43:27 -04:00
Joey Hess 7173ef1b13 htmlscrubber: Allow the URI schemes of major VCS's. 2013-01-05 17:25:47 -04:00
Joey Hess 22cb87c684 Merge remote-tracking branch 'smcv/ready/trail' 2013-01-02 15:31:10 -04:00
Simon McVittie 7029f98bc7 trail: remove excess presence-dependencies
Since trail members are explicitly rebuilt if the information used for
their prev/up/next boxes changes, they don't need another dependency
on the trail itself. (If the trail disappears, it will disappear from
the member's member_to_trails entry, causing a rebuild; so the add_depends
is redundant.)

Similarly, since trail members are explicitly rebuilt if their next
or previous item, or its title, changes, the presence dependencies on the
next and previous items are redundant.
2013-01-02 19:19:32 +00:00
Simon McVittie 7b06a65221 If the title of a trail or trail-member changes, rebuild affected pages
If the title of a trail changes, each member of that trail must be
rebuilt, for its prev/up/next box to reflect the new title.

If the title of a member changes, its next and previous items (if any)
must be rebuilt, for their prev/up/next boxes to reflect the new title.
2013-01-02 19:19:32 +00:00
Simon McVittie 1daa68b8b7 trail: call prerender from build_affected
In the unlikely event that the ordered contents of a trail have changed
without the TRAILS or TRAILLOOP template variables being evaluated
(for instance, all trail directives are removed from a former trail
that uses a custom pagetemplate that doesn't contain TRAILS), we might
get here without having already called prerender.
2013-01-02 19:19:32 +00:00
Simon McVittie 6e962a2d74 opendiscussion: don't allow editing discussionpage if discussion is disabled 2013-01-02 18:05:33 +00:00
Joey Hess 86519b047e trail: Converted all dependencies to presence dependencies.
smcv please note this introduces another bug, which I've opened
2012-12-27 22:29:51 -04:00
Joey Hess dc05125b0b aggregate: When run with --aggregate, if an aggregation is already running, don't go on and --refresh.
This way, if a previous aggregation job is running, we don't add additional
load doing work that job will do anyway.
2012-12-27 21:25:59 -04:00
Joey Hess 3d6ee9eccd htmlscrubber: Allow the bitcoin URI scheme. 2012-12-22 16:15:38 -04:00
Shlomi Fish 12c9219d67 Fix some warnigns in recent perls.
All existing tests pass.
2012-12-17 22:44:54 +02:00
Joey Hess c29413ba2a openid: Display openid in Preferences page as a comment, so it can be selected in all browsers. 2012-12-04 13:59:19 -04:00
Joey Hess 286026877d filecheck: Fix bug that prevented File::MimeInfo::Magic from ever being used. 2012-11-04 12:02:26 -04:00
Joey Hess 96bfdbf1be really fix diff display to not show both types of diff
12fa9c031f porported to fix this, but failed
2012-10-16 10:59:00 -04:00
Joey Hess b5b3f56703 typo 2012-10-14 20:49:42 -04:00
Joey Hess b1cd1c067f add cgi_overload_message 2012-10-11 11:22:03 -04:00
Joey Hess 6bd8c6732e add cgi_overload_delay tunable
Try to avoid a situation in which so many ikiwiki cgi wrapper programs are
running, all waiting on some long-running thing like a site rebuild, that
it prevents the web server from doing anything else. The current approach
only avoids this problem for GET requests; if multiple cgi's run GETs on a
site at the same time, one will display a "please wait" page for a
configurable number of seconds, which then redirects to retry. To enable
this protection, set cgi_overload_delay to the number of seconds to wait.
This is not enabled by default.
2012-10-09 17:12:04 -04:00
Antoine Beaupré 9aa888cadf osm: indent the generated KML file for better readability
(cherry picked from commit 1636da85d82644d923042c870aaedc5a29754aa6)
2012-08-25 10:45:21 -04:00
Antoine Beaupré a12dc95883 osm: optimization: do not create duplicate styles
(cherry picked from commit 9d550817ca546d1dd30a21cebad6093d1f3bacad)
2012-08-25 10:45:16 -04:00
Joey Hess a3c1768e10 comments: Remove ipv6 address specific code. 2012-08-25 10:43:24 -04:00
Joey Hess 93a12752ac merged anarcat/osm_arbitrary_layers 2012-08-25 10:13:22 -04:00
Antoine Beaupré 636e04a13a make layers an array
this simplifies the code, make the configuration more intuitive, at
the cost of making the labels on the layers automatically generated
and therefore less customizable
2012-08-25 08:53:33 -04:00
Antoine Beaupré 081fd38636 make layers completely customizable 2012-08-25 08:20:30 -04:00
Antoine Beaupré acc4d7d7d6 osm: add optional google maps support
for google maps to work, an API key needs to be added to the configuration
2012-08-25 08:20:30 -04:00
Geneviève Bastien 8fb42f42f4 OSM plugin: new config option to specify the url to fetch maps from 2012-08-25 08:20:30 -04:00
Philippe Gauthier d5b2dfd0e4 Add Document tag to OSM plugin KML output
(cherry picked from commit 519d35368e2f1e7fe1fce577fe7d71ef9bd5c07e)
2012-08-24 23:24:47 -04:00
Genevieve 409c4e48f9 OSM Plugin: Possibility to configure where the OpenLayers.js file is
(cherry picked from commit 6f684cd412e6d93f943c1fa5d8dac91caa138be0)
2012-08-05 22:02:01 -04:00
Philippe Gauthier 60ef4b1965 Fix incorrect URL pointing to the generated waypoint files by calling will_render() before first call to urlto().
Fixes
http://ikiwiki.info/bugs/osm_linkto__40____41___usage_breaks_map_rendering/
(cherry picked from commit 691312225789ff6cd5e3fcc4979c076791d67452)
2012-08-05 21:58:32 -04:00
Joey Hess 25ea99bc22 Split CFLAGS into words when building wrapper. Closes: #682237 2012-07-20 12:56:57 -04:00
Antoine Beaupré c42f992dc9 include manually the toggle js code 2012-07-19 10:32:02 -04:00
Joey Hess 32f3b4de00 Merge remote-tracking branch 'intrigeri/mirrorlist' 2012-06-03 13:15:19 -04:00
Joey Hess 18b0f2737b ensure HTML::Entities is always loaded
(Worked ok in my tests w/o this, but not sure I tested every case,
and this is correct.)
2012-05-16 22:13:23 -04:00
Joey Hess fbfcea89f8 meta: Security fix; add missing sanitization of author and authorurl. Thanks, Raúl Benencia 2012-05-16 19:54:41 -04:00
intrigeri 5b494e1b63 mirrorlist: new mirrorlist_use_cgi boolean setting.
When set to true, let each mirror's ikiwiki CGI find out the correct target page
url themselves.

This resolves the usecase described on
[[todo/mirrorlist_with_per-mirror_usedirs_settings]].

Signed-off-by: intrigeri <intrigeri@boum.org>
2012-04-28 00:18:59 +02:00
Joey Hess ae083783df Merge remote-tracking branch 'smcv/ready/trail' 2012-04-18 15:45:37 -04:00
Joey Hess 30a3efda58 graphviz: Handle self-links. 2012-04-18 15:36:27 -04:00
Joey Hess 169550a926 link: Fix renaming wikilinks that contain embedded urls. 2012-04-18 15:15:11 -04:00
Joey Hess e81e857ba6 add comment subscription checkbox to editpage
Reworded template, which also called the commit message a "comment".
2012-04-13 14:28:02 -04:00
Simon McVittie 3128409c06 trail: delete the right state
At some point I changed the storage of trail members' membership
and forgot to update this use.

(It turns out to be rather difficult to reach this code, possibly even
impossible: it only applies if a member somehow ceases to match the
trail's pagespec without either the trail or the member changing.)
2012-04-09 17:01:23 +01:00
Joey Hess fc5c938b19 Merge remote-tracking branch 'smcv/ready/literal-pagenames' 2012-04-08 16:02:03 -04:00
Joey Hess a434e3ed8d remove unnecessary quoting 2012-04-08 15:56:53 -04:00
Joey Hess b92e8caa4d Merge remote-tracking branch 'smcv/ready/transient-rm' 2012-04-08 15:54:25 -04:00
Joey Hess 4e1806ef7c save whole form state, not just QUERY_STRING, for postsignin
Normally, needsignin is called when there is a QUERY_STRING, not when a
form is posted. However, it's certianly possible, and should be supported,
to make a form that invokes an ikiwiki action that checks needsignin.

I encountered this when posting ?do=rename&page=foo. The form is displayed
without checking needsignin, for complicated reasons. Posting the form
is when the true authentication happens.
2012-04-08 14:14:33 -04:00
Joey Hess bcc2809b96 actually tested rename not started from the edit page 2012-04-08 13:40:01 -04:00
Simon McVittie a7f8a4eb98 Allow deletion of files from the transient underlay 2012-04-07 18:11:05 +01:00
Simon McVittie 5674e7fc12 prune: do not prune beyond an optional base directory, and add a test
Previously, prune("wiki/srcdir/sandbox/test.mdwn") could delete srcdir
or even wiki, if they happened to be empty. This is rarely what you
want: there's usually some base directory (destdir, srcdir, transientdir
or another subdirectory of wikistatedir) beyond which you do not want to
delete.
2012-04-07 17:52:29 +01:00
Simon McVittie 258ee1bc3b trail, inline: treat pagenames as a list of literal names, not links 2012-04-06 17:05:26 +01:00
Simon McVittie 4a4610e66e trail: fix inline documentation 2012-04-06 16:17:44 +01:00
Joey Hess 792e660cb1 improve prototype
src param always needed now
2012-04-05 15:09:13 -04:00
Joey Hess e4cdce4bce rename: Allow rename to be started not from the edit page; return to the renamed page in this case. 2012-04-05 14:48:18 -04:00
Simon McVittie 276ab9a78a Reinstate trail support in inline
This was removed in aaa72a3a80.
2012-04-05 09:43:44 +01:00
Joey Hess 93bda514ba httpauth: When it's the only auth method, avoid a pointless and confusing signin form, and just right to the httpauthurl. 2012-04-04 12:58:36 -04:00
Joey Hess f181b7fa0f uniq list for changed hook
There can be dups when eg, adding a new internal page, apparently.
2012-04-02 13:50:58 -04:00
Joey Hess c885ec66e0 allow users to subscribe to comments w/o registering
Technically, when the user does this, a passwordless account is created
for them. The notify mails include a login url, and once logged in that
way, the user can enter a password to get a regular account (although
one with an annoying username).

This all requires the passwordauth plugin is enabled. A future enhancement
could be to split the passwordless user concept out into a separate plugin.
2012-04-02 13:45:39 -04:00
Joey Hess c16b1e638e support do=tokenauth login for passwordless accounts 2012-04-02 12:29:13 -04:00
Joey Hess f9e96b0c32 passwordauth: Fix url in password recovery email to be absolute.
This got broken when cgiurl began often returning a relative url.
Added a cgiurl_abs for the things that need a guaranteed absolute cgiurl.
2012-04-02 12:24:14 -04:00
Joey Hess 1d1ef20034 add support for a passwordless login token
The plan is to use this for accounts that are created implicitly, as when
a non-logged-in user subscribes to notifyemail. Such an account has no
password, and login can be accomplished by way of a url that is sent to
them in email.

When the user sets a password, the passwordless login token is disabled.
2012-04-02 12:17:07 -04:00
Joey Hess 89df287aaa meta: Support keywords header. Closes: #664780 Thanks, Martin Michlmayr 2012-04-01 14:39:27 -04:00
Joey Hess 5ed773c643 more fixes to subscription prefs 2012-03-28 20:56:22 -04:00
Joey Hess d366a7bbb5 don't force old subscriptions value when posting 2012-03-28 20:45:52 -04:00
Joey Hess 6c297c4097 fix adding first subscription to pagespec 2012-03-28 20:42:37 -04:00
Joey Hess dadc822295 remove misc section 2012-03-28 20:36:25 -04:00
Joey Hess accf79f94a polishing notifyemail 2012-03-28 19:39:08 -04:00
Joey Hess f16de0c4e3 fix hook name 2012-03-28 19:04:44 -04:00
Joey Hess a22be4eef0 finish notifyemail plugin 2012-03-28 18:52:11 -04:00
Joey Hess d68d255268 Added a "changes" hook. Renamed the "change" hook to "rendered", but
the old hook name is called for now for back-compat.
2012-03-28 18:43:07 -04:00
Joey Hess 1916f97472 integrate comments plugin with notifyemail 2012-03-28 18:38:37 -04:00
Joey Hess 4b85a6eca1 add Subscriptions field to prefs 2012-03-28 17:00:54 -04:00
Joey Hess c0e5a0f1aa fix another undef/"" confusion 2012-03-28 16:47:37 -04:00
Joey Hess 723c5b97d3 changemail: New plugin, sends emails about changed pages. 2012-03-28 16:40:10 -04:00
Joey Hess 88e8f0ced9 simplify 2012-03-27 15:52:35 -04:00
Joey Hess 4250d389d3 meta: Export author information in html <meta> tag. Closes: #664779 Thanks, Martin Michlmayr 2012-03-27 15:52:35 -04:00
Joey Hess e7bf599ee0 remove debug message
A file may have no git sha1 if it's in the underlay, or just is not checked
into git. This debug message doesn't add any value and is potentially
confusing.
2012-03-22 13:07:30 -04:00