Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
updated proxy templates to be current
Browse files Browse the repository at this point in the history
changed config to pull from attributes
  • Loading branch information
paulczar committed Mar 2, 2014
1 parent 913b6c5 commit 5ae0ee5
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 64 deletions.
19 changes: 11 additions & 8 deletions Berksfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,34 @@
"locked_version": "2.3.1"
},
"rsyslog": {
"locked_version": "1.10.2"
"locked_version": "1.12.2"
},
"build-essential": {
"locked_version": "1.4.2"
"locked_version": "1.4.4"
},
"ohai": {
"locked_version": "1.1.12"
},
"runit": {
"locked_version": "1.4.0"
"locked_version": "1.5.8"
},
"yum-epel": {
"locked_version": "0.3.4"
},
"dmg": {
"locked_version": "2.0.8"
"locked_version": "2.2.0"
},
"windows": {
"locked_version": "1.11.0"
"locked_version": "1.30.0"
},
"chef_handler": {
"locked_version": "1.1.4"
"locked_version": "1.1.5"
},
"aws": {
"locked_version": "0.101.6"
"locked_version": "2.1.0"
},
"xml": {
"locked_version": "1.2.0"
"locked_version": "1.2.2"
},
"monit": {
"locked_version": "0.7.1"
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This file is used to list changes made in each version of kibana.

## 1.2.1:
* proxy backend healthcheck
* update proxy templates to match kibana master
* changed config.js template to pull from attributes

## 1.2.0:

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ As with most cookbooks I write, this one is hopefully flexible enough to be wrap
- `node['kibana']['webserver_listen']` - The ip address the web server will listen on
- `node['kibana']['webserver_port']` - The port the webserver will listen on
- `node['kibana']['webserver_scheme']` - Scheme helper if webserver is outside of this cookbook `http://` or `https://`
- `node['kibana']['config']['elasticsearch']` - The URL or a javascript expression with for the elasticsearch server to connect to

#### kibana::nginx

Expand Down
9 changes: 9 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,13 @@
default['kibana']['webserver_listen'] = node.ipaddress
default['kibana']['webserver_port'] = 80
default['kibana']['webserver_scheme'] = "http://"
default['kibana']['config']['kibana_index'] = "kibana-int"
default['kibana']['config']['panel_names'] = [
'histogram', 'map', 'pie', 'table', 'filtering', 'timepicker', 'text', 'fields',
'hits', 'dashcontrol','column', 'derivequeries', 'trends', 'bettermap', 'query', 'terms'
]
default['kibana']['config']['default_route'] = '/dashboard/file/logstash.json'

# include quote inside this next variable if not using window.location style variables...
# e.g. = "'http://elasticsearch.example.com:9200'"
default['kibana']['config']['elasticsearch'] = "window.location.protocol+\"//\"+window.location.hostname+\":\"+window.location.port"
48 changes: 6 additions & 42 deletions templates/default/config.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,11 @@ function (Settings) {

return new Settings({

/**
* URL to your elasticsearch server. You almost certainly don't
* want 'http://localhost:9200' here. Even if Kibana and ES are on
* the same host
*
* By default this will attempt to reach ES at the same host you have
* elasticsearch installed on. You probably want to set it to the FQDN of your
* elasticsearch host
* @type {String}
*/
elasticsearch: window.location.protocol+"//"+window.location.hostname+":"+window.location.port,
<%= " elasticsearch: #{node['kibana']['config']['elasticsearch']}," %>
<%= " kibana_index: \"#{node['kibana']['config']['kibana_index']}\"," %>
<%= " default_route: \"#{node['kibana']['config']['default_route']}\"," %>
<%= " panel_names: #{node['kibana']['config']['panel_names']}" %>

/**
* The default ES index to use for storing Kibana specific object
* such as stored dashboards
* @type {String}
*/
kibana_index: "kibana-int",

/**
* Panel modules available. Panels will only be loaded when they are defined in the
* dashboard, but this list is used in the "add panel" interface.
* @type {Array}
*/
panel_names: [
'histogram',
'map',
'pie',
'table',
'filtering',
'timepicker',
'text',
'fields',
'hits',
'dashcontrol',
'column',
'derivequeries',
'trends',
'bettermap',
'query',
'terms'
]
});
});
});

16 changes: 8 additions & 8 deletions templates/default/kibana-apache.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@

# Proxy for cluster health
<LocationMatch "^(/_cluster/health)$">
ProxyPassMatch http://<%= @params[:es_server] %>:<%= @params[:es_port] %>
ProxyPassReverse http://<%= @params[:es_server] %>:<%= @params[:es_port] %>
ProxyPassMatch http://<%= @params[:es_server] %>:<%= @params[:es_port] %>/$1
ProxyPassReverse http://<%= @params[:es_server] %>:<%= @params[:es_port] %>/$1
</LocationMatch>

# Proxy for _aliases and .*/_search
<LocationMatch "^(/_aliases|/_nodes|/.*/_mapping|/.*/_search|/.*/_aliases)$">
ProxyPassMatch <%= @params[:es_scheme] %><%= @params[:es_server] %>:<%= @params[:es_port] %>
ProxyPassReverse <%= @params[:es_scheme] %><%= @params[:es_server] %>:<%= @params[:es_port] %>
<LocationMatch "^/(_nodes|_aliases|.*/_aliases|_search|.*/_search|_mapping|.*/_mapping)$">
ProxyPassMatch <%= @params[:es_scheme] %><%= @params[:es_server] %>:<%= @params[:es_port] %>/$1
ProxyPassReverse <%= @params[:es_scheme] %><%= @params[:es_server] %>:<%= @params[:es_port] %>/$1
</LocationMatch>

# Proxy for kibana-int/{dashboard,temp} stuff (if you don't want auth on /, then you will want these to be protected)
<LocationMatch "^(/kibana-int/dashboard/|/kibana-int/temp).*$">
ProxyPassMatch <%= @params[:es_scheme] %><%= @params[:es_server] %>:<%= @params[:es_port] %>
ProxyPassReverse <%= @params[:es_scheme] %><%= @params[:es_server] %>:<%= @params[:es_port] %>
<LocationMatch "^/(kibana-int/dashboard/|kibana-int/temp)(.*)$">
ProxyPassMatch <%= @params[:es_scheme] %><%= @params[:es_server] %>:<%= @params[:es_port] %>/$1$2
ProxyPassReverse <%= @params[:es_scheme] %><%= @params[:es_server] %>:<%= @params[:es_port] %>$1$2
</LocationMatch>

</VirtualHost>
14 changes: 8 additions & 6 deletions templates/default/kibana-nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,32 @@ server {
index index.html index.htm;
}

location ~ ^/_aliases$ {
location ~ ^/_aliases$ {
proxy_pass <%= @es_scheme %><%= @es_server %>:<%= @es_port %>;
proxy_read_timeout 90;
}
location ~ ^/_nodes$ {
location ~ ^/.*/_aliases$ {
proxy_pass <%= @es_scheme %><%= @es_server %>:<%= @es_port %>;
proxy_read_timeout 90;
}
location ~ ^/.*/_search$ {
location ~ ^/_nodes$ {
proxy_pass <%= @es_scheme %><%= @es_server %>:<%= @es_port %>;
proxy_read_timeout 90;
}
location ~ ^/.*/_mapping$ {
location ~ ^/.*/_search$ {
proxy_pass <%= @es_scheme %><%= @es_server %>:<%= @es_port %>;
proxy_read_timeout 90;
}
location ~ ^/.*/_aliases$ {
location ~ ^/.*/_mapping$ {
proxy_pass <%= @es_scheme %><%= @es_server %>:<%= @es_port %>;
proxy_read_timeout 90;
}
location ~ ^/_cluster/health$ {
proxy_pass http://<%= @es_server %>:<%= @es_port %>;
proxy_pass <%= @es_scheme %><%= @es_server %>:<%= @es_port %>;
proxy_read_timeout 90;
}

# password protected end points
location ~ ^/kibana-int/dashboard/.*$ {
proxy_pass <%= @es_scheme %><%= @es_server %>:<%= @es_port %>;
proxy_read_timeout 90;
Expand Down

0 comments on commit 5ae0ee5

Please sign in to comment.