kibana-rack 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +1 -0
  3. data.tar.gz.sig +0 -0
  4. data/.editorconfig +13 -0
  5. data/.gitattributes +2 -0
  6. data/.gitignore +10 -0
  7. data/.overcommit.yml +11 -0
  8. data/.rspec +2 -0
  9. data/.rubocop.yml +24 -0
  10. data/.simplecov +12 -0
  11. data/.travis.yml +5 -0
  12. data/.yardopts +13 -0
  13. data/CHANGELOG.md +5 -0
  14. data/CONTRIBUTING.md +105 -0
  15. data/Gemfile +30 -0
  16. data/LICENSE.txt +22 -0
  17. data/README.md +269 -0
  18. data/Rakefile +27 -0
  19. data/dashboards/blank.json +32 -0
  20. data/dashboards/default.json +90 -0
  21. data/dashboards/guided.json +272 -0
  22. data/dashboards/logstash.js +138 -0
  23. data/dashboards/logstash.json +227 -0
  24. data/dashboards/noted.json +161 -0
  25. data/examples/dashboards/default.json +90 -0
  26. data/examples/rack/config.ru +14 -0
  27. data/examples/rack_basic_auth/config.ru +18 -0
  28. data/examples/rack_basic_auth/dashboards/default.json +90 -0
  29. data/examples/rails/app/controllers/application_controller.rb +3 -0
  30. data/examples/rails/app/helpers/application_helper.rb +2 -0
  31. data/examples/rails/app/kibana/blank.json +32 -0
  32. data/examples/rails/app/kibana/default.json +90 -0
  33. data/examples/rails/app/kibana/guided.json +272 -0
  34. data/examples/rails/app/kibana/logstash.json +227 -0
  35. data/examples/rails/app/kibana/noted.json +161 -0
  36. data/examples/rails/bin/bundle +3 -0
  37. data/examples/rails/bin/rails +4 -0
  38. data/examples/rails/bin/rake +4 -0
  39. data/examples/rails/config.ru +2 -0
  40. data/examples/rails/config/application.rb +11 -0
  41. data/examples/rails/config/boot.rb +2 -0
  42. data/examples/rails/config/environment.rb +2 -0
  43. data/examples/rails/config/environments/development.rb +7 -0
  44. data/examples/rails/config/environments/production.rb +11 -0
  45. data/examples/rails/config/environments/test.rb +11 -0
  46. data/examples/rails/config/initializers/cookies_serializer.rb +1 -0
  47. data/examples/rails/config/initializers/filter_parameter_logging.rb +1 -0
  48. data/examples/rails/config/initializers/kibana.rb +3 -0
  49. data/examples/rails/config/initializers/session_store.rb +1 -0
  50. data/examples/rails/config/initializers/wrap_parameters.rb +3 -0
  51. data/examples/rails/config/routes.rb +3 -0
  52. data/examples/rails/config/secrets.yml +9 -0
  53. data/examples/rails/log/.keep +0 -0
  54. data/examples/sinatra/config.ru +27 -0
  55. data/examples/sinatra/dashboards/default.json +90 -0
  56. data/kibana-rack.gemspec +28 -0
  57. data/lib/kibana/rack.rb +34 -0
  58. data/lib/kibana/rack/version.rb +5 -0
  59. data/lib/kibana/rack/web.rb +60 -0
  60. data/spec/fixtures/dashboards/default.json +90 -0
  61. data/spec/fixtures/dashboards/templated.json +1 -0
  62. data/spec/spec_helper.rb +32 -0
  63. data/spec/unit/kibana/rack/web_spec.rb +69 -0
  64. data/spec/unit/kibana/rack_spec.rb +4 -0
  65. data/tabolario.gpg +31 -0
  66. data/tabolario.pem +21 -0
  67. data/web/assets/LICENSE.md +13 -0
  68. data/web/assets/README.md +69 -0
  69. data/web/assets/app/app.js +24 -0
  70. data/web/assets/app/components/require.config.js +4 -0
  71. data/web/assets/app/factories/store.js +4 -0
  72. data/web/assets/app/panels/bettermap/editor.html +1 -0
  73. data/web/assets/app/panels/bettermap/leaflet/images/layers-2x.png +0 -0
  74. data/web/assets/app/panels/bettermap/leaflet/images/layers.png +0 -0
  75. data/web/assets/app/panels/bettermap/leaflet/images/marker-icon-2x.png +0 -0
  76. data/web/assets/app/panels/bettermap/leaflet/images/marker-icon.png +0 -0
  77. data/web/assets/app/panels/bettermap/leaflet/images/marker-shadow.png +0 -0
  78. data/web/assets/app/panels/bettermap/leaflet/leaflet.css +1 -0
  79. data/web/assets/app/panels/bettermap/leaflet/leaflet.ie.css +1 -0
  80. data/web/assets/app/panels/bettermap/leaflet/leaflet.js +7 -0
  81. data/web/assets/app/panels/bettermap/leaflet/plugins.css +1 -0
  82. data/web/assets/app/panels/bettermap/leaflet/plugins.js +4 -0
  83. data/web/assets/app/panels/bettermap/module.css +1 -0
  84. data/web/assets/app/panels/bettermap/module.html +3 -0
  85. data/web/assets/app/panels/bettermap/module.js +8 -0
  86. data/web/assets/app/panels/column/editor.html +1 -0
  87. data/web/assets/app/panels/column/module.html +1 -0
  88. data/web/assets/app/panels/column/module.js +4 -0
  89. data/web/assets/app/panels/column/panelgeneral.html +1 -0
  90. data/web/assets/app/panels/dashcontrol/editor.html +1 -0
  91. data/web/assets/app/panels/dashcontrol/module.html +1 -0
  92. data/web/assets/app/panels/dashcontrol/module.js +4 -0
  93. data/web/assets/app/panels/derivequeries/editor.html +1 -0
  94. data/web/assets/app/panels/derivequeries/module.html +1 -0
  95. data/web/assets/app/panels/derivequeries/module.js +4 -0
  96. data/web/assets/app/panels/fields/editor.html +1 -0
  97. data/web/assets/app/panels/fields/micropanel.html +1 -0
  98. data/web/assets/app/panels/fields/module.html +1 -0
  99. data/web/assets/app/panels/fields/module.js +4 -0
  100. data/web/assets/app/panels/filtering/editor.html +1 -0
  101. data/web/assets/app/panels/filtering/meta.html +3 -0
  102. data/web/assets/app/panels/filtering/module.html +30 -0
  103. data/web/assets/app/panels/filtering/module.js +4 -0
  104. data/web/assets/app/panels/goal/editor.html +1 -0
  105. data/web/assets/app/panels/goal/module.html +1 -0
  106. data/web/assets/app/panels/goal/module.js +4 -0
  107. data/web/assets/app/panels/histogram/editor.html +1 -0
  108. data/web/assets/app/panels/histogram/module.html +40 -0
  109. data/web/assets/app/panels/histogram/module.js +5 -0
  110. data/web/assets/app/panels/histogram/queriesEditor.html +9 -0
  111. data/web/assets/app/panels/histogram/styleEditor.html +1 -0
  112. data/web/assets/app/panels/hits/editor.html +1 -0
  113. data/web/assets/app/panels/hits/module.html +1 -0
  114. data/web/assets/app/panels/hits/module.js +4 -0
  115. data/web/assets/app/panels/map/editor.html +1 -0
  116. data/web/assets/app/panels/map/lib/map.europe.js +4 -0
  117. data/web/assets/app/panels/map/lib/map.usa.js +4 -0
  118. data/web/assets/app/panels/map/lib/map.world.js +4 -0
  119. data/web/assets/app/panels/map/module.html +58 -0
  120. data/web/assets/app/panels/map/module.js +5 -0
  121. data/web/assets/app/panels/query/editor.html +1 -0
  122. data/web/assets/app/panels/query/editors/lucene.html +0 -0
  123. data/web/assets/app/panels/query/editors/regex.html +0 -0
  124. data/web/assets/app/panels/query/editors/topN.html +1 -0
  125. data/web/assets/app/panels/query/help/lucene.html +1 -0
  126. data/web/assets/app/panels/query/help/regex.html +1 -0
  127. data/web/assets/app/panels/query/help/topN.html +1 -0
  128. data/web/assets/app/panels/query/helpModal.html +1 -0
  129. data/web/assets/app/panels/query/meta.html +3 -0
  130. data/web/assets/app/panels/query/module.html +1 -0
  131. data/web/assets/app/panels/query/module.js +4 -0
  132. data/web/assets/app/panels/query/query.css +1 -0
  133. data/web/assets/app/panels/sparklines/editor.html +1 -0
  134. data/web/assets/app/panels/sparklines/module.html +1 -0
  135. data/web/assets/app/panels/sparklines/module.js +4 -0
  136. data/web/assets/app/panels/stats/editor.html +1 -0
  137. data/web/assets/app/panels/stats/module.html +7 -0
  138. data/web/assets/app/panels/stats/module.js +4 -0
  139. data/web/assets/app/panels/table/editor.html +1 -0
  140. data/web/assets/app/panels/table/micropanel.html +3 -0
  141. data/web/assets/app/panels/table/modal.html +31 -0
  142. data/web/assets/app/panels/table/module.html +52 -0
  143. data/web/assets/app/panels/table/module.js +4 -0
  144. data/web/assets/app/panels/table/pagination.html +1 -0
  145. data/web/assets/app/panels/terms/editor.html +1 -0
  146. data/web/assets/app/panels/terms/module.html +24 -0
  147. data/web/assets/app/panels/terms/module.js +4 -0
  148. data/web/assets/app/panels/text/editor.html +1 -0
  149. data/web/assets/app/panels/text/module.html +1 -0
  150. data/web/assets/app/panels/text/module.js +4 -0
  151. data/web/assets/app/panels/timepicker/custom.html +31 -0
  152. data/web/assets/app/panels/timepicker/editor.html +1 -0
  153. data/web/assets/app/panels/timepicker/module.html +3 -0
  154. data/web/assets/app/panels/timepicker/module.js +4 -0
  155. data/web/assets/app/panels/timepicker/refreshctrl.html +1 -0
  156. data/web/assets/app/panels/trends/editor.html +1 -0
  157. data/web/assets/app/panels/trends/module.html +9 -0
  158. data/web/assets/app/panels/trends/module.js +4 -0
  159. data/web/assets/app/partials/dashLoader.html +3 -0
  160. data/web/assets/app/partials/dashLoaderShare.html +1 -0
  161. data/web/assets/app/partials/dashboard.html +1 -0
  162. data/web/assets/app/partials/dasheditor.html +1 -0
  163. data/web/assets/app/partials/inspector.html +2 -0
  164. data/web/assets/app/partials/load.html +1 -0
  165. data/web/assets/app/partials/modal.html +1 -0
  166. data/web/assets/app/partials/paneladd.html +1 -0
  167. data/web/assets/app/partials/paneleditor.html +1 -0
  168. data/web/assets/app/partials/panelgeneral.html +1 -0
  169. data/web/assets/app/partials/querySelect.html +9 -0
  170. data/web/assets/app/partials/roweditor.html +1 -0
  171. data/web/assets/build.txt +153 -0
  172. data/web/assets/css/animate.min.css +1 -0
  173. data/web/assets/css/bootstrap-responsive.min.css +9 -0
  174. data/web/assets/css/bootstrap.dark.less +6290 -0
  175. data/web/assets/css/bootstrap.dark.min.css +9 -0
  176. data/web/assets/css/bootstrap.light.less +6287 -0
  177. data/web/assets/css/bootstrap.light.min.css +9 -0
  178. data/web/assets/css/font-awesome.min.css +1 -0
  179. data/web/assets/css/normalize.min.css +1 -0
  180. data/web/assets/css/timepicker.css +18 -0
  181. data/web/assets/favicon.ico +0 -0
  182. data/web/assets/font/FontAwesome.otf +0 -0
  183. data/web/assets/font/fontawesome-webfont.eot +0 -0
  184. data/web/assets/font/fontawesome-webfont.svg +399 -0
  185. data/web/assets/font/fontawesome-webfont.ttf +0 -0
  186. data/web/assets/font/fontawesome-webfont.woff +0 -0
  187. data/web/assets/img/annotation-icon.png +0 -0
  188. data/web/assets/img/cubes.png +0 -0
  189. data/web/assets/img/glyphicons-halflings-white.png +0 -0
  190. data/web/assets/img/glyphicons-halflings.png +0 -0
  191. data/web/assets/img/kibana.png +0 -0
  192. data/web/assets/img/light.png +0 -0
  193. data/web/assets/img/load.gif +0 -0
  194. data/web/assets/img/load_big.gif +0 -0
  195. data/web/assets/img/small.png +0 -0
  196. data/web/assets/index.html +1 -0
  197. data/web/assets/vendor/LICENSE.json +94 -0
  198. data/web/assets/vendor/bootstrap/less/tests/buttons.html +139 -0
  199. data/web/assets/vendor/bootstrap/less/tests/css-tests.css +3 -0
  200. data/web/assets/vendor/bootstrap/less/tests/css-tests.html +1399 -0
  201. data/web/assets/vendor/bootstrap/less/tests/forms-responsive.html +71 -0
  202. data/web/assets/vendor/bootstrap/less/tests/forms.html +179 -0
  203. data/web/assets/vendor/bootstrap/less/tests/navbar-fixed-top.html +104 -0
  204. data/web/assets/vendor/bootstrap/less/tests/navbar-static-top.html +107 -0
  205. data/web/assets/vendor/bootstrap/less/tests/navbar.html +107 -0
  206. data/web/assets/vendor/require/css-build.js +4 -0
  207. data/web/assets/vendor/require/require.js +4 -0
  208. data/web/assets/vendor/require/tmpl.js +4 -0
  209. data/web/assets/vendor/timezone.js +4 -0
  210. data/web/views/config.erb +80 -0
  211. data/web/views/index.erb +56 -0
  212. metadata +336 -0
  213. metadata.gz.sig +3 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c84229a0b4a7242afe5be57e2f6f1d2cc4ea87ed
4
+ data.tar.gz: a16c4495954ff43258e0a0af39219d1de082cfe8
5
+ SHA512:
6
+ metadata.gz: d3a4c177193bfb9d395b76d813872e9395789ca2b1fde6d265f3d516e1871d0413de59c51df0a6cee072e2b9314f70474ab6abf54b34d0cb2e4bcaf50d409f93
7
+ data.tar.gz: 7bc37e75f0a1a97187e9e8b742494d545bdd66381306f00e3035f10ae025abccaba1d5622d722586397c020f9c73a75229801c9e4fa90aa5092799c2b23ca209
checksums.yaml.gz.sig ADDED
@@ -0,0 +1 @@
1
+ q�H1>��k����G�'�M�T��i�>�9���M\Z��q�V�o�ǵM4$2���믃9�
data.tar.gz.sig ADDED
Binary file
data/.editorconfig ADDED
@@ -0,0 +1,13 @@
1
+ # See http://editorconfig.org/ for more information.
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.md]
13
+ trim_trailing_whitespace = false
data/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ * text=auto
2
+ *.yml text
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ *.gem
2
+ *.log
3
+ .bundle/
4
+ .config/
5
+ .yardoc/
6
+ Gemfile.lock
7
+ coverage/
8
+ doc/
9
+ pkg/
10
+ tmp/
data/.overcommit.yml ADDED
@@ -0,0 +1,11 @@
1
+ ---
2
+ PreCommit:
3
+ Rubocop:
4
+ enabled: true
5
+ include:
6
+ - '*.gemspec'
7
+ - 'bin/*'
8
+ - 'lib/**/*.{rake,rb}'
9
+ - 'spec/**/*.rb'
10
+ - 'Gemfile'
11
+ - 'Rakefile'
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,24 @@
1
+ ---
2
+ AllCops:
3
+ Include:
4
+ - '**/*.gemspec'
5
+ - '**/config.ru'
6
+ - '**/Gemfile'
7
+ - '**/Rakefile'
8
+ Exclude:
9
+ - '.bundle/**/*'
10
+ - 'tmp/**/*'
11
+ - 'vendor/**/*'
12
+
13
+ # Handled via inch.
14
+ Style/Documentation:
15
+ Enabled: false
16
+
17
+ Style/FileName:
18
+ Exclude:
19
+ - !ruby/regexp /(\d+)-(\w+)\.rb$/
20
+ - Gemfile
21
+ - Rakefile
22
+
23
+ Style/LineLength:
24
+ Max: 120
data/.simplecov ADDED
@@ -0,0 +1,12 @@
1
+ require 'coveralls'
2
+
3
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
4
+ SimpleCov::Formatter::HTMLFormatter,
5
+ Coveralls::SimpleCov::Formatter
6
+ ]
7
+ SimpleCov.start do
8
+ SimpleCov.minimum_coverage 95
9
+
10
+ add_filter '.bundle'
11
+ add_filter 'spec'
12
+ end
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ ---
2
+ language: ruby
3
+ rvm:
4
+ - 2.1.2
5
+ bundler_args: --without debugger docs
data/.yardopts ADDED
@@ -0,0 +1,13 @@
1
+ --charset utf-8
2
+ --embed-mixin ClassMethods
3
+ --markup-provider redcarpet
4
+ --markup markdown
5
+ --no-private
6
+ --quiet
7
+ --protected
8
+ --readme README.md
9
+ lib/**/*.rb
10
+ -
11
+ CHANGELOG.md
12
+ CONTRIBUTING.md
13
+ LICENSE.txt
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Change history for kibana-rack
2
+
3
+ ## [v0.1.0](https://github.com/tabolario/kibana-rack/releases/tag/v0.1.0)
4
+
5
+ * Initial release
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,105 @@
1
+ # Contributing to kibana-rack
2
+
3
+ Thank you for interest in contributing to kibana-rack!
4
+
5
+ kibana-rack uses GitHub issues for discussion, issues, and contributions. There are two main ways to contribute to kibana-rack:
6
+
7
+ One of the goals of kibana-rack is to make it easy for the community to contribute changes. To that end, here are detailed guidelines on how to contribute to kibana-rack.
8
+
9
+ * Report an issue or make a feature request at kibana-rack's [issue tracker](https://github.com/tabolario/kibana-rack/issues)
10
+ * Contribute features and fix bugs yourself by contributing code to kibana-rack (see below).
11
+
12
+ ## Issues
13
+
14
+ Issue tracking for kibana-rack happens on GitHub Issues. If you've found a bug or have a feature that you'd like to see implemented, please report it on the issue tracker. [Discussion-only issues](#discussions) are also welcome.
15
+
16
+ ### Bug reports
17
+
18
+ To minimize the time spent by maintainers in diagnosing and fixing bugs, please use the following template when filing a bug report:
19
+
20
+ ```markdown
21
+ ### Version
22
+
23
+ [Version of kibana-rack installed, or commit SHA if installed from Git]
24
+
25
+ ### Environment
26
+
27
+ Operating system: [Your operating system and version, (e.g. Mac OS X 10.9)
28
+ Ruby version: [Version of Ruby installed (run `ruby --version`)
29
+ Rails version: [Version of Rails installed if mounting kibana-rack in a Rails application (run `bundle show rails`)]
30
+ Sinatra version: [Version of Sinatra installed if mounting kibana-rack in a Sinatra application (run `bundle show sinatra`)]
31
+
32
+ [Include any other information about your environment that might be helpful]
33
+
34
+ ### Scenario
35
+
36
+ [What are you attempting to do that isn't working?]
37
+
38
+ ### Steps to reproduce
39
+
40
+ [What are the things we need to do in order to reproduce the problem?]
41
+
42
+ ### Expected result:
43
+
44
+ [What are you expecting to happen when the above steps to reproduce are performed?]
45
+
46
+ ### Actual result:
47
+
48
+ [What actually happens when the above steps to reproduce are performed?]
49
+ ```
50
+
51
+ ### Security issues
52
+
53
+ If you have discovered an issue with kibana-rack of a sensitive nature that could compromise the security of kibana-rack users, **please report it securely by sending a GPG-encrypted message instead of filing an issue on GitHub**. Please use the following key and send your report to [tony@tabolario.com](mailto:tony@tabolario.com).
54
+
55
+ [https://raw.github.com/tabolario/kibana-rack/tabolario.gpg](https://raw.github.com/tabolario/kibana-rack/tabolario.gpg)
56
+
57
+ The fingerprint of the key should be:
58
+
59
+ 6EED 2359 968F 7734 06A4 AB56 D90E 487A 60F1 0579
60
+
61
+ ### Discussions
62
+
63
+ Issues to discuss the architecture, design, and functionality of kibana-rack are welcome on the issue tracker, and this is where these discussions are preferred so that we can track them and associate them with issues if necessary.
64
+
65
+ ## Pull requests
66
+
67
+ ### Getting started
68
+
69
+ * [Fork](https://github.com/tabolario/kibana-rack/fork) the repository on GitHub.
70
+ * Install development dependencies: `bundle`
71
+ * Install the pre-commit hook: `bundle exec rake overcommit --install`
72
+ * Make sure the existing test suite runs for you: `bundle exec rake`
73
+
74
+ ### Making changes
75
+
76
+ * Create a topic branch for your work.
77
+ - Prefer to target `master` for new topic branches (`git checkout -b feature/my-new-feature master`).
78
+ - Only target release branches if your change *must* be for that release.
79
+ - Avoid working directly on the `master` branch.
80
+ * Make atomic commits of logical units.
81
+ * Check to make sure your changes adhere to the project style guide and linter configuration with `bundle exec rake lint`. (This is done automatically if you have the pre-commit hook installed.)
82
+ * Write unit and integration tests as necessary for your changes. **Pull requests will not be accepted for non-trivial changes without tests.**
83
+ * Ensure that the entire test suite passes with `bundle exec rake spec`.
84
+ * Create a pull request on GitHub for your contribution.
85
+ * Check [Travis CI](https://travis-ci.org/tabolario/kibana-rack/pull_requests) for your pull request. **Only green pull requests will be merged.**
86
+
87
+ ### Trivial changes
88
+
89
+ Certain types of changes do not need to undergo the same process as changes involving the functionality of kibana-rack (e.g. running tests and static analysis tools). These types of changes include:
90
+
91
+ * Changes to "root documentation" like `README.md`, `CHANGELOG.md`, and this document
92
+ * Changes to build scripts, and other development configuration files
93
+ * Comment cleanup
94
+ * Formatting cleanup
95
+ * Spelling/grammar fixes
96
+ * Typo corrections
97
+
98
+ Trivial changes **do** need to pass the Ruby linter (`bundle exec rake lint:ruby`) if they make changes to any Ruby code.
99
+
100
+ ## Getting help
101
+
102
+ A number of support channels are available for getting help with kibana-rack:
103
+
104
+ * Email: [tony@tabolario.com](mailto:tony@tabolario.com)
105
+ * Twitter: [@tabolario](https://twitter.com/tabolario)
data/Gemfile ADDED
@@ -0,0 +1,30 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ gem 'overcommit', '~> 0.16'
7
+ gem 'rails', '~> 4.1'
8
+ gem 'rake', '~> 10.3'
9
+ end
10
+
11
+ group :lint do
12
+ gem 'inch', '~> 0.4'
13
+ gem 'rubocop', '~> 0.24'
14
+ end
15
+
16
+ group :test do
17
+ gem 'coveralls', '~> 0.7', require: false
18
+ gem 'rspec', '~> 3.0'
19
+ gem 'webmock', '~> 1.18', require: false
20
+ end
21
+
22
+ group :debugger do
23
+ gem 'pry-byebug', '~> 1.3'
24
+ end
25
+
26
+ group :docs do
27
+ gem 'github-markup', '~> 1.2'
28
+ gem 'redcarpet', '~> 3.1'
29
+ gem 'yard', github: 'lsegal/yard'
30
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Tony Burns
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,269 @@
1
+ # kibana-rack [![Kibana Version](https://img.shields.io/badge/kibana%20version-3.1.0-orange.svg)](http://www.elasticsearch.org/overview/kibana/)
2
+
3
+ [![Gem Version](https://img.shields.io/gem/v/kibana-rack.svg)](https://rubygems.org/gems/kibana-rack)
4
+ [![Dependency Status](https://gemnasium.com/tabolario/kibana-rack.svg)](https://gemnasium.com/tabolario/kibana-rack)
5
+ [![Build Status](https://travis-ci.org/tabolario/kibana-rack.svg?branch=master)](https://travis-ci.org/tabolario/kibana-rack)
6
+ [![Code Climate](https://img.shields.io/codeclimate/github/tabolario/kibana-rack.svg)](https://codeclimate.com/github/tabolario/kibana-rack)
7
+ [![Coverage Status](https://img.shields.io/coveralls/tabolario/kibana-rack.svg)](https://coveralls.io/r/tabolario/kibana-rack?branch=master)
8
+ [![Inline docs](http://inch-ci.org/github/tabolario/kibana-rack.svg)](http://inch-ci.org/github/tabolario/kibana-rack)
9
+
10
+ Embed [Kibana](http://www.elasticsearch.org/overview/kibana/) as a [Rack](http://rack.github.io/) application.
11
+
12
+ Kibana is a beautiful and powerful dashboard built on top of [Elasticsearch](http://www.elasticsearch.org/). It's great for viewing logs indexed by tools like [logstash](http://logstash.net/) and exploring data on Elasticsearch in general.
13
+
14
+ kibana-rack tracks the latest version of Kibana (currently 3.1.0) and embeds it directly in your application, along with a proxy for the Elasticsearch API endpoints that Kibana needs.
15
+
16
+ Kibana dashboards can be created using ERB-processed JSON files in the directory specified by your kibana-rack configuration.
17
+
18
+ ## Requirements
19
+
20
+ * Ruby 2.1+ (kibana-rack is developed and tested with Ruby 2.1.2)
21
+
22
+ ## Installation
23
+
24
+ Add this line to your application's Gemfile:
25
+
26
+ gem 'kibana-rack', '~> 0.1.0'
27
+
28
+ And then execute:
29
+
30
+ $ bundle
31
+
32
+ ### Rails
33
+
34
+ **Note: kibana-rails is coming soon!**
35
+
36
+ Create an initializer at `config/initializers/kibana.rb` to configure kibana-rack:
37
+
38
+ ```ruby
39
+ Kibana.configure do |config|
40
+ config.elasticsearch_host = 'localhost'
41
+ config.elasticsearch_port = 9200
42
+ config.kibana_dashboards_path = Rails.root.join('app/kibana')
43
+ config.kibana_default_route = '/dashboard/file/default.json'
44
+ config.kibana_index = 'kibana-int'
45
+ end
46
+ ```
47
+
48
+ Modify `config/routes.rb`:
49
+
50
+ ```ruby
51
+ Rails.application.routes.draw do
52
+ mount Kibana::Rack::Web => '/kibana'
53
+ end
54
+ ```
55
+
56
+ ### Sinatra and other Rack applications
57
+
58
+ Configure kibana-rack:
59
+
60
+ ```ruby
61
+ Kibana.configure do |config|
62
+ config.elasticsearch_host = 'localhost'
63
+ config.elasticsearch_port = 9200
64
+ config.kibana_dashboards_path = File.expand_path('../path/to/dashboards', __FILE__)
65
+ config.kibana_default_route = '/dashboard/file/default.json'
66
+ config.kibana_index = 'kibana-int'
67
+ end
68
+ ```
69
+
70
+ Mount kibana-rack with [Rack::Builder](http://rubydoc.info/github/rack/rack/master/Rack/Builder):
71
+
72
+ ```ruby
73
+ class MyRackApplication < Sinatra::Base
74
+ ...
75
+ end
76
+
77
+ app = Rack::Builder.new do
78
+ map('/kibana') { use Kibana::Rack::Web }
79
+ run MyRackApplication
80
+ end
81
+
82
+ run app
83
+ ```
84
+
85
+ ## Usage
86
+
87
+ See the [Kibana documentation](http://www.elasticsearch.org/guide/en/kibana/current/index.html) for information on how to use Kibana.
88
+
89
+ ## Configuration
90
+
91
+ kibana-rack is configured by default to serve the dashboards that come in the gem (see the [dashboards](https://github.com/tabolario/kibana-rack/tree/master/dashboards) directory), and proxy to Elasticsearch on `localhost:9200`. It is recommended that you maintain your own dashboards directory inside of the application that kibana-rack is mounted in. Production deployments will also most likely need to configure the address of Elasticsearch.
92
+
93
+ The following settings are available as accessors on the object yielded to from `Kibana.configure`:
94
+
95
+ ```ruby
96
+ Kibana.configure do |config|
97
+ config.elasticsearch_host = '10.0.8.9'
98
+ ...
99
+ end
100
+ ```
101
+
102
+ | Name | Description |
103
+ | ------------------------ | ----------------------------------------------------------------------------------------------- |
104
+ | `elasticsearch_host` | The host of the Elasticsearch instance to proxy to. Default: `localhost` |
105
+ | `elasticsearch_port` | The port of the Elasticsearch instance to proxy to. Default: `9200` |
106
+ | `kibana_dashboards_path` | The directory to look for dashboards in. Default: `dashboards` directory inside of kibana-rack |
107
+ | `kibana_default_route` | The default path that Kibana will load. Default: `/dashboard/file/default.json` |
108
+ | `kibana_index` | The name of the Elasticsearch index Kibana will use for internal storage. Default: `kibana-int` |
109
+
110
+ ## Securing the `/kibana` endpoint
111
+
112
+ Kibana is very useful to have in production for things like searching logs and exploring Elasticsearch indexes. When using kibana-rack in a production environment, be sure to secure it from unauthorized access.
113
+
114
+ ### Devise
115
+
116
+ In `config/routes.rb`:
117
+
118
+ ```ruby
119
+ authenticate :user do
120
+ mount Kibana::Rack::Web => '/kibana'
121
+ end
122
+ ```
123
+
124
+ Or authenticate only if `User#admin?` returns true for `current_user`:
125
+
126
+ ```ruby
127
+ authenticate :user, ->(user) { user.admin? } do
128
+ mount Kibana::Rack::Web => '/kibana'
129
+ end
130
+ ```
131
+
132
+ ### Rack with HTTP basic authentication
133
+
134
+ ```ruby
135
+ require 'kibana/rack'
136
+
137
+ map '/kibana' do
138
+ use Rack::Auth::Basic, 'Restricted Access' do |username, password|
139
+ username == 'kibana' && password == 'kibana'
140
+ end
141
+
142
+ run Kibana::Rack::Web
143
+ end
144
+ ```
145
+
146
+ ## Documentation
147
+
148
+ See the [examples](https://github.com/tabolario/kibana-rack/tree/master/examples) directory for installation and configuration examples.
149
+
150
+ See the [YARD documentation](http://rdoc.info/github/tabolario/kibana-rack) for the latest API documentation.
151
+
152
+ Generate local documentation with YARD (output to the `doc` directory):
153
+
154
+ $ bundle exec rake yard
155
+
156
+ ## Support
157
+
158
+ * [GitHub Issues](https://github.com/tabolario/kibana-rack/issues)
159
+ * Email: [tony@tabolario.com](mailto:tony@tabolario.com)
160
+ * Twitter: [@tabolario](https://twitter.com/tabolario)
161
+
162
+ ## Development and testing
163
+
164
+ kibana-rack follows the [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide) for style conventions, with a few exceptions. See [.rubocop.yml](https://github.com/tabolario/kibana-rack/blob/master/.rubocop.yml) for the details.
165
+
166
+ Run linters ([RuboCop](https://github.com/bbatsov/rubocop) and [Inch](https://github.com/rrrene/inch)):
167
+
168
+ $ bundle exec rake lint
169
+
170
+ Run tests:
171
+
172
+ $ bundle exec rake spec
173
+
174
+ Install pre-commit hooks for [overcommit](https://github.com/causes/overcommit) (configuration is in [.overcommit.yml](https://github.com/tabolario/kibana-rack/blob/master/.overcommit.yml)):
175
+
176
+ $ gem install overcommit
177
+ $ overcommit --install
178
+
179
+ ## Security
180
+
181
+ ### Installation
182
+
183
+ kibana-rack is cryptographically signed. To be sure the gem you install hasn't been tampered with, add my public key (if you haven't already) as a trusted certificate:
184
+
185
+ $ gem cert --add <(curl -Ls https://raw.github.com/tabolario/kibana-rack/master/tabolario.pem)
186
+
187
+ Installing the gem with the MediumSecurity trust profile will verify all signed gems, but allow the installation of unsigned dependencies:
188
+
189
+ $ gem install kibana-rack -P MediumSecurity
190
+
191
+ You can also set the trust file for Bundler:
192
+
193
+ $ bundle --trust-policy MediumSecurity
194
+
195
+ Using the MediumSecurity policy is often necessary because not all of your dependencies may not be signed, so HighSecurity is not an option.
196
+
197
+ ### Reporting Security Issues
198
+
199
+ If you have discovered an issue with kibana-rack of a sensitive nature that could compromise the security of kibana-rack users, **please report it securely by sending a GPG-encrypted message instead of filing an issue on GitHub**. Please use the following key and send your report to [tony@tabolario.com](mailto:tony@tabolario.com).
200
+
201
+ [https://raw.github.com/tabolario/kibana-rack/tabolario.gpg](https://raw.github.com/tabolario/kibana-rack/tabolario.gpg)
202
+
203
+ The fingerprint of the key should be:
204
+
205
+ 6EED 2359 968F 7734 06A4 AB56 D90E 487A 60F1 0579
206
+
207
+ ## Contributing
208
+
209
+ See [CONTRIBUTING.md](https://github.com/tabolario/kibana-rack/blob/master/CONTRIBUTING.md) for full information on how to contribute to kibana-rack.
210
+
211
+ ## Release process
212
+
213
+ kibana-rack follows [Semver 2.0.0](http://semver.org/spec/v2.0.0.html) for release versioning. The version number components X.Y.Z have the following meanings:
214
+
215
+ * X for **Major** releases that may contain backwards-incompatible changes.
216
+ * Y for **Minor** releases that may contain features, bug fixes, and backwards-compatible changes.
217
+ * Z for **Patch** releases that only contain bug fixes and trivial changes.
218
+
219
+ **Pre-release** versions like `X.Y.Z.alpha.0` and `X.Y.Z.beta.1` will be made before **Major**, and **Minor** versions. Pre-release versions are well-tested, but not as thoroughly as the versions that they precede.
220
+
221
+ Whenever a new version is made, it will be tagged as a release on [GitHub Releases](https://github.com/tabolario/kibana-rack/releases) and pushed to [RubyGems](https://rubygems.org/gems/kibana-rack). Entries in [CHANGELOG.md](https://github.com/tabolario/kibana-rack/blob/master/CHANGELOG.md) will be made incrementally up to the release. An announcement will also be made on Twitter.
222
+
223
+ When a new **Major** version is made, a corresponding branch will be created named `X-0-0` for further **Minor** and **Patch** releases on that version.
224
+
225
+ ## Todo
226
+
227
+ * kibana-rails gem for easy integration with Ruby on Rails applications
228
+ * A Ruby DSL for defining dashboards
229
+ * Example dashboards for common use cases
230
+
231
+ ## License
232
+
233
+ ### kibana-rack
234
+
235
+ | | |
236
+ | ------------- | ------------------------------------------------------------------------- |
237
+ | **Author** | Tony Burns <[tony@tabolario.com](mailto:tony@tabolario.com)> |
238
+ | **Copyright** | Copyright (c) 2014 Tony Burns |
239
+ | **License** | [MIT License](http://opensource.org/licenses/MIT) |
240
+
241
+ ```text
242
+ MIT License
243
+
244
+ Permission is hereby granted, free of charge, to any person obtaining
245
+ a copy of this software and associated documentation files (the
246
+ "Software"), to deal in the Software without restriction, including
247
+ without limitation the rights to use, copy, modify, merge, publish,
248
+ distribute, sublicense, and/or sell copies of the Software, and to
249
+ permit persons to whom the Software is furnished to do so, subject to
250
+ the following conditions:
251
+
252
+ The above copyright notice and this permission notice shall be
253
+ included in all copies or substantial portions of the Software.
254
+
255
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
256
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
257
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
258
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
259
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
260
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
261
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
262
+ ```
263
+
264
+ ### Kibana
265
+
266
+ | | |
267
+ | ------------- | ------------------------------------------------------------------------- |
268
+ | **Copyright** | Copyright 2012-2013 Elasticsearch BV |
269
+ | **License** | [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) |