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