]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1399721 - change canonical from bugzil.la to bugzilla.mozilla.org
authorKohei Yoshino <kohei.yoshino@gmail.com>
Fri, 24 Aug 2018 20:33:44 +0000 (16:33 -0400)
committerdklawren <dklawren@users.noreply.github.com>
Fri, 24 Aug 2018 20:33:44 +0000 (16:33 -0400)
Bugzilla/Install/Localconfig.pm
README.rst
extensions/BMO/template/en/default/hook/global/header-additional_header.html.tmpl
template/en/default/setup/strings.txt.pl

index e524535acd73e7222ddec87e133cdbde88764863..6650eca279faa6473f61e17bae7d53d603830679 100644 (file)
@@ -163,6 +163,10 @@ use constant LOCALCONFIG_VARS => (
         name    => 'urlbase',
         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;
 }
 
 #
index 985be314eee43d4f5dbdaf83d096a15e6ce40ff4..05eb1df1faf5f0017955cc33e6c5c452d1710ee9 100644 (file)
@@ -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
index f1896dccc7b706535de58a06ec5416af97302f07..0566f48b3cae1c79f28420c6c92a57bf24dde24a 100644 (file)
@@ -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 *** %]
index adb79884a85db8e417916190ac654856628cc82d..cb0ac4fe9bb337f2b3df8a14d8dacd6ed7a52856 100644 (file)
@@ -232,6 +232,10 @@ Only the keys listed below can be overridden.
 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.