From 39dfbc1f65b04634fde79bebb600351236e71661 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 30 Sep 2010 20:28:38 +0200 Subject: Fix admin config always prepend basedir, and tidy our vars. --- ikiwiki_admin.setup | 34 +++++++++++++--------------------- ikiwiki_da_admin.setup | 34 +++++++++++++--------------------- ikiwiki_nb_admin.setup | 34 +++++++++++++--------------------- 3 files changed, 39 insertions(+), 63 deletions(-) diff --git a/ikiwiki_admin.setup b/ikiwiki_admin.setup index 8d0bcd5..0a2c7a1 100644 --- a/ikiwiki_admin.setup +++ b/ikiwiki_admin.setup @@ -6,20 +6,12 @@ # # Remember to re-run ikiwiki --setup any time you edit this file. -our $libdir; -our $adminwebdir; -our $admincgidir; -our $gitdir; -our $adminwebhost; -our $githost; -our $gitrepo; +our ($basedir, $builddir, $domain, $gitrepo); BEGIN { - $libdir = $ENV{'PWD'} . '/perl'; - $adminwebdir = 'build/html-admin'; - $admincgidir = 'build/cgi-admin'; - $gitdir = 'build/git'; - $adminwebhost = 'admin.wiki.example.org'; - $githost = 'git.example.org'; + # git hook requires full path as basedir: $ENV{'HOME'} . '/mywiki' + $basedir = $ENV{'PWD'}; + $builddir = $ENV{'BUILDDIR'} || $basedir . '/build'; + $domain = 'example.org'; $gitrepo = 'wiki'; } @@ -35,13 +27,13 @@ use IkiWiki::Setup::Standard { # where the source of the wiki is located srcdir => 'content', # where to build the wiki - destdir => $adminwebdir, + destdir => $builddir . '/html-admin', # base url to the wiki - url => 'http://' . $adminwebhost . '/', + url => 'http://admin.' . $domain . '/', # url to the ikiwiki.cgi - cgiurl => 'http://' . $adminwebhost . '/ikiwiki.cgi', + cgiurl => 'http://admin.' . $domain . '/ikiwiki.cgi', # cgi wrapper to generate - cgi_wrapper => $admincgidir . '/ikiwiki.cgi', + cgi_wrapper => $builddir . '/cgi-admin/ikiwiki.en.cgi', # mode for cgi_wrapper (can safely be made suid) cgi_wrappermode => '00755', # rcs backend to use @@ -87,7 +79,7 @@ use IkiWiki::Setup::Standard { # force ikiwiki to use a particular umask #umask => 022, # extra library and plugin directory - libdir => $libdir, + libdir => $basedir . '/perl', # environment variables ENV => {}, # regexp of source files to ignore @@ -143,13 +135,13 @@ use IkiWiki::Setup::Standard { # git plugin # git hook to generate - git_wrapper => $gitdir . '/post-update-ikiwiki-admin', + git_wrapper => $builddir . '/git/post-update-ikiwiki-admin', # 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=' . $gitrepo . '.git;a=history;f=[[file]]', # ;hb=master + historyurl => 'http://source.' . $domain . '/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=' . $gitrepo . '.git;a=blobdiff;h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_parent]];f=[[file]]', + diffurl => 'http://source.' . $domain . '/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 diff --git a/ikiwiki_da_admin.setup b/ikiwiki_da_admin.setup index d3a64c9..fbae9fe 100644 --- a/ikiwiki_da_admin.setup +++ b/ikiwiki_da_admin.setup @@ -6,20 +6,12 @@ # # Remember to re-run ikiwiki --setup any time you edit this file. -our $libdir; -our $admindawebdir; -our $admindacgidir; -our $gitdir; -our $admindawebhost; -our $githost; -our $gitrepo; +our ($basedir, $builddir, $domain, $gitrepo); BEGIN { - $libdir = $ENV{'PWD'} . '/perl'; - $admindawebdir = 'build/html-da-admin'; - $admindacgidir = 'build/cgi-da-admin'; - $gitdir = 'build/git'; - $admindawebhost = 'admin.da.wiki.example.org'; - $githost = 'git.example.org'; + # git hook requires full path as basedir: $ENV{'HOME'} . '/mywiki' + $basedir = $ENV{'PWD'}; + $builddir = $ENV{'BUILDDIR'} || $basedir . '/build'; + $domain = 'example.org'; $gitrepo = 'wiki'; } @@ -35,13 +27,13 @@ use IkiWiki::Setup::Standard { # where the source of the wiki is located srcdir => 'content_da', # where to build the wiki - destdir => $admindawebdir, + destdir => $builddir . '/html-da-admin', # base url to the wiki - url => 'http://' . $admindawebhost . '/', + url => 'http://admin.da.' . $domain . '/', # url to the ikiwiki.cgi - cgiurl => 'http://' . $admindawebhost . '/ikiwiki.cgi', + cgiurl => 'http://admin.da.' . $domain . '/ikiwiki.cgi', # cgi wrapper to generate - cgi_wrapper => $admindacgidir . '/ikiwiki.cgi', + cgi_wrapper => $builddir . '/cgi-da-admin/ikiwiki.en.cgi', # mode for cgi_wrapper (can safely be made suid) cgi_wrappermode => '00755', # rcs backend to use @@ -87,7 +79,7 @@ use IkiWiki::Setup::Standard { # force ikiwiki to use a particular umask #umask => 022, # extra library and plugin directory - libdir => $libdir, + libdir => $basedir . '/perl', # environment variables ENV => {}, # regexp of source files to ignore @@ -143,13 +135,13 @@ use IkiWiki::Setup::Standard { # git plugin # git hook to generate - git_wrapper => $gitdir . '/post-update-ikiwiki-da-admin', + git_wrapper => $builddir . '/git/post-update-ikiwiki-da-admin', # 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=' . $gitrepo . '.git;a=history;f=[[file]];hb=master-da', + historyurl => 'http://source.' . $domain . '/gitweb.cgi?p=' . $gitrepo . '.git;a=history;f=[[file]];hb=master-da', # gitweb url to show a diff ([[sha1_to]], [[sha1_from]], [[sha1_parent]], and [[file]] substituted) - diffurl => 'http://' . $githost . '/gitweb.cgi?p=' . $gitrepo . '.git;a=blobdiff;h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_parent]];f=[[file]]', + diffurl => 'http://source.' . $domain . '/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 diff --git a/ikiwiki_nb_admin.setup b/ikiwiki_nb_admin.setup index d0543a4..fa594c2 100644 --- a/ikiwiki_nb_admin.setup +++ b/ikiwiki_nb_admin.setup @@ -6,20 +6,12 @@ # # Remember to re-run ikiwiki --setup any time you edit this file. -our $libdir; -our $adminnbwebdir; -our $adminnbcgidir; -our $gitdir; -our $adminnbwebhost; -our $githost; -our $gitrepo; +our ($basedir, $builddir, $domain, $gitrepo); BEGIN { - $libdir = $ENV{'PWD'} . '/perl'; - $adminnbwebdir = 'build/html-nb-admin'; - $adminnbcgidir = 'build/cgi-nb-admin'; - $gitdir = 'build/git'; - $adminnbwebhost = 'admin.nb.wiki.example.org'; - $githost = 'git.example.org'; + # git hook requires full path as basedir: $ENV{'HOME'} . '/mywiki' + $basedir = $ENV{'PWD'}; + $builddir = $ENV{'BUILDDIR'} || $basedir . '/build'; + $domain = 'example.org'; $gitrepo = 'wiki'; } @@ -35,13 +27,13 @@ use IkiWiki::Setup::Standard { # where the source of the wiki is located srcdir => 'content_nb', # where to build the wiki - destdir => $adminnbwebdir, + destdir => $builddir . '/html-nb-admin', # base url to the wiki - url => 'http://' . $adminnbwebhost . '/', + url => 'http://admin.nb.' . $domain . '/', # url to the ikiwiki.cgi - cgiurl => 'http://' . $adminnbwebhost . '/ikiwiki.cgi', + cgiurl => 'http://admin.nb.' . $domain . '/ikiwiki.cgi', # cgi wrapper to generate - cgi_wrapper => $adminnbcgidir . '/ikiwiki.cgi', + cgi_wrapper => $builddir . '/cgi-nb-admin/ikiwiki.en.cgi', # mode for cgi_wrapper (can safely be made suid) cgi_wrappermode => '00755', # rcs backend to use @@ -87,7 +79,7 @@ use IkiWiki::Setup::Standard { # force ikiwiki to use a particular umask #umask => 022, # extra library and plugin directory - libdir => $libdir, + libdir => $basedir . '/perl', # environment variables ENV => {}, # regexp of source files to ignore @@ -143,13 +135,13 @@ use IkiWiki::Setup::Standard { # git plugin # git hook to generate - git_wrapper => $gitdir . '/post-update-ikiwiki-nb-admin', + git_wrapper => $builddir . '/git/post-update-ikiwiki-nb-admin', # 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=' . $gitrepo . '.git;a=history;f=[[file]];hb=master-nb', + historyurl => 'http://source.' . $domain . '/gitweb.cgi?p=' . $gitrepo . '.git;a=history;f=[[file]];hb=master-nb', # gitweb url to show a diff ([[sha1_to]], [[sha1_from]], [[sha1_parent]], and [[file]] substituted) - diffurl => 'http://' . $githost . '/gitweb.cgi?p=' . $gitrepo . '.git;a=blobdiff;h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_parent]];f=[[file]]', + diffurl => 'http://source.' . $domain . '/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