Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/elastic/kibana into featu…
Browse files Browse the repository at this point in the history
…re/custom-panel-titles
  • Loading branch information
stacey-gammon committed Nov 15, 2017
2 parents 82f08e0 + d7c8e76 commit e5fb671
Show file tree
Hide file tree
Showing 444 changed files with 10,593 additions and 9,102 deletions.
24 changes: 24 additions & 0 deletions bin/kibana-keystore
@@ -0,0 +1,24 @@
#!/bin/sh
SCRIPT=$0

# SCRIPT may be an arbitrarily deep series of symlinks. Loop until we have the concrete path.
while [ -h "$SCRIPT" ] ; do
ls=$(ls -ld "$SCRIPT")
# Drop everything prior to ->
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=$(dirname "$SCRIPT")/"$link"
fi
done

DIR="$(dirname "${SCRIPT}")/.."
NODE="${DIR}/node/bin/node"
test -x "$NODE" || NODE=$(which node)
if [ ! -x "$NODE" ]; then
echo "unable to find usable node.js executable."
exit 1
fi

"${NODE}" "${DIR}/src/cli_keystore" "$@"
29 changes: 29 additions & 0 deletions bin/kibana-keystore.bat
@@ -0,0 +1,29 @@
@echo off

SETLOCAL

set SCRIPT_DIR=%~dp0
for %%I in ("%SCRIPT_DIR%..") do set DIR=%%~dpfI

set NODE=%DIR%\node\node.exe

WHERE /Q node
IF %ERRORLEVEL% EQU 0 (
for /f "delims=" %%i in ('WHERE node') do set SYS_NODE=%%i
)

If Not Exist "%NODE%" (
IF Exist "%SYS_NODE%" (
set "NODE=%SYS_NODE%"
) else (
Echo unable to find usable node.js executable.
Exit /B 1
)
)

TITLE Kibana Keystore
"%NODE%" "%DIR%\src\cli_keystore" %*

:finally

ENDLOCAL
2 changes: 2 additions & 0 deletions docs/setup.asciidoc
Expand Up @@ -50,6 +50,8 @@ include::setup/install.asciidoc[]

include::setup/settings.asciidoc[]

include::setup/secure-settings.asciidoc[]

include::setup/docker.asciidoc[]

include::setup/access.asciidoc[]
Expand Down
64 changes: 64 additions & 0 deletions docs/setup/secure-settings.asciidoc
@@ -0,0 +1,64 @@
[[secure-settings]]
=== Secure Settings

Some settings are sensitive, and relying on filesystem permissions to protect
their values is not sufficient. For this use case, Kibana provides a
keystore, and the `kibana-keystore` tool to manage the settings in the keystore.

NOTE: All commands here should be run as the user which will run Kibana.

[float]
[[creating-keystore]]
=== Creating the keystore

To create the `kibana.keystore`, use the `create` command:

[source,sh]
----------------------------------------------------------------
bin/kibana-keystore create
----------------------------------------------------------------

The file `kibana.keystore` will be created in the directory defined by the
`path.data` configuration setting.

[float]
[[list-settings]]
=== Listing settings in the keystore

A list of the settings in the keystore is available with the `list` command:

[source,sh]
----------------------------------------------------------------
bin/kibana-keystore list
----------------------------------------------------------------

[float]
[[add-string-to-keystore]]
=== Adding string settings

Sensitive string settings, like authentication credentials for Elasticsearch
can be added using the `add` command:

[source,sh]
----------------------------------------------------------------
bin/kibana-keystore add the.setting.name.to.set
----------------------------------------------------------------

The tool will prompt for the value of the setting. To pass the value
through stdin, use the `--stdin` flag:

[source,sh]
----------------------------------------------------------------
cat /file/containing/setting/value | bin/kibana-keystore add --stdin the.setting.name.to.set
----------------------------------------------------------------

[float]
[[remove-settings]]
=== Removing settings

To remove a setting from the keystore, use the `remove` command:

[source,sh]
----------------------------------------------------------------
bin/kibana-keystore remove the.setting.name.to.remove
----------------------------------------------------------------
2 changes: 1 addition & 1 deletion docs/visualize/tilemap.asciidoc
Expand Up @@ -33,7 +33,7 @@ Enter a string in the *Custom Label* field to change the display label.

===== Buckets

Coordinate maps use the {es-ref}search-aggregations-bucket-geohashgrid-aggregation.html[_geohash_] aggregation. Select a field, typically coordinates, from the
Coordinate maps use the {ref}/search-aggregations-bucket-geohashgrid-aggregation.html[_geohash_] aggregation. Select a field, typically coordinates, from the
drop-down.

- The_Change precision on map zoom_ box is checked by default. Uncheck the box to disable this behavior.
Expand Down
22 changes: 11 additions & 11 deletions package.json
Expand Up @@ -57,8 +57,8 @@
"precommit": "grunt precommit",
"karma": "karma start",
"elasticsearch": "grunt esvm:dev:keepalive",
"lint": "grunt eslint:source",
"lintroller": "grunt eslint:fixSource",
"lint": "echo 'use `node scripts/eslint`' && false",
"lintroller": "echo 'use `node scripts/eslint --fix`' && false",
"makelogs": "echo 'use `node scripts/makelogs`' && false",
"mocha": "echo 'use `node scripts/mocha`' && false",
"sterilize": "grunt sterilize",
Expand Down Expand Up @@ -214,11 +214,11 @@
"yauzl": "2.7.0"
},
"devDependencies": {
"@elastic/eslint-config-kibana": "0.13.0",
"@elastic/eslint-config-kibana": "0.14.0",
"@elastic/eslint-import-resolver-kibana": "0.9.0",
"@elastic/eslint-plugin-kibana-custom": "1.0.3",
"@elastic/eslint-plugin-kibana-custom": "1.1.0",
"angular-mocks": "1.4.7",
"babel-eslint": "7.2.3",
"babel-eslint": "8.0.2",
"backport": "1.1.1",
"chai": "3.5.0",
"chalk": "2.0.1",
Expand All @@ -229,13 +229,13 @@
"classnames": "2.2.5",
"enzyme": "2.9.1",
"enzyme-to-json": "1.4.5",
"eslint": "3.19.0",
"eslint-plugin-babel": "4.1.1",
"eslint-plugin-import": "2.3.0",
"eslint-plugin-jest": "21.0.0",
"eslint-plugin-mocha": "4.9.0",
"eslint": "4.10.0",
"eslint-plugin-babel": "4.1.2",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-jest": "21.2.0",
"eslint-plugin-mocha": "4.11.0",
"eslint-plugin-prefer-object-spread": "1.2.1",
"eslint-plugin-react": "7.1.0",
"eslint-plugin-react": "7.4.0",
"event-stream": "3.3.2",
"expect.js": "0.3.1",
"faker": "1.1.0",
Expand Down
27 changes: 16 additions & 11 deletions packages/eslint-config-kibana/jest.js
@@ -1,15 +1,20 @@
module.exports = {
plugins: [
'jest',
],
overrides: [
{
files: ['**/*.test.js'],
plugins: [
'jest',
],

env: {
'jest/globals': true,
},
env: {
'jest/globals': true,
},

rules: {
'jest/no-disabled-tests': 'error',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
},
rules: {
'jest/no-disabled-tests': 'error',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
},
}
]
};
4 changes: 2 additions & 2 deletions packages/eslint-config-kibana/package.json
@@ -1,6 +1,6 @@
{
"name": "@elastic/eslint-config-kibana",
"version": "0.13.0",
"version": "0.14.0",
"description": "The eslint config used by the kibana team",
"main": ".eslintrc.js",
"scripts": {
Expand All @@ -18,7 +18,7 @@
},
"homepage": "https://github.com/elastic/eslint-config-kibana#readme",
"peerDependencies": {
"babel-eslint": "^7.2.3",
"babel-eslint": "^8.0.0",
"eslint": "^4.1.0",
"eslint-plugin-babel": "^4.1.1",
"eslint-plugin-import": "^2.6.0",
Expand Down
17 changes: 12 additions & 5 deletions packages/eslint-plugin-kibana-custom/index.js
@@ -1,7 +1,14 @@
module.exports.rules = {
'no-default-export': context => ({
ExportDefaultDeclaration: (node) => {
context.report(node, 'Default exports not allowed.');
module.exports = {
rules: {
'no-default-export': {
meta: {
schema: []
},
create: context => ({
ExportDefaultDeclaration: (node) => {
context.report(node, 'Default exports not allowed.');
}
})
}
})
}
};
2 changes: 1 addition & 1 deletion packages/eslint-plugin-kibana-custom/package.json
@@ -1,6 +1,6 @@
{
"name": "@elastic/eslint-plugin-kibana-custom",
"version": "1.0.3",
"version": "1.1.0",
"description": "Custom ESLint rules for Kibana",
"repository": {
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions scripts/eslint.js
@@ -0,0 +1,2 @@
require('../src/babel-register');
require('../src/dev/run_eslint');
30 changes: 15 additions & 15 deletions src/cli/cli.js
Expand Up @@ -7,29 +7,29 @@ const argv = process.env.kbnWorkerArgv ? JSON.parse(process.env.kbnWorkerArgv) :
const program = new Command('bin/kibana');

program
.version(pkg.version)
.description(
'Kibana is an open source (Apache Licensed), browser ' +
.version(pkg.version)
.description(
'Kibana is an open source (Apache Licensed), browser ' +
'based analytics and search dashboard for Elasticsearch.'
);
);

// attach commands
serveCommand(program);

program
.command('help <command>')
.description('Get the help for a specific command')
.action(function (cmdName) {
const cmd = _.find(program.commands, { _name: cmdName });
if (!cmd) return program.error(`unknown command ${cmdName}`);
cmd.help();
});
.command('help <command>')
.description('Get the help for a specific command')
.action(function (cmdName) {
const cmd = _.find(program.commands, { _name: cmdName });
if (!cmd) return program.error(`unknown command ${cmdName}`);
cmd.help();
});

program
.command('*', null, { noHelp: true })
.action(function (cmd) {
program.error(`unknown command ${cmd}`);
});
.command('*', null, { noHelp: true })
.action(function (cmd) {
program.error(`unknown command ${cmd}`);
});

// check for no command name
const subCommand = argv[2] && !String(argv[2][0]).match(/^-|^\.|\//);
Expand Down
4 changes: 2 additions & 2 deletions src/cli/cluster/base_path_proxy.js
Expand Up @@ -82,8 +82,8 @@ export default class BasePathProxy {
});
}
})
.return(undefined)
.nodeify(reply);
.return(undefined)
.nodeify(reply);
}
],
},
Expand Down
4 changes: 2 additions & 2 deletions src/cli/command.js
Expand Up @@ -8,7 +8,7 @@ Command.prototype.error = function (err) {
if (err && err.message) err = err.message;

console.log(
`
`
${red(' ERROR ')} ${err}
${help(this, ' ')}
Expand All @@ -20,7 +20,7 @@ ${help(this, ' ')}

Command.prototype.defaultHelp = function () {
console.log(
`
`
${help(this, ' ')}
`
Expand Down
4 changes: 2 additions & 2 deletions src/cli/help.js
Expand Up @@ -13,7 +13,7 @@ export default function help(command, spaces) {
const cmdDef = !defCmd ? '' : `=${defCmd._name}`;

return (
`
`
Usage: ${command._name} [command${cmdDef}] [options]
${desc}
Expand Down Expand Up @@ -58,7 +58,7 @@ function cmdHelp(cmd) {
if (!cmd) return '';
return (

`
`
"${cmd._name}" Options:
${indent(cmd.optionHelp(), 2)}
Expand Down
2 changes: 1 addition & 1 deletion src/cli/serve/__tests__/read_yaml_config.js
@@ -1,6 +1,6 @@
import expect from 'expect.js';
import { join, relative, resolve } from 'path';
import readYamlConfig from '../read_yaml_config';
import { readYamlConfig } from '../read_yaml_config';

function fixture(name) {
return resolve(__dirname, 'fixtures', name);
Expand Down
2 changes: 1 addition & 1 deletion src/cli/serve/__tests__/reload_logging_config.js
Expand Up @@ -3,7 +3,7 @@ import { writeFileSync } from 'fs';
import { relative, resolve } from 'path';
import { safeDump } from 'js-yaml';
import es from 'event-stream';
import readYamlConfig from '../read_yaml_config';
import { readYamlConfig } from '../read_yaml_config';
import expect from 'expect.js';

const testConfigFile = follow(`fixtures/reload_logging_config/kibana.test.yml`);
Expand Down
26 changes: 26 additions & 0 deletions src/cli/serve/read_keystore.js
@@ -0,0 +1,26 @@
import { join } from 'path';
import { set } from 'lodash';

import { Keystore } from '../../server/keystore';
import { getData } from '../../server/path';

export function loadKeystore() {
const path = join(getData(), 'kibana.keystore');

const keystore = new Keystore(path);
keystore.load();

return keystore;
}

export function readKeystore() {
const keystore = loadKeystore();
const keys = Object.keys(keystore.data);

const data = {};
keys.forEach(key => {
set(data, key, keystore.data[key]);
});

return data;
}

0 comments on commit e5fb671

Please sign in to comment.