proxes 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b504f6a2dcb6fa6d41872ad0d203d5a57324567
4
- data.tar.gz: 203323938f3a6ad123d14a9bd7934af90f40912f
3
+ metadata.gz: 1c294e375262e708cfc0ef3645d3b6b9399f25e0
4
+ data.tar.gz: 48d1100105c1f9dc9582107c5d6d7af0d34c45fc
5
5
  SHA512:
6
- metadata.gz: 5d14a2a8d057c7f9c8b94b2c05e72de6d6df3f91719ef41bd93fc5af069960fe8c039f315c6e1394fbaec3b5f8c91b533d498df6a0f7cd524f7a45bd8809a0c4
7
- data.tar.gz: '0490f5333bbc15dce6c32e9bc6e87dfba9314090482e83a14e7f8753d54512edb765b6d571be5f6d8b03af625a61ffd1f011a06539be5ff5f56c1f61f2305cae'
6
+ metadata.gz: 15ccea3a78653a32eb3e36204c5e411b38f56d045d392cc738a496c9c8289bb461909f3093ec92542c1f01482fcd3bfc6101825a259752245fd861defe039275
7
+ data.tar.gz: 65807f0075dd7910d19fa1424351963d3dd5a2fb944b72a7e2ab3cf98024479d095cbda3aa76237811b3298959ee108fd8cfeb72665936142ddc6651a730fb82
data/README.md CHANGED
@@ -6,22 +6,12 @@
6
6
 
7
7
  ProxES provides a management interface and security layer for Elasticsearch.
8
8
 
9
- ## Components
10
-
11
- ProxES has two main components that works together, but can be used separately
12
- as well:
13
-
14
- ### 1. Management Interface
15
-
16
- This interface gives you the ability to manage your Elasticsearch users and get
17
- and overview of your Elasticsearch cluster.
9
+ ## Getting Started
18
10
 
19
- ### 2. Security Middleware
11
+ This is a full application that requires some setup. The following complete setup
12
+ scripts are available:
20
13
 
21
- The Rack middleware checks all requests going to your Elasticsearch cluster
22
- against the users and permissions you've set up in the Management Interface. It
23
- uses a combination of [Pundit](https://github.com/elabs/pundit) and
24
- [OmniAuth](https://github.com/omniauth/omniauth) to secure your cluster.
14
+ * [Ubuntu](https://gist.github.com/jrgns/979a6d3ea7cc94db671551227fd6469a#file-setup-ubuntu-sh)
25
15
 
26
16
  ## Installation
27
17
 
@@ -48,14 +38,32 @@ gem install proxes
48
38
  1. Add the components to your rack config file. See the included [`config.ru`](https://github.com/EagerELK/proxes/blob/master/config.ru) file for an example setup
49
39
  2. Add the ProxES rake tasks to your Rakefile: `require 'proxes/rake_tasks'`
50
40
  3. Set the DB connection as the `DATABASE_URL` ENV variable: `DATABASE_URL=sqlite://development.db`
51
- 4. Create and populate the DB:
41
+ 4. Create and populate the DB and secret tokens:
52
42
 
53
43
  ```bash
54
44
  bundle exec rake proxes:migrate
55
45
  bundle exec rake proxes:seed
46
+ bundle exec rake proxes:generate_tokens
56
47
  ```
57
48
 
58
- 4. Start up the web app: `bundle exec rackup`
49
+ 5. Start up the web app: `bundle exec rackup`
50
+
51
+ ## Components
52
+
53
+ ProxES has two main components that works together, but can be used separately
54
+ as well:
55
+
56
+ ### 1. Management Interface
57
+
58
+ This interface gives you the ability to manage your Elasticsearch users and get
59
+ and overview of your Elasticsearch cluster.
60
+
61
+ ### 2. Security Middleware
62
+
63
+ The Rack middleware checks all requests going to your Elasticsearch cluster
64
+ against the users and permissions you've set up in the Management Interface. It
65
+ uses a combination of [Pundit](https://github.com/elabs/pundit) and
66
+ [OmniAuth](https://github.com/omniauth/omniauth) to secure your cluster.
59
67
 
60
68
  ## Development
61
69
 
data/config.ru CHANGED
@@ -1,24 +1,17 @@
1
1
  # frozen_string_literal: true
2
- #\-o 0.0.0.0 -p 9294
3
2
  libdir = File.expand_path(File.dirname(__FILE__) + '/lib')
4
3
  $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
5
4
 
6
5
  raise 'Unconfigured' unless ENV['ELASTICSEARCH_URL']
7
6
 
8
- require 'proxes'
9
- require 'proxes/db'
10
- require 'proxes/app'
11
- require 'proxes/listener'
12
-
13
- Sequel.extension :migration
14
- Sequel::Migrator.check_current(DB, './migrate')
15
-
16
7
  use Rack::Static, urls: ['/css', '/js'], root: 'public'
8
+ use Rack::MethodOverride
17
9
  use Rack::Session::Cookie,
18
10
  key: '_ProxES_session',
19
11
  #:secure=>!TEST_MODE, # Uncomment if only allowing https:// access
20
12
  secret: File.read('.session_secret')
21
13
 
14
+ require 'proxes'
22
15
  require 'omniauth'
23
16
  require 'omniauth-identity'
24
17
  require 'proxes/models/identity'
@@ -37,21 +30,8 @@ end
37
30
  OmniAuth.config.on_failure = ProxES::AuthIdentity
38
31
 
39
32
  # Management App
40
- Dir.glob("#{libdir}/proxes/controllers/*.rb").each { |file| require file }
41
-
42
33
  map '/_proxes' do
43
- {
44
- '/users' => ProxES::Users,
45
- '/roles' => ProxES::Roles,
46
- '/permissions' => ProxES::Permissions,
47
- '/audit-logs' => ProxES::AuditLogs,
48
- }.each do |route, app|
49
- map route do
50
- run app
51
- end
52
- end
53
-
54
- run ProxES::App
34
+ run Rack::URLMap.new ProxES::Container.routes
55
35
  end
56
36
 
57
37
  # Proxy all Elasticsearch requests
@@ -1,3 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
  require 'proxes/version'
3
3
  require 'proxes/container'
4
+ require 'proxes/db'
5
+ require 'proxes/app'
6
+ require 'proxes/listener'
7
+
8
+ require 'proxes/proxes'
9
+ ProxES::Container.plugin(:proxes)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ProxES
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proxes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jurgens du Toit