Commit Graph

574 Commits (ed90210efa5b0839c391ad2ba99343747c277c62)

Author SHA1 Message Date
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 3aaa33064c Optmised loadindex by caching the page name in the index.
I have benchmarked the pagename() call this avoids taking up to 2 seconds
for a loadindex in a large wiki. The total loadindex for that wiki was
6.46s, so this is a significant improvment.
Even on a smaller site, this reduces the refresh time from 1.69 to 1.52
seconds.

The only breakage risk here is that pagename() can change the page name
it calculates due to setup changes. But in the case of a setup change, the
whole site is rebuilt. So the cached page name is not used in that
case.
2013-11-16 12:48:11 -04:00
Joey Hess 992d4f52ff Fixed unncessary tight loop hash copy in saveindex where a pointer can be used instead. Can speed up refreshes by nearly 50% in some circumstances.
I *think* this is ok, at least it results in close to the same index being
saved as before. The difference is that plugins that have a pagestate of {}
have that recorded this way, while with the tight loop, the key for the
plugin in not copied in that case. I cannot see how this could matter.
2013-11-16 12:28:01 -04:00
Joey Hess df09eba2fd Fix cookiejar default setting. 2013-09-04 10:15:35 -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 533793ee46 The ip() pagespec can now contain glob characters to match eg, a subnet full of spammers. 2013-07-08 11:49:38 -04:00
Giuseppe Bilotta 186a76ec20 Allow dots in parameter key names
This allows e.g. the meta command to be used to introduce DublinCore
metadata.
2013-02-15 17:24:33 -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
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 3200515b3d fix typo in LC_TIME locale lookup 2012-02-01 22:49:35 -04:00
Joey Hess a78126c55e calendar, prettydate: Fix strftime encoding bug
strftime is a C function, it does not return decoded utf8.
Several places in ikiwiki manually decoded it, but at least two
forgot to.

Also, strftime might not return even encoded utf8, if LC_TIME is set
to a non-utf8 value. Went ahead and supported decoding whatever encoding
it uses.

The remaining direct calls to strftime() are all ones that first set
LC_TIME=C, in order to get times that are not for human display.
2012-01-30 15:09:37 -04:00
Giuseppe Bilotta 17fb0cf9f9 backlink(.) should behave like backlink(<current page>)
Since commit c4d4cad3be, the single dot in
a pagespec can be used to mean the current page. While this worked
correctly in link() it didn't work in backlink(). Fix this by explicitly
checking the testpage in backlink against . and replacing it with the
current location if necessary.
2012-01-13 13:42:38 -04:00
Simon McVittie 5333c113d6 Add path and path_natural sort orders
(cherry picked from commit 272e0b2f17)
2011-12-06 14:26:27 -04:00
Simon McVittie 3df7d14346 Support private, group, public as values for umask
These are equivalent to octal 077, 027 and 022, but easier to get from
YAML.

Signed-off-by: Simon McVittie <smcv@debian.org>
2011-11-27 14:14:47 +00:00
Joey Hess d2cf716876 Avoid using named capture groups in heredoc code for oldperl compatability.
Also reordered heredoc part of regexp for consistency.
2011-07-30 20:12:33 +02:00
Joey Hess 25b01f9404 Preserve mixed case in page creation links, and when creating a page whose title is mixed case, allow selecting between the mixed case and all lower-case names. 2011-06-29 16:38:32 -04:00
Joey Hess c90bc78d44 Support svg as a inlinable image type
svg images can be included on a page by simply linking to them, or by using
the img directive. Note that sanitizing svg files is still not addressed.
2011-06-29 14:17:47 -04:00
Joey Hess 46064d6d63 html5 is not experimental anymore. But not the default either, quite yet. 2011-06-23 09:41:21 -04:00
Timo Paulssen 1c58634068 added support for here-docs and ''' in parameters. 2011-05-13 11:24:15 -04:00
Joey Hess 9df8971e57 Yaml formatted setup files are now produced by default
This has been a while coming. It turns out that non-excutable setup files
have a number of benefits. Also, I find YAML setup files easier to edit
myself, and I suspect many users will prefer not needing to deal with
perl syntax.
2011-03-24 21:30:18 -04:00
Joey Hess 78c750f2d2 Add timezone setting in setup file. This alows time zone to be configured via the web. 2011-03-24 13:36:16 -04:00
Joey Hess 2a2ae88c84 avoid uninitlized value when urlto is called with 1 parameter and no url is configured
This brings back the old behavior before urlto changes for this case.
It will generate a path like "/foo", which is not right, but is
the same as is generated by urlto($page, "", 1) -- which is what
the code that now uses 1-parameter urlto used to use.
2011-02-27 18:32:44 -04:00
Simon McVittie dff44e4a6d Add add_literal_underlay and use it for the transient underlay
This means we don't need to import Cwd and use abs_path.
2011-01-07 20:04:45 +00:00
Joey Hess d991ccf134 use cgitemplate, remove misctemplate 2011-01-05 17:15:38 -04:00
Joey Hess 885bff7239 make urlabs a noop if base url is not provided
This allows urlabs($foo, $config{url}) to be used safely, even if
no url is configured.
2011-01-05 16:23:05 -04:00
Joey Hess c91b39fdb5 factored out an urlabs from aggregate and cgi 2011-01-05 16:18:25 -04:00
Joey Hess c11b1226ca oops 2011-01-05 15:43:03 -04:00
Joey Hess 6b5b0a3282 Temporarily revert one part of the multiple url support in the last release. Non-edit pages are now back to having `<base>` set to the site's main url. 2011-01-05 15:01:31 -04:00
Joey Hess 4fb26f4e60 Add a second parameter to the rcs_diff hook, and avoid bloating memory reading in enormous commits. 2010-12-29 19:58:49 -04:00
Simon McVittie d4704d8bbb urlto: simplify the to='' special case to allow it to be made absolute 2010-12-25 22:54:54 +00:00
Simon McVittie eb58b51bb0 checkconfig: don't warn if $config{url} is undef
The warning was "Use of uninitialized value $IkiWiki::config{"url"} in
length" when running a modified t/tag.t.
2010-12-25 21:35:06 +00:00
intrigeri b2a2246bac Enable HTML::Template's parent_global_vars option.
Else setting parameters that do not appear in the template (such as
title_overridden) fails horribly.
2010-12-22 19:21:41 +01:00
Joey Hess 53d466a07f second parameter of urlto is optional 2010-11-29 14:59:48 -04:00
Joey Hess 0ae1e4cc0e Merge remote branch 'smcv/ready/localurl' 2010-11-29 14:43:57 -04:00
Joey Hess 93d77673e4 Merge remote branch 'blipvert/fixes' 2010-11-28 13:35:52 -04:00
Craig Lennox e4c6f5bcbe check that user is defined before regexp compare 2010-11-28 10:51:53 -05:00
Simon McVittie d01334b8e9 If cgiurl is set, but url isn't, use an absolute $local_cgiurl 2010-11-23 22:21:31 +00:00
Simon McVittie 4c224ae143 urlto(): if $from is undef, return a local path, not an absolute URL 2010-11-22 23:47:05 +00:00
Simon McVittie f032bce791 baseurl(): return local path, not absolute URL, if the argument is undef 2010-11-22 23:47:04 +00:00
Simon McVittie 6be4e6d1a5 cgiurl(): return a locally-valid path by default
To get an absolute version you can use cgiurl(cgiurl => $config{cgiurl}).
The only place in IkiWiki that seems to actually need an absolute URL
is the openid plugin, and that already uses the named parameter.
2010-11-22 23:47:04 +00:00
Simon McVittie 200c599dca cgiurl: don't append "?" if there are no parameters
This means we can use cgiurl() instead of $config{cgiurl} if an absolute
URL isn't desired.
2010-11-22 23:16:59 +00:00
Simon McVittie 8f64c69e08 Compute local paths to the top of the wiki
"local" here is short for "locally valid" - the idea is that we can use
URLs that are relative in the sense of only having the path part, but
absolute in the sense that they start from '/', such as
'/~smcv/ikiwiki.cgi'. There's no particularly good name that I can find
for these between-relative-and-absolute URLs.

They're useful because in the common case where the pages and the CGI
script have the same scheme and authority component, each page is
identified by the same locally-valid URL when linking from any page or
from the CGI, without hard-coding a choice between HTTP and HTTPS, or
between multiple virtual hostnames with the same path layout. As such,
we can use them in many situations that previously used an absolute URL.

If there's no suitable semi-absolute value for local_url (for instance,
if your pages and your CGI reside on different servers), we can just fall
back to using the absolute URL. I append '/' because $config{url} doesn't
end with '/', but the common case for local_url (on all branchable.com
sites, for instance) is that it's just '/'.
2010-11-22 23:13:52 +00:00
Joey Hess b3bca318ef avoid an unnecessary hash lookup 2010-11-20 12:25:52 -04:00
Simon McVittie 55515050e1 make use of precompiled regex objects 2010-11-20 00:02:49 +00:00
Simon McVittie 788105e2a7 glob2re: return a precompiled, anchored case-insensitive regex
In practice every use of glob2re uses it like that.
2010-11-19 23:59:04 +00:00
Simon McVittie 321bf7ec19 match_glob: streamline glob cache slightly 2010-11-19 23:46:46 +00:00
Kathryn Andersen ff0e244701 Improve the speed of match_glob 2010-11-19 23:46:46 +00:00
Joey Hess 0cc2a36f59 bugfix 2010-10-23 16:47:19 -04:00