diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-10-14 18:16:48 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-10-14 18:16:48 +0200 |
commit | 6367a26da4093a8379e370ef328e9507c98b2e7e (patch) | |
tree | 14c29aefed892abd5e9a53954019dc44242a9a7c | |
parent | f64b0d503df0ea11b3ec26f452c581493f832233 (diff) | |
parent | 8f0d6063aa670f01ab1ac25d682589d1978c6e83 (diff) | |
download | bugzilla-6367a26da4093a8379e370ef328e9507c98b2e7e.tar.gz bugzilla-6367a26da4093a8379e370ef328e9507c98b2e7e.tar.xz |
Merge remote-tracking branch 'bmo/master'
-rw-r--r-- | Bugzilla.pm | 2 | ||||
-rw-r--r-- | Bugzilla/Install/Localconfig.pm | 22 | ||||
-rw-r--r-- | README.rst | 5 | ||||
-rw-r--r-- | extensions/BMO/template/en/default/hook/global/header-additional_header.html.tmpl | 2 | ||||
-rw-r--r-- | template/en/default/setup/strings.txt.pl | 4 |
5 files changed, 21 insertions, 14 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm index 0b88f5c3e..3ba535c8e 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -13,7 +13,7 @@ use warnings; use Bugzilla::Logging; -our $VERSION = '5.15'; +our $VERSION = '5.16'; use Bugzilla::Auth; use Bugzilla::Auth::Persist::Cookie; diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm index ac21a0cb7..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,18 +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}) { - my $lc = _read_localconfig_from_env(); - if ( $lc->{urlbase} eq 'AUTOMATIC' ) { - $lc->{urlbase} = sprintf 'http://%s:%d/%s', hostname(), $ENV{PORT}, $ENV{BZ_QA_LEGACY_MODE} ? 'bmo/' : ''; - $ENV{BZ_BASE_URL} = sprintf 'http://%s:%d', hostname(), $ENV{PORT}; - } - return $lc; - } - 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 0d8d03f38..2a0fa289c 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. |