administration.xml 61.4 KB
Newer Older
1 2 3
<!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.1//EN"> -->
<chapter id="administration">
  <title>Administering Bugzilla</title>
4

5 6
  <section id="parameters">
    <title>Bugzilla Configuration</title>
7

8 9 10 11
    <para>Bugzilla is configured by changing various parameters, accessed
    from the "Edit parameters" link in the page footer. Here are
    some of the key parameters on that page. You should run down this
    list and set them appropriately after installing Bugzilla.</para>
12 13 14 15 16

    <indexterm>
      <primary>checklist</primary>
    </indexterm>

17 18
    <procedure>
      <step>
19 20 21 22 23 24
        <para> 
        <command>maintainer</command>:
        The maintainer parameter is the email address of the person 
        responsible for maintaining this
        Bugzilla installation. The address need not be that of a valid Bugzilla
        account.</para>
25
      </step>
26

27
      <step>
28 29 30 31 32 33 34 35 36
        <para>
        <command>urlbase</command>:
        This parameter defines the fully qualified domain name and web 
        server path to your Bugzilla installation.</para>

        <para>For example, if your Bugzilla query page is
        <filename>http://www.foo.com/bugzilla/query.cgi</filename>, 
        set your <quote>urlbase</quote>
        to <filename>http://www.foo.com/bugzilla/</filename>.</para>
37
      </step>
38

39
      <step>
40
        <para>
41 42 43 44
        <command>makeproductgroups</command>:
        This dictates whether or not to automatically create groups
        when new products are created.
        </para>
45
      </step>
46

47
      <step>
48
        <para>
49 50 51 52 53 54 55 56 57 58
        <command>useentrygroupdefault</command>:
        Bugzilla products can have a group associated with them, so that
        certain users can only see bugs in certain products. When this 
        parameter is set to <quote>on</quote>, this 
        causes the initial group controls on newly created products 
        to place all newly-created bugs in the group 
        having the same name as the product immediately.
        After a product is initially created, the group controls
        can be further adjusted without interference by 
        this mechanism.</para>
59
      </step>
60

61
      <step>
62 63 64
        <para>
        <command>shadowdb</command>:
        You run into an interesting problem when Bugzilla reaches a
65 66 67 68
        high level of continuous activity. MySQL supports only table-level
        write locking. What this means is that if someone needs to make a
        change to a bug, they will lock the entire table until the operation
        is complete. Locking for write also blocks reads until the write is
69 70 71 72 73 74 75 76
        complete. Note that more recent versions of mysql support row level
        locking using different table types. These types are slower than the
        standard type, and Bugzilla does not yet take advantage of features
        such as transactions which would justify this speed decrease. The
        Bugzilla team are, however, happy to hear about any experiences with
        row level locking and Bugzilla</para>

        <para>The <quote>shadowdb</quote>
77 78 79 80 81 82
        parameter was designed to get around this limitation. While only a
        single user is allowed to write to a table at a time, reads can
        continue unimpeded on a read-only shadow copy of the database.
        Although your database size will double, a shadow database can cause
        an enormous performance improvement when implemented on extremely
        high-traffic Bugzilla databases.</para>
83 84 85 86 87 88
        
        <para>
        As a guide, mozilla.org began needing 
        <quote>shadowdb</quote>
        when they reached around 40,000 Bugzilla users with several hundred
        Bugzilla bug changes and comments per day.</para>
89

90
        <para>The value of the parameter defines the name of the 
91 92 93 94
        shadow bug database. You will need to set the host and port settings
        from the params page, and set up replication in your database server
        so that updates reach this readonly mirror. Consult your database
        documentation for more detail.</para>
95
      </step>
96

97 98
      <step>
        <para>
99
        <command>shutdownhtml</command>:
100

101 102 103 104 105
        If you need to shut down Bugzilla to perform administration, enter
        some descriptive HTML here and anyone who tries to use Bugzilla will
        receive a page to that effect. Obviously, editparams.cgi will
        still be accessible so you can remove the HTML and re-enable Bugzilla.
        :-)
106
        </para>
107
      </step>
108

109 110
      <step>
        <para>
111
        <command>passwordmail</command>:
112

113 114
        Every time a user creates an account, the text of
        this parameter (with substitutions) is sent to the new user along with
115 116 117 118 119
        their password message.</para>

        <para>Add any text you wish to the "passwordmail" parameter box. For
        instance, many people choose to use this box to give a quick training
        blurb about how to use Bugzilla at your site.</para>
120
      </step>
121

122 123 124 125 126 127 128 129 130 131 132 133 134

      <step>
        <para>
	<command>movebugs</command>:

	This option is an undocumented feature to allow moving bugs
	between separate Bugzilla installations.  You will need to understand
	the source code in order to use this feature.  Please consult
	<filename>movebugs.pl</filename> in your Bugzilla source tree for
	further documentation, such as it is.
	</para>
      </step>

135
      <step>
136
        <para>
137
        <command>useqacontact</command>:
138

139 140
        This allows you to define an email address for each component, in
        addition
141
        to that of the default owner, who will be sent carbon copies of
142 143 144
        incoming bugs.</para>
      </step>
      <step>
145
        <para>
146 147
        <command>usestatuswhiteboard</command>:
        This defines whether you wish to have a free-form, overwritable field
148 149 150
        associated with each bug. The advantage of the Status Whiteboard is
        that it can be deleted or modified with ease, and provides an
        easily-searchable field for indexing some bugs that have some trait
151 152
        in common.         
        </para>
153
      </step>
154

155
      <step>
156 157 158 159
        <para>
        <command>whinedays</command>:
        Set this to the number of days you want to let bugs go
        in the NEW or REOPENED state before notifying people they have
160 161 162
        untouched new bugs. If you do not plan to use this feature, simply do
        not set up the whining cron job described in the installation
        instructions, or set this value to "0" (never whine).</para>
163
      </step>
164

165
      <step>
166
        <para>
167 168
        <command>commenton*</command>:
        All these
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
        fields allow you to dictate what changes can pass without comment,
        and which must have a comment from the person who changed them.
        Often, administrators will allow users to add themselves to the CC
        list, accept bugs, or change the Status Whiteboard without adding a
        comment as to their reasons for the change, yet require that most
        other changes come with an explanation.</para>

        <para>Set the "commenton" options according to your site policy. It
        is a wise idea to require comments when users resolve, reassign, or
        reopen bugs at the very least. 
        <note>
          <para>It is generally far better to require a developer comment
          when resolving bugs than not. Few things are more annoying to bug
          database users than having a developer mark a bug "fixed" without
          any comment as to what the fix was (or even that it was truly
          fixed!)</para>
        </note>
        </para>
187
      </step>
188

189
      <step>
190 191
        <para>
        <command>supportwatchers</command>:
192

193 194
        Turning on this option allows users to ask to receive copies of 
        all a particular other user's bug email. This is, of
195 196 197 198
        course, subject to the groupset restrictions on the bug; if the 
        <quote>watcher</quote>
        would not normally be allowed to view a bug, the watcher cannot get
        around the system by setting herself up to watch the bugs of someone
199 200
        with bugs outside her privileges. They would still only receive email
        updates for those bugs she could normally view.</para>        
201 202 203
      </step>
    </procedure>
  </section>
204

205 206
  <section id="useradmin">
    <title>User Administration</title>
207

208 209
    <section id="defaultuser">
      <title>Creating the Default User</title>
210

211 212
      <para>When you first run checksetup.pl after installing Bugzilla, it
      will prompt you for the administrative username (email address) and
213
      password for this "super user". If for some reason you delete
214 215 216
      the "super user" account, re-running checksetup.pl will again prompt
      you for this username and password.</para>

217
      <tip>
218 219 220 221
        <para>If you wish to add more administrative users, add them to 
        the "admin" group and, optionally, add edit the tweakparams, editusers,
        creategroups, editcomponents, and editkeywords groups to add the
        entire admin group to those groups.
222
        </para>
223 224
      </tip>
    </section>
225

226 227
    <section id="manageusers">
      <title>Managing Other Users</title>
228

229
      <section id="createnewusers">
230 231 232
        <title>Creating new users</title>

        <para>Your users can create their own user accounts by clicking the
233 234
        "New Account" link at the bottom of each page (assuming they
        aren't logged in as someone else already.) However, should you
235 236 237 238 239 240
        desire to create user accounts ahead of time, here is how you do
        it.</para>

        <orderedlist>
          <listitem>
            <para>After logging in, click the "Users" link at the footer of
241
            the query page, and then click "Add a new user".</para>
242 243 244 245
          </listitem>

          <listitem>
            <para>Fill out the form presented. This page is self-explanatory.
246
            When done, click "Submit".</para>
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264

            <note>
              <para>Adding a user this way will 
              <emphasis>not</emphasis>

              send an email informing them of their username and password.
              While useful for creating dummy accounts (watchers which
              shuttle mail to another system, for instance, or email
              addresses which are a mailing list), in general it is
              preferable to log out and use the 
              <quote>New Account</quote>

              button to create users, as it will pre-populate all the
              required fields and also notify the user of her account name
              and password.</para>
            </note>
          </listitem>
        </orderedlist>
265
      </section>
266

267
      <section id="modifyusers">
268 269
        <title>Modifying Users</title>

270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
        <para>To see a specific user, search for their login name
        in the box provided on the "Edit Users" page. To see all users, 
        leave the box blank.</para>

        <para>You can search in different ways the listbox to the right
        of the text entry box. You can match by 
        case-insensitive substring (the default),
        regular expression, or a 
        <emphasis>reverse</emphasis>
        regular expression match, which finds every user name which does NOT
        match the regular expression. (Please see
        the <command>man regexp</command>
        manual page for details on regular expression syntax.)
        </para>

        <para>Once you have found your user, you can change the following
        fields:</para>
287 288 289 290

        <itemizedlist>
          <listitem>
            <para>
291 292 293 294 295
            <emphasis>Login Name</emphasis>: 
            This is generally the user's full email address. However, if you
            have are using the emailsuffix Param, this may just be the user's
            login name. Note that users can now change their login names
            themselves (to any valid email address.)
296 297 298 299 300
            </para>
          </listitem>

          <listitem>
            <para>
301 302
            <emphasis>Real Name</emphasis>: The user's real name. Note that
            Bugzilla does not require this to create an account.</para>
303 304 305 306
          </listitem>

          <listitem>
            <para>
307 308 309 310 311
            <emphasis>Password</emphasis>: 
            You can change the user's password here. Users can automatically
            request a new password, so you shouldn't need to do this often.
            If you want to disable an account, see Disable Text below.
            </para>
312 313 314 315
          </listitem>

          <listitem>
            <para>
316 317 318 319 320 321 322
            <emphasis>Disable Text</emphasis>: 
            If you type anything in this box, including just a space, the
            user is prevented from logging in, or making any changes to 
            bugs via the web interface. 
            The HTML you type in this box is presented to the user when
            they attempt to perform these actions, and should explain
            why the account was disabled.
323 324 325 326 327
            <warning>
              <para>Don't disable the administrator account!</para>
            </warning>

            <note>
328 329 330
              <para>The user can still submit bugs via
              the e-mail gateway, if you set it up, even if the disabled text
              field is filled in. The e-mail gateway should 
331 332 333 334 335 336 337 338
              <emphasis>not</emphasis>
              be enabled for secure installations of Bugzilla.</para>
            </note>
            </para>
          </listitem>

          <listitem>
            <para>
339 340 341 342 343
            <emphasis>&lt;groupname&gt;</emphasis>: 
            If you have created some groups, e.g. "securitysensitive", then
            checkboxes will appear here to allow you to add users to, or
            remove them from, these groups.
            </para>
344 345 346 347
          </listitem>

          <listitem>
            <para>
348 349 350 351 352
            <emphasis>canconfirm</emphasis>: 
            This field is only used if you have enabled the "unconfirmed"
            status. If you enable this for a user,
            that user can then move bugs from "Unconfirmed" to a "Confirmed"
            status (e.g.: "New" status).</para>
353 354 355 356
          </listitem>

          <listitem>
            <para>
357 358 359 360
            <emphasis>creategroups</emphasis>: 
            This option will allow a user to create and destroy groups in
            Bugzilla.</para>
          </listitem>
361

362 363 364 365 366 367
          <listitem>
            <para>
            <emphasis>editbugs</emphasis>: 
            Unless a user has this bit set, they can only edit those bugs
            for which they are the assignee or the reporter. Even if this
            option is unchecked, users can still add comments to bugs.
368 369 370 371 372
            </para>
          </listitem>

          <listitem>
            <para>
373 374
            <emphasis>editcomponents</emphasis>: 
            This flag allows a user to create new products and components,
375 376 377
            as well as modify and destroy those that have no bugs associated
            with them. If a product or component has bugs associated with it,
            those bugs must be moved to a different product or component
378 379
            before Bugzilla will allow them to be destroyed.
            </para>
380 381 382 383
          </listitem>

          <listitem>
            <para>
384 385 386
            <emphasis>editkeywords</emphasis>: 
            If you use Bugzilla's keyword functionality, enabling this
            feature allows a user to create and destroy keywords. As always,
387 388
            the keywords for existing bugs containing the keyword the user
            wishes to destroy must be changed before Bugzilla will allow it
389
            to die.</para>
390 391 392 393
          </listitem>

          <listitem>
            <para>
394 395
            <emphasis>editusers</emphasis>: 
            This flag allows a user to do what you're doing right now: edit
396 397 398 399 400
            other users. This will allow those with the right to do so to
            remove administrator privileges from other users or grant them to
            themselves. Enable with care.</para>
          </listitem>

401 402 403 404 405 406 407 408

          <listitem>
            <para>
            <emphasis>tweakparams</emphasis>: 
            This flag allows a user to change Bugzilla's Params 
            (using <filename>editparams.cgi</filename>.)</para>
          </listitem>

409 410
          <listitem>
            <para>
411 412 413 414
            <emphasis>&lt;productname&gt;</emphasis>: 
            This allows an administrator to specify the products in which 
            a user can see bugs. The user must still have the 
            "editbugs" privilege to edit bugs in these products.</para>
415 416
          </listitem>
        </itemizedlist>
417 418 419
      </section>
    </section>
  </section>
420

421
  <section id="programadmin">
422 423
    <title>Product, Component, Milestone, and Version Administration</title>

424 425
    <section id="products">
      <title>Products</title>
426

427
      <para>
428 429 430
      <glossterm linkend="gloss-product" baseform="product">
      Products</glossterm>

431 432 433 434 435
      are the broadest category in Bugzilla, and tend to represent real-world
      shipping products. E.g. if your company makes computer games, 
      you should have one product per game, perhaps a "Common" product for 
      units of technology used in multiple games, and maybe a few special
       products (Website, Administration...)</para>
436

437 438 439
      <para>Many of Bugzilla's settings are configurable on a per-product
      basis. The number of "votes" available to users is set per-product, 
      as is the number of votes
440
      required to move a bug automatically from the UNCONFIRMED status to the
441
      NEW status.</para>
442

443
      <para>To create a new product:</para>
444

445
      <orderedlist>
446
        <listitem>
447
          <para>Select "products" from the footer</para>
448 449 450 451

        </listitem>

        <listitem>
452
          <para>Select the "Add" link in the bottom right</para>
453 454 455 456
        </listitem>

        <listitem>
          <para>Enter the name of the product and a description. The
457
          Description field may contain HTML.</para>
458
        </listitem>
459
      </orderedlist>
460

461 462 463 464 465 466
      <para>Don't worry about the "Closed for bug entry", "Maximum Votes
      per person", "Maximum votes a person can put on a single bug",
      "Number of votes a bug in this Product needs to automatically get out
      of the UNCOMFIRMED state", and "Version" options yet. We'll cover
      those in a few moments.
      </para>
467
    </section>
468

469 470
    <section id="components">
      <title>Components</title>
471

472 473 474 475 476 477 478 479 480
      <para>Components are subsections of a Product. E.g. the computer game 
      you are designing may have a "UI"
      component, an "API" component, a "Sound System" component, and a
      "Plugins" component, each overseen by a different programmer. It
      often makes sense to divide Components in Bugzilla according to the
      natural divisions of responsibility within your Product or
      company.</para>
      
      <para>
481 482 483 484 485 486 487
      Each component has a owner and (if you turned it on in the parameters),
      a QA Contact. The owner should be the primary person who fixes bugs in
      that component. The QA Contact should be the person who will ensure
      these bugs are completely fixed. The Owner, QA Contact, and Reporter
      will get email when new bugs are created in this Component and when
      these bugs change. Default Owner and Default QA Contact fields only
      dictate the 
488 489 490
      <emphasis>default assignments</emphasis>; 
      these can be changed on bug submission, or at any later point in
      a bug's life.</para>
491 492 493

      <para>To create a new Component:</para>

494
      <orderedlist>
495 496 497 498 499 500
        <listitem>
          <para>Select the "Edit components" link from the "Edit product"
          page</para>
        </listitem>

        <listitem>
501
          <para>Select the "Add" link in the bottom right.</para>
502 503 504
        </listitem>

        <listitem>
505 506 507 508 509
          <para>Fill out the "Component" field, a short "Description", 
          the "Initial Owner" and "Initial QA Contact" (if enabled.) 
          The Component and Description fields may contain HTML; 
          the "Initial Owner" field must be a login name
          already existing in the database. 
510 511
          </para>
        </listitem>
512 513
      </orderedlist>
    </section>
514

515 516
    <section id="versions">
      <title>Versions</title>
517 518

      <para>Versions are the revisions of the product, such as "Flinders
519 520 521
      3.1", "Flinders 95", and "Flinders 2000". Version is not a multi-select
      field; the usual practice is to select the most recent version with
      the bug.
522
      </para>
523 524 525

      <para>To create and edit Versions:</para>

526
      <orderedlist>
527 528 529 530 531 532
        <listitem>
          <para>From the "Edit product" screen, select "Edit Versions"</para>
        </listitem>

        <listitem>
          <para>You will notice that the product already has the default
533
          version "undefined". Click the "Add" link in the bottom right.</para>
534 535 536
        </listitem>

        <listitem>
537 538
          <para>Enter the name of the Version. This field takes text only. 
          Then click the "Add" button.</para>
539 540
        </listitem>

541 542
      </orderedlist>
    </section>
543

544 545
    <section id="milestones">
      <title>Milestones</title>
546 547 548

      <para>Milestones are "targets" that you plan to get a bug fixed by. For
      example, you have a bug that you plan to fix for your 3.0 release, it
549
      would be assigned the milestone of 3.0.</para>
550

551
      <note>
552
        <para>Milestone options will only appear for a Product if you turned
553 554
        on the "usetargetmilestone" Param in the "Edit Parameters" screen.
        </para>
555
      </note>
556 557 558 559

      <para>To create new Milestones, set Default Milestones, and set
      Milestone URL:</para>

560
      <orderedlist>
561
        <listitem>
562
          <para>Select "Edit milestones" from the "Edit product" page.</para>
563 564 565
        </listitem>

        <listitem>
566
          <para>Select "Add" in the bottom right corner.
567 568 569 570 571
          text</para>
        </listitem>

        <listitem>
          <para>Enter the name of the Milestone in the "Milestone" field. You
572
          can optionally set the "sortkey", which is a positive or negative
573
          number (-255 to 255) that defines where in the list this particular
574 575 576
          milestone appears. This is because milestones often do not 
          occur in alphanumeric order For example, "Future" might be
          after "Release 1.2". Select "Add".</para>
577 578 579
        </listitem>

        <listitem>
580 581 582 583 584 585 586 587 588 589
          <para>From the Edit product screen, you can enter the URL of a 
          page which gives information about your milestones and what
          they mean. </para>

        <tip>
          <para>If you want your milestone document to be restricted so
          that it can only be viewed by people in a particular Bugzilla
          group, the best way is to attach the document to a bug in that
          group, and make the URL the URL of that attachment.</para>
        </tip>
590
        </listitem>
591 592
      </orderedlist>
    </section>
593 594 595 596
  </section>
  
  <section id="voting">
    <title>Voting</title>
597

598 599 600 601 602 603 604
    <para>Voting allows users to be given a pot of votes which they can allocate
    to bugs, to indicate that they'd like them fixed. 
    This allows developers to gauge
    user need for a particular enhancement or bugfix. By allowing bugs with
    a certain number of votes to automatically move from "UNCONFIRMED" to
    "NEW", users of the bug system can help high-priority bugs garner
    attention so they don't sit for a long time awaiting triage.</para>
605

606
    <para>To modify Voting settings:</para>
607

608 609 610 611 612
    <orderedlist>
      <listitem>
        <para>Navigate to the "Edit product" screen for the Product you
        wish to modify</para>
      </listitem>
613

614 615 616 617
      <listitem>
        <para><emphasis>Maximum Votes per person</emphasis>:
        Setting this field to "0" disables voting.</para>
      </listitem>
618

619 620 621 622 623 624 625 626
      <listitem>
        <para><emphasis>Maximum Votes a person can put on a single
         bug"</emphasis>: 
         It should probably be some number lower than the
        "Maximum votes per person". Don't set this field to "0" if
        "Maximum votes per person" is non-zero; that doesn't make
        any sense.</para>
      </listitem>
627

628 629 630 631 632 633 634
      <listitem>
        <para><emphasis>Number of votes a bug in this product needs to
        automatically get out of the UNCONFIRMED state</emphasis>: 
        Setting this field to "0" disables the automatic move of
        bugs from UNCONFIRMED to NEW. 
        </para>
      </listitem>
635

636 637 638 639 640 641
      <listitem>
        <para>Once you have adjusted the values to your preference, click
        "Update".</para>
      </listitem>
    </orderedlist>
  </section>
642

643 644
  <section id="groups">
    <title>Groups and Group Security</title>
645

646 647
    <para>Groups allow the administrator
    to isolate bugs or products that should only be seen by certain people.
648 649 650 651 652 653 654
    The association between products and groups is controlled from
    the product edit page under <quote>Edit Group Controls.</quote>
    </para>

    <para>
    If the makeproductgroups param is on, a new group will be automatically
    created for every new product.
655 656 657
    </para>
    
    <para>
658 659 660 661 662 663
    On the product edit page, there is a page to edit the 
    <quote>Group Controls</quote> 
    for a product and determine which groups are applicable, default, 
    and mandatory for each product as well as controlling entry 
    for each product and being able to set bugs in a product to be 
    totally read-only unless some group restrictions are met. 
664 665 666
    </para>
    
    <para>
667 668
    For each group, it is possible to specify if membership in that
    group is...
669
    </para>
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704
    <orderedlist>
      <listitem>
        <para>
        required for bug entry, 
        </para>
      </listitem>
      <listitem>
        <para>
        Not applicable to this product(NA),
        a possible restriction for a member of the 
        group to place on a bug in this product(Shown),
        a default restriction for a member of the 
        group to place on a bug in this product(Default),
        or a mandatory restriction to be placed on bugs 
        in this product(Mandatory).
        </para>
      </listitem>
      <listitem>
        <para>
        Not applicable by non-members to this product(NA),
        a possible restriction for a non-member of the 
        group to place on a bug in this product(Shown),
        a default restriction for a non-member of the 
        group to place on a bug in this product(Default),
        or a mandatory restriction to be placed on bugs 
        in this product when entered by a non-member(Mandatory).
        </para>
      </listitem>
      <listitem>
        <para>
        required in order to make <emphasis>any</emphasis> change
        to bugs in this product <emphasis>including comments.</emphasis>
        </para>
      </listitem>
    </orderedlist>
705
    
706
    <para>To create Groups:</para>
707

708 709
    <orderedlist>
      <listitem>
710
        <para>Select the <quote>groups</quote>
711 712
        link in the footer.</para>
      </listitem>
713

714
      <listitem>
715 716
        <para>Take a moment to understand the instructions on the <quote>Edit
        Groups</quote> screen, then select the <quote>Add Group</quote> link.</para>
717
      </listitem>
718

719
      <listitem>
720 721 722
        <para>Fill out the <quote>Group</quote>, <quote>Description</quote>, 
         and <quote>User RegExp</quote> fields. 
         <quote>User RegExp</quote> allows you to automatically
723
         place all users who fulfill the Regular Expression into the new group. 
724
         When you have finished, click <quote>Add</quote>.</para>
725 726 727 728 729 730 731 732 733 734 735 736
         <warning>
           <para>The User Regexp is a perl regexp and, if not anchored, will match 
           any part of an address.  So, if you do not want to grant access
           into 'mycompany.com' to 'badperson@mycompany.com.hacker.net', use 
           '@mycompany\.com$' as the regexp.</para>
         </warning>
      </listitem>
      <listitem>
        <para>After you add your new group, edit the new group.  On the
        edit page, you can specify other groups that should be included
        in this group and which groups should be permitted to add and delete
        users from this group.</para>
737 738
      </listitem>
    </orderedlist>
739

740 741 742
    <para>
      Note that group permissions are such that you need to be a member
      of <emphasis>all</emphasis> the groups a bug is in, for whatever
743 744 745 746 747 748
      reason, to see that bug. Similarly, you must be a member 
      of <emphasis>all</emphasis> of the entry groups for a product 
      to add bugs to a product and you must be a member 
      of <emphasis>all</emphasis> of the canedit groups for a product
      in order to make <emphasis>any</emphasis> change to bugs in that
      product.
749
    </para>    
750
  </section>
751

752

753 754
  <section id="security">
    <title>Bugzilla Security</title>
755

756 757
    <warning>
      <para>Poorly-configured MySQL and Bugzilla installations have
758 759 760 761
      given attackers full access to systems in the past. Please take these
      guidelines seriously, even for Bugzilla machines hidden away behind
      your firewall. 80% of all computer trespassers are insiders, not
      anonymous crackers.</para>
762
    </warning>
763 764 765 766 767 768 769

    <note>
      <para>These instructions must, of necessity, be somewhat vague since
      Bugzilla runs on so many different platforms. If you have refinements
      of these directions for specific platforms, please submit them to 
      <ulink url="mailto://mozilla-webtools@mozilla.org">
      mozilla-webtools@mozilla.org</ulink>
770
      </para>
771 772
    </note>

773 774
    <para>To secure your installation:
     
775 776
    <orderedlist>
      <listitem>
777
        <para>
778 779 780 781
        <emphasis>There is no substitute for understanding the tools on your
        system!</emphasis>

        Read 
782
        <ulink url="http://www.mysql.com/doc/P/r/Privilege_system.html">
783 784 785 786 787
        The MySQL Privilege System</ulink>
        until you can recite it from memory!</para>
      </listitem>

      <listitem>
788 789 790
        <para>Lock down <filename>/etc/inetd.conf</filename>. Heck, disable
        inet entirely on this box. It should only listen to port 25 for
        Sendmail and port 80 for Apache.</para>
791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812
      </listitem>

      <listitem>
        <para>Do not run Apache as 
        <quote>nobody</quote>

        . This will require very lax permissions in your Bugzilla
        directories. Run it, instead, as a user with a name, set via your
        httpd.conf file. 
        <note>
          <para>
          <quote>nobody</quote>

          is a real user on UNIX systems. Having a process run as user id 
          <quote>nobody</quote>

          is absolutely no protection against system crackers versus using
          any other user account. As a general security measure, I recommend
          you create unique user ID's for each daemon running on your system
          and, if possible, use "chroot" to jail that process away from the
          rest of your system.</para>
        </note>
813
        </para>
814 815 816 817
      </listitem>

      <listitem>
        <para>Ensure you have adequate access controls for the
818 819
        <filename>$BUGZILLA_HOME/data/</filename> directory, as well as the
        <filename>$BUGZILLA_HOME/localconfig</filename> file.
820 821
        The localconfig file stores your "bugs" database account password. 
        In addition, some
822 823 824 825 826 827 828
        files under <filename>$BUGZILLA_HOME/data/</filename> store sensitive
        information.
        </para>

        <para>Also, beware that some text editors create backup files in the
        current working directory so you need to also secure files like
        <filename>localconfig~</filename>.
829
        </para>
830

831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849
        <note>
          <para>Simply blocking <computeroutput>.*localconfig.*</computeroutput>
          won't work because the QuickSearch feature requires the web browser
          to be able to retrieve <filename>localconfig.js</filename> and
          others may be introduced in the future (see 
          <ulink url="http://bugzilla.mozilla.org/show_bug.cgi?id=186383">bug
          186383</ulink> for more information.
          </para>
        </note>

        <para>Bugzilla provides default <filename>.htaccess</filename> files
        to protect the most common Apache installations. However, you should
        verify these are adequate according to the site-wide security policy
        of your web server, and ensure that the <filename>.htaccess</filename>
        files are allowed to <quote>override</quote> default permissions set
        in your Apache configuration files. Covering Apache security is beyond
        the scope of this Guide; please consult the Apache documentation for
        details.
        </para>
850 851

        <para>If you are using a web server that does not support the
852
        <filename>.htaccess</filename> control method, 
853 854 855
        <emphasis>you are at risk!</emphasis>

        After installing, check to see if you can view the file
856
        <filename>localconfig</filename> in your web browser (e.g.: 
857 858 859 860 861 862 863 864
        <ulink url="http://bugzilla.mozilla.org/localconfig">
        http://bugzilla.mozilla.org/localconfig</ulink>

        ). If you can read the contents of this file, your web server has
        not secured your bugzilla directory properly and you must fix this
        problem before deploying Bugzilla. If, however, it gives you a
        "Forbidden" error, then it probably respects the .htaccess
        conventions and you are good to go.</para>
865
      </listitem>
866

867
      <listitem>
868 869
        <para>When you run checksetup.pl, the script will attempt to modify
        various permissions on files which Bugzilla uses. If you do not have
870 871 872
        a webservergroup set in the <filename>localconfig</filename> file,
        then Bugzilla will have to make certain files world readable and/or
        writable. 
873 874 875 876 877 878 879 880 881 882 883 884
        <emphasis>THIS IS INSECURE!</emphasis>

        . This means that anyone who can get access to your system can do
        whatever they want to your Bugzilla installation.</para>

        <note>
          <para>This also means that if your webserver runs all cgi scripts
          as the same user/group, anyone on the system who can run cgi
          scripts will be able to take control of your Bugzilla
          installation.</para>
        </note>

885 886 887 888 889 890
        <para>On Apache, you can use <filename>.htaccess</filename> files to
        protect access to these directories, as outlined in Bugs 
        <ulink url="http://bugzilla.mozilla.org/show_bug.cgi?id=57161">
        57161</ulink> and
        <ulink url="http://bugzilla.mozilla.org/show_bug.cgi?id=186383">
        186383</ulink>
891

892
        for the <filename>localconfig</filename> file, and 
893 894 895
        <ulink url="http://bugzilla.mozilla.org/show_bug.cgi?id=65572">Bug
        65572</ulink>

896 897 898 899 900 901 902 903 904 905
        for adequate protection in your <filename>data/</filename> directory.
        Also, don't forget about the <filename>template/</filename> and
        <filename>Bugzilla/</filename> directories and to allow access to the
        <filename>data/webdot</filename> directory for the
        <computeroutput>192.20.225.10</computeroutput> IP address if you are
        using webdot from research.att.com.  The easiest way to
        accomplish this is to set <function>$create_htaccess</function> to 1
        in <filename>localconfig</filename>.  However, the information below
        is provided for those that want to know exactly what is created.
        </para>
906 907 908 909 910 911

        <para>Note the instructions which follow are Apache-specific. If you
        use IIS, Netscape, or other non-Apache web servers, please consult
        your system documentation for how to secure these files from being
        transmitted to curious users.</para>

912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933
        <para><filename>$BUGZILLA_HOME/.htaccess</filename>
        <programlisting><![CDATA[
# don't allow people to retrieve non-cgi executable files or our private data
<FilesMatch ^(.*\.pl|.*localconfig.*|processmail|runtests.sh)$>
  deny from all
</FilesMatch>
<FilesMatch ^(localconfig.js|localconfig.rdf)$>
  allow from all
</FilesMatch>
        ]]></programlisting> 
        </para>

        <para><filename>$BUGZILLA_HOME/data/.htaccess</filename> 
        <programlisting><![CDATA[
# nothing in this directory is retrievable unless overriden by an .htaccess
# in a subdirectory; the only exception is duplicates.rdf, which is used by
# duplicates.xul and must be loadable over the web
deny from all
<Files duplicates.rdf>
  allow from all
</Files>
        ]]></programlisting>
934 935
        </para>

936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954
        <para><filename>$BUGZILLA_HOME/data/webdot</filename>
        <programlisting><![CDATA[
# Restrict access to .dot files to the public webdot server at research.att.com 
# if research.att.com ever changed their IP, or if you use a different
# webdot server, you'll need to edit this
<FilesMatch ^[0-9]+\.dot$>
  Allow from 192.20.225.10
  Deny from all
</FilesMatch>

# Allow access by a local copy of 'dot' to .png, .gif, .jpg, and
# .map files
<FilesMatch ^[0-9]+\.(png|gif|jpg|map)$>
  Allow from all
</FilesMatch>

# And no directory listings, either.
Deny from all
        ]]></programlisting>
955 956
        </para>

957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972
        <para><filename>$BUGZILLA_HOME/Bugzilla/.htaccess</filename>
        <programlisting>
# nothing in this directory is retrievable unless overriden by an .htaccess
# in a subdirectory
deny from all
         </programlisting>
         </para>

        <para><filename>$BUGZILLA_HOME/template/.htaccess</filename>
        <programlisting>
# nothing in this directory is retrievable unless overriden by an .htaccess
# in a subdirectory
deny from all
         </programlisting>
         </para>

973 974
      </listitem>
    </orderedlist>
975 976
    </para>
  </section>
977 978

  <section id="cust-templates">
979
    <title>Template Customization</title>
980 981
    
    <para>
982
      One of the large changes for 2.16 was the templatization of the
983 984 985 986 987 988 989 990
      entire user-facing UI, using the 
      <ulink url="http://www.template-toolkit.org">Template Toolkit</ulink>.
      Administrators can now configure the look and feel of Bugzilla without
      having to edit Perl files or face the nightmare of massive merge
      conflicts when they upgrade to a newer version in the future.
    </para>
    
    <para>
991
      Templatization also makes localized versions of Bugzilla possible, 
992
      for the first time. In the future, a Bugzilla installation may
993
      have templates installed for multiple localizations, and select
994 995 996 997 998 999 1000 1001 1002 1003
      which ones to use based on the user's browser language setting.      
    </para>
    
    <section>
      <title>What to Edit</title>
      <para>
        There are two different ways of editing of Bugzilla's templates,
        and which you use depends mainly on how you upgrade Bugzilla. The
        template directory structure is that there's a top level directory,
        <filename>template</filename>, which contains a directory for
1004
        each installed localization. The default English templates are
1005 1006 1007 1008 1009 1010 1011 1012 1013
        therefore in <filename>en</filename>. Underneath that, there
        is the <filename>default</filename> directory and optionally the 
        <filename>custom</filename> directory. The <filename>default</filename>
        directory contains all the templates shipped with Bugzilla, whereas
        the <filename>custom</filename> directory does not exist at first and
        must be created if you want to use it.
      </para>

      <para>
1014
        The first method of making customizations is to directly edit the
1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166
        templates in <filename>template/en/default</filename>. This is
        probably the best method for small changes if you are going to use
        the CVS method of upgrading, because if you then execute a
        <command>cvs update</command>, any template fixes will get
        automagically merged into your modified versions.
      </para>

      <para>
        If you use this method, your installation will break if CVS conflicts
        occur.
      </para>

      <para>
        The other method is to copy the templates into a mirrored directory
        structure under <filename>template/en/custom</filename>.  The templates
        in this directory automatically override those in default.  
        This is the technique you
        need to use if you use the overwriting method of upgrade, because
        otherwise your changes will be lost.  This method is also better if
        you are using the CVS method of upgrading and are going to make major
        changes, because it is guaranteed that the contents of this directory
        will not be touched during an upgrade, and you can then decide whether
        to continue using your own templates, or make the effort to merge your
        changes into the new versions by hand.
      </para>

      <para>
        If you use this method, your installation may break if incompatible
        changes are made to the template interface.  If such changes are made
        they will be documented in the release notes, provided you are using a
        stable release of Bugzilla.  If you use using unstable code, you will
        need to deal with this one yourself, although if possible the changes
        will be mentioned before they occur in the deprecations section of the
        previous stable release's release notes.
      </para>

      <note>
        <para>
          Don't directly edit the compiled templates in 
          <filename class="directory">data/template/*</filename> - your
          changes will be lost when Template Toolkit recompiles them.
        </para>
      </note>
    </section>
    
    <section>
      <title>How To Edit Templates</title>
      
     <para>
        The syntax of the Template Toolkit language is beyond the scope of
        this guide. It's reasonably easy to pick up by looking at the current 
        templates; or, you can read the manual, available on the
        <ulink url="http://www.template-toolkit.org">Template Toolkit home
        page</ulink>. However, you should particularly remember (for security
        reasons) to always HTML filter things which come from the database or
        user input, to prevent cross-site scripting attacks.
      </para>
      
      <para>
        However, one thing you should take particular care about is the need
        to properly HTML filter data that has been passed into the template.
        This means that if the data can possibly contain special HTML characters
        such as &lt;, and the data was not intended to be HTML, they need to be
        converted to entity form, ie &amp;lt;.  You use the 'html' filter in the
        Template Toolkit to do this.  If you fail to do this, you may open up
        your installation to cross-site scripting attacks.
      </para>

      <para>
        Also note that Bugzilla adds a few filters of its own, that are not
        in standard Template Toolkit.  In particular, the 'url_quote' filter
        can convert characters that are illegal or have special meaning in URLs,
        such as &amp;, to the encoded form, ie %26.  This actually encodes most
        characters (but not the common ones such as letters and numbers and so
        on), including the HTML-special characters, so there's never a need to
        HTML filter afterwards.
      </para>
 
      <para>
        Editing templates is a good way of doing a "poor man's custom fields".
        For example, if you don't use the Status Whiteboard, but want to have
        a free-form text entry box for "Build Identifier", then you can just
        edit the templates to change the field labels. It's still be called
        status_whiteboard internally, but your users don't need to know that.
      </para>
      
      <note>
        <para>
          If you are making template changes that you intend on submitting back
          for inclusion in standard Bugzilla, you should read the relevant
          sections of the 
          <ulink url="http://www.bugzilla.org/developerguide.html">Developers'
          Guide</ulink>.
        </para>
      </note>
    </section>
            
    
    <section>
      <title>Template Formats</title>
      
      <para>
        Some CGIs have the ability to use more than one template. For
        example, buglist.cgi can output bug lists as RDF or two
        different forms of HTML (complex and simple). (Try this out
        by appending <filename>&amp;format=simple</filename> to a buglist.cgi
        URL on your Bugzilla installation.) This
        mechanism, called template 'formats', is extensible.
      </para>
      
      <para>
        To see if a CGI supports multiple output formats, grep the
        CGI for "ValidateOutputFormat". If it's not present, adding
        multiple format support isn't too hard - see how it's done in
        other CGIs.
      </para>
      
      <para>
        To make a new format template for a CGI which supports this, 
        open a current template for
        that CGI and take note of the INTERFACE comment (if present.) This 
        comment defines what variables are passed into this template. If 
        there isn't one, I'm afraid you'll have to read the template and
        the code to find out what information you get. 
      </para>     
  
      <para>
        Write your template in whatever markup or text style is appropriate.
      </para>
      
      <para>
        You now need to decide what content type you want your template
        served as. Open up the <filename>localconfig</filename> file and find the 
        <filename>$contenttypes</filename>
        variable. If your content type is not there, add it. Remember
        the three- or four-letter tag assigned to you content type. 
        This tag will be part of the template filename.
      </para>
      
      <para>
        Save the template as <filename>&lt;stubname&gt;-&lt;formatname&gt;.&lt;contenttypetag&gt;.tmpl</filename>. 
        Try out the template by calling the CGI as 
        <filename>&lt;cginame&gt;.cgi?format=&lt;formatname&gt;</filename> .
      </para>       
    </section>
    
    
    <section>
      <title>Particular Templates</title>
      
      <para>
        There are a few templates you may be particularly interested in
1167
        customizing for your installation.
1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187
      </para>
      
      <para>
        <command>index.html.tmpl</command>:
        This is the Bugzilla front page.
      </para>      

      <para>
        <command>global/header.html.tmpl</command>:
        This defines the header that goes on all Bugzilla pages.
        The header includes the banner, which is what appears to users
        and is probably what you want to edit instead.  However the
        header also includes the HTML HEAD section, so you could for
        example add a stylesheet or META tag by editing the header.
      </para>

      <para>
        <command>global/banner.html.tmpl</command>:
        This contains the "banner", the part of the header that appears
        at the top of all Bugzilla pages.  The default banner is reasonably
1188
        barren, so you'll probably want to customize this to give your
1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206
        installation a distinctive look and feel.  It is recommended you
        preserve the Bugzilla version number in some form so the version 
        you are running can be determined, and users know what docs to read.
      </para>

      <para>
        <command>global/footer.html.tmpl</command>:
        This defines the footer that goes on all Bugzilla pages.  Editing
        this is another way to quickly get a distinctive look and feel for
        your Bugzilla installation.
      </para>

      <para>
        <command>bug/create/user-message.html.tmpl</command>:
        This is a message that appears near the top of the bug reporting page.
        By modifying this, you can tell your users how they should report
        bugs.
      </para>
1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219

      <para>
        <command>bug/process/midair.html.tmpl</command>:
        This is the page used if two people submit simultaneous changes to the
        same bug.  The second person to submit their changes will get this page
        to tell them what the first person did, and ask if they wish to
        overwrite those changes or go back and revisit the bug.  The default
        title and header on this page read "Mid-air collision detected!"  If
        you work in the aviation industry, or other environment where this
        might be found offensive (yes, we have true stories of this happening)
        you'll want to change this to something more appropriate for your
        environment.
      </para>
1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267
        
      <para>
        <command>bug/create/create.html.tmpl</command> and
        <command>bug/create/comment.txt.tmpl</command>:
        You may wish to get bug submitters to give certain bits of structured
        information, each in a separate input widget, for which there is not a
        field in the database. The bug entry system has been designed in an
        extensible fashion to enable you to define arbitrary fields and widgets,
        and have their values appear formatted in the initial
        Description, rather than in database fields. An example of this
        is the mozilla.org 
        <ulink url="http://bugzilla.mozilla.org/enter_bug.cgi?format=guided">guided 
        bug submission form</ulink>.
      </para>

      <para>
        To make this work, create a custom template for 
        <filename>enter_bug.cgi</filename> (the default template, on which you
        could base it, is <filename>create.html.tmpl</filename>),
        and either call it <filename>create.html.tmpl</filename> or use a format and
        call it <filename>create-&lt;formatname&gt;.html.tmpl</filename>.
        Put it in the <filename class="directory">custom/bug/create</filename>
        directory. In it, add widgets for each piece of information you'd like
        collected - such as a build number, or set of steps to reproduce.
      </para>

      <para>
        Then, create a template like 
        <filename>custom/bug/create/comment.txt.tmpl</filename>, also named
        after your format if you are using one, which
        references the form fields you have created. When a bug report is
        submitted, the initial comment attached to the bug report will be
        formatted according to the layout of this template.
      </para> 

      <para>
        For example, if your enter_bug template had a field
        <programlisting>&lt;input type="text" name="buildid" size="30"&gt;</programlisting>
        and then your comment.txt.tmpl had
        <programlisting>BuildID: [% form.buildid %]</programlisting>
        then
        <programlisting>BuildID: 20020303</programlisting>
        would appear in the initial checkin comment.
      </para>        
    </section>          
    
  </section>

1268
  <section id="cust-change-permissions">
1269
    <title>Change Permission Customization</title>
1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290
    
    <warning>
      <para>
        This feature should be considered experimental; the Bugzilla code you
        will be changing is not stable, and could change or move between 
        versions. Be aware that if you make modifications to it, you may have
        to re-make them or port them if Bugzilla changes internally between
        versions.
      </para>
    </warning>
       
    <para>
      Companies often have rules about which employees, or classes of employees,
      are allowed to change certain things in the bug system. For example, 
      only the bug's designated QA Contact may be allowed to VERIFY the bug.
      Bugzilla has been
      designed to make it easy for you to write your own custom rules to define
      who is allowed to make what sorts of value transition.
    </para>
    
    <para>
1291
      For maximum flexibility, customizing this means editing Bugzilla's Perl 
1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322
      code. This gives the administrator complete control over exactly who is
      allowed to do what. The relevant function is called 
      <filename>CheckCanChangeField()</filename>,
      and is found in <filename>process_bug.cgi</filename> in your 
      Bugzilla directory. If you open that file and grep for 
      "sub CheckCanChangeField", you'll find it.
    </para>
    
    <para>
      This function has been carefully commented to allow you to see exactly
      how it works, and give you an idea of how to make changes to it. Certain
      marked sections should not be changed - these are the "plumbing" which
      makes the rest of the function work. In between those sections, you'll
      find snippets of code like:
      <programlisting>    # Allow the owner to change anything.
    if ($ownerid eq $whoid) {
        return 1;
    }</programlisting>
      It's fairly obvious what this piece of code does.
    </para>      
      
    <para>
      So, how does one go about changing this function? Well, simple changes
      can be made just be removing pieces - for example, if you wanted to 
      prevent any user adding a comment to a bug, just remove the lines marked
      "Allow anyone to change comments." And if you want the reporter to have
      no special rights on bugs they have filed, just remove the entire section
      which refers to him.
    </para>
    
    <para>
1323
      More complex customizations are not much harder. Basically, you add
1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357
      a check in the right place in the function, i.e. after all the variables
      you are using have been set up. So, don't look at $ownerid before 
      $ownerid has been obtained from the database. You can either add a
      positive check, which returns 1 (allow) if certain conditions are true,
      or a negative check, which returns 0 (deny.) E.g.:
      <programlisting>    if ($field eq "qacontact") {
        if (UserInGroup("quality_assurance")) {
            return 1;
        } 
        else {
            return 0;
        }
    }</programlisting>
      This says that only users in the group "quality_assurance" can change
      the QA Contact field of a bug. Getting more weird:
      <programlisting>    if (($field eq "priority") &&
        ($vars->{'user'}{'login'} =~ /.*\@example\.com$/))
    {
        if ($oldvalue eq "P1") {
            return 1;
        } 
        else {
            return 0;
        }
    }</programlisting>
      This says that if the user is trying to change the priority field,
      and their email address is @example.com, they can only do so if the
      old value of the field was "P1". Not very useful, but illustrative.
    </para>
    
    <para>
      For a list of possible field names, look in 
      <filename>data/versioncache</filename> for the list called 
      <filename>@::log_columns</filename>. If you need help writing custom
1358
      rules for your organization, ask in the newsgroup.
1359 1360 1361
    </para>    
  </section>   
  
1362 1363 1364
  <section id="upgrading">
    <title>Upgrading to New Releases</title>

1365 1366 1367
    <para>Upgrading Bugzilla is something we all want to do from time to time,
    be it to get new features or pick up the latest security fix. How easy
    it is to update depends on a few factors.
1368
    </para>
1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554

    <itemizedlist>
      <listitem>
        <para>If the new version is a revision or a new point release</para>
      </listitem>
      <listitem>
        <para>How many, if any, local changes have been made</para>
      </listitem>
    </itemizedlist>

    <para>There are also three different methods to upgrade your installation.
    </para>

    <orderedlist>
      <listitem>
        <para>Using CVS (<xref linkend="upgrade-cvs"/>)</para>
      </listitem>
      <listitem>
        <para>Downloading a new tarball (<xref linkend="upgrade-tarball"/>)</para>
      </listitem>
      <listitem>
        <para>Applying the relevant patches (<xref linkend="upgrade-patches"/>)</para>
      </listitem>
    </orderedlist>

    <para>Which options are available to you may depend on how large a jump
    you are making and/or your network configuration.
    </para>

    <para>Revisions are normally released to fix security vulnerabilities
    and are distinguished by an increase in the third number. For example,
    when 2.16.2 was released, it was a revision to 2.16.1.
    </para>

    <para>Point releases are normally released when the Bugzilla team feels
    that there has been a significant amount of progress made between the
    last point release and the current time. These are often proceeded by a
    stabilization period and release candidates, however the use of 
    development versions or release candidates is beyond the scope of this
    document. Point releases can be distinguished by an increase in the
    second number, or minor version. For example, 2.16.2 is a newer point
    release than 2.14.5.
    </para>

    <para>The examples in this section are written as if you were updating
    to version 2.16.2.  The procedures are the same regardless if you are
    updating to a new point release or a new revision.  However, the chance
    of running into trouble increases when upgrading to a new point release,
    escpecially if you've made local changes.
    </para>

    <para>These examples also assume that your Bugzilla installation is at
    <filename>/var/www/html/bugzilla</filename>. If that is not the case,
    simply substitute the proper paths where appropriate.
    </para>

    <example id="upgrade-cvs">
      <title>Upgrading using CVS</title>

      <para>Every release of Bugzilla, whether it is a revision or a point
      release, is tagged in CVS.  Also, every tarball we have distributed
      since version 2.12 has been primed for using CVS. This does, however,
      require that you are able to access cvs-mirror.mozilla.org on port
      2401.

        <tip>
          <para>If you can do this, updating using CVS is probably the most
          painless method, especially if you have a lot of local changes.
          </para>
        </tip>
      </para>

      <programlisting>
bash$ <command>cd /var/www/html/bugzilla</command>
bash$ <command>cvs login</command>
Logging in to :pserver:anonymous@cvs-mirror.mozilla.org:2401/cvsroot
CVS password: <command>anonymous</command>
bash$ <command>cvs -q update -r BUGZILLA-2_16_2 -dP</command>
P checksetup.pl
P collectstats.pl
P globals.pl
P docs/rel_notes.txt
P template/en/default/list/quips.html.tmpl
      </programlisting>

      <para>
        <caution>
          <para>If a line in the output from <command>cvs update</command>
          begins with a <computeroutput>C</computeroutput> that represents a
          file with local changes that CVS was unable to properly merge. You
          need to resolve these conflicts manually before Bugzilla (or at
          least the portion using that file) will be usable.
          </para>
        </caution>

        <note>
          <para>You also need to run <command>./checksetup.pl</command>
          before your Bugzilla upgrade will be complete.
          </para>
        </note>
      </para>
    </example>

    <example id="upgrade-tarball">
      <title>Upgrading using the tarball</title>

      <para>If you are unable or unwilling to use CVS, another option that's
      always available is to download the latest tarball. This is the most
      difficult option to use, especially if you have local changes.
      </para>

      <programlisting>
bash$ <command>cd /var/www/html</command>
bash$ <command>wget ftp://ftp.mozilla.org/pub/webtools/bugzilla-2.16.2.tar.gz</command>
<emphasis>Output omitted</emphasis>
bash$ <command>tar xzvf bugzilla-2.16.2.tar.gz</command>
bugzilla-2.16.2/
bugzilla-2.16.2/.cvsignore
bugzilla-2.16.2/1x1.gif
<emphasis>Output truncated</emphasis>
bash$ <command>cd bugzilla-2.16.2</command>
bash$ <command>cp ../bugzilla/localconfig* .</command>
bash$ <command>cp -r ../bugzilla/data .</command>
bash$ <command>cd ..</command>
bash$ <command>mv bugzilla bugzilla.old</command>
bash$ <command>mv bugzilla-2.16.2 bugzilla</command>
bash$ <command>cd bugzilla</command>
bash$ <command>./checksetup.pl</command>
<emphasis>Output omitted</emphasis>
      </programlisting>

      <para>
        <warning>
          <para>The <command>cp</command> commands both end with periods which
          is a very important detail, it tells the shell that the destination
          directory is the current working directory. Also, the period at the
          beginning of the <command>./checksetup.pl</command> is important and
          can not be omitted.
          </para>
        </warning>

        <note>
          <para>You will now have to reapply any changes you have made to your
          local installation manually.
          </para>
        </note>
      </para>
    </example>

    <example id="upgrade-patches">
      <title>Upgrading using patches</title>

      <para>The Bugzilla team will normally make a patch file available for
      revisions to go from the most recent revision to the new one. You could
      also read the release notes and grab the patches attached to the
      mentioned bug, but it is safer to use the released patch file as
      sometimes patches get changed before they get checked in (for minor
      spelling fixes and the like). It is also theorectically possible to
      scour the fixed bug list and pick and choose which patches to apply
      from a point release, but this is not recommended either as what you'll
      end up with is a hodge podge Bugzilla that isn't really any version.
      This would also make it more difficult to upgrade in the future.
      </para>

      <programlisting>
bash$ <command>cd /var/www/html/bugzilla</command>
bash$ <command>wget ftp://ftp.mozilla.org/pub/webtools/bugzilla-2.16.1-to-2.16.2.diff.gz</command>
<emphasis>Output omitted</emphasis>
bash$ <command>gunzip bugzilla-2.16.1-to-2.16.2.diff.gz</command>
bash$ <command>patch -p1 &lt; bugzilla-2.16.1-to-2.16.2.diff</command>
patching file checksetup.pl
patching file collectstats.pl
patching file globals.pl
      </programlisting>

      <para>
        <caution>
          <para>If you do this, beware that this doesn't change the entires in
          your <filename id="dir">CVS</filename> directory so it may make
          updates using CVS (<xref linkend="upgrade-cvs"/>) more difficult in the
          future.
          </para>
        </caution>
      </para>
    </example>

1555 1556 1557 1558 1559
  </section>

  <!-- Integrating Bugzilla with Third-Party Tools -->
  &integration;

1560
</chapter>
1561

1562 1563 1564 1565
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-always-quote-attributes:t
1566 1567
sgml-auto-insert-required-elements:t
sgml-balanced-tag-edit:t
1568
sgml-exposed-tags:nil
1569 1570 1571
sgml-general-insert-case:lower
sgml-indent-data:t
sgml-indent-step:2
1572 1573
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
1574 1575 1576 1577 1578 1579
sgml-minimize-attributes:nil
sgml-namecase-general:t
sgml-omittag:t
sgml-parent-document:("Bugzilla-Guide.sgml" "book" "chapter")
sgml-shorttag:t
sgml-tag-region-if-active:t
1580 1581
End:
-->
1582