# wrappers and build the wiki.
#
# Remember to re-run ikiwiki --setup any time you edit this file.
-use IkiWiki::Setup::Standard {
+
+use vars qw/%setup_args/;
+
+BEGIN {
+
+my %common_setup_args = (
# name of the wiki
wikiname => 'SIPB',
# contact email for wiki
adminuser => [],
# users who are banned from the wiki
banned_users => [],
- # where the source of the wiki is located
- srcdir => '/afs/sipb.mit.edu/project/sipb-www/ikiwiki/src',
- # where to build the wiki
- destdir => '/afs/sipb.mit.edu/project/sipb-www/web_scripts/wiki/',
- # base url to the wiki
- url => 'http://sipb.mit.edu/wiki',
- # url to the ikiwiki.cgi
- cgiurl => 'https://sipb.mit.edu:444/wiki/ikiwiki.cgi',
- # filename of cgi wrapper to generate
- cgi_wrapper => '/afs/sipb.mit.edu/project/sipb-www/web_scripts/wiki/ikiwiki.cgi',
- # mode for cgi_wrapper (can safely be made suid)
- cgi_wrappermode => '06755',
- # rcs backend to use
- rcs => 'git',
# plugins to add to the default configuration
# IMPORTANT! If you add plugins that involve interface changes, you
# will need to modify our templates to allow this, as our custom
# template does not support them yet. See ~/src/ikiwiki/templates
- add_plugins => [qw(goodstuff httpauth)],
+ add_plugins => [qw(goodstuff html httpauth rename remove 404 attachment)],
# plugins to disable
# IMPORTANT! If you reenable passwordauth/openid, you need to
# do some modifications described in TODO.SIPB in the source-tree
disable_plugins => [qw(smiley passwordauth openid)],
- # location of template files
- templatedir => '/mit/sipb-www/share/ikiwiki/templates',
- # base wiki source location
- underlaydir => '/mit/sipb-www/share/ikiwiki/basewiki',
# display verbose messages when building?
verbose => 1,
# log to syslog?
# attachment plugin
# enhanced PageSpec specifying what attachments are allowed
- #allowed_attachments => 'virusfree() and mimetype(image/*) and maxsize(50kb)',
+ allowed_attachments => 'virusfree() and (mimetype(image/*) or mimetype(application/pdf)) and maxsize(10000kb)',
# virus checker program (reads STDIN, returns nonzero if virus found)
- #virus_checker => 'clamdscan -',
-
- # bzr plugin
- # bzr post-commit hook to generate
- #bzr_wrapper => '',
- # mode for bzr_wrapper (can safely be made suid)
- #bzr_wrappermode => '06755',
- # url to show file history, using loggerhead ([[file]] substituted)
- #historyurl => '',
- # url to view a diff, using loggerhead ([[file]] and [[r2]] substituted)
- #diffurl => 'http://example.com/revision?start_revid=[[r2]]#[[file]]-s',
+ virus_checker => 'clamscan -',
# calendar plugin
# base of the archives hierarchy
#comments_allowauthor => 0,
# commit comments to the VCS
#comments_commit => 1,
-
- # git plugin
- # git hook to generate
- git_wrapper => '/mit/sipb-www/ikiwiki/src/.git/hooks/post-update',
- # mode for git_wrapper (can safely be made suid)
- #git_wrappermode => '06755',
- # git pre-receive hook to generate
- #git_test_receive_wrapper => '/git/wiki.git/hooks/pre-receive',
- # unix users whose commits should be checked by the pre-receive hook
- #untrusted_committers => [],
- # gitweb url to show file history ([[file]] substituted)
- historyurl => '/cgit/cgit.cgi/wiki/log/[[file]]',
- # gitweb url to show a diff ([[file]], [[sha1_to]], [[sha1_from]], [[sha1_commit]], and [[sha1_parent]] substituted)
- diffurl => '/cgit/cgit.cgi/wiki/diff/?id=[[sha1_commit]]',
- # where to pull and push changes (set to empty string to disable)
- #gitorigin_branch => 'origin',
- # branch that the wiki is stored in
- #gitmaster_branch => 'master',
-
# htmlscrubber plugin
# PageSpec specifying pages not to scrub
#htmlscrubber_skip => '!*/Discussion',
+ htmlscrubber_skip => 'calendar',
# inline plugin
# enable rss feeds by default?
# lockedit plugin
# PageSpec controlling which pages are locked
#locked_pages => '!*/Discussion',
+ locked_pages => 'calendar',
# mdwn plugin
# enable multimarkdown features?
#multimarkdown => 0,
- # mercurial plugin
- # mercurial post-commit hook to generate
- #mercurial_wrapper => '',
- # mode for mercurial_wrapper (can safely be made suid)
- #mercurial_wrappermode => '06755',
- # url to hg serve'd repository, to show file history ([[file]] substituted)
- #historyurl => 'http://example.com:8000/log/tip/[[file]]',
- # url to hg serve'd repository, to show diff ([[file]] and [[r2]] substituted)
- #diffurl => 'http://localhost:8000/?fd=[[r2]];file=[[file]]',
-
# mirrorlist plugin
# list of mirrors
#mirrorlist => {},
# path to the omega cgi program
#omega_cgi => '/usr/lib/cgi-bin/omega/omega',
- # svn plugin
- # subversion repository location
- #svnrepo => '/svn/wiki',
- # path inside repository where the wiki is located
- #svnpath => 'trunk',
- # svn post-commit hook to generate
- #svn_wrapper => '/svn/wikirepo/hooks/post-commit',
- # mode for svn_wrapper (can safely be made suid)
- #svn_wrappermode => '04755',
- # viewvc url to show file history ([[file]] substituted)
- #historyurl => 'http://svn.example.org/trunk/[[file]]',
- # viewvc url to show a diff ([[file]], [[r1]], and [[r2]] substituted)
- #diffurl => 'http://svn.example.org/trunk/[[file]]?root=wiki&r1=[[r1]]&r2=[[r2]]',
-
# tag plugin
# parent page tags are located under
#tagbase => 'tag',
# LaTeX postfix for teximg plugin
#teximg_postfix => '\\end{document}',
- # tla plugin
- # tla post-commit hook to generate
- #tla_wrapper => '',
- # mode for tla_wrapper (can safely be made suid)
- #tla_wrappermode => '06755',
- # url to show file history ([[file]] substituted)
- #historyurl => '',
- # url to show a diff ([[file]] and [[rev]] substituted)
- #diffurl => '',
-
# websetup plugin
# list of plugins that cannot be enabled/disabled via the web interface
#websetup_force_plugins => [],
# show unsafe settings, read-only, in web interface?
#websetup_show_unsafe => 1,
+);
+
+if ($ENV{"IKIWIKI_PREVIEW_OUTPUT"}) {
+
+ my $self_path = $IkiWiki::config{'setupfile'};
+ use File::Basename;
+ my $git_root = dirname($self_path);
+ use File::Spec::Functions;
+
+ %setup_args = (
+ %common_setup_args,
+ srcdir => catdir($git_root, "wiki"),
+ destdir => $ENV{"IKIWIKI_PREVIEW_OUTPUT"},
+ url => 'http://sipb.mit.edu',
+ templatedir => catdir($ENV{"IKIWIKI_SHARE"}, 'templates'),
+ underlaydir => catdir($ENV{"IKIWIKI_SHARE"}, 'basewiki'),
+ );
+} else {
+%setup_args = (
+ %common_setup_args,
+ # where the source of the wiki is located
+ srcdir => '/afs/sipb.mit.edu/project/sipb-www/ikiwiki/src',
+ # where to build the wiki
+ destdir => '/afs/sipb.mit.edu/project/sipb-www/Scripts/wiki',
+ # base url to the wiki
+ url => 'http://sipb.mit.edu',
+ # url to the ikiwiki.cgi
+ cgiurl => 'https://sipb.mit.edu:444/ikiwiki.cgi',
+ # filename of cgi wrapper to generate
+ cgi_wrapper => '/afs/sipb.mit.edu/project/sipb-www/Scripts/wiki-cgi/ikiwiki.cgi',
+ # mode for cgi_wrapper (can safely be made suid)
+ cgi_wrappermode => '06755',
+ # rcs backend to use
+ rcs => 'git',
+ # location of template files
+ templatedir => '/mit/sipb-www/share/ikiwiki/templates',
+ # base wiki source location
+ underlaydir => '/mit/sipb-www/share/ikiwiki/basewiki',
+
+ # git plugin
+ # git hook to generate
+ git_wrapper => '/mit/sipb-www/wiki.git/hooks/post-update-wiki',
+ # mode for git_wrapper (can safely be made suid)
+ #git_wrappermode => '06755',
+ # git pre-receive hook to generate
+ #git_test_receive_wrapper => '/git/wiki.git/hooks/pre-receive',
+ # unix users whose commits should be checked by the pre-receive hook
+ #untrusted_committers => [],
+ # gitweb url to show file history ([[file]] substituted)
+ historyurl => '/cgit/cgit.cgi/wiki/log/[[file]]',
+ # gitweb url to show a diff ([[file]], [[sha1_to]], [[sha1_from]], [[sha1_commit]], and [[sha1_parent]] substituted)
+ diffurl => '/cgit/cgit.cgi/wiki/diff/?id=[[sha1_commit]]',
+ # where to pull and push changes (set to empty string to disable)
+ #gitorigin_branch => 'origin',
+ # branch that the wiki is stored in
+ #gitmaster_branch => 'master',
+);
}
+}
+
+use IkiWiki::Setup::Standard \%setup_args;