summaryrefslogtreecommitdiff
path: root/auto.setup
blob: 74879dbc51047fb66db08027cf02e9f8a2c1d737 (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 $rcs=IkiWiki::Setup::Automator::ask(
  16. gettext("What revision control system to use?"), "git");
  17. our $admin=IkiWiki::Setup::Automator::ask(
  18. gettext("What wiki user (or openid) will be wiki admin?"), $ENV{USER});
  19. use Net::Domain q{hostfqdn};
  20. our $domain=hostfqdn() || ikiwiki::setup::automator::ask(
  21. gettext("What is the domain name of the web server?"), "");
  22. IkiWiki::Setup::Automator->import(
  23. wikiname => $wikiname,
  24. adminuser => [$admin],
  25. rcs => $rcs,
  26. srcdir => "$ENV{HOME}/$wikiname",
  27. destdir => "$ENV{HOME}/public_html/$wikiname",
  28. repository => "$ENV{HOME}/$wikiname.$rcs",
  29. dumpsetup => "$ENV{HOME}/$wikiname.setup",
  30. url => "http://$domain/~$ENV{USER}/$wikiname",
  31. cgiurl => "http://$domain/~$ENV{USER}/$wikiname/ikiwiki.cgi",
  32. cgi_wrapper => "$ENV{HOME}/public_html/$wikiname/ikiwiki.cgi",
  33. adminemail => "$ENV{USER}\@$domain",
  34. add_plugins => [qw{goodstuff websetup}],
  35. disable_plugins => [qw{}],
  36. libdir => "$ENV{HOME}/.ikiwiki",
  37. rss => 1,
  38. atom => 1,
  39. syslog => 1,
  40. prefix_directives => 1,
  41. hardlink => 1,
  42. )