Skip to content

Commit

Permalink
Provide myconfig.pl script for user customization
Browse files Browse the repository at this point in the history
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
jandubois committed Nov 30, 2011
1 parent 04da174 commit 26871a3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
9 changes: 9 additions & 0 deletions myconfig.pl
Original file line number Diff line number Diff line change
@@ -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',
);
14 changes: 8 additions & 6 deletions setup.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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;
Expand Down

0 comments on commit 26871a3

Please sign in to comment.