1
<!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.1//EN"> -->
2
<chapter id="administration">
3
<title>Administering Bugzilla</title>
5
<section id="parameters">
6
<title>Bugzilla Configuration</title>
8
<para>Bugzilla is configured by changing various parameters, accessed
9
from the "Edit parameters" link in the page footer. Here are
10
some of the key parameters on that page. You should run down this
11
list and set them appropriately after installing Bugzilla.</para>
14
<primary>checklist</primary>
20
<command>maintainer</command>:
21
The maintainer parameter is the email address of the person
22
responsible for maintaining this
23
Bugzilla installation. The address need not be that of a valid Bugzilla
29
<command>urlbase</command>:
30
This parameter defines the fully qualified domain name and web
31
server path to your Bugzilla installation.</para>
33
<para>For example, if your Bugzilla query page is
34
<filename>http://www.foo.com/bugzilla/query.cgi</filename>,
35
set your <quote>urlbase</quote>
36
to <filename>http://www.foo.com/bugzilla/</filename>.</para>
41
<command>usebuggroups</command>:
42
This dictates whether or not to implement group-based security for
43
Bugzilla. If set, Bugzilla bugs can have an associated 'group',
44
defining which users are allowed to see and edit the
47
<para>Set "usebuggroups" to "on"
48
<emphasis>only</emphasis>
49
if you may wish to restrict access to particular bugs to certain
50
groups of users. I suggest leaving
51
this parameter <emphasis>off</emphasis>
52
while initially testing your Bugzilla.</para>
57
<command>usebuggroupsentry</command>:
58
Bugzilla Products can have a group associated with them, so that
59
certain users can only see bugs in certain products. When this parameter
60
is set to <quote>on</quote>, this places all newly-created bugs in the
61
group for their product immediately.</para>
66
<command>shadowdb</command>:
67
You run into an interesting problem when Bugzilla reaches a
68
high level of continuous activity. MySQL supports only table-level
69
write locking. What this means is that if someone needs to make a
70
change to a bug, they will lock the entire table until the operation
71
is complete. Locking for write also blocks reads until the write is
73
<quote>shadowdb</quote>
74
parameter was designed to get around this limitation. While only a
75
single user is allowed to write to a table at a time, reads can
76
continue unimpeded on a read-only shadow copy of the database.
77
Although your database size will double, a shadow database can cause
78
an enormous performance improvement when implemented on extremely
79
high-traffic Bugzilla databases.</para>
82
As a guide, mozilla.org began needing
83
<quote>shadowdb</quote>
84
when they reached around 40,000 Bugzilla users with several hundred
85
Bugzilla bug changes and comments per day.</para>
87
<para>The value of the parameter defines the name of the
89
Set "shadowdb" to e.g. "bug_shadowdb" if you will be running a
90
*very* large installation of Bugzilla.
92
<para>Enabling "shadowdb" can adversely affect the stability of
93
your installation of Bugzilla. You should regularly check that your
94
database is in sync. It is often advisable to force a shadow
95
database sync nightly via
101
<para>If you use the "shadowdb" option, it is only natural that you
102
should turn the "queryagainstshadowdb" option on as well. Otherwise
103
you are replicating data into a shadow database for no reason!</para>
109
<command>shutdownhtml</command>:
111
If you need to shut down Bugzilla to perform administration, enter
112
some descriptive HTML here and anyone who tries to use Bugzilla will
113
receive a page to that effect. Obviously, editparams.cgi will
114
still be accessible so you can remove the HTML and re-enable Bugzilla.
121
<command>passwordmail</command>:
123
Every time a user creates an account, the text of
124
this parameter (with substitutions) is sent to the new user along with
125
their password message.</para>
127
<para>Add any text you wish to the "passwordmail" parameter box. For
128
instance, many people choose to use this box to give a quick training
129
blurb about how to use Bugzilla at your site.</para>
134
<command>useqacontact</command>:
136
This allows you to define an email address for each component, in
138
to that of the default owner, who will be sent carbon copies of
139
incoming bugs.</para>
143
<command>usestatuswhiteboard</command>:
144
This defines whether you wish to have a free-form, overwritable field
145
associated with each bug. The advantage of the Status Whiteboard is
146
that it can be deleted or modified with ease, and provides an
147
easily-searchable field for indexing some bugs that have some trait
154
<command>whinedays</command>:
155
Set this to the number of days you want to let bugs go
156
in the NEW or REOPENED state before notifying people they have
157
untouched new bugs. If you do not plan to use this feature, simply do
158
not set up the whining cron job described in the installation
159
instructions, or set this value to "0" (never whine).</para>
164
<command>commenton*</command>:
166
fields allow you to dictate what changes can pass without comment,
167
and which must have a comment from the person who changed them.
168
Often, administrators will allow users to add themselves to the CC
169
list, accept bugs, or change the Status Whiteboard without adding a
170
comment as to their reasons for the change, yet require that most
171
other changes come with an explanation.</para>
173
<para>Set the "commenton" options according to your site policy. It
174
is a wise idea to require comments when users resolve, reassign, or
175
reopen bugs at the very least.
177
<para>It is generally far better to require a developer comment
178
when resolving bugs than not. Few things are more annoying to bug
179
database users than having a developer mark a bug "fixed" without
180
any comment as to what the fix was (or even that it was truly
188
<command>supportwatchers</command>:
190
Turning on this option allows users to ask to receive copies of
191
all a particular other user's bug email. This is, of
192
course, subject to the groupset restrictions on the bug; if the
193
<quote>watcher</quote>
194
would not normally be allowed to view a bug, the watcher cannot get
195
around the system by setting herself up to watch the bugs of someone
196
with bugs outside her privileges. They would still only receive email
197
updates for those bugs she could normally view.</para>
202
<section id="useradmin">
203
<title>User Administration</title>
205
<section id="defaultuser">
206
<title>Creating the Default User</title>
208
<para>When you first run checksetup.pl after installing Bugzilla, it
209
will prompt you for the administrative username (email address) and
210
password for this "super user". If for some reason you delete
211
the "super user" account, re-running checksetup.pl will again prompt
212
you for this username and password.</para>
215
<para>If you wish to add more administrative users, you must use the
216
MySQL interface. Run "mysql" from the command line, and use these
220
<prompt>mysql></prompt>
221
<command>use bugs;</command>
225
<prompt>mysql></prompt>
228
update profiles set groupset=0x7fffffffffffffff where login_name =
229
"(user's login name)";
236
<emphasis>fifteen</emphasis>
240
's. A whole lot of f-ing going on if you want to create a new
245
<section id="manageusers">
246
<title>Managing Other Users</title>
248
<section id="createnewusers">
249
<title>Creating new users</title>
251
<para>Your users can create their own user accounts by clicking the
252
"New Account" link at the bottom of each page (assuming they
253
aren't logged in as someone else already.) However, should you
254
desire to create user accounts ahead of time, here is how you do
259
<para>After logging in, click the "Users" link at the footer of
260
the query page, and then click "Add a new user".</para>
264
<para>Fill out the form presented. This page is self-explanatory.
265
When done, click "Submit".</para>
268
<para>Adding a user this way will
269
<emphasis>not</emphasis>
271
send an email informing them of their username and password.
272
While useful for creating dummy accounts (watchers which
273
shuttle mail to another system, for instance, or email
274
addresses which are a mailing list), in general it is
275
preferable to log out and use the
276
<quote>New Account</quote>
278
button to create users, as it will pre-populate all the
279
required fields and also notify the user of her account name
286
<section id="modifyusers">
287
<title>Modifying Users</title>
289
<para>To see a specific user, search for their login name
290
in the box provided on the "Edit Users" page. To see all users,
291
leave the box blank.</para>
293
<para>You can search in different ways the listbox to the right
294
of the text entry box. You can match by
295
case-insensitive substring (the default),
296
regular expression, or a
297
<emphasis>reverse</emphasis>
298
regular expression match, which finds every user name which does NOT
299
match the regular expression. (Please see
300
the <command>man regexp</command>
301
manual page for details on regular expression syntax.)
304
<para>Once you have found your user, you can change the following
310
<emphasis>Login Name</emphasis>:
311
This is generally the user's full email address. However, if you
312
have are using the emailsuffix Param, this may just be the user's
313
login name. Note that users can now change their login names
314
themselves (to any valid email address.)
320
<emphasis>Real Name</emphasis>: The user's real name. Note that
321
Bugzilla does not require this to create an account.</para>
326
<emphasis>Password</emphasis>:
327
You can change the user's password here. Users can automatically
328
request a new password, so you shouldn't need to do this often.
329
If you want to disable an account, see Disable Text below.
335
<emphasis>Disable Text</emphasis>:
336
If you type anything in this box, including just a space, the
337
user is prevented from logging in, or making any changes to
338
bugs via the web interface.
339
The HTML you type in this box is presented to the user when
340
they attempt to perform these actions, and should explain
341
why the account was disabled.
343
<para>Don't disable the administrator account!</para>
347
<para>The user can still submit bugs via
348
the e-mail gateway, if you set it up, even if the disabled text
349
field is filled in. The e-mail gateway should
350
<emphasis>not</emphasis>
351
be enabled for secure installations of Bugzilla.</para>
358
<emphasis><groupname></emphasis>:
359
If you have created some groups, e.g. "securitysensitive", then
360
checkboxes will appear here to allow you to add users to, or
361
remove them from, these groups.
367
<emphasis>canconfirm</emphasis>:
368
This field is only used if you have enabled the "unconfirmed"
369
status. If you enable this for a user,
370
that user can then move bugs from "Unconfirmed" to a "Confirmed"
371
status (e.g.: "New" status).</para>
376
<emphasis>creategroups</emphasis>:
377
This option will allow a user to create and destroy groups in
383
<emphasis>editbugs</emphasis>:
384
Unless a user has this bit set, they can only edit those bugs
385
for which they are the assignee or the reporter. Even if this
386
option is unchecked, users can still add comments to bugs.
392
<emphasis>editcomponents</emphasis>:
393
This flag allows a user to create new products and components,
394
as well as modify and destroy those that have no bugs associated
395
with them. If a product or component has bugs associated with it,
396
those bugs must be moved to a different product or component
397
before Bugzilla will allow them to be destroyed.
403
<emphasis>editkeywords</emphasis>:
404
If you use Bugzilla's keyword functionality, enabling this
405
feature allows a user to create and destroy keywords. As always,
406
the keywords for existing bugs containing the keyword the user
407
wishes to destroy must be changed before Bugzilla will allow it
413
<emphasis>editusers</emphasis>:
414
This flag allows a user to do what you're doing right now: edit
415
other users. This will allow those with the right to do so to
416
remove administrator privileges from other users or grant them to
417
themselves. Enable with care.</para>
423
<emphasis>tweakparams</emphasis>:
424
This flag allows a user to change Bugzilla's Params
425
(using <filename>editparams.cgi</filename>.)</para>
430
<emphasis><productname></emphasis>:
431
This allows an administrator to specify the products in which
432
a user can see bugs. The user must still have the
433
"editbugs" privilege to edit bugs in these products.</para>
440
<section id="programadmin">
441
<title>Product, Component, Milestone, and Version Administration</title>
443
<section id="products">
444
<title>Products</title>
447
<glossterm linkend="gloss-product" baseform="product">
450
are the broadest category in Bugzilla, and tend to represent real-world
451
shipping products. E.g. if your company makes computer games,
452
you should have one product per game, perhaps a "Common" product for
453
units of technology used in multiple games, and maybe a few special
454
products (Website, Administration...)</para>
456
<para>Many of Bugzilla's settings are configurable on a per-product
457
basis. The number of "votes" available to users is set per-product,
458
as is the number of votes
459
required to move a bug automatically from the UNCONFIRMED status to the
462
<para>To create a new product:</para>
466
<para>Select "products" from the footer</para>
471
<para>Select the "Add" link in the bottom right</para>
475
<para>Enter the name of the product and a description. The
476
Description field may contain HTML.</para>
480
<para>Don't worry about the "Closed for bug entry", "Maximum Votes
481
per person", "Maximum votes a person can put on a single bug",
482
"Number of votes a bug in this Product needs to automatically get out
483
of the UNCOMFIRMED state", and "Version" options yet. We'll cover
484
those in a few moments.
488
<section id="components">
489
<title>Components</title>
491
<para>Components are subsections of a Product. E.g. the computer game
492
you are designing may have a "UI"
493
component, an "API" component, a "Sound System" component, and a
494
"Plugins" component, each overseen by a different programmer. It
495
often makes sense to divide Components in Bugzilla according to the
496
natural divisions of responsibility within your Product or
500
Each component has a owner and (if you turned it on in the parameters),
501
a QA Contact. The owner should be the primary person who fixes bugs in
502
that component. The QA Contact should be the person who will ensure
503
these bugs are completely fixed. The Owner, QA Contact, and Reporter
504
will get email when new bugs are created in this Component and when
505
these bugs change. Default Owner and Default QA Contact fields only
507
<emphasis>default assignments</emphasis>;
508
these can be changed on bug submission, or at any later point in
511
<para>To create a new Component:</para>
515
<para>Select the "Edit components" link from the "Edit product"
520
<para>Select the "Add" link in the bottom right.</para>
524
<para>Fill out the "Component" field, a short "Description",
525
the "Initial Owner" and "Initial QA Contact" (if enabled.)
526
The Component and Description fields may contain HTML;
527
the "Initial Owner" field must be a login name
528
already existing in the database.
534
<section id="versions">
535
<title>Versions</title>
537
<para>Versions are the revisions of the product, such as "Flinders
538
3.1", "Flinders 95", and "Flinders 2000". Version is not a multi-select
539
field; the usual practice is to select the most recent version with
543
<para>To create and edit Versions:</para>
547
<para>From the "Edit product" screen, select "Edit Versions"</para>
551
<para>You will notice that the product already has the default
552
version "undefined". Click the "Add" link in the bottom right.</para>
556
<para>Enter the name of the Version. This field takes text only.
557
Then click the "Add" button.</para>
563
<section id="milestones">
564
<title>Milestones</title>
566
<para>Milestones are "targets" that you plan to get a bug fixed by. For
567
example, you have a bug that you plan to fix for your 3.0 release, it
568
would be assigned the milestone of 3.0.</para>
571
<para>Milestone options will only appear for a Product if you turned
572
on the "usetargetmilestone" Param in the "Edit Parameters" screen.
576
<para>To create new Milestones, set Default Milestones, and set
577
Milestone URL:</para>
581
<para>Select "Edit milestones" from the "Edit product" page.</para>
585
<para>Select "Add" in the bottom right corner.
590
<para>Enter the name of the Milestone in the "Milestone" field. You
591
can optionally set the "sortkey", which is a positive or negative
592
number (-255 to 255) that defines where in the list this particular
593
milestone appears. This is because milestones often do not
594
occur in alphanumeric order For example, "Future" might be
595
after "Release 1.2". Select "Add".</para>
599
<para>From the Edit product screen, you can enter the URL of a
600
page which gives information about your milestones and what
604
<para>If you want your milestone document to be restricted so
605
that it can only be viewed by people in a particular Bugzilla
606
group, the best way is to attach the document to a bug in that
607
group, and make the URL the URL of that attachment.</para>
614
<section id="voting">
615
<title>Voting</title>
617
<para>Voting allows users to be given a pot of votes which they can allocate
618
to bugs, to indicate that they'd like them fixed.
619
This allows developers to gauge
620
user need for a particular enhancement or bugfix. By allowing bugs with
621
a certain number of votes to automatically move from "UNCONFIRMED" to
622
"NEW", users of the bug system can help high-priority bugs garner
623
attention so they don't sit for a long time awaiting triage.</para>
625
<para>To modify Voting settings:</para>
629
<para>Navigate to the "Edit product" screen for the Product you
630
wish to modify</para>
634
<para><emphasis>Maximum Votes per person</emphasis>:
635
Setting this field to "0" disables voting.</para>
639
<para><emphasis>Maximum Votes a person can put on a single
641
It should probably be some number lower than the
642
"Maximum votes per person". Don't set this field to "0" if
643
"Maximum votes per person" is non-zero; that doesn't make
648
<para><emphasis>Number of votes a bug in this product needs to
649
automatically get out of the UNCONFIRMED state</emphasis>:
650
Setting this field to "0" disables the automatic move of
651
bugs from UNCONFIRMED to NEW.
656
<para>Once you have adjusted the values to your preference, click
662
<section id="groups">
663
<title>Groups and Group Security</title>
665
<para>Groups allow the administrator
666
to isolate bugs or products that should only be seen by certain people.
667
There are two types of group - Generic Groups, and Product-Based Groups.
671
Product-Based Groups are matched with products, and allow you to restrict
672
access to bugs on a per-product basis. They are enabled using the
673
usebuggroups Param. Turning on the usebuggroupsentry
674
Param will mean bugs automatically get added to their product group when
679
Generic Groups have no special relationship to products;
680
you create them, and put bugs in them
681
as required. One example of the use of Generic Groups
682
is Mozilla's "Security" group,
683
into which security-sensitive bugs are placed until fixed. Only the
684
Mozilla Security Team are members of this group.
687
<para>To create Generic Groups:</para>
691
<para>Select the "groups"
692
link in the footer.</para>
696
<para>Take a moment to understand the instructions on the "Edit
697
Groups" screen, then select the "Add Group" link.</para>
701
<para>Fill out the "New Name", "New Description", and
702
"New User RegExp" fields. "New User RegExp" allows you to automatically
703
place all users who fulfill the Regular Expression into the new group.
704
When you have finished, click "Add".</para>
708
<para>To use Product-Based Groups:</para>
712
<para>Turn on "usebuggroups" and "usebuggroupsentry" in the "Edit
713
Parameters" screen.</para>
716
<para>XXX is this still true?
717
"usebuggroupsentry" has the capacity to prevent the
718
administrative user from directly altering bugs because of
719
conflicting group permissions. If you plan on using
720
"usebuggroupsentry", you should plan on restricting
721
administrative account usage to administrative duties only. In
722
other words, manage bugs with an unpriveleged user account, and
723
manage users, groups, Products, etc. with the administrative
729
<para>In future, when you create a Product, a matching group will be
730
automatically created. If you need to add a Product Group to
731
a Product which was created before you turned on usebuggroups,
732
then simply create a new group, as outlined above, with the
733
same name as the Product.</para>
738
<para>Bugzilla currently has a limit of 64 groups per installation. If
739
you have more than about 50 products, you should consider
740
running multiple Bugzillas. Ask in the newsgroup for other
741
suggestions for working around this restriction.</para>
745
Note that group permissions are such that you need to be a member
746
of <emphasis>all</emphasis> the groups a bug is in, for whatever
747
reason, to see that bug.
751
<section id="security">
752
<title>Bugzilla Security</title>
755
<para>Poorly-configured MySQL and Bugzilla installations have
756
given attackers full access to systems in the past. Please take these
757
guidelines seriously, even for Bugzilla machines hidden away behind
758
your firewall. 80% of all computer trespassers are insiders, not
759
anonymous crackers.</para>
763
<para>These instructions must, of necessity, be somewhat vague since
764
Bugzilla runs on so many different platforms. If you have refinements
765
of these directions, please submit a bug to &bzg-bugs;.
770
<para>This is not meant to be a comprehensive list of every possible
771
security issue regarding the tools mentioned in this section. There is
772
no subsitute for reading the information written by the authors of any
773
software running on your system.
777
<section id="security-networking">
778
<title>TCP/IP Ports</title>
780
<!-- TODO: Make this make sense (TCP/IP) -->
781
<para>TCP/IP defines 65,000 some ports for trafic. Of those, Bugzilla
782
only needs 1... 2 if you need to use features that require e-mail such
783
as bug moving or the e-mail interface from contrib. You should audit
784
your server and make sure that you aren't listening on any ports you
785
don't need to be. You may also wish to use some kind of firewall
786
software to be sure that trafic can only be recieved on ports you
791
<section id="security-mysql">
794
<para>MySQL ships by default with many settings that should be changed.
795
By defaults it allows anybody to connect from localhost without a
796
password and have full administrative capabilities. It also defaults to
797
not have a root password (this is <emphasis>not</emphasis> the same as
798
the system root). Also, many installations default to running
799
<application>mysqld</application> as the system root.
804
<para>Make sure you are running at least version 3.22.32 of MySQL
805
as earlier versions had notable security holes.
810
<para>Consult the documentation that came with your system for
811
information on making <application>mysqld</application> run as an
817
<para>You should also be sure to disable the anonymous user account
818
and set a password for the root user. This is accomplished using the
822
<prompt>bash$</prompt> mysql mysql
823
<prompt>mysql></prompt> DELETE FROM user WHERE user = '';
824
<prompt>mysql></prompt> UPDATE user SET password = password('<replaceable>new_password</replaceable>') WHERE user = 'root';
825
<prompt>mysql></prompt> FLUSH PRIVILEGES;
827
<para>From this point forward you will need to use
828
<command>mysql -u root -p</command> and enter
829
<replaceable>new_password</replaceable> when prompted when using the
835
<para>If you run MySQL on the same machine as your httpd server, you
836
should consider disabling networking from within MySQL by adding
837
the following to your <filename>/etc/my.conf</filename>:
841
# Prevent network access to MySQL.
847
<para>You may also consider running MySQL, or even all of Bugzilla
848
in a chroot jail; however, instructions for doing that are beyond
849
the scope of this document.
857
<section id="security-daemon">
858
<title>Daemon Accounts</title>
860
<para>Many daemons, such as Apache's httpd and MySQL's mysqld default to
861
running as either <quote>root</quote> or <quote>nobody</quote>. Running
862
as <quote>root</quote> introduces obvious security problems, but the
863
problems introduced by running everything as <quote>nobody</quote> may
864
not be so obvious. Basically, if you're running every daemon as
865
<quote>nobody</quote> and one of them gets comprimised, they all get
866
comprimised. For this reason it is recommended that you create a user
867
account for each daemon.
871
<para>You will need to set the <varname>webservergroup</varname> to
872
the group you created for your webserver to run as in
873
<filename>localconfig</filename>. This will allow
874
<command>./checksetup.pl</command> to better adjust the file
875
permissions on your Bugzilla install so as to not require making
876
anything world-writable.
882
<section id="security-access">
883
<title>Web Server Access Controls</title>
885
<para>There are many files that are placed in the Bugzilla directory
886
area that should not be accessable from the web. Because of the way
887
Bugzilla is currently layed out, the list of what should and should
888
not be accessible is rather complicated. A new installation method
889
is currently in the works which should solve this by allowing files
890
that shouldn't be accessible from the web to be placed in directory
891
outside the webroot. See
892
<ulink url="http://bugzilla.mozilla.org/show_bug.cgi?id=44659">bug
893
44659</ulink> for more information.
896
<itemizedlist spacing="compact">
898
<para>In the main Bugzilla directory, you should:</para>
899
<itemizedlist spacing="compact">
902
<simplelist type="inline">
903
<member><filename>*.pl</filename></member>
904
<member><filename>*localconfig*</filename></member>
905
<member><filename>runtests.sh</filename></member>
906
<member><filename>processmail</filename></member>
907
<member><filename>syncshadowdb</filename></member>
913
<simplelist type="inline">
914
<member><filename>localconfig.js</filename></member>
915
<member><filename>localconfig.rdf</filename></member>
923
<para>In <filename class="directory">data</filename>:</para>
924
<itemizedlist spacing="compact">
926
<para>Block everything</para>
930
<simplelist type="inline">
931
<member><filename>duplicates.rdf</filename></member>
939
<para>In <filename class="directory">data/webdot</filename>:</para>
940
<itemizedlist spacing="compact">
942
<para>If you use a remote webdot server:</para>
943
<itemizedlist spacing="compact">
945
<para>Block everything</para>
949
<simplelist type="inline">
950
<member><filename>*.dot</filename></member>
952
only for the remote webdot server</para>
957
<para>Otherwise, if you use a local GraphViz:</para>
958
<itemizedlist spacing="compact">
960
<para>Block everything</para>
964
<simplelist type="inline">
965
<member><filename>*.png</filename></member>
966
<member><filename>*.gif</filename></member>
967
<member><filename>*.jpg</filename></member>
968
<member><filename>*.map</filename></member>
975
<para>And if you don't use any dot:</para>
976
<itemizedlist spacing="compact">
978
<para>Block everything</para>
986
<para>In <filename class="directory">Bugzilla</filename>:</para>
987
<itemizedlist spacing="compact">
989
<para>Block everything</para>
995
<para>In <filename class="directory">template</filename>:</para>
996
<itemizedlist spacing="compact">
998
<para>Block everything</para>
1005
<para>Bugzilla ships with the ability to generate
1006
<filename>.htaccess</filename> files instructing Apache which files
1007
should and should not be accessible.
1011
<para>You should test to make sure that the files mentioned above are
1012
not accessible from the Internet, especially your
1013
<filename>localconfig</filename> file which contains your database
1014
password. To test, simply point your web browser at the file; for
1015
example, to test mozilla.org's installation, we'd try to access
1016
<ulink url="http://bugzilla.mozilla.org/localconfig"/>. You should
1017
get a <errorcode>403</errorcode> <errorname>Forbidden</errorname>
1022
<para>Not following the instructions in this section, including
1023
testing, may result in sensitive information being globally
1032
<section id="cust-templates">
1033
<title>Template Customisation</title>
1036
One of the large changes for 2.16 was the templatisation of the
1037
entire user-facing UI, using the
1038
<ulink url="http://www.template-toolkit.org">Template Toolkit</ulink>.
1039
Administrators can now configure the look and feel of Bugzilla without
1040
having to edit Perl files or face the nightmare of massive merge
1041
conflicts when they upgrade to a newer version in the future.
1045
Templatisation also makes localised versions of Bugzilla possible,
1046
for the first time. In the future, a Bugzilla installation may
1047
have templates installed for multiple localisations, and select
1048
which ones to use based on the user's browser language setting.
1052
<title>What to Edit</title>
1054
There are two different ways of editing of Bugzilla's templates,
1055
and which you use depends mainly on how you upgrade Bugzilla. The
1056
template directory structure is that there's a top level directory,
1057
<filename>template</filename>, which contains a directory for
1058
each installed localisation. The default English templates are
1059
therefore in <filename>en</filename>. Underneath that, there
1060
is the <filename>default</filename> directory and optionally the
1061
<filename>custom</filename> directory. The <filename>default</filename>
1062
directory contains all the templates shipped with Bugzilla, whereas
1063
the <filename>custom</filename> directory does not exist at first and
1064
must be created if you want to use it.
1068
The first method of making customisations is to directly edit the
1069
templates in <filename>template/en/default</filename>. This is
1070
probably the best method for small changes if you are going to use
1071
the CVS method of upgrading, because if you then execute a
1072
<command>cvs update</command>, any template fixes will get
1073
automagically merged into your modified versions.
1077
If you use this method, your installation will break if CVS conflicts
1082
The other method is to copy the templates into a mirrored directory
1083
structure under <filename>template/en/custom</filename>. The templates
1084
in this directory automatically override those in default.
1085
This is the technique you
1086
need to use if you use the overwriting method of upgrade, because
1087
otherwise your changes will be lost. This method is also better if
1088
you are using the CVS method of upgrading and are going to make major
1089
changes, because it is guaranteed that the contents of this directory
1090
will not be touched during an upgrade, and you can then decide whether
1091
to continue using your own templates, or make the effort to merge your
1092
changes into the new versions by hand.
1096
If you use this method, your installation may break if incompatible
1097
changes are made to the template interface. If such changes are made
1098
they will be documented in the release notes, provided you are using a
1099
stable release of Bugzilla. If you use using unstable code, you will
1100
need to deal with this one yourself, although if possible the changes
1101
will be mentioned before they occur in the deprecations section of the
1102
previous stable release's release notes.
1107
Don't directly edit the compiled templates in
1108
<filename class="directory">data/template/*</filename> - your
1109
changes will be lost when Template Toolkit recompiles them.
1114
<para>It is recommended that you run <command>./checksetup.pl</command>
1115
after any template edits, especially if you've created a new file in
1116
the <filename class="directory">custom</filename> directory.
1122
<title>How To Edit Templates</title>
1125
The syntax of the Template Toolkit language is beyond the scope of
1126
this guide. It's reasonably easy to pick up by looking at the current
1127
templates; or, you can read the manual, available on the
1128
<ulink url="http://www.template-toolkit.org">Template Toolkit home
1129
page</ulink>. However, you should particularly remember (for security
1130
reasons) to always HTML filter things which come from the database or
1131
user input, to prevent cross-site scripting attacks.
1135
However, one thing you should take particular care about is the need
1136
to properly HTML filter data that has been passed into the template.
1137
This means that if the data can possibly contain special HTML characters
1138
such as <, and the data was not intended to be HTML, they need to be
1139
converted to entity form, ie &lt;. You use the 'html' filter in the
1140
Template Toolkit to do this. If you fail to do this, you may open up
1141
your installation to cross-site scripting attacks.
1145
Also note that Bugzilla adds a few filters of its own, that are not
1146
in standard Template Toolkit. In particular, the 'url_quote' filter
1147
can convert characters that are illegal or have special meaning in URLs,
1148
such as &, to the encoded form, ie %26. This actually encodes most
1149
characters (but not the common ones such as letters and numbers and so
1150
on), including the HTML-special characters, so there's never a need to
1151
HTML filter afterwards.
1155
Editing templates is a good way of doing a "poor man's custom fields".
1156
For example, if you don't use the Status Whiteboard, but want to have
1157
a free-form text entry box for "Build Identifier", then you can just
1158
edit the templates to change the field labels. It's still be called
1159
status_whiteboard internally, but your users don't need to know that.
1164
If you are making template changes that you intend on submitting back
1165
for inclusion in standard Bugzilla, you should read the relevant
1167
<ulink url="http://www.bugzilla.org/developerguide.html">Developers'
1175
<title>Template Formats</title>
1178
Some CGIs have the ability to use more than one template. For
1179
example, buglist.cgi can output bug lists as RDF or two
1180
different forms of HTML (complex and simple). (Try this out
1181
by appending <filename>&format=simple</filename> to a buglist.cgi
1182
URL on your Bugzilla installation.) This
1183
mechanism, called template 'formats', is extensible.
1187
To see if a CGI supports multiple output formats, grep the
1188
CGI for "ValidateOutputFormat". If it's not present, adding
1189
multiple format support isn't too hard - see how it's done in
1194
To make a new format template for a CGI which supports this,
1195
open a current template for
1196
that CGI and take note of the INTERFACE comment (if present.) This
1197
comment defines what variables are passed into this template. If
1198
there isn't one, I'm afraid you'll have to read the template and
1199
the code to find out what information you get.
1203
Write your template in whatever markup or text style is appropriate.
1207
You now need to decide what content type you want your template
1208
served as. Open up the <filename>localconfig</filename> file and find the
1209
<filename>$contenttypes</filename>
1210
variable. If your content type is not there, add it. Remember
1211
the three- or four-letter tag assigned to you content type.
1212
This tag will be part of the template filename.
1216
Save the template as <filename><stubname>-<formatname>.<contenttypetag>.tmpl</filename>.
1217
Try out the template by calling the CGI as
1218
<filename><cginame>.cgi?format=<formatname></filename> .
1224
<title>Particular Templates</title>
1227
There are a few templates you may be particularly interested in
1228
customising for your installation.
1232
<command>index.html.tmpl</command>:
1233
This is the Bugzilla front page.
1237
<command>global/header.html.tmpl</command>:
1238
This defines the header that goes on all Bugzilla pages.
1239
The header includes the banner, which is what appears to users
1240
and is probably what you want to edit instead. However the
1241
header also includes the HTML HEAD section, so you could for
1242
example add a stylesheet or META tag by editing the header.
1246
<command>global/banner.html.tmpl</command>:
1247
This contains the "banner", the part of the header that appears
1248
at the top of all Bugzilla pages. The default banner is reasonably
1249
barren, so you'll probably want to customise this to give your
1250
installation a distinctive look and feel. It is recommended you
1251
preserve the Bugzilla version number in some form so the version
1252
you are running can be determined, and users know what docs to read.
1256
<command>global/footer.html.tmpl</command>:
1257
This defines the footer that goes on all Bugzilla pages. Editing
1258
this is another way to quickly get a distinctive look and feel for
1259
your Bugzilla installation.
1263
<command>bug/create/user-message.html.tmpl</command>:
1264
This is a message that appears near the top of the bug reporting page.
1265
By modifying this, you can tell your users how they should report
1270
<command>bug/create/create.html.tmpl</command> and
1271
<command>bug/create/comment.txt.tmpl</command>:
1272
You may wish to get bug submitters to give certain bits of structured
1273
information, each in a separate input widget, for which there is not a
1274
field in the database. The bug entry system has been designed in an
1275
extensible fashion to enable you to define arbitrary fields and widgets,
1276
and have their values appear formatted in the initial
1277
Description, rather than in database fields. An example of this
1279
<ulink url="http://bugzilla.mozilla.org/enter_bug.cgi?format=guided">guided
1280
bug submission form</ulink>.
1284
To make this work, create a custom template for
1285
<filename>enter_bug.cgi</filename> (the default template, on which you
1286
could base it, is <filename>create.html.tmpl</filename>),
1287
and either call it <filename>create.html.tmpl</filename> or use a format and
1288
call it <filename>create-<formatname>.html.tmpl</filename>.
1289
Put it in the <filename class="directory">custom/bug/create</filename>
1290
directory. In it, add widgets for each piece of information you'd like
1291
collected - such as a build number, or set of steps to reproduce.
1295
Then, create a template like
1296
<filename>custom/bug/create/comment.txt.tmpl</filename>, also named
1297
after your format if you are using one, which
1298
references the form fields you have created. When a bug report is
1299
submitted, the initial comment attached to the bug report will be
1300
formatted according to the layout of this template.
1304
For example, if your enter_bug template had a field
1305
<programlisting><input type="text" name="buildid" size="30"></programlisting>
1306
and then your comment.txt.tmpl had
1307
<programlisting>BuildID: [% form.buildid %]</programlisting>
1309
<programlisting>BuildID: 20020303</programlisting>
1310
would appear in the initial checkin comment.
1316
<section id="upgrading">
1317
<title>Upgrading to New Releases</title>
1319
<para>Upgrading Bugzilla is something we all want to do from time to time,
1320
be it to get new features or pick up the latest security fix. How easy
1321
it is to update depends on a few factors.
1326
<para>If the new version is a revision or a new point release</para>
1329
<para>How many, if any, local changes have been made</para>
1333
<para>There are also three different methods to upgrade your installation.
1338
<para>Using CVS (<xref linkend="upgrade-cvs"/>)</para>
1341
<para>Downloading a new tarball (<xref linkend="upgrade-tarball"/>)</para>
1344
<para>Applying the relevant patches (<xref linkend="upgrade-patches"/>)</para>
1348
<para>Which options are available to you may depend on how large a jump
1349
you are making and/or your network configuration.
1352
<para>Revisions are normally released to fix security vulnerabilities
1353
and are distinguished by an increase in the third number. For example,
1354
when 2.16.2 was released, it was a revision to 2.16.1.
1357
<para>Point releases are normally released when the Bugzilla team feels
1358
that there has been a significant amount of progress made between the
1359
last point release and the current time. These are often proceeded by a
1360
stabilization period and release candidates, however the use of
1361
development versions or release candidates is beyond the scope of this
1362
document. Point releases can be distinguished by an increase in the
1363
second number, or minor version. For example, 2.16.2 is a newer point
1364
release than 2.14.5.
1367
<para>The examples in this section are written as if you were updating
1368
to version 2.16.2. The procedures are the same regardless if you are
1369
updating to a new point release or a new revision. However, the chance
1370
of running into trouble increases when upgrading to a new point release,
1371
escpecially if you've made local changes.
1374
<para>These examples also assume that your Bugzilla installation is at
1375
<filename>/var/www/html/bugzilla</filename>. If that is not the case,
1376
simply substitute the proper paths where appropriate.
1379
<example id="upgrade-cvs">
1380
<title>Upgrading using CVS</title>
1382
<para>Every release of Bugzilla, whether it is a revision or a point
1383
release, is tagged in CVS. Also, every tarball we have distributed
1384
since version 2.12 has been primed for using CVS. This does, however,
1385
require that you are able to access cvs-mirror.mozilla.org on port
1389
<para>If you can do this, updating using CVS is probably the most
1390
painless method, especially if you have a lot of local changes.
1396
bash$ <command>cd /var/www/html/bugzilla</command>
1397
bash$ <command>cvs login</command>
1398
Logging in to :pserver:anonymous@cvs-mirror.mozilla.org:2401/cvsroot
1399
CVS password: <command>anonymous</command>
1400
bash$ <command>cvs -q update -r BUGZILLA-2_16_2 -dP</command>
1404
P docs/rel_notes.txt
1405
P template/en/default/list/quips.html.tmpl
1410
<para>If a line in the output from <command>cvs update</command>
1411
begins with a <computeroutput>C</computeroutput> that represents a
1412
file with local changes that CVS was unable to properly merge. You
1413
need to resolve these conflicts manually before Bugzilla (or at
1414
least the portion using that file) will be usable.
1419
<para>You also need to run <command>./checksetup.pl</command>
1420
before your Bugzilla upgrade will be complete.
1426
<example id="upgrade-tarball">
1427
<title>Upgrading using the tarball</title>
1429
<para>If you are unable or unwilling to use CVS, another option that's
1430
always available is to download the latest tarball. This is the most
1431
difficult option to use, especially if you have local changes.
1435
bash$ <command>cd /var/www/html</command>
1436
bash$ <command>wget ftp://ftp.mozilla.org/pub/webtools/bugzilla-2.16.2.tar.gz</command>
1437
<emphasis>Output omitted</emphasis>
1438
bash$ <command>tar xzvf bugzilla-2.16.2.tar.gz</command>
1440
bugzilla-2.16.2/.cvsignore
1441
bugzilla-2.16.2/1x1.gif
1442
<emphasis>Output truncated</emphasis>
1443
bash$ <command>cd bugzilla-2.16.2</command>
1444
bash$ <command>cp ../bugzilla/localconfig* .</command>
1445
bash$ <command>cp -r ../bugzilla/data .</command>
1446
bash$ <command>cd ..</command>
1447
bash$ <command>mv bugzilla bugzilla.old</command>
1448
bash$ <command>mv bugzilla-2.16.2 bugzilla</command>
1449
bash$ <command>cd bugzilla</command>
1450
bash$ <command>./checksetup.pl</command>
1451
<emphasis>Output omitted</emphasis>
1456
<para>The <command>cp</command> commands both end with periods which
1457
is a very important detail, it tells the shell that the destination
1458
directory is the current working directory. Also, the period at the
1459
beginning of the <command>./checksetup.pl</command> is important and
1465
<para>You will now have to reapply any changes you have made to your
1466
local installation manually.
1472
<example id="upgrade-patches">
1473
<title>Upgrading using patches</title>
1475
<para>The Bugzilla team will normally make a patch file available for
1476
revisions to go from the most recent revision to the new one. You could
1477
also read the release notes and grab the patches attached to the
1478
mentioned bug, but it is safer to use the released patch file as
1479
sometimes patches get changed before they get checked in (for minor
1480
spelling fixes and the like). It is also theorectically possible to
1481
scour the fixed bug list and pick and choose which patches to apply
1482
from a point release, but this is not recommended either as what you'll
1483
end up with is a hodge podge Bugzilla that isn't really any version.
1484
This would also make it more difficult to upgrade in the future.
1488
bash$ <command>cd /var/www/html/bugzilla</command>
1489
bash$ <command>wget ftp://ftp.mozilla.org/pub/webtools/bugzilla-2.16.1-to-2.16.2.diff.gz</command>
1490
<emphasis>Output omitted</emphasis>
1491
bash$ <command>gunzip bugzilla-2.16.1-to-2.16.2.diff.gz</command>
1492
bash$ <command>patch -p1 < bugzilla-2.16.1-to-2.16.2.diff</command>
1493
patching file checksetup.pl
1494
patching file collectstats.pl
1495
patching file globals.pl
1500
<para>If you do this, beware that this doesn't change the entires in
1501
your <filename id="dir">CVS</filename> directory so it may make
1502
updates using CVS (<xref linkend="upgrade-cvs"/>) more difficult in the
1511
<!-- Integrating Bugzilla with Third-Party Tools -->
1516
<!-- Keep this comment at the end of the file
1519
sgml-always-quote-attributes:t
1520
sgml-auto-insert-required-elements:t
1521
sgml-balanced-tag-edit:t
1522
sgml-exposed-tags:nil
1523
sgml-general-insert-case:lower
1526
sgml-local-catalogs:nil
1527
sgml-local-ecat-files:nil
1528
sgml-minimize-attributes:nil
1529
sgml-namecase-general:t
1531
sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter")
1533
sgml-tag-region-if-active:t