summaryrefslogtreecommitdiff
path: root/auto-blog.setup
blob: 0eb83ded614a2b4e2b2397bf8d2db897984317db (plain)
  1. #!/usr/bin/perl
  2. # Ikiwiki setup automator -- blog version.
  3. #
  4. # This setup file causes ikiwiki to create a wiki, containing a blog,
  5. # check it into revision control, generate a setup file for the new
  6. # wiki, and set everything up.
  7. #
  8. # Just run: ikiwiki -setup /etc/ikiwiki/auto-blog.setup
  9. #
  10. # By default, it asks a few questions, and confines itself to the user's home
  11. # directory. You can edit it to change what it asks questions about, or to
  12. # modify the values to use site-specific settings.
  13. require IkiWiki::Setup::Automator;
  14. our $wikiname=IkiWiki::Setup::Automator::ask(
  15. gettext("What will the blog be named?"), gettext("blog"));
  16. our $wikiname_short=IkiWiki::Setup::Automator::sanitize_wikiname($wikiname);
  17. our $rcs=IkiWiki::Setup::Automator::ask(
  18. gettext("What revision control system to use?"), "git");
  19. our $admin=IkiWiki::Setup::Automator::ask(
  20. gettext("What wiki user (or openid) will be admin?"), $ENV{USER});
  21. use Net::Domain q{hostfqdn};
  22. our $domain=hostfqdn() || IkiWiki::Setup::Automator::ask(
  23. gettext("What is the domain name of the web server?"), "");
  24. IkiWiki::Setup::Automator->import(
  25. wikiname => $wikiname,
  26. adminuser => [$admin],
  27. rcs => $rcs,
  28. srcdir => "$ENV{HOME}/$wikiname_short",
  29. destdir => "$ENV{HOME}/public_html/$wikiname_short",
  30. repository => "$ENV{HOME}/$wikiname_short.".($rcs eq "monotone" ? "mtn" : $rcs),
  31. dumpsetup => "$ENV{HOME}/$wikiname_short.setup",
  32. url => "http://$domain/~$ENV{USER}/$wikiname_short",
  33. cgiurl => "http://$domain/~$ENV{USER}/$wikiname_short/ikiwiki.cgi",
  34. cgi_wrapper => "$ENV{HOME}/public_html/$wikiname_short/ikiwiki.cgi",
  35. adminemail => "$ENV{USER}\@$domain",
  36. add_plugins => [qw{goodstuff websetup comments blogspam calendar sidebar}],
  37. disable_plugins => [qw{}],
  38. libdir => "$ENV{HOME}/.ikiwiki",
  39. rss => 1,
  40. atom => 1,
  41. syslog => 1,
  42. example => "blog",
  43. comments_pagespec => "posts/* and !*/Discussion",
  44. blogspam_pagespec => "postcomment(*)",
  45. archive_pagespec => "page(posts/*) and !*/Discussion",
  46. global_sidebars => 0,
  47. discussion => 0,
  48. locked_pages => "* and !postcomment(*)",
  49. tagbase => "tags",
  50. )