Skip to content

Commit 737231a

Browse files
authored
Merge pull request #133 from dlumbrer/integration-6.8.6
Add docker image for secured version and README with the details
2 parents 3a98c27 + 57941c9 commit 737231a

File tree

3 files changed

+269
-38
lines changed

3 files changed

+269
-38
lines changed

README.md

Lines changed: 83 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,96 @@
1-
# Kibana
1+
# Kibiter 6.8.6
22

3-
Kibana is your window into the [Elastic Stack](https://www.elastic.co/products). Specifically, it's a browser-based analytics and search dashboard for Elasticsearch.
3+
Kibiter is a custom soft fork of [Kibana](https://github.com/elastic/kibana) which empowers [GrimoireLab](https://chaoss.github.io/grimoirelab/) Panels with metrics & data visualizations.
44

5-
- [Getting Started](#getting-started)
6-
- [Using a Kibana Release](#using-a-kibana-release)
7-
- [Building and Running Kibana, and/or Contributing Code](#building-and-running-kibana-andor-contributing-code)
8-
- [Documentation](#documentation)
9-
- [Version Compatibility with Elasticsearch](#version-compatibility-with-elasticsearch)
10-
- [Questions? Problems? Suggestions?](#questions-problems-suggestions)
5+
- [Installation](#installation)
6+
- [Features](#features)
7+
- [Compatibility with Elasticsearch](#compatibility-with-elasticsearch)
8+
- [Contributing](#contributing)
9+
- [License](#license)
1110

12-
## Getting Started
11+
## Installation
1312

14-
If you just want to try Kibana out, check out the [Elastic Stack Getting Started Page](https://www.elastic.co/start) to give it a whirl.
13+
There are several ways for installing Kibiter on your system: from releases, Docker images or source code.
1514

16-
If you're interested in diving a bit deeper and getting a taste of Kibana's capabilities, head over to the [Kibana Getting Started Page](https://www.elastic.co/guide/en/kibana/current/getting-started.html).
15+
### Releases
1716

18-
### Using a Kibana Release
17+
- Go to [release tab](https://github.com/chaoss/grimoirelab-kibiter/releases) and download the version you want.
1918

20-
If you want to use a Kibana release in production, give it a test run, or just play around:
19+
### Docker images
2120

22-
- Download the latest version on the [Kibana Download Page](https://www.elastic.co/downloads/kibana).
23-
- Learn more about Kibana's features and capabilities on the
24-
[Kibana Product Page](https://www.elastic.co/products/kibana).
25-
- We also offer a hosted version of Kibana on our
26-
[Cloud Service](https://www.elastic.co/cloud/as-a-service).
21+
There are four Docker images of Kibiter, they have the following tags:
2722

28-
### Building and Running Kibana, and/or Contributing Code
23+
- `bitergia/kibiter:community-v6.8.6-X` (being X the version of the release), the image that corresponds to the community version of Kibiter.
24+
- `bitergia/kibiter:optimized-v6.8.6-X` (being X the version of the release), the image that corresponds to the optimized version of Kibiter.
25+
- `bitergia/kibiter:secured-v6.8.6-X` (being X the version of the release), the image that corresponds to the secured (with Search Guard) version of Kibiter.
2926

30-
You may want to build Kibana locally to contribute some code, test out the latest features, or try
31-
out an open PR:
27+
#### Docker env variables for the secured version
3228

33-
- [CONTRIBUTING.md](CONTRIBUTING.md) will help you get Kibana up and running.
34-
- If you would like to contribute code, please follow our [STYLEGUIDE.md](STYLEGUIDE.md).
35-
- Learn more about our UI code with [UI_SYSTEMS.md](src/ui/public/UI_SYSTEMS.md).
36-
- For all other questions, check out the [FAQ.md](FAQ.md) and
37-
[wiki](https://github.com/elastic/kibana/wiki).
29+
There are docker env variables for the secured image (`bitergia/kibiter:secured-v6.8.6-X`) that should be defined:
3830

39-
## Documentation
31+
- `ELASTICSEARCH_URL`: This env variable defines the URL of the ElasticSearch that Kibiter will connect.
32+
- `BASE_PATH`: Enables you to specify a path to mount Kibiter at if you are running behind a proxy.
33+
- `PROJECT_NAME`: The name of the project that will be in the menu top bar and the page title.
34+
- `ELASTICSEARCH_USER`: Username that will use Kibiter to connect to ElasticSearch.
35+
- `ELASTICSEARCH_PASSWORD`: Password of the username that will use Kibiter to connect to ElasticSearch.
36+
- `ANONYMOUS_USER`: If true, the anonymous user will be activated. If not defined or false, the anonymous user will be deactivated. ElasticSearch with SearchGuard plugin must have activated the anonymous authentication (`ANONYMOUS_USER` if using [Bitergia](https://github.com/Bitergia/elasticsearch) ElasticSearch image).
37+
- `LOGIN_BRANDIMAGE`: This env variable must be an URL to an image, this image will be the logo of the login form. If not defined, the Bitergia logo will appear.
38+
- `LOGIN_TITLE`: A string (or HTML) that will define the title of the login. If not defined, the title will be: `Please login to Bitergia Analytics Dashboard`.
39+
- `LOGIN_SUBTITLE`: A string (or HTML) that will define the subtitle of the login. If not defined, the subtitle will be: `If you have forgotten your username or password, please contact the <a href="mailto:[email protected]?Subject=Credentials" target="_top">Bitergia staff</a>`.
4040

41-
Visit [Elastic.co](http://www.elastic.co/guide/en/kibana/current/index.html) for the full Kibana documentation.
41+
### Source code
4242

43-
For information about building the documentation, see the README in [elastic/docs](https://github.com/elastic/docs).
43+
Clone the repository from the branch `integration-6.8.6-<version>`, where version can be empty or //community//.
44+
```
45+
git clone https://github.com/chaoss/grimoirelab-kibiter -b integration-6.8.6-<version>
46+
```
4447

45-
## Version Compatibility with Elasticsearch
48+
Install the npm dependencies
4649

47-
Ideally, you should be running Elasticsearch and Kibana with matching version numbers. If your Elasticsearch has an older version number or a newer _major_ number than Kibana, then Kibana will fail to run. If Elasticsearch has a newer minor or patch number than Kibana, then the Kibana Server will log a warning.
50+
```
51+
cd grimoirelab-kibiter
52+
yarn kbn bootstrap
53+
```
4854

49-
_Note: The version numbers below are only examples, meant to illustrate the relationships between different types of version numbers._
55+
Launch Kibiter
56+
```
57+
./bin/kibana --oss
58+
```
5059

51-
| Situation | Example Kibana version | Example ES version | Outcome |
60+
## Features
61+
62+
Kibiter provides several features, not present in Kibana, that have been developed for GrimoireLab. The most important ones are described below.
63+
64+
### Panel menu
65+
66+
If you are using Kibiter with the [GrimoireLab](https://chaoss.github.io/grimoirelab/) tools, you will see a quick menu at the top of the page, like the one below:
67+
68+
<img alt="Panel menu" src="https://i.imgur.com/6hO4aEV.png">
69+
70+
71+
This menu allows you to navigate through the GrimoireLab panels, see its structure below:
72+
73+
<img alt="Panel menu opened" src="https://i.imgur.com/9yimD9m.png">
74+
75+
### New visualization plugins
76+
77+
Kibiter has several plugins installed by default, they improve the user customization and add more information to the dashboards. Clearly, they are all open source. The plugins are listed below:
78+
79+
- [Network plugin](https://github.com/dlumbrer/kbn_network) supports data visualization in a graph-style way.
80+
- [Searchtables plugin](https://github.com/dlumbrer/kbn_searchtables) improves Kibiter tables by adding a search box to perform searches without applying filters.
81+
- [Radar plugin](https://github.com/dlumbrer/kbn_radar) allows to explore the data using radar visualizations.
82+
- [Dot plot plugin](https://github.com/dlumbrer/kbn_dotplot) empowers Kibiter with dot-plot visualizations, granting to add metrics in both X and Y axis.
83+
- [Polar plugin](https://github.com/dlumbrer/kbn_network) enhances Kibiter with polar visualizations for your data.
84+
- [Enhanced table](https://github.com/fbaligand/kibana-enhanced-table) This Kibtier visualization plugin uses the Data Table, but with enhanced features like computed columns, filter bar and pivot table.
85+
86+
## Version compatibility with Elasticsearch
87+
88+
Following the Kibana docs, you should be running Elasticsearch and Kibiter with matching version numbers. However, Kibiter will run (and log a warning) in case your Elasticsearch has a newer minor or patch number.
89+
Note that Kibiter won't be able to run, if your Elasticsearch has an older version number or a newer _major_ number.
90+
91+
The table below shows some examples to illustrate the relationships between different types of version numbers.
92+
93+
| Situation | Example Kibiter version | Example ES version | Outcome |
5294
| ------------------------- | -------------------------- |------------------- | ------- |
5395
| Versions are the same. | 5.1.2 | 5.1.2 | 💚 OK |
5496
| ES patch number is newer. | 5.1.__2__ | 5.1.__5__ | ⚠️ Logged warning |
@@ -58,9 +100,12 @@ _Note: The version numbers below are only examples, meant to illustrate the rela
58100
| ES minor number is older. | 5.__1__.2 | 5.__0__.0 | 🚫 Fatal error |
59101
| ES major number is older. | __5__.1.2 | __4__.0.0 | 🚫 Fatal error |
60102

61-
## Questions? Problems? Suggestions?
103+
## Contributing
104+
105+
We happily accept contributions, and we will help you in case you need. We follow the same contribution process that Kibana provides, thus have a look at:
106+
107+
- [CONTRIBUTING.md](CONTRIBUTING.md) if you want to get Kibiter up and running.
108+
- [STYLEGUIDE.md](STYLEGUIDE.md) if you plan to submit a pull request.
109+
- [GitHub issue tracker](https://github.com/chaoss/grimoirelab-kibiter/issues) for all other questions, we will answer you as soon as possible.
62110

63-
- If you've found a bug or want to request a feature, please create a [GitHub Issue](https://github.com/elastic/kibana/issues/new).
64-
Please check to make sure someone else hasn't already created an issue for the same topic.
65-
- Need help using Kibana? Ask away on our [Kibana Discuss Forum](https://discuss.elastic.co/c/kibana) and a fellow community member or
66-
Elastic engineer will be glad to help you out.
111+
If you find a bug or want to request a new feature, please open a issue on [GitHub](https://github.com/chaoss/grimoirelab-kibiter/issues). To avoid duplicated issues, check the existing issues to make sure someone else hasn't already created a similar one.

docker/Dockerfile

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
FROM debian:stable
2+
3+
MAINTAINER David Moreno <[email protected]>
4+
# Image for developing Kibiter/Kibana
5+
6+
# nvm environment variables
7+
ENV NVM_DIR /usr/local/nvm
8+
ENV NODE_VERSION 10.15.2
9+
10+
# add our user and group first to make sure their IDs get assigned consistently
11+
RUN groupadd --system kibana && \
12+
useradd --system --create-home --gid kibana kibana
13+
14+
# backports used to install java 8 needed by elasticsearch 5
15+
# ruby gems are used for building binary packages
16+
RUN apt-get update && \
17+
apt-get install -y --no-install-recommends \
18+
ca-certificates dirmngr gnupg \
19+
curl \
20+
wget \
21+
unzip \
22+
git \
23+
python \
24+
zip \
25+
make \
26+
g++ \
27+
ruby-dev rpm rubygems \
28+
libffi-dev
29+
# Install nvm and npm
30+
RUN curl -o /tmp/nvm-install.sh -sSL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh && \
31+
chmod +x /tmp/nvm-install.sh && \
32+
bash -c /tmp/nvm-install.sh && \
33+
. /root/.bashrc && \
34+
nvm install $NODE_VERSION
35+
# add node and npm to path so the commands are available
36+
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
37+
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
38+
# Install kibiter
39+
# gems needed in Kibana > 5.x to build binary packages
40+
RUN gem install rake && \
41+
gem install ffi && \
42+
gem install fpm -v 1.5.0 && \
43+
gem install pleaserun -v 0.0.24
44+
# Download Kibiter release
45+
RUN curl -o /tmp/kibiter-6.8.6-linux-x86_64-1.tar.gz -sSL https://github.com/chaoss/grimoirelab-kibiter/releases/download/secured-v6.8.6-1/kibiter-6.8.6-linux-x86_64-1.tar.gz && \
46+
tar xfz /tmp/kibiter-6.8.6-linux-x86_64-1.tar.gz --directory /opt && \
47+
mv /opt/kibiter-6.8.6-linux-x86_64 /opt/kibana && \
48+
chown -R kibana:kibana /opt/kibana
49+
# Install dotplot plugin: https://github.com/dlumbrer/kbn_dotplot
50+
RUN cd /opt/kibana/plugins && \
51+
git clone https://github.com/dlumbrer/kbn_dotplot.git -b 6-dev && \
52+
cd kbn_dotplot && \
53+
npm install
54+
# Install polar plugin: https://github.com/dlumbrer/kbn_polar
55+
RUN cd /opt/kibana/plugins && \
56+
git clone https://github.com/dlumbrer/kbn_polar.git -b 6-dev && \
57+
cd kbn_polar && \
58+
npm install
59+
# Install radar plugin: https://github.com/dlumbrer/kbn_radar
60+
RUN cd /opt/kibana/plugins && \
61+
git clone https://github.com/dlumbrer/kbn_radar.git -b 6-dev && \
62+
cd kbn_radar && \
63+
npm install
64+
# Install network plugin: https://dlumbrer.github.io/kbn_network/
65+
RUN cd /opt/kibana/plugins && \
66+
git clone https://github.com/dlumbrer/kbn_network.git network_vis -b 6-dev && \
67+
cd network_vis && \
68+
npm install
69+
# Install kibana-enchanced table plugin: https://github.com/fbaligand/kibana-enhanced-table
70+
RUN cd /opt/kibana && \
71+
./bin/kibana-plugin install https://github.com/fbaligand/kibana-enhanced-table/releases/download/v1.8.0/enhanced-table-1.8.0_6.8.6.zip
72+
# Install Search-Guard Custom Bitergia plugin: https://github.com/Bitergia/search-guard-kibana-plugin
73+
RUN cd /opt/kibana && \
74+
./bin/kibana-plugin install https://releases.floragunn.com/search-guard-kibana-plugin-6/6.8.6-19.0/search-guard-kibana-plugin-6-6.8.6-19.0.zip
75+
# Add Search-Guard configuration to kibana.yml
76+
RUN echo 'elasticsearch.ssl.verificationMode: none' >> /opt/kibana/config/kibana.yml && \
77+
echo 'searchguard.auth.type: "basicauth"' >> /opt/kibana/config/kibana.yml && \
78+
echo '#searchguard.auth.anonymous_auth_enabled:' >> /opt/kibana/config/kibana.yml && \
79+
echo '#searchguard.basicauth.login.brandimage:' >> /opt/kibana/config/kibana.yml && \
80+
echo '#searchguard.basicauth.login.title:' >> /opt/kibana/config/kibana.yml && \
81+
echo '#searchguard.basicauth.login.subtitle:' >> /opt/kibana/config/kibana.yml && \
82+
cd /root
83+
# cleanup to thin the final image
84+
RUN rm -rf /kibiter && \
85+
apt-get purge -y g++ git make python zip wget && \
86+
apt-get autoremove --purge -y && \
87+
apt-get clean && \
88+
find /var/lib/apt/lists -type f -delete && \
89+
rm -rf /root/.npm /root/.node-gyp /root/.nvm /tmp/* /var/tmp/* && \
90+
bash -c 'find /usr/share/locale -maxdepth 1 -mindepth 1 -type d | grep -v -e "en_US" | xargs rm -rfv' && \
91+
bash -c 'localedef --list-archive | grep -v -e "en_US" | xargs localedef --delete-from-archive' && \
92+
rm -rf /usr/share/doc/*
93+
94+
# grab gosu for easy step-down from root
95+
RUN ( gpg --batch --keyserver hkps://hkps.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
96+
|| gpg --batch --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
97+
|| gpg --batch --keyserver hkp://keys.gnupg.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 )
98+
RUN arch="$(dpkg --print-architecture)" \
99+
&& set -x \
100+
&& curl -o /usr/local/bin/gosu -sSL "https://github.com/tianon/gosu/releases/download/1.3/gosu-$arch" \
101+
&& curl -o /usr/local/bin/gosu.asc -sSL "https://github.com/tianon/gosu/releases/download/1.3/gosu-$arch.asc" \
102+
&& gpg --verify /usr/local/bin/gosu.asc \
103+
&& rm /usr/local/bin/gosu.asc \
104+
&& chmod +x /usr/local/bin/gosu
105+
106+
ENV PATH /opt/kibana/bin:$PATH
107+
108+
# Remove kibana optimize so it is regenerated when we modify src files in containers
109+
# Don't delete because we don't modify anymore src in docker-entrypoint.sh
110+
RUN rm -rf /opt/kibana/optimize/*
111+
RUN cat /opt/kibana/config/kibana.yml
112+
113+
RUN ./opt/kibana/bin/kibana | sleep 200 > /tmp/run_kibana_log.txt
114+
115+
COPY ./docker_entrypoint.sh /
116+
RUN ["chmod", "+x", "/docker_entrypoint.sh"]
117+
118+
EXPOSE 5601
119+
ENTRYPOINT ["/docker_entrypoint.sh"]
120+
CMD ["kibana"]

docker/docker_entrypoint.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Add kibana as command if needed
6+
if [[ "$1" == -* ]]; then
7+
set -- kibana "$@"
8+
fi
9+
10+
# Run as user "kibana" if the command is "kibana"
11+
if [ "$1" = 'kibana' ]; then
12+
if [ "$ELASTICSEARCH_URL" -o "$ELASTICSEARCH_PORT_9200_TCP" ]; then
13+
: ${ELASTICSEARCH_URL:='http://elasticsearch:9200'}
14+
sed -ri "s!^(\#\s*)?(elasticsearch\.hosts:).*!\2 ['$ELASTICSEARCH_URL']!" /opt/kibana/config/kibana.yml
15+
else
16+
echo >&2 'warning: missing ELASTICSEARCH_PORT_9200_TCP or ELASTICSEARCH_URL'
17+
echo >&2 ' Did you forget to --link some-elasticsearch:elasticsearch'
18+
echo >&2 ' or -e ELASTICSEARCH_URL=http://some-elasticsearch:9200 ?'
19+
echo >&2
20+
fi
21+
sed -e "s|^#server.host: .*$|server.host: 0.0.0.0|" -i /opt/kibana/config/kibana.yml
22+
23+
if [ "$BASE_PATH" != "" ]; then
24+
sed -e "s|^#server.basePath: \"\".*$|server.basePath: \"$BASE_PATH\"|" -i /opt/kibana/config/kibana.yml
25+
fi
26+
27+
if [ "$PROJECT_NAME" != "" ]; then
28+
sed -e "s/title: 'Kibana',$/title: '$PROJECT_NAME',/" -i /opt/kibana/src/legacy/core_plugins/kibana/index.js
29+
sed -e "s|__PROJECT__|$PROJECT_NAME|" -i /opt/kibana/src/ui/ui_render/views/chrome.pug
30+
fi
31+
32+
if [ "$ELASTICSEARCH_USER" != "" -a "$ELASTICSEARCH_PASSWORD" != "" ]; then
33+
sed -e "s|^#elasticsearch.username:.*$|elasticsearch.username: \"$ELASTICSEARCH_USER\"|" -i /opt/kibana/config/kibana.yml
34+
sed -e "s|^#elasticsearch.password:.*$|elasticsearch.password: \"$ELASTICSEARCH_PASSWORD\"|" -i /opt/kibana/config/kibana.yml
35+
else
36+
echo >&2 'error: ELASTICSEARCH_USER or/and ELASTICSEARCH_PASSWORD environment variables were not configured'
37+
echo >&2 ' these two docker environment variables must be configured before running the container'
38+
exit 1
39+
fi
40+
41+
if [ "$ANONYMOUS_USER" != "" ]; then
42+
sed -e "s|^#searchguard.auth.anonymous_auth_enabled:.*$|searchguard.auth.anonymous_auth_enabled: \"$ANONYMOUS_USER\"|" -i /opt/kibana/config/kibana.yml
43+
fi
44+
45+
if [ "$LOGIN_BRANDIMAGE" != "" ]; then
46+
sed -e "s|^#searchguard.basicauth.login.brandimage:.*$|searchguard.basicauth.login.brandimage: \"$LOGIN_BRANDIMAGE\"|" -i /opt/kibana/config/kibana.yml
47+
else
48+
sed -e "s|^#searchguard.basicauth.login.brandimage:.*$|searchguard.basicauth.login.brandimage: 'https://bitergia.com/assets/img/bitergia_logo-907x227.png'|" -i /opt/kibana/config/kibana.yml
49+
fi
50+
51+
if [ "$LOGIN_TITLE" != "" ]; then
52+
sed -e "s|^#searchguard.basicauth.login.title:.*$|searchguard.basicauth.login.title: \"$LOGIN_TITLE\"|" -i /opt/kibana/config/kibana.yml
53+
else
54+
sed -e "s|^#searchguard.basicauth.login.title:.*$|searchguard.basicauth.login.title: Please login to Bitergia Analytics Dashboard|" -i /opt/kibana/config/kibana.yml
55+
fi
56+
57+
if [ "$LOGIN_SUBTITLE" != "" ]; then
58+
sed -e "s|^#searchguard.basicauth.login.subtitle:.*$|searchguard.basicauth.login.subtitle: \"$LOGIN_SUBTITLE\"|" -i /opt/kibana/config/kibana.yml
59+
else
60+
sed -e 's|^#searchguard.basicauth.login.subtitle:.*$|searchguard.basicauth.login.subtitle: If you have forgotten your username or password, please contact the <a href="mailto:[email protected]?Subject=Credentials" target="_top">Bitergia staff</a>|' -i /opt/kibana/config/kibana.yml
61+
fi
62+
63+
set -- gosu kibana "$@"
64+
fi
65+
66+
exec "$@"

0 commit comments

Comments
 (0)