From 17e39c698233df61c6132a085a08b58952186a32 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 31 Aug 2010 16:08:49 +0200 Subject: Generalize paths and URLs iki ikiwiki setup file. --- ikiwiki.setup | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/ikiwiki.setup b/ikiwiki.setup index aff75a0..faaeacb 100644 --- a/ikiwiki.setup +++ b/ikiwiki.setup @@ -5,6 +5,24 @@ # wrappers and build the wiki. # # Remember to re-run ikiwiki --setup any time you edit this file. + +our $libdir; +our $webdir; +our $cgidir; +our $gitdir; +our $webhost; +our $githost; +our $gitrepo; +BEGIN { + $libdir = $ENV{'PWD'} . '/perl'; + $webdir = 'build/html'; + $cgidir = 'build/cgi'; + $gitdir = 'build/git'; + $webhost = 'wiki.example.org'; + $githost = 'git.example.org'; + $gitrepo = 'wiki'; +} + use IkiWiki::Setup::Standard { # name of the wiki wikiname => 'MyWiki', @@ -15,15 +33,15 @@ use IkiWiki::Setup::Standard { # users who are banned from the wiki banned_users => [], # where the source of the wiki is located - srcdir => $ENV{'HOME'} . '/private_webdata/samplewiki/content', + srcdir => 'content', # where to build the wiki - destdir => $ENV{'HOME'} . '/public_websites/wiki.example.org', + destdir => $webdir, # base url to the wiki - url => 'http://wiki.example.org', + url => 'http://' . $webhost . '/', # url to the ikiwiki.cgi - cgiurl => 'http://wiki.example.org/ikiwiki.cgi', + cgiurl => 'http://' . $webhost . '/ikiwiki.cgi', # cgi wrapper to generate - cgi_wrapper => $ENV{'HOME'} . '/public_cgi/wiki.example.org/ikiwiki.cgi', + cgi_wrapper => $cgidir . '/ikiwiki.cgi', # mode for cgi_wrapper (can safely be made suid) cgi_wrappermode => '00755', # rcs backend to use @@ -35,9 +53,9 @@ use IkiWiki::Setup::Standard { disable_plugins => [qw{ }], # location of template files - templatedir => $ENV{'HOME'} . '/private_webdata/samplewiki/templates', + templatedir => 'templates', # base wiki source location - underlaydir => $ENV{'HOME'} . '/private_webdata/samplewiki/basewiki', + underlaydir => 'basewiki', # display verbose messages when building? #verbose => 1, # log to syslog? @@ -69,7 +87,7 @@ use IkiWiki::Setup::Standard { # force ikiwiki to use a particular umask #umask => 022, # extra library and plugin directory - libdir => $ENV{'HOME'} . '/private_webdata/samplewiki/perl', + libdir => $libdir, # environment variables ENV => {}, # regexp of source files to ignore @@ -89,7 +107,7 @@ use IkiWiki::Setup::Standard { # public access key id #amazon_s3_key_id => 'XXXXXXXXXXXXXXXXXXXX', # file holding secret key (must not be readable by others!) - #amazon_s3_key_id => $ENV{'HOME'} . '/secret_webdata/s3_key', + #amazon_s3_key_id => 's3_key', # globally unique name of bucket to store wiki in #amazon_s3_bucket => 'mywiki', # a prefix to prepend to each page name @@ -125,13 +143,13 @@ use IkiWiki::Setup::Standard { # git plugin # git hook to generate - git_wrapper => $ENV{'HOME'} . '/public_websites/git.example.org/samplewiki_content.git/hooks/post-update-ikiwiki', + git_wrapper => $gitdir . '/post-update-ikiwiki', # mode for git_wrapper (can safely be made suid) git_wrappermode => '06755', # gitweb url to show file history ([[file]] substituted) - #historyurl => 'http://git.example.org/gitweb.cgi?p=wiki.git;a=history;f=[[file]]', # ;hb=master + #historyurl => 'http://' . $githost . '/gitweb.cgi?p=wiki.git;a=history;f=[[file]]', # ;hb=master # gitweb url to show a diff ([[sha1_to]], [[sha1_from]], [[sha1_parent]], and [[file]] substituted) - #diffurl => 'http://git.example.org/gitweb.cgi?p=wiki.git;a=blobdiff;h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_parent]];f=[[file]]', + #diffurl => 'http://' . $githost . '/gitweb.cgi?p=wiki.git;a=blobdiff;h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_parent]];f=[[file]]', # where to pull and push changes (set to empty string to disable) #gitorigin_branch => 'samplewiki', # branch that the wiki is stored in -- cgit v1.2.3 From bdc057f3edc154091d8eeec4bedddf230500d170 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 31 Aug 2010 16:58:15 +0200 Subject: Fix generalize gitrepo in ikiwiki setup file. --- ikiwiki.setup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ikiwiki.setup b/ikiwiki.setup index faaeacb..0193f6f 100644 --- a/ikiwiki.setup +++ b/ikiwiki.setup @@ -147,9 +147,9 @@ use IkiWiki::Setup::Standard { # mode for git_wrapper (can safely be made suid) git_wrappermode => '06755', # gitweb url to show file history ([[file]] substituted) - #historyurl => 'http://' . $githost . '/gitweb.cgi?p=wiki.git;a=history;f=[[file]]', # ;hb=master + #historyurl => 'http://' . $githost . '/gitweb.cgi?p=' . $gitrepo . '.git;a=history;f=[[file]]', # ;hb=master # gitweb url to show a diff ([[sha1_to]], [[sha1_from]], [[sha1_parent]], and [[file]] substituted) - #diffurl => 'http://' . $githost . '/gitweb.cgi?p=wiki.git;a=blobdiff;h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_parent]];f=[[file]]', + #diffurl => 'http://' . $githost . '/gitweb.cgi?p=' . $gitrepo . '.git;a=blobdiff;h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_parent]];f=[[file]]', # where to pull and push changes (set to empty string to disable) #gitorigin_branch => 'samplewiki', # branch that the wiki is stored in -- cgit v1.2.3