Permalink
Browse files

Provide myconfig.pl script for user customization

This is slightly safer than asking users to modify the setup.pl
script, which contains a bunch of unrelated code that should not
be modified.
  • Loading branch information...
1 parent 04da174 commit 26871a311445a715c5a28fbe30ba9f8e165e0b8a @jandubois jandubois committed Nov 30, 2011
Showing with 17 additions and 6 deletions.
  1. +9 −0 myconfig.pl
  2. +8 −6 setup.pl
View
@@ -0,0 +1,9 @@
+# Sample Bugzilla configuration
+%answer = (
+ ADMIN_EMAIL => 'admin@stackato.local',
+ ADMIN_PASSWORD => 'changeme',
+ ADMIN_REALNAME => 'Sample Admin',
+ mailfrom => "bugzilla-daemon\@stackato.local",
+ smtpserver => "stackato.local",
+ urlbase => 'http://bugzilla.stackato.local',
+);
View
@@ -56,10 +56,10 @@
# Create an "answer" file for checksetup.pl to configure MySQL
# and to setup the initial administrator account.
-my %answer = (
- ADMIN_EMAIL => 'admin@example.com',
- ADMIN_PASSWORD => 'changeme',
- ADMIN_REALNAME => 'Sample Admin',
+our %answer;
+do '../myconfig.pl';
+
+%answer = (
NO_PAUSE => 1,
db_driver => 'mysql',
db_host => $cred{host},
@@ -70,10 +70,12 @@
webservergroup => 'stackato',
mail_delivery_method => 'SMTP',
- mailfrom => "bugzilla-daemon\@example.com",
- smtpserver => "smtp.example.com",
+ %answer
);
+# Make sure urlbase ends with a slash
+$answer{urlbase} =~ s,(.*[^/])$,$1/,;
+
my $answer = "checksetup.answer";
open my $fh, ">", $answer or die "Can't write '$answer': $!";
print $fh qq(\$answer{$_} = "\Q$answer{$_}\E";\n) for sort keys %answer;

0 comments on commit 26871a3

Please sign in to comment.