proxes 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +24 -16
- data/config.ru +3 -23
- data/lib/proxes.rb +6 -0
- data/lib/proxes/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c294e375262e708cfc0ef3645d3b6b9399f25e0
|
4
|
+
data.tar.gz: 48d1100105c1f9dc9582107c5d6d7af0d34c45fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
##
|
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
|
-
|
11
|
+
This is a full application that requires some setup. The following complete setup
|
12
|
+
scripts are available:
|
20
13
|
|
21
|
-
|
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
|
-
|
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
|
data/lib/proxes.rb
CHANGED
data/lib/proxes/version.rb
CHANGED