summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKohei Yoshino <kohei.yoshino@gmail.com>2018-08-24 22:33:44 +0200
committerdklawren <dklawren@users.noreply.github.com>2018-08-24 22:33:44 +0200
commit8f0d6063aa670f01ab1ac25d682589d1978c6e83 (patch)
treecc3e02407551dacf8b52c69d8855c38ce2dc7f89
parentf7b415b0354a32f36d37366b19e90f3834a01a69 (diff)
downloadbugzilla-8f0d6063aa670f01ab1ac25d682589d1978c6e83.tar.gz
bugzilla-8f0d6063aa670f01ab1ac25d682589d1978c6e83.tar.xz
Bug 1399721 - change canonical from bugzil.la to bugzilla.mozilla.org
-rw-r--r--Bugzilla/Install/Localconfig.pm17
-rw-r--r--README.rst5
-rw-r--r--extensions/BMO/template/en/default/hook/global/header-additional_header.html.tmpl2
-rw-r--r--template/en/default/setup/strings.txt.pl4
4 files changed, 20 insertions, 8 deletions
diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm
index e524535ac..6650eca27 100644
--- a/Bugzilla/Install/Localconfig.pm
+++ b/Bugzilla/Install/Localconfig.pm
@@ -164,6 +164,10 @@ use constant LOCALCONFIG_VARS => (
default => _migrate_param( "urlbase", "" ),
},
{
+ name => 'canonical_urlbase',
+ default => '',
+ },
+ {
name => 'attachment_base',
default => _migrate_param( "attachment_base", '' ),
},
@@ -294,13 +298,14 @@ sub _read_localconfig_from_file {
sub read_localconfig {
my ($include_deprecated) = @_;
+ my $config = $ENV{LOCALCONFIG_ENV}
+ ? _read_localconfig_from_env()
+ : _read_localconfig_from_file($include_deprecated);
- if ($ENV{LOCALCONFIG_ENV}) {
- return _read_localconfig_from_env();
- }
- else {
- return _read_localconfig_from_file($include_deprecated);
- }
+ # Use the site's URL as the default Canonical URL
+ $config->{canonical_urlbase} //= $config->{urlbase};
+
+ return $config;
}
#
diff --git a/README.rst b/README.rst
index 985be314e..05eb1df1f 100644
--- a/README.rst
+++ b/README.rst
@@ -252,9 +252,12 @@ BUGZILLA_UNSAFE_AUTH_DELEGATION
BMO_urlbase
The public url for this instance. Note that if this begins with https://
- abd BMO_inbound_proxies is set to '*' Bugzilla will believe the connection to it
+ and BMO_inbound_proxies is set to '*' Bugzilla will believe the connection to it
is using SSL.
+BMO_canonical_urlbase
+ The public url for the production instance, if different from urlbase above.
+
BMO_attachment_base
This is the url for attachments.
When the allow_attachment_display parameter is on, it is possible for a
diff --git a/extensions/BMO/template/en/default/hook/global/header-additional_header.html.tmpl b/extensions/BMO/template/en/default/hook/global/header-additional_header.html.tmpl
index f1896dccc..0566f48b3 100644
--- a/extensions/BMO/template/en/default/hook/global/header-additional_header.html.tmpl
+++ b/extensions/BMO/template/en/default/hook/global/header-additional_header.html.tmpl
@@ -21,7 +21,7 @@
<link rel="shortcut icon" href="extensions/BMO/web/images/favicon.ico">
[% IF bug %]
-<link id="shorturl" rev="canonical" href="https://bugzil.la/[% bug.bug_id FILTER uri %]">
+<link rel="canonical" href="[% Bugzilla.localconfig.canonical_urlbase FILTER none %]show_bug.cgi?id=[% bug.bug_id FILTER uri %]">
[% END %]
[%# *** Bug List Navigation *** %]
diff --git a/template/en/default/setup/strings.txt.pl b/template/en/default/setup/strings.txt.pl
index adb79884a..cb0ac4fe9 100644
--- a/template/en/default/setup/strings.txt.pl
+++ b/template/en/default/setup/strings.txt.pl
@@ -233,6 +233,10 @@ END
localconfig_urlbase => <<'END',
The URL that is the common initial leading part of all URLs.
END
+ localconfig_canonical_urlbase => <<'END',
+The URL that is the canonical initial leading part of all URLs.
+This will be the production url for a dev site, for instance.
+END
localconfig_use_suexec => <<'END',
Set this to 1 if Bugzilla runs in an Apache SuexecUserGroup environment.