summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Config/Common.pm48
-rw-r--r--Bugzilla/Install/Filesystem.pm14
-rw-r--r--Bugzilla/Install/Localconfig.pm11
-rw-r--r--Bugzilla/Install/Requirements.pm46
-rwxr-xr-xchecksetup.pl10
-rw-r--r--docs/en/rst/administering/parameters.rst36
-rwxr-xr-xeditparams.cgi2
-rwxr-xr-xshowdependencygraph.cgi2
-rw-r--r--template/en/default/bug/edit.html.tmpl4
-rw-r--r--template/en/default/reports/chart.png.tmpl13
-rw-r--r--template/en/default/reports/report-bar.png.tmpl13
-rw-r--r--template/en/default/reports/report-line.png.tmpl13
-rw-r--r--template/en/default/reports/report-pie.png.tmpl7
-rw-r--r--template/en/default/setup/strings.txt.pl31
14 files changed, 131 insertions, 119 deletions
diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm
index fe6a2c2c0..f7e37c6fc 100644
--- a/Bugzilla/Config/Common.pm
+++ b/Bugzilla/Config/Common.pm
@@ -24,9 +24,8 @@ use parent qw(Exporter);
@Bugzilla::Config::Common::EXPORT =
qw(check_multi check_numeric check_regexp check_url check_group
check_sslbase check_priority check_severity check_platform
- check_opsys check_shadowdb check_urlbase check_webdotbase
- check_user_verify_class check_ip check_font_file
- check_mail_delivery_method check_notification check_utf8
+ check_opsys check_shadowdb check_urlbase check_user_verify_class
+ check_ip check_mail_delivery_method check_notification check_utf8
check_bug_status check_smtp_auth check_theschwartz_available
check_maxattachmentsize check_email check_smtp_ssl
check_comment_taggers_group check_smtp_server
@@ -85,7 +84,7 @@ sub check_sslbase {
my $url = shift;
if ($url ne '') {
if ($url !~ m#^https://([^/]+).*/$#) {
- return "must be a legal URL, that starts with https and ends with a slash.";
+ return "must be a legal URL, that starts with https and ends with a slash";
}
my $host = $1;
# Fall back to port 443 if for some reason getservbyname() fails.
@@ -221,43 +220,6 @@ sub check_url {
return '';
}
-sub check_webdotbase {
- my ($value) = (@_);
- $value = trim($value);
- if ($value eq "") {
- return "";
- }
- if($value !~ /^https?:/) {
- if(! -x $value) {
- return "The file path \"$value\" is not a valid executable. Please specify the complete file path to 'dot' if you intend to generate graphs locally.";
- }
- # Check .htaccess allows access to generated images
- my $webdotdir = bz_locations()->{'webdotdir'};
- if(-e "$webdotdir/.htaccess") {
- open HTACCESS, "$webdotdir/.htaccess";
- if(! grep(/ \\\.png\$/,<HTACCESS>)) {
- return "Dependency graph images are not accessible.\nAssuming that you have not modified the file, delete $webdotdir/.htaccess and re-run checksetup.pl to rectify.\n";
- }
- close HTACCESS;
- }
- }
- return "";
-}
-
-sub check_font_file {
- my ($font) = @_;
- $font = trim($font);
- return '' unless $font;
-
- if ($font !~ /\.ttf$/) {
- return "The file must point to a TrueType font file (its extension must be .ttf)"
- }
- if (! -f $font) {
- return "The file '$font' cannot be found. Make sure you typed the full path to the file"
- }
- return '';
-}
-
sub check_user_verify_class {
# doeditparams traverses the list of params, and for each one it checks,
# then updates. This means that if one param checker wants to look at
@@ -535,10 +497,6 @@ valid group is provided.
=item check_email
-=item check_webdotbase
-
-=item check_font_file
-
=item get_param_list
=item check_maxattachmentsize
diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm
index 523c09fec..2120cbc57 100644
--- a/Bugzilla/Install/Filesystem.pm
+++ b/Bugzilla/Install/Filesystem.pm
@@ -349,13 +349,13 @@ EOT
},
"$webdotdir/.htaccess" => { perms => WS_SERVE, contents => <<EOT
-# Restrict access to .dot files to the public webdot server at research.att.com
-# if research.att.com ever changes their IP, or if you use a different
-# webdot server, you'll need to edit this
-<FilesMatch \\.dot\$>
- Allow from 192.20.225.0/24
- Deny from all
-</FilesMatch>
+# If you run a local webdot server, you will need to allow it access to
+# generated .dot files. Uncomment this section and replace the IP address with
+# the IP address of your webdot server.
+#<FilesMatch \\.dot\$>
+# Allow from 127.0.0.1/24
+# Deny from all
+#</FilesMatch>
# Allow access to .png files created by a local copy of 'dot'
<FilesMatch \\.png\$>
diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm
index 7f473cc77..4ccd107ae 100644
--- a/Bugzilla/Install/Localconfig.pm
+++ b/Bugzilla/Install/Localconfig.pm
@@ -109,6 +109,14 @@ use constant LOCALCONFIG_VARS => (
default => sub { dirname(bin_loc('diff')) },
},
{
+ name => 'font_file',
+ default => '',
+ },
+ {
+ name => 'webdotbase',
+ default => '',
+ },
+ {
name => 'site_wide_secret',
# 64 characters is roughly the equivalent of a 384-bit key, which
# is larger than anybody would ever be able to brute-force.
@@ -225,6 +233,9 @@ sub update_localconfig {
if (exists $answer->{$name}) {
$localconfig->{$name} = $answer->{$name};
}
+ elsif (exists Bugzilla->params->{$name}) {
+ $localconfig->{$name} = Bugzilla->params->{$name};
+ }
else {
# If the user did not supply an answers file, then they get
# notified about every variable that gets added. If there was
diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm
index 622d1db66..ee50a526a 100644
--- a/Bugzilla/Install/Requirements.pm
+++ b/Bugzilla/Install/Requirements.pm
@@ -30,7 +30,8 @@ our @EXPORT = qw(
FEATURE_FILES
check_requirements
- check_graphviz
+ check_webdotbase
+ check_font_file
have_vers
install_command
map_files_to_features
@@ -655,10 +656,10 @@ sub _translate_feature {
return join(', ', @strings);
}
-sub check_graphviz {
+sub check_webdotbase {
my ($output) = @_;
- my $webdotbase = Bugzilla->params->{'webdotbase'};
+ my $webdotbase = Bugzilla->localconfig->{'webdotbase'};
return 1 if $webdotbase =~ /^https?:/;
my $return;
@@ -677,7 +678,7 @@ sub check_graphviz {
if (-e "$webdotdir/.htaccess") {
my $htaccess = new IO::File("$webdotdir/.htaccess", 'r')
|| die "$webdotdir/.htaccess: " . $!;
- if (!grep(/png/, $htaccess->getlines)) {
+ if (!grep(/ \\\.png\$/, $htaccess->getlines)) {
print STDERR install_string('webdot_bad_htaccess',
{ dir => $webdotdir }), "\n";
}
@@ -687,6 +688,31 @@ sub check_graphviz {
return $return;
}
+sub check_font_file {
+ my ($output) = @_;
+
+ my $font_file = Bugzilla->localconfig->{'font_file'};
+
+ my $readable;
+ $readable = 1 if -r $font_file;
+
+ my $ttf;
+ $ttf = 1 if $font_file =~ /\.ttf$/;
+
+ if ($output) {
+ _checking_for({ package => 'Font file', ok => $readable && $ttf});
+ }
+
+ if (!$readable) {
+ print install_string('bad_font_file', { file => $font_file }), "\n";
+ }
+ elsif (!$ttf) {
+ print install_string('bad_font_file_name', { file => $font_file }), "\n";
+ }
+
+ return $readable && $ttf;
+}
+
# This was originally clipped from the libnet Makefile.PL, adapted here for
# accurate version checking.
sub have_vers {
@@ -910,7 +936,7 @@ optional modules.
=back
-=item C<check_graphviz($output)>
+=item C<check_webdotbase($output)>
Description: Checks if the graphviz binary specified in the
C<webdotbase> parameter is a valid binary, or a valid URL.
@@ -920,6 +946,16 @@ Params: C<$output> - C<$true> if you want the function to
Returns: C<1> if the check was successful, C<0> otherwise.
+=item C<check_font_file($output)>
+
+Description: Checks if the font file specified in the C<font_type> parameter
+ is a valid-looking font file.
+
+Params: C<$output> - C<$true> if you want the function to
+ print out information about what it's doing.
+
+Returns: C<1> if the check was successful, C<0> otherwise.
+
=item C<have_vers($module, $output)>
Description: Tells you whether or not you have the appropriate
diff --git a/checksetup.pl b/checksetup.pl
index 50ca8bda8..eb6b3f857 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -151,7 +151,15 @@ fix_all_file_permissions(!$silent);
# If we are using a local 'dot' binary, verify the specified binary exists
# and that the generated images are accessible.
-check_graphviz(!$silent) if Bugzilla->params->{'webdotbase'};
+check_webdotbase(!$silent) if $lc_hash->{'webdotbase'};
+
+###########################################################################
+# Check font file setup
+###########################################################################
+
+# If we are using a local font file, verify the specified file exists and
+# that it has the correct extension.
+check_font_file(!$silent) if $lc_hash->{'font_file'};
###########################################################################
# Changes to the fielddefs --TABLE--
diff --git a/docs/en/rst/administering/parameters.rst b/docs/en/rst/administering/parameters.rst
index 1a0999093..ce6a55f6a 100644
--- a/docs/en/rst/administering/parameters.rst
+++ b/docs/en/rst/administering/parameters.rst
@@ -337,42 +337,6 @@ collapsed_comment_tags
A comma-separated list of tags which, when applied to comments, will
cause them to be collapsed by default.
-.. _param-dependency-graphs:
-
-Graphs
-======
-
-Bugzilla can draw graphs of bug-dependency relationships, using a tool called
-:file:`dot` (from the `GraphViz project <http://graphviz.org/>`_) or a web
-service called Web Dot. This page allows you to set the location of the binary
-or service. If no Web Dot server or binary is specified, then dependency
-graphs will be disabled.
-
-webdotbase
- You may set this parameter to any of the following:
-
- * A complete file path to :command:`dot` (part of GraphViz), which will
- generate the graphs locally.
- * A URL prefix pointing to an installation of the Web Dot package, which
- will generate the graphs remotely.
- * A blank value, which will disable dependency graphing.
-
- The default value is blank. We recommend using a local install of
- :file:`dot`. If you change this value to a web service, make certain that
- the Web Dot server can read files from your Web Dot directory. On Apache
- you do this by editing the :file:`.htaccess` file; for other systems the
- needed measures may vary. You can run :command:`checksetup.pl` to
- recreate the :file:`.htaccess` file if it has been lost.
-
-font_file
- You can specify the full path to a TrueType font file which will be used
- to display text (labels, legends, ...) in charts and graphical reports.
- To support as many languages as possible, we recommend to specify a
- TrueType font such as Unifont which supports all printable characters in
- the Basic Multilingual Plane. If you leave this parameter empty, a default
- font will be used, but its support is limited to English characters only
- and so other characters will be displayed incorrectly.
-
.. _param-group-security:
Group Security
diff --git a/editparams.cgi b/editparams.cgi
index ae569c2eb..5484f5fdc 100755
--- a/editparams.cgi
+++ b/editparams.cgi
@@ -89,7 +89,7 @@ if ($action eq 'save' && $current_module) {
}
# Stop complaining if the URL has no trailing slash.
# XXX - This hack can go away once bug 303662 is implemented.
- if ($name =~ /(?<!webdot)base$/) {
+ if ($name =~ /base$/) {
$value = "$value/" if ($value && $value !~ m#/$#);
}
}
diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi
index 02c8fd94f..528b9cd61 100755
--- a/showdependencygraph.cgi
+++ b/showdependencygraph.cgi
@@ -235,7 +235,7 @@ if ($bug_count > MAX_WEBDOT_BUGS) {
ThrowUserError("webdot_too_large");
}
-my $webdotbase = Bugzilla->params->{'webdotbase'};
+my $webdotbase = Bugzilla->localconfig->{'webdotbase'};
if ($webdotbase =~ /^https?:/) {
# Remote dot server. We don't hardcode 'urlbase' here in case
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 516a24ed8..e27f47263 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -595,7 +595,8 @@
<td colspan="2" id="show_dependency_tree_or_graph">
Show dependency <a href="showdependencytree.cgi?id=[% bug.bug_id %]&amp;hide_resolved=1">tree</a>
- [% IF Param('webdotbase') %]
+ [% USE Bugzilla %]
+ [% IF Bugzilla.localconfig.webdotbase %]
/&nbsp;<a href="showdependencygraph.cgi?id=[% bug.bug_id %]">graph</a>
[% END %]
</td>
@@ -968,7 +969,6 @@
[% BLOCK section_customfields %]
[%# *** Custom Fields *** %]
- [% USE Bugzilla %]
[% FOREACH field = Bugzilla.active_custom_fields %]
<tr>
[% PROCESS bug/field.html.tmpl value = bug.${field.name}
diff --git a/template/en/default/reports/chart.png.tmpl b/template/en/default/reports/chart.png.tmpl
index 91944fee5..336efda2a 100644
--- a/template/en/default/reports/chart.png.tmpl
+++ b/template/en/default/reports/chart.png.tmpl
@@ -34,12 +34,13 @@
END;
-%]
-[% IF Param("font_file") %]
- [% graph.set_x_axis_font(Param("font_file"), 9);
- graph.set_x_label_font(Param("font_file"), 10);
- graph.set_y_axis_font(Param("font_file"), 9);
- graph.set_y_label_font(Param("font_file"), 10);
- graph.set_legend_font(Param("font_file"), 9);
+[% USE Bugzilla %]
+[% IF Bugzilla.localconfig.font_file %]
+ [% graph.set_x_axis_font(Bugzilla.localconfig.font_file, 9);
+ graph.set_x_label_font(Bugzilla.localconfig.font_file, 10);
+ graph.set_y_axis_font(Bugzilla.localconfig.font_file, 9);
+ graph.set_y_label_font(Bugzilla.localconfig.font_file, 10);
+ graph.set_legend_font(Bugzilla.localconfig.font_file, 9);
%]
[% END %]
diff --git a/template/en/default/reports/report-bar.png.tmpl b/template/en/default/reports/report-bar.png.tmpl
index d879f6dd1..3f0faa5d9 100644
--- a/template/en/default/reports/report-bar.png.tmpl
+++ b/template/en/default/reports/report-bar.png.tmpl
@@ -36,12 +36,13 @@
END;
-%]
-[% IF Param("font_file") %]
- [% graph.set_x_axis_font(Param("font_file"), 9);
- graph.set_x_label_font(Param("font_file"), 10);
- graph.set_y_axis_font(Param("font_file"), 9);
- graph.set_y_label_font(Param("font_file"), 10);
- graph.set_legend_font(Param("font_file"), 9);
+[% USE Bugzilla %]
+[% IF Bugzilla.localconfig.font_file %]
+ [% graph.set_x_axis_font(Bugzilla.localconfig.font_file, 9);
+ graph.set_x_label_font(Bugzilla.localconfig.font_file, 10);
+ graph.set_y_axis_font(Bugzilla.localconfig.font_file, 9);
+ graph.set_y_label_font(Bugzilla.localconfig.font_file, 10);
+ graph.set_legend_font(Bugzilla.localconfig.font_file, 9);
%]
[% END %]
diff --git a/template/en/default/reports/report-line.png.tmpl b/template/en/default/reports/report-line.png.tmpl
index 585133afd..a4baff641 100644
--- a/template/en/default/reports/report-line.png.tmpl
+++ b/template/en/default/reports/report-line.png.tmpl
@@ -38,12 +38,13 @@
END;
-%]
-[% IF Param("font_file") %]
- [% graph.set_x_axis_font(Param("font_file"), 9);
- graph.set_x_label_font(Param("font_file"), 10);
- graph.set_y_axis_font(Param("font_file"), 9);
- graph.set_y_label_font(Param("font_file"), 10);
- graph.set_legend_font(Param("font_file"), 9);
+[% USE Bugzilla %]
+[% IF Bugzilla.localconfig.font_file %]
+ [% graph.set_x_axis_font(Bugzilla.localconfig.font_file, 9);
+ graph.set_x_label_font(Bugzilla.localconfig.font_file, 10);
+ graph.set_y_axis_font(Bugzilla.localconfig.font_file, 9);
+ graph.set_y_label_font(Bugzilla.localconfig.font_file, 10);
+ graph.set_legend_font(Bugzilla.localconfig.font_file, 9);
%]
[% END %]
diff --git a/template/en/default/reports/report-pie.png.tmpl b/template/en/default/reports/report-pie.png.tmpl
index cc2a1325a..6808cfb77 100644
--- a/template/en/default/reports/report-pie.png.tmpl
+++ b/template/en/default/reports/report-pie.png.tmpl
@@ -20,9 +20,10 @@
END;
-%]
-[% IF Param("font_file") %]
- [% graph.set_title_font(Param("font_file"), 10);
- graph.set_value_font(Param("font_file"), 9);
+[% USE Bugzilla %]
+[% IF Bugzilla.localconfig.font_file %]
+ [% graph.set_title_font(Bugzilla.localconfig.font_file, 10);
+ graph.set_value_font(Bugzilla.localconfig.font_file, 9);
%]
[% END %]
diff --git a/template/en/default/setup/strings.txt.pl b/template/en/default/setup/strings.txt.pl
index c63d65ce1..b6cd693d7 100644
--- a/template/en/default/setup/strings.txt.pl
+++ b/template/en/default/setup/strings.txt.pl
@@ -23,6 +23,13 @@ happens when you are not running checksetup.pl as ##root##. To see the
problem we ran into, run: ##command##
END
bad_executable => 'not a valid executable: ##bin##',
+ bad_font_file => <<'END',
+The file ##file## cannot be found. Make sure you typed the full path to the file
+END
+ bad_font_file_name => <<'END',
+The file ##file## must point to a TrueType font file (its extension must be
+.ttf)
+END
blacklisted => '(blacklisted)',
bz_schema_exists_before_220 => <<'END',
You are upgrading from a version before 2.20, but the bz_schema table
@@ -215,6 +222,15 @@ For the "Difference Between Two Patches" feature to work, we need to know
what directory the "diff" bin is in. (You only need to set this if you
are using that feature of the Patch Viewer.)
END
+ localconfig_font_file => <<'END',
+You can specify the full path to a TrueType font file, which will be used to
+display text (labels, legends, ...) in charts and graphical reports. To support
+as many languages as possible, we recommend to specify a TrueType font such as
+Unifont (http://unifoundry.com/unifont.html), which supports all printable
+characters in the Basic Multilingual Plane. If you leave this parameter empty,
+a default font will be used, but its support is limited to English characters
+only and so other characters will be displayed incorrectly.
+END
localconfig_index_html => <<'END',
Most web servers will allow you to use index.cgi as a directory
index, and many come preconfigured that way, but if yours doesn't
@@ -252,6 +268,21 @@ a normal webserver environment.
If set to 1, checksetup.pl will set file permissions so that Bugzilla
works in a SuexecUserGroup environment.
END
+ localconfig_webdotbase => <<'END',
+It is possible to show graphs of dependent bugs. You may set this parameter to
+any of the following:
+
+- A complete file path to 'dot' (part of GraphViz (http://www.graphviz.org/))
+ will generate the graphs locally.
+- A URL prefix pointing to an installation of the webdot package will generate
+ the graphs remotely. (append "/%urlbase%" to the URL prefix)
+- A blank value will disable dependency graphing.
+
+If you use a webdot URL prefix, make certain that the webdot server can read
+files from your webdot directory. On Apache you do this by editing the
+.htaccess file, for other systems the needed measures may vary. You can run
+checksetup.pl to recreate the .htaccess file if it has been lost.
+END
localconfig_webservergroup => <<'END',
The name of the group that your web server runs as. On Red Hat
distributions, this is usually "apache". On Debian/Ubuntu, it is