use strict; ## URI (or part of URI) of Wiki CGI itself and its external addons ## Note: If your Wiki CGI URI is , ## cookie-path: /path/to/ ## script-short-name: wiki.cgi ## URI parts MUST NOT contains "&" and/or non-URI characters. our %uri = ( cookie_path => '/~wakaba/-temp/wiki/', external_script => '../wiki/script/', script_short_name => 'wiki', ## If you use CVS repository of WikiDatabase, cvs_repository => '/gate/cvs/suikawiki/wikidata/page/', ); our $url_cgi; { my $scheme = 'http'; $scheme = lc $1 if $main::ENV{SERVER_PROTOCOL} =~ m#([A-Za-z0-9+.%-]+)#; $url_cgi = "$scheme://".($main::ENV{HTTP_HOST} || $main::ENV{SERVER_NAME}.($main::ENV{SERVER_PORT}==80?'':":$main::ENV{SERVER_PORT}"))."$uri{cookie_path}$uri{script_short_name}"; } $uri{wiki_abs} = $url_cgi; $uri{wiki} = qq($uri{cookie_path}$uri{script_short_name}); ## Path to modules and databases push @main::INC, 'lib'; push @SuikaWiki::Plugin::plugin_directory, ( q(lib/SuikaWiki/Plugin/), q(misc/plugins/), ); our %PathTo = ( ## Path to your data, from the main CGI script (NOT from this config script) CachePrefix => q(./wikidata/.cache.), TempPrefix => q(./wikidata/.tmp.), WikiDataBase => q(./wikidata/page), WikiDatabase => q(./wikidata/page), WikiDatabaseErrorLog => q(./wikidata/log/error.log), convert => q(/usr/X11R6/bin/convert), ); require SuikaWiki::DB::Util::Lock; our $locker = SuikaWiki::DB::Util::Lock->new (-directory => q(./wikidata/lock), -name => 'wikipage', -retry => ($main::ENV{HTTP_USER_AGENT} =~ m#Openbot/3# ? 2 : 80), -timeout => 300, -error_handler => sub { my ($self, %o) = @_; open LOG, '>>', $main::PathTo{WikiDatabaseErrorLog}; print LOG scalar (gmtime)."\@@{[time]} @{[$$]} {$o{level}}: ", $o{msg}, "\n"; close LOG; if ($o{level} eq 'fatal') { die $o{msg}; } }); $locker->lock or do { open LOG, '>>', $main::PathTo{WikiDatabaseErrorLog}; print LOG scalar (time), " Can't lock\n"; close LOG; die "Can't lock"; }; ## Type of WikiPage Database #our $modifier_dbtype = 'AnyDBM_File'; # Fast, not available on some server, page size limited. #our $modifier_dbtype = 'dbmopen'; # Fast, not available on some server, page size limited. #our $modifier_dbtype = 'Yuki::YukiWikiDB'; # Slow, available on all environment. #our $modifier_dbtype = 'Yuki::YukiWikiDB2'; # Slow, available on all environment. our $modifier_dbtype = 'Yuki::YukiWikiDBMeta'; # Slow, available on all environment. our $use_exists = 1; # If you can use 'exists' method for your DB. ## Name of Special WikiPage (linked as parts of navigations) our %PageName = ( FrontPage => 'HomePage', IndexPage => 'IndexPage', InterWikiName => 'Wiki//InterWikiName', SearchPage => 'Wiki//Page//Search', CreatePage => 'Wiki//Page//Create', MenuBar => 'Wiki//MenuBar', RecentChanges => 'RecentChanges', RefererDontRecord => 'Wiki//Referer//IgnoreSite', RefererSiteName => 'Wiki//Referer//SiteName', ResourceNS => 'Wiki//Resource//', StyleList => 'Wiki//Style//List//', UserAgentList => 'Wiki//UserAgentList', AdminSpecialPage => "\x11\x11Admin\x11Special\x11Page\x11\x11", ); ## (Should be reimplemented) our $kanjicode = 'euc'; our $lang = 'ja'; ## Misc. options $SuikaWiki::Plugin::UserAgent::LoggingName = 1; ## Use UA-name log? (require UserAgent plugin module) ## Definition of views require SuikaWiki::View; SuikaWiki::View->template ('links')->add_line (<<'EOH'); %link-wiki(page=>"Wiki//News",rel=>News,class=>wiki,title=>"%res(name=>GoToWikiNewsLink);"p); %link-wiki(page=>"Wiki//Help",rel=>help,class=>wiki,title=>"%res(name=>GoToWikiHelpLink);"p); %link-wiki(page=>"Wiki//Page//License",rel=>copyright,class=>wiki,title=>"%res(name=>GoToWikiPageLicenseLink);"p); EOH SuikaWiki::View->template ('navbar')->add_line (<<"EOH"); %anchor-wiki(mode=>edit,rel=>edit,class=>wiki-cmd,label=>"%res(name=>EditThisPage);"p,title=>"%res(name=>EditThisPageLong);"p,accesskey=>E,add-param=>{#edit}); %anchor-wiki(rel=>view,up_to_date,class=>wiki-cmd,label=>"%res(name=>ViewThisPage);"p,title=>"%res(name=>ViewThisPageLong);"p); %anchor-wiki(page=>{$main::PageName{CreatePage}},class=>wiki,label=>"%res(name=>GoToCreatePage);"p,title=>"%res(name=>GoToCreatePageLong);"p); %anchor-wiki(page=>{$main::PageName{SearchPage}},class=>wiki,label=>"%res(name=>GoToSearchPage);"p,title=>"%res(name=>GoToSearchPageLong);"p); %anchor-wiki(mode=>RandomJump,up-to-date,rel=>lucky,class=>"wiki randomlink",label=>"%res(name=>GoSomewhere);"p,title=>"%res(name=>GoSomewhereLong);"p); %anchor-wiki(page=>{$main::PageName{RecentChanges}},class=>wiki,label=>"%res(name=>GoToRecentChanges);"p,title=>"%res(name=>GoToRecentChangesLong,safe);"p); EOH push @{$SuikaWiki::Plugin::On{Load}}, sub { SuikaWiki::View->definition ('read')->property (template => <<'EOH'); %html-document(title=>{%res(name=>{View:WebPageTitle});}p,link-meta=>{%predefined-template(name=>links);}p,content=>{ %section(level=>1,add-to-toc=>0,type=>body,title=>{%ns-short-page-name;}p,heading,content=>{ %section(id=>tools1,class=>tools,add-to-toc=>0,content=>{%predefined-template(name=>navbar);}p); %section(level=>2,id=>read,add-to-toc=>0,content=>{ %if-calender(month,true=>{ %format(context=>form_input,template=>{%calender;}); },false=>{ %if-calender(true=>{ %format(context=>form_input,template=>{%calender-months;}); }); }); %read(comment); }p); %section(level=>2,id=>children,title=>{%res(name=>{Children:Title});}p,heading, content=>{%page-list(ns=>{%page-name;}p,recursive=>0,type=>both,template=>{%res(name=>{Children:Item});}p);}p); %section(level=>2,id=>see-also,title=>{%res(name=>SeeAlso);}p,heading,content=>{%search-result;}p); %section(level=>2,id=>referer,title=>{%res(name=>Referer);}p,heading,content=>{%referer-list;}p); %section(level=>2,id=>toc,title=>{%res(name=>{TOC:Title});}p,heading,add_to_toc=>0,content=>{%toc(drag);}p); %section(id=>last-modified,add_to_toc=>0,content=>{%res(name=>{LastModified=});%last-modified;}p); %section(class=>tools,add_to_toc=>0,content=>{%predefined-template(name=>navbar);}p); %section(id=>footer,add-to-toc=>0,content=>{%predefined-template(name=>footer);}p); }p); }p);%log-hotness; EOH SuikaWiki::View->definition ('-wrote')->property (template => SuikaWiki::View->definition ('-wrote')->property ('template').q(%log-hotness(weight=>2);)); SuikaWiki::View->definition ('WithMenu')->property (template => SuikaWiki::View->definition ('WithMenu')->property ('template').q(%log-hotness;)); }; =head1 NAME suikawiki-config.ph --- SuikaWiki: site configuration script =head1 LICENSE Copyright 2003 Wakaba This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1; # $Date: 2003/10/05 11:57:09 $