Fixup kibanaurl for cloudy mozdef setup

This commit is contained in:
Brandon Myers 2019-05-13 16:43:01 -05:00
Родитель 18e12c47c2
Коммит 2c7181ccc8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 8AA79AD83045BBC7
3 изменённых файлов: 2 добавлений и 20 удалений

Просмотреть файл

@ -122,9 +122,7 @@ Resources:
# Drives the configuration of variables for a variety of containers.
OPTIONS_ESSERVERS=${ESURL}
OPTIONS_KIBANAURL=${KibanaURL}
# The OPTIONS_METEOR_KIBANAURL uses the reserved word "relative" which triggers MozDef
# to use relative links to Kibana : https://github.com/mozilla/MozDef/pull/956
OPTIONS_METEOR_KIBANAURL=https://relative:9090/_plugin/kibana/
OPTIONS_METEOR_KIBANAURL=$OPTIONS_KIBANAURL
OPTIONS_METEOR_ROOTURL=https://${DomainName}
# See https://github.com/mozilla-iam/mozilla.oidc.accessproxy/blob/master/README.md#setup
# Future support will be added for cognito backed authentication.

Просмотреть файл

@ -14,7 +14,7 @@ Copyright (c) 2014 Mozilla Corporation
<li><img class="mozillalogo" src="/images/mozilla.svg"></li>
<li><a class="mozdef" href="/" title="MOZDEF">MOZDEF</a></li>
{{#if isFeature "kibana"}}
<li> <a target="_blank" href={{ resolveKibanaURL mozdef.kibanaURL }}>Kibana</a>
<li> <a target="_blank" href={{ mozdef.kibanaURL }}>Kibana</a>
<ul>
<li>
{{#each kibanadashboards as item}}

Просмотреть файл

@ -12,21 +12,5 @@ Template.menu.helpers({
haveFeatures: function(){
//subscription has records?
return features.find().count() >0;
},
resolveKibanaURL: function(url){
// special function just for the menu
// to adjust the kibana URL if we are told to make it 'relative'
// to whatever DNS name we are running on
// i.e. pass in http://relative:9090/app/kibana
// when the running dns is something.com
// and we will set the hostname to something.com instead of 'relative'
var kibanaURL = new URL(url);
if ( kibanaURL.hostname == 'relative' ){
// we were passed something like OPTIONS_METEOR_KIBANAURL=http://relative:9090/app/kibana
// so lets figure out where we should be
dnsURL=new URL(document.URL);
kibanaURL.hostname = dnsURL.hostname;
}
return kibanaURL;
}
});