aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-08-03 10:03:31 -0400
committerJoey Hess <joey@kitenet.net>2013-08-03 10:03:31 -0400
commitcbde8520e9cc5512bd2726e2fa26089db0ddc7ab (patch)
treec60255d0f633877a444050f53f8178fd327d4b55 /IkiWiki.pm
parentb785d135402611b66b6df7ca561f5a4152ab5dee (diff)
parentd844a3487ed03fc35eecd89c6924c5e5ad36b4c5 (diff)
downloadikiwiki-cbde8520e9cc5512bd2726e2fa26089db0ddc7ab.tar
ikiwiki-cbde8520e9cc5512bd2726e2fa26089db0ddc7ab.tar.gz
Merge remote-tracking branch 'schmonz/proxy'
Conflicts: doc/todo/outbound_proxy.mdwn doc/users/schmonz.mdwn
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm17
1 files changed, 16 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index c497dd38f..75c957932 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -22,7 +22,7 @@ our @EXPORT = qw(hook debug error htmlpage template template_depends
htmllink readfile writefile pagetype srcfile pagename
displaytime strftime_utf8 will_render gettext ngettext urlto targetpage
add_underlay pagetitle titlepage linkpage newpagefile
- inject add_link add_autofile
+ inject add_link add_autofile useragent
%config %links %pagestate %wikistate %renderedfiles
%pagesources %destsources %typedlinks);
our $VERSION = 3.00; # plugin interface version, next is ikiwiki version
@@ -513,6 +513,14 @@ sub getsetup () {
safe => 0,
rebuild => 0,
},
+ cookiejar => {
+ type => "string",
+ default => "$ENV{HOME}/.ikiwiki/cookies",
+ description => "cookie control",
+ example => { file => "$ENV{HOME}/.ikiwiki/cookies" },
+ safe => 0, # hooks into perl module internals
+ rebuild => 0,
+ },
}
sub defaultconfig () {
@@ -2274,6 +2282,13 @@ sub add_autofile ($$$) {
$autofiles{$file}{generator}=$generator;
}
+sub useragent () {
+ return LWP::UserAgent->new(
+ cookie_jar => $config{cookiejar},
+ env_proxy => 1, # respect proxy env vars
+ );
+}
+
sub sortspec_translate ($$) {
my $spec = shift;
my $reverse = shift;