fluentd-ui 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fluentd-ui might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ChangeLog +4 -1
- data/Gemfile.lock +1 -1
- data/README.md +4 -0
- data/app/controllers/concerns/setting_concern.rb +34 -0
- data/app/controllers/fluentd/settings/in_syslog_controller.rb +9 -27
- data/app/controllers/fluentd/settings/out_elasticsearch_controller.rb +21 -0
- data/app/controllers/fluentd/settings/out_forward_controller.rb +13 -27
- data/app/controllers/fluentd/settings/out_mongo_controller.rb +10 -28
- data/app/controllers/fluentd/settings/out_td_controller.rb +10 -28
- data/app/controllers/users_controller.rb +0 -4
- data/app/models/fluentd/setting/out_elasticsearch.rb +24 -0
- data/app/views/fluentd/settings/out_elasticsearch/_form.html.haml +23 -0
- data/app/views/fluentd/settings/out_elasticsearch/show.html.haml +6 -0
- data/app/views/fluentd/settings/source_and_output.html.haml +4 -0
- data/config/locales/translation_en.yml +6 -0
- data/config/locales/translation_ja.yml +7 -0
- data/config/routes.rb +4 -0
- data/db/seeds.rb +0 -4
- data/lib/file_reverse_reader.rb +1 -2
- data/lib/fluentd-ui/version.rb +1 -1
- data/spec/features/fluentd/setting/out_elasticsearch_spec.rb +38 -0
- data/spec/features/sessions_spec.rb +42 -6
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc93f563d3aa8095d2689a544d43a5dca19ba9ba
|
4
|
+
data.tar.gz: f947b3d3b364ceecf025d2b455ab121109bf320a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aeaea39c8258a781b4cf2f99f5ee6a30974673a2d0fb14a5c7cdc4e408b185dc28a97f90529fc4364270f97233229ad96dc98f1064234d7be3bc8c713da38df1
|
7
|
+
data.tar.gz: afce6cad466ace12346a56bcc5783f153cf69e2dc1b3edfe9842d239e5d030b1150fdf5e07631752042eac5a93da22ef83985e338af81ea0b575c040512dc676
|
data/ChangeLog
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
Release 0.1.3 - 2014/08/13
|
2
|
+
|
3
|
+
* [feature] Add out_elasticsearch setting
|
4
|
+
|
1
5
|
Release 0.1.2 - 2014/08/07
|
2
6
|
|
3
7
|
* [fixed] Can't login if password changed from default
|
@@ -7,7 +11,6 @@ Release 0.1.1 - 2014/08/07
|
|
7
11
|
* [fixed] Can't install a gem on some environment #70
|
8
12
|
* [fixed] Can't setup in_tail if recognized as binary file selected #71
|
9
13
|
|
10
|
-
|
11
14
|
Release 0.1.0 - 2014/08/01
|
12
15
|
|
13
16
|
* First release!
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# fluentd-ui
|
2
2
|
|
3
|
+
[![build status](https://circleci.com/gh/fluent/fluentd-ui.png?style=shield&circle-token=a739a52ae9ae6774ab2192d4236a5f93ac29e11e)](https://circleci.com/gh/fluent/fluentd-ui)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/fluentd-ui.svg)](http://badge.fury.io/rb/fluentd-ui)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/fluent/fluentd-ui/badges/gpa.svg)](https://codeclimate.com/github/fluent/fluentd-ui)
|
6
|
+
|
3
7
|
fluentd-ui is a browser-based [fluentd](http://fluentd.org/) and [td-agent](http://docs.treasuredata.com/articles/td-agent) manager that supports following operations.
|
4
8
|
|
5
9
|
* Install, uninstall, and upgrade fluentd plugins
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module SettingConcern
|
2
|
+
extend ActiveSupport::Concern
|
3
|
+
|
4
|
+
included do
|
5
|
+
before_action :login_required
|
6
|
+
before_action :find_fluentd
|
7
|
+
end
|
8
|
+
|
9
|
+
def show
|
10
|
+
@setting = target_class.new(initial_params)
|
11
|
+
end
|
12
|
+
|
13
|
+
def finish
|
14
|
+
@setting = target_class.new(setting_params)
|
15
|
+
unless @setting.valid?
|
16
|
+
return render "show"
|
17
|
+
end
|
18
|
+
|
19
|
+
@fluentd.agent.config_append @setting.to_config
|
20
|
+
if @fluentd.agent.running?
|
21
|
+
unless @fluentd.agent.restart
|
22
|
+
@setting.errors.add(:base, @fluentd.agent.log_tail(1).first)
|
23
|
+
return render "show"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
redirect_to daemon_setting_path(@fluentd)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def setting_params
|
32
|
+
params.require(target_class.to_s.underscore.gsub("/", "_")).permit(*target_class.const_get(:KEYS))
|
33
|
+
end
|
34
|
+
end
|
@@ -1,34 +1,16 @@
|
|
1
1
|
class Fluentd::Settings::InSyslogController < ApplicationController
|
2
|
-
|
3
|
-
before_action :find_fluentd
|
4
|
-
|
5
|
-
def show
|
6
|
-
@setting = Fluentd::Setting::InSyslog.new({
|
7
|
-
bind: "0.0.0.0",
|
8
|
-
port: 5140,
|
9
|
-
})
|
10
|
-
end
|
11
|
-
|
12
|
-
def finish
|
13
|
-
@setting = Fluentd::Setting::InSyslog.new(setting_params)
|
14
|
-
unless @setting.valid?
|
15
|
-
return render "show"
|
16
|
-
end
|
17
|
-
|
18
|
-
@fluentd.agent.config_append @setting.to_config
|
19
|
-
if @fluentd.agent.running?
|
20
|
-
unless @fluentd.agent.restart
|
21
|
-
@setting.errors.add(:base, @fluentd.agent.log_tail(1).first)
|
22
|
-
return render "show"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
redirect_to daemon_setting_path(@fluentd)
|
26
|
-
end
|
2
|
+
include SettingConcern
|
27
3
|
|
28
4
|
private
|
29
5
|
|
30
|
-
def
|
31
|
-
|
6
|
+
def target_class
|
7
|
+
Fluentd::Setting::InSyslog
|
32
8
|
end
|
33
9
|
|
10
|
+
def initial_params
|
11
|
+
{
|
12
|
+
bind: "0.0.0.0",
|
13
|
+
port: 5140,
|
14
|
+
}
|
15
|
+
end
|
34
16
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class Fluentd::Settings::OutElasticsearchController < ApplicationController
|
2
|
+
include SettingConcern
|
3
|
+
|
4
|
+
private
|
5
|
+
|
6
|
+
def target_class
|
7
|
+
Fluentd::Setting::OutElasticsearch
|
8
|
+
end
|
9
|
+
|
10
|
+
def initial_params
|
11
|
+
{
|
12
|
+
host: "127.0.0.1",
|
13
|
+
port: 9200,
|
14
|
+
index_name: "via_fluentd",
|
15
|
+
type_name: "via_fluentd",
|
16
|
+
logstash_format: true,
|
17
|
+
include_tag_key: false,
|
18
|
+
utc_index: true,
|
19
|
+
}
|
20
|
+
end
|
21
|
+
end
|
@@ -1,35 +1,12 @@
|
|
1
1
|
class Fluentd::Settings::OutForwardController < ApplicationController
|
2
|
-
|
3
|
-
before_action :find_fluentd
|
2
|
+
include SettingConcern
|
4
3
|
|
5
|
-
|
6
|
-
@setting = Fluentd::Setting::OutForward.new({
|
7
|
-
secondary: {
|
8
|
-
"0" => {
|
9
|
-
type: "file",
|
10
|
-
}
|
11
|
-
}
|
12
|
-
})
|
13
|
-
end
|
14
|
-
|
15
|
-
def finish
|
16
|
-
@setting = Fluentd::Setting::OutForward.new(setting_params)
|
17
|
-
unless @setting.valid?
|
18
|
-
return render "show"
|
19
|
-
end
|
4
|
+
private
|
20
5
|
|
21
|
-
|
22
|
-
|
23
|
-
unless @fluentd.agent.restart
|
24
|
-
@setting.errors.add(:base, @fluentd.agent.log_tail(1).first)
|
25
|
-
return render "show"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
redirect_to daemon_setting_path(@fluentd)
|
6
|
+
def target_class
|
7
|
+
Fluentd::Setting::OutForward
|
29
8
|
end
|
30
9
|
|
31
|
-
private
|
32
|
-
|
33
10
|
def setting_params
|
34
11
|
params.require(:fluentd_setting_out_forward).permit(*Fluentd::Setting::OutForward::KEYS).merge(
|
35
12
|
params.require(:fluentd_setting_out_forward).permit(
|
@@ -39,4 +16,13 @@ class Fluentd::Settings::OutForwardController < ApplicationController
|
|
39
16
|
)
|
40
17
|
end
|
41
18
|
|
19
|
+
def initial_params
|
20
|
+
{
|
21
|
+
secondary: {
|
22
|
+
"0" => {
|
23
|
+
type: "file",
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
end
|
42
28
|
end
|
@@ -1,36 +1,18 @@
|
|
1
1
|
class Fluentd::Settings::OutMongoController < ApplicationController
|
2
|
-
|
3
|
-
before_action :find_fluentd
|
2
|
+
include SettingConcern
|
4
3
|
|
5
|
-
|
6
|
-
|
4
|
+
private
|
5
|
+
|
6
|
+
def target_class
|
7
|
+
Fluentd::Setting::OutMongo
|
8
|
+
end
|
9
|
+
|
10
|
+
def initial_params
|
11
|
+
{
|
7
12
|
host: "127.0.0.1",
|
8
13
|
port: 27017,
|
9
14
|
capped: true,
|
10
15
|
capped_size: "100m",
|
11
|
-
}
|
12
|
-
end
|
13
|
-
|
14
|
-
def finish
|
15
|
-
@setting = Fluentd::Setting::OutMongo.new(setting_params)
|
16
|
-
unless @setting.valid?
|
17
|
-
return render "show"
|
18
|
-
end
|
19
|
-
|
20
|
-
@fluentd.agent.config_append @setting.to_config
|
21
|
-
if @fluentd.agent.running?
|
22
|
-
unless @fluentd.agent.restart
|
23
|
-
@setting.errors.add(:base, @fluentd.agent.log_tail(1).first)
|
24
|
-
return render "show"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
redirect_to daemon_setting_path(@fluentd)
|
28
|
-
end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
def setting_params
|
33
|
-
params.require(:fluentd_setting_out_mongo).permit(*Fluentd::Setting::OutMongo::KEYS)
|
16
|
+
}
|
34
17
|
end
|
35
|
-
|
36
18
|
end
|
@@ -1,36 +1,18 @@
|
|
1
1
|
class Fluentd::Settings::OutTdController < ApplicationController
|
2
|
-
|
3
|
-
before_action :find_fluentd
|
2
|
+
include SettingConcern
|
4
3
|
|
5
|
-
|
6
|
-
|
4
|
+
private
|
5
|
+
|
6
|
+
def target_class
|
7
|
+
Fluentd::Setting::OutTd
|
8
|
+
end
|
9
|
+
|
10
|
+
def initial_params
|
11
|
+
{
|
7
12
|
buffer_type: "file",
|
8
13
|
buffer_path: "/var/log/td-agent/buffer/td",
|
9
14
|
auto_create_table: true,
|
10
15
|
match: "td.*.*",
|
11
|
-
}
|
12
|
-
end
|
13
|
-
|
14
|
-
def finish
|
15
|
-
@setting = Fluentd::Setting::OutTd.new(setting_params)
|
16
|
-
unless @setting.valid?
|
17
|
-
return render "show"
|
18
|
-
end
|
19
|
-
|
20
|
-
@fluentd.agent.config_append @setting.to_config
|
21
|
-
if @fluentd.agent.running?
|
22
|
-
unless @fluentd.agent.restart
|
23
|
-
@setting.errors.add(:base, @fluentd.agent.log_tail(1).first)
|
24
|
-
return render "show"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
redirect_to daemon_setting_path(@fluentd)
|
28
|
-
end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
def setting_params
|
33
|
-
params.require(:fluentd_setting_out_td).permit(*Fluentd::Setting::OutTd::KEYS)
|
16
|
+
}
|
34
17
|
end
|
35
|
-
|
36
18
|
end
|
@@ -5,10 +5,6 @@ class UsersController < ApplicationController
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def update
|
8
|
-
unless @user.authenticate(user_params[:current_password])
|
9
|
-
@user.errors.add(:current_password, :wrong_password)
|
10
|
-
return render :show
|
11
|
-
end
|
12
8
|
unless @user.update_attributes(user_params)
|
13
9
|
return render :show
|
14
10
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class Fluentd
|
2
|
+
module Setting
|
3
|
+
class OutElasticsearch
|
4
|
+
include Common
|
5
|
+
|
6
|
+
KEYS = [
|
7
|
+
:match,
|
8
|
+
:host, :port, :index_name, :type_name,
|
9
|
+
:logstash_format, :logstash_prefix, :logstash_dateformat, :utc_index,
|
10
|
+
:hosts, :request_timeout, :include_tag_key
|
11
|
+
].freeze
|
12
|
+
|
13
|
+
attr_accessor(*KEYS)
|
14
|
+
|
15
|
+
booleans :logstash_format, :utc_index, :include_tag_key
|
16
|
+
|
17
|
+
validates :match, presence: true
|
18
|
+
validates :host, presence: true
|
19
|
+
validates :port, presence: true
|
20
|
+
validates :index_name, presence: true
|
21
|
+
validates :type_name, presence: true
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
= render "shared/setting_errors"
|
2
|
+
|
3
|
+
= form_for(@setting, url: finish_daemon_setting_out_elasticsearch_path(@fluentd), html: {class: "ignore-rails-error-div"}) do |f|
|
4
|
+
= field(f, :match)
|
5
|
+
= field(f, :host)
|
6
|
+
= field(f, :port)
|
7
|
+
= field(f, :logstash_format)
|
8
|
+
= field(f, :index_name)
|
9
|
+
= field(f, :type_name)
|
10
|
+
|
11
|
+
.well.well-sm
|
12
|
+
%h4{"data-toggle" => "collapse", "href" => "#advanced-setting"}
|
13
|
+
= icon('fa-caret-down')
|
14
|
+
= t('terms.advanced_setting')
|
15
|
+
#advanced-setting.collapse
|
16
|
+
= field(f, :hosts)
|
17
|
+
= field(f, :logstash_prefix)
|
18
|
+
= field(f, :logstash_dateformat)
|
19
|
+
= field(f, :utc_index)
|
20
|
+
= field(f, :request_timeout)
|
21
|
+
= field(f, :include_tag_key)
|
22
|
+
= f.submit t('fluentd.common.finish'), class: "btn btn-lg btn-primary pull-right"
|
23
|
+
|
@@ -39,6 +39,10 @@
|
|
39
39
|
= link_to(daemon_setting_out_mongo_path(@fluentd)) do
|
40
40
|
= icon('fa-file-text-o fa-lg')
|
41
41
|
= t("fluentd.common.setup_out_mongo")
|
42
|
+
%p
|
43
|
+
= link_to(daemon_setting_out_elasticsearch_path(@fluentd)) do
|
44
|
+
= icon('fa-file-text-o fa-lg')
|
45
|
+
= t("fluentd.common.setup_out_elasticsearch")
|
42
46
|
%p
|
43
47
|
= link_to(daemon_setting_out_forward_path(@fluentd)) do
|
44
48
|
= icon('fa-file-text-o fa-lg')
|
@@ -97,6 +97,7 @@ en:
|
|
97
97
|
setup_out_mongo: MongoDB
|
98
98
|
setup_out_forward: Forwarding
|
99
99
|
setup_out_s3: Amazon S3
|
100
|
+
setup_out_elasticsearch: Elasticsearch
|
100
101
|
finish: Update & Restart
|
101
102
|
fluentd_info: Setting info
|
102
103
|
recent_errors: "Errors within recent %{days} days"
|
@@ -144,6 +145,11 @@ en:
|
|
144
145
|
For each config parameter, pelase refer to the <a href="http://docs.fluentd.org/articles/out_td" target="_blank">Treasure Data output plugin</a> documentation page.
|
145
146
|
show:
|
146
147
|
page_title: Add Output to Treasure Data
|
148
|
+
out_elasticsearch:
|
149
|
+
option_guide: |
|
150
|
+
For each config parameter, pelase refer to the <a target="_blank" href="https://github.com/uken/fluent-plugin-elasticsearch">Elasticsearch output plugin</a> documentation page.
|
151
|
+
show:
|
152
|
+
page_title: Add Output to Elasticsearch
|
147
153
|
out_mongo:
|
148
154
|
option_guide: |
|
149
155
|
For each config parameter, pelase refer to the <a href="http://docs.fluentd.org/articles/out_mongo" target="_blank">MongoDB output plugin</a> documentation page.
|
@@ -96,6 +96,7 @@ ja:
|
|
96
96
|
setup_out_mongo: MongoDB
|
97
97
|
setup_out_forward: 転送
|
98
98
|
setup_out_s3: AWS S3
|
99
|
+
setup_out_elasticsearch: Elasticsearch
|
99
100
|
finish: 設定する
|
100
101
|
fluentd_info: 設定情報
|
101
102
|
recent_errors: "直近 %{days} 日内のエラー"
|
@@ -143,6 +144,12 @@ ja:
|
|
143
144
|
fluent-plugin-tdプラグインのインストールが必要です。<br />
|
144
145
|
show:
|
145
146
|
page_title: Treasure Data書き出し設定
|
147
|
+
out_elasticsearch:
|
148
|
+
option_guide: |
|
149
|
+
fluent-plugin-elasticsearchプラグインのインストールが必要です。<br />
|
150
|
+
<a target="_blank" href="https://github.com/uken/fluent-plugin-elasticsearch">out_elasticsearchプラグインの解説</a>もご参照ください。
|
151
|
+
show:
|
152
|
+
page_title: Elasticsearch設定
|
146
153
|
out_mongo:
|
147
154
|
option_guide: |
|
148
155
|
fluent-plugin-mongoプラグインのインストールが必要です。<br />
|
data/config/routes.rb
CHANGED
@@ -43,6 +43,10 @@ Rails.application.routes.draw do
|
|
43
43
|
resource :out_forward, only: [:show], module: :settings, controller: :out_forward do
|
44
44
|
post "finish"
|
45
45
|
end
|
46
|
+
|
47
|
+
resource :out_elasticsearch, only: [:show], module: :settings, controller: :out_elasticsearch do
|
48
|
+
post "finish"
|
49
|
+
end
|
46
50
|
end
|
47
51
|
end
|
48
52
|
end
|
data/db/seeds.rb
CHANGED
data/lib/file_reverse_reader.rb
CHANGED
@@ -36,8 +36,7 @@ class FileReverseReader
|
|
36
36
|
|
37
37
|
def binary_file?
|
38
38
|
sample = io.read(1024) || ""
|
39
|
-
|
40
|
-
sample != sample2 # maybe binary file
|
39
|
+
!sample.force_encoding('us-ascii').valid_encoding?
|
41
40
|
ensure
|
42
41
|
io.rewind
|
43
42
|
end
|
data/lib/fluentd-ui/version.rb
CHANGED
@@ -0,0 +1,38 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "out_elasticsearch" do
|
4
|
+
let(:exists_user) { build(:user) }
|
5
|
+
let(:daemon) { build(:fluentd, variant: "td-agent") }
|
6
|
+
let(:match) { "test.out_elasticsearch.#{Time.now.to_i}.*" }
|
7
|
+
let(:location) { daemon_setting_out_elasticsearch_path }
|
8
|
+
|
9
|
+
before do
|
10
|
+
Fluentd.stub(:instance).and_return(daemon)
|
11
|
+
Fluentd::Agent::TdAgent.any_instance.stub(:detached_command).and_return(true)
|
12
|
+
daemon.agent.config_write ""
|
13
|
+
|
14
|
+
visit '/sessions/new'
|
15
|
+
within("form") do
|
16
|
+
fill_in 'session_name', :with => exists_user.name
|
17
|
+
fill_in 'session_password', :with => exists_user.password
|
18
|
+
end
|
19
|
+
click_button I18n.t("terms.sign_in")
|
20
|
+
end
|
21
|
+
|
22
|
+
it "Shown form" do
|
23
|
+
visit location
|
24
|
+
page.should have_css('input[name="fluentd_setting_out_elasticsearch[match]"]')
|
25
|
+
end
|
26
|
+
|
27
|
+
it "Updated config after submit", js: true do
|
28
|
+
daemon.agent.config.should_not include(match)
|
29
|
+
visit location
|
30
|
+
within('#new_fluentd_setting_out_elasticsearch') do
|
31
|
+
fill_in "Match", with: match
|
32
|
+
fill_in "Index name", with: "index"
|
33
|
+
fill_in "Type name", with: "type_name"
|
34
|
+
end
|
35
|
+
click_button I18n.t("fluentd.common.finish")
|
36
|
+
daemon.agent.config.should include(match)
|
37
|
+
end
|
38
|
+
end
|
@@ -1,8 +1,9 @@
|
|
1
1
|
describe "sessions" do
|
2
2
|
let(:exists_user) { build(:user) }
|
3
|
+
let(:submit_label) { I18n.t("terms.sign_in") }
|
4
|
+
let(:after_sign_in_location) { daemon_path }
|
3
5
|
|
4
|
-
describe "
|
5
|
-
let(:submit_label) { I18n.t("terms.sign_in") }
|
6
|
+
describe "sign in with default password" do
|
6
7
|
before do
|
7
8
|
visit '/sessions/new'
|
8
9
|
within("form") do
|
@@ -12,18 +13,18 @@ describe "sessions" do
|
|
12
13
|
click_button submit_label
|
13
14
|
end
|
14
15
|
|
15
|
-
context "
|
16
|
+
context "correct credentials" do
|
16
17
|
let(:user) { exists_user }
|
17
18
|
it "login success, then redirect to root_path, and redirect_to daemon_path from root_path" do
|
18
|
-
current_path.should ==
|
19
|
+
current_path.should == after_sign_in_location
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
22
|
-
context "
|
23
|
+
context "wrong credentials" do
|
23
24
|
let(:user) { build(:user, password: "passw0rd") }
|
24
25
|
|
25
26
|
it "current location is not root_path" do
|
26
|
-
current_path.should_not ==
|
27
|
+
current_path.should_not == after_sign_in_location
|
27
28
|
end
|
28
29
|
|
29
30
|
it "display form for retry" do
|
@@ -32,6 +33,41 @@ describe "sessions" do
|
|
32
33
|
end
|
33
34
|
end
|
34
35
|
|
36
|
+
describe "sign in with modified password" do
|
37
|
+
let(:user) { build(:user, password: password) }
|
38
|
+
let(:new_password) { "newpassword" }
|
39
|
+
let(:old_password) { Settings.default_password }
|
40
|
+
|
41
|
+
before do
|
42
|
+
exists_user.update_attributes(current_password: Settings.default_password, password: new_password, password_confirmation: new_password)
|
43
|
+
visit '/sessions/new'
|
44
|
+
within("form") do
|
45
|
+
fill_in 'session_name', :with => user.name
|
46
|
+
fill_in 'session_password', :with => user.password
|
47
|
+
end
|
48
|
+
click_button submit_label
|
49
|
+
end
|
50
|
+
|
51
|
+
after do
|
52
|
+
# reset password to the default
|
53
|
+
FileUtils.rm_rf(User::ENCRYPTED_PASSWORD_FILE)
|
54
|
+
end
|
55
|
+
|
56
|
+
context "correct password" do
|
57
|
+
let(:password) { new_password }
|
58
|
+
it "login success" do
|
59
|
+
current_path.should == after_sign_in_location
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
context "wrong password" do
|
64
|
+
let(:password) { old_password }
|
65
|
+
it "login failed" do
|
66
|
+
current_path.should_not == after_sign_in_location
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
35
71
|
describe "sign out process" do
|
36
72
|
let(:submit_label) { I18n.t("terms.sign_in") }
|
37
73
|
before do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluentd-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro Nakagawa
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-08-
|
12
|
+
date: 2014-08-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|
@@ -296,9 +296,11 @@ files:
|
|
296
296
|
- app/controllers/api_controller.rb
|
297
297
|
- app/controllers/application_controller.rb
|
298
298
|
- app/controllers/concerns/.keep
|
299
|
+
- app/controllers/concerns/setting_concern.rb
|
299
300
|
- app/controllers/fluentd/agents_controller.rb
|
300
301
|
- app/controllers/fluentd/settings/in_syslog_controller.rb
|
301
302
|
- app/controllers/fluentd/settings/in_tail_controller.rb
|
303
|
+
- app/controllers/fluentd/settings/out_elasticsearch_controller.rb
|
302
304
|
- app/controllers/fluentd/settings/out_forward_controller.rb
|
303
305
|
- app/controllers/fluentd/settings/out_mongo_controller.rb
|
304
306
|
- app/controllers/fluentd/settings/out_s3_controller.rb
|
@@ -333,6 +335,7 @@ files:
|
|
333
335
|
- app/models/fluentd/setting/common.rb
|
334
336
|
- app/models/fluentd/setting/in_syslog.rb
|
335
337
|
- app/models/fluentd/setting/in_tail.rb
|
338
|
+
- app/models/fluentd/setting/out_elasticsearch.rb
|
336
339
|
- app/models/fluentd/setting/out_forward.rb
|
337
340
|
- app/models/fluentd/setting/out_mongo.rb
|
338
341
|
- app/models/fluentd/setting/out_s3.rb
|
@@ -354,6 +357,8 @@ files:
|
|
354
357
|
- app/views/fluentd/settings/in_tail/after_format.html.haml
|
355
358
|
- app/views/fluentd/settings/in_tail/confirm.html.haml
|
356
359
|
- app/views/fluentd/settings/in_tail/show.html.haml
|
360
|
+
- app/views/fluentd/settings/out_elasticsearch/_form.html.haml
|
361
|
+
- app/views/fluentd/settings/out_elasticsearch/show.html.haml
|
357
362
|
- app/views/fluentd/settings/out_forward/_form.html.haml
|
358
363
|
- app/views/fluentd/settings/out_forward/show.html.haml
|
359
364
|
- app/views/fluentd/settings/out_mongo/_form.html.haml
|
@@ -462,6 +467,7 @@ files:
|
|
462
467
|
- spec/factories/fluentd.rb
|
463
468
|
- spec/factories/plugins.rb
|
464
469
|
- spec/factories/user.rb
|
470
|
+
- spec/features/fluentd/setting/out_elasticsearch_spec.rb
|
465
471
|
- spec/features/fluentd/setting/out_forward_spec.rb
|
466
472
|
- spec/features/fluentd/setting/out_td_spec.rb
|
467
473
|
- spec/features/sessions_spec.rb
|
@@ -622,6 +628,7 @@ test_files:
|
|
622
628
|
- spec/factories/fluentd.rb
|
623
629
|
- spec/factories/plugins.rb
|
624
630
|
- spec/factories/user.rb
|
631
|
+
- spec/features/fluentd/setting/out_elasticsearch_spec.rb
|
625
632
|
- spec/features/fluentd/setting/out_forward_spec.rb
|
626
633
|
- spec/features/fluentd/setting/out_td_spec.rb
|
627
634
|
- spec/features/sessions_spec.rb
|