fluentd-ui 1.0.0.beta.1 → 1.0.0

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.

Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog.md +24 -0
  3. data/Gemfile +5 -3
  4. data/Gemfile.lock +88 -75
  5. data/README.md +11 -0
  6. data/Rakefile +1 -1
  7. data/app/javascript/packs/aws_credential.js +1 -1
  8. data/app/javascript/packs/in_tail_parse.js +1 -1
  9. data/app/javascript/packs/owned_plugin_form.js +1 -1
  10. data/app/javascript/packs/settings.js +20 -9
  11. data/app/javascript/packs/transport_config.js +1 -1
  12. data/app/javascript/packs/transport_section.js +1 -1
  13. data/app/javascript/packs/treeview.js +2 -2
  14. data/app/models/plugin.rb +2 -2
  15. data/app/views/fluentd/settings/source_and_output.html.haml +12 -10
  16. data/app/views/layouts/application.html.erb +3 -0
  17. data/app/views/plugins/recommended.html.haml +3 -0
  18. data/app/views/plugins/updated.html.haml +5 -6
  19. data/config.ru +3 -1
  20. data/config/application.rb +1 -1
  21. data/config/application.yml +104 -31
  22. data/config/locales/translation_en.yml +1 -0
  23. data/config/locales/translation_ja.yml +1 -0
  24. data/gemfiles/ruby2.2.gemfile +2 -1
  25. data/lib/fluentd-ui/version.rb +1 -1
  26. data/test/application_system_test_case.rb +8 -0
  27. data/test/controllers/application_controller_test.rb +42 -0
  28. data/test/controllers/fluentd/agents_controller_test.rb +39 -0
  29. data/test/controllers/misc_controller_test.rb +70 -0
  30. data/test/controllers/polling_controller_test.rb +29 -0
  31. data/test/decorators/plugin_decorator_test.rb +26 -0
  32. data/{spec → test}/factories/fluentd.rb +0 -0
  33. data/{spec → test}/factories/plugins.rb +0 -0
  34. data/{spec → test}/factories/user.rb +0 -0
  35. data/{spec/support → test}/fixtures/error0.log +0 -0
  36. data/{spec/support → test}/fixtures/error2.log +0 -0
  37. data/{spec/support → test}/fixtures/error3.log +0 -0
  38. data/{spec/support → test}/fixtures/error4.log +0 -0
  39. data/{spec/support → test}/fixtures/multiline_example.log +0 -0
  40. data/test/integration/dashboard_test.rb +57 -0
  41. data/test/integration/fluentd/setting/histories_test.rb +139 -0
  42. data/test/integration/fluentd/setting/notes_test.rb +27 -0
  43. data/test/integration/fluentd/setting/running_backup_test.rb +65 -0
  44. data/test/integration/fluentd_ui_update_checking_test.rb +27 -0
  45. data/test/integration/sesstions_test.rb +56 -0
  46. data/test/integration/setting_test.rb +126 -0
  47. data/test/integration/users_test.rb +43 -0
  48. data/test/lib/filte_reverse_reader_test.rb +63 -0
  49. data/test/lib/fluentd_ui_test.rb +36 -0
  50. data/test/lib/regexp_preview/multi_line_test.rb +86 -0
  51. data/test/lib/regexp_preview/single_line_test.rb +87 -0
  52. data/test/models/fluent_gem_test.rb +76 -0
  53. data/test/models/fluentd/agent_test.rb +331 -0
  54. data/{spec/models/fluentd/setting/in_forward_spec.rb → test/models/fluentd/setting/in_forward_test.rb} +32 -44
  55. data/test/models/fluentd/setting/in_http_test.rb +30 -0
  56. data/test/models/fluentd/setting/in_monitor_agent_test.rb +30 -0
  57. data/test/models/fluentd/setting/in_syslog_test.rb +88 -0
  58. data/test/models/fluentd/setting/in_tail_test.rb +52 -0
  59. data/test/models/fluentd/setting/out_elasticsearch_test.rb +32 -0
  60. data/test/models/fluentd/setting/out_mongo_test.rb +61 -0
  61. data/test/models/fluentd/setting/out_s3_test.rb +112 -0
  62. data/test/models/fluentd/setting/out_stdout_test.rb +32 -0
  63. data/test/models/fluentd/setting/out_tdlog_test.rb +60 -0
  64. data/test/models/fluentd_log_test.rb +140 -0
  65. data/test/models/fluentd_test.rb +185 -0
  66. data/test/models/plugin_test.rb +144 -0
  67. data/test/models/user_test.rb +48 -0
  68. data/test/support/config_histories.rb +72 -0
  69. data/test/support/configurable_daemon_settings.rb +26 -0
  70. data/test/support/login_macro.rb +12 -0
  71. data/test/support/login_required.rb +8 -0
  72. data/test/support/stub_daemon.rb +14 -0
  73. data/test/system/fluentd/setting/in_forward_test.rb +13 -0
  74. data/test/system/fluentd/setting/in_http_test.rb +13 -0
  75. data/test/system/fluentd/setting/in_monitor_agent.rb +13 -0
  76. data/test/system/fluentd/setting/out_elasticsearch_test.rb +32 -0
  77. data/test/system/fluentd/setting/out_forward_test.rb +41 -0
  78. data/test/system/fluentd/setting/out_stdout_test.rb +15 -0
  79. data/test/system/fluentd/setting/out_tdlog_test.rb +15 -0
  80. data/test/system/source_and_output_test.rb +184 -0
  81. data/test/test_helper.rb +34 -0
  82. metadata +147 -161
  83. data/spec/controllers/application_controller_spec.rb +0 -84
  84. data/spec/controllers/fluentd/agents_controller_spec.rb +0 -61
  85. data/spec/controllers/misc_controller_spec.rb +0 -68
  86. data/spec/controllers/polling_controller_spec.rb +0 -39
  87. data/spec/controllers/sessions_controller_spec.rb +0 -5
  88. data/spec/decorators/plugin_decorator_spec.rb +0 -37
  89. data/spec/features/dashboard_spec.rb +0 -42
  90. data/spec/features/fluentd/setting/histories_spec.rb +0 -110
  91. data/spec/features/fluentd/setting/in_forward_spec.rb +0 -6
  92. data/spec/features/fluentd/setting/in_http_spec.rb +0 -6
  93. data/spec/features/fluentd/setting/in_monitor_agent_spec.rb +0 -6
  94. data/spec/features/fluentd/setting/notes_spec.rb +0 -27
  95. data/spec/features/fluentd/setting/out_forward_spec.rb +0 -38
  96. data/spec/features/fluentd/setting/out_stdout_spec.rb +0 -6
  97. data/spec/features/fluentd/setting/running_backup_spec.rb +0 -106
  98. data/spec/features/fluentd_status_spec.rb +0 -36
  99. data/spec/features/fluentd_ui_update_available_spec.rb +0 -33
  100. data/spec/features/out_elasticsearch_spec.rb +0 -28
  101. data/spec/features/out_forward_spec.rb +0 -36
  102. data/spec/features/out_tdlog_spec.rb +0 -26
  103. data/spec/features/sessions_spec.rb +0 -79
  104. data/spec/features/setting_spec.rb +0 -95
  105. data/spec/features/shared_examples/configurable_daemon_settings.rb +0 -17
  106. data/spec/features/shared_examples/login_required.rb +0 -4
  107. data/spec/features/source_and_output_spec.rb +0 -158
  108. data/spec/features/users_spec.rb +0 -53
  109. data/spec/grok_converter_spec.rb +0 -50
  110. data/spec/lib/file_reverse_reader_spec.rb +0 -93
  111. data/spec/lib/fluentd-ui_spec.rb +0 -35
  112. data/spec/lib/regexp_preview/multi_line_spec.rb +0 -111
  113. data/spec/lib/regexp_preview/single_line_spec.rb +0 -185
  114. data/spec/models/fluent_gem_spec.rb +0 -104
  115. data/spec/models/fluentd/agent/common_spec.rb +0 -82
  116. data/spec/models/fluentd/agent_spec.rb +0 -134
  117. data/spec/models/fluentd/setting/in_http_spec.rb +0 -31
  118. data/spec/models/fluentd/setting/in_monitor_agent_spec.rb +0 -31
  119. data/spec/models/fluentd/setting/in_syslog_spec.rb +0 -98
  120. data/spec/models/fluentd/setting/in_tail_spec.rb +0 -53
  121. data/spec/models/fluentd/setting/out_elasticsearch_spec.rb +0 -31
  122. data/spec/models/fluentd/setting/out_mongo_spec.rb +0 -62
  123. data/spec/models/fluentd/setting/out_s3_spec.rb +0 -128
  124. data/spec/models/fluentd/setting/out_stdout_spec.rb +0 -31
  125. data/spec/models/fluentd/setting/out_tdlog_spec.rb +0 -46
  126. data/spec/models/fluentd_log_spec.rb +0 -171
  127. data/spec/models/fluentd_spec.rb +0 -164
  128. data/spec/models/plugin_spec.rb +0 -191
  129. data/spec/models/user_spec.rb +0 -59
  130. data/spec/spec_helper.rb +0 -85
  131. data/spec/support/config_histories.rb +0 -57
  132. data/spec/support/fluentd_agent_common_behavior.rb +0 -181
  133. data/spec/support/fluentd_agent_restart_strategy.rb +0 -94
  134. data/spec/support/javascript_macro.rb +0 -21
  135. data/spec/support/login_macro.rb +0 -10
  136. data/spec/support/stub_daemon.rb +0 -12
@@ -1,31 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Fluentd::Setting::InHttp do
4
- let(:klass) { described_class }
5
- let(:instance) { klass.new(valid_attributes) }
6
- let(:valid_attributes) {
7
- {}
8
- }
9
-
10
- describe "#valid?" do
11
- it "should be valid" do
12
- params = valid_attributes.dup
13
- klass.new(params).should be_valid
14
- end
15
- end
16
-
17
- describe "#plugin_name" do
18
- subject { instance.plugin_name }
19
- it { should == "http" }
20
- end
21
-
22
- describe "#plugin_type" do
23
- subject { instance.plugin_type }
24
- it { should == "input" }
25
- end
26
-
27
- describe "#to_config" do
28
- subject { instance.to_config.to_s }
29
- it { should include("@type http") }
30
- end
31
- end
@@ -1,31 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Fluentd::Setting::InMonitorAgent do
4
- let(:klass) { described_class }
5
- let(:instance) { klass.new(valid_attributes) }
6
- let(:valid_attributes) {
7
- {}
8
- }
9
-
10
- describe "#valid?" do
11
- it "should be valid" do
12
- params = valid_attributes.dup
13
- klass.new(params).should be_valid
14
- end
15
- end
16
-
17
- describe "#plugin_name" do
18
- subject { instance.plugin_name }
19
- it { should == "monitor_agent" }
20
- end
21
-
22
- describe "#plugin_type" do
23
- subject { instance.plugin_type }
24
- it { should == "input" }
25
- end
26
-
27
- describe "#to_config" do
28
- subject { instance.to_config.to_s }
29
- it { should include("@type monitor_agent") }
30
- end
31
- end
@@ -1,98 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Fluentd::Setting::InSyslog do
4
- let(:klass) { described_class }
5
- let(:instance) { klass.new(valid_attributes) }
6
- let(:valid_attributes) {
7
- {
8
- tag: "foo.bar",
9
- }
10
- }
11
-
12
- describe "#valid?" do
13
- it "should be invalid if tag parameter lacked" do
14
- params = valid_attributes.dup
15
- params.delete(:tag)
16
- klass.new(params).should_not be_valid
17
- end
18
- end
19
-
20
- describe "#plugin_name" do
21
- subject { instance.plugin_name }
22
- it { should == "syslog" }
23
- end
24
-
25
- describe "#plugin_type" do
26
- subject { instance.plugin_type }
27
- it { should == "input" }
28
- end
29
-
30
- describe "#to_config" do
31
- subject { instance.to_config.to_s }
32
- it { should include("@type syslog") }
33
- end
34
-
35
- describe "with parse section" do
36
- let(:valid_attributes) {
37
- {
38
- tag: "test",
39
- parse_type: "syslog",
40
- parse: {
41
- "0" => {
42
- "type" => "syslog",
43
- "message_format" => "rfc5424"
44
- }
45
- }
46
- }
47
- }
48
- let(:expected) {
49
- <<-CONFIG
50
- <source>
51
- @type syslog
52
- tag test
53
- <parse>
54
- @type syslog
55
- message_format rfc5424
56
- </parse>
57
- </source>
58
- CONFIG
59
- }
60
- it do
61
- object = klass.new(valid_attributes)
62
- puts object.to_config.to_s
63
- object.to_config.to_s.should == expected
64
- end
65
- end
66
-
67
- describe "with @log_level" do
68
- let(:valid_attributes) {
69
- {
70
- tag: "test",
71
- log_level: "debug",
72
- parse: {
73
- "0" => {
74
- "type" => "syslog",
75
- "message_format" => "rfc5424"
76
- }
77
- }
78
- }
79
- }
80
- let(:expected) {
81
- <<-CONFIG
82
- <source>
83
- @type syslog
84
- tag test
85
- @log_level debug
86
- <parse>
87
- @type syslog
88
- message_format rfc5424
89
- </parse>
90
- </source>
91
- CONFIG
92
- }
93
- it do
94
- object = klass.new(valid_attributes)
95
- object.to_config.to_s.should == expected
96
- end
97
- end
98
- end
@@ -1,53 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Fluentd::Setting::InTail do
4
- let(:klass) { described_class }
5
- let(:instance) { klass.new(valid_attributes) }
6
- let(:valid_attributes) {
7
- {
8
- tag: "dummy.log",
9
- path: "/tmp/log/dummy.log",
10
- parse_type: "none",
11
- parse: {
12
- "0" => {
13
- "type" => "none"
14
- }
15
- }
16
- }
17
- }
18
-
19
- describe "#valid?" do
20
- it "should be valid" do
21
- params = valid_attributes.dup
22
- klass.new(params).should be_valid
23
- end
24
-
25
- it "should be invalid if tag parameter is missing" do
26
- params = valid_attributes.dup
27
- params.delete(:tag)
28
- klass.new(params).should_not be_valid
29
- end
30
-
31
- it "should be invalid if path parameter is missing" do
32
- params = valid_attributes.dup
33
- params.delete(:path)
34
- klass.new(params).should_not be_valid
35
- end
36
- end
37
-
38
-
39
- describe "#plugin_name" do
40
- subject { instance.plugin_name }
41
- it { should == "tail" }
42
- end
43
-
44
- describe "#plugin_type" do
45
- subject { instance.plugin_type }
46
- it { should == "input" }
47
- end
48
-
49
- describe "#to_config" do
50
- subject { instance.to_config.to_s }
51
- it { should include("@type tail") }
52
- end
53
- end
@@ -1,31 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Fluentd::Setting::OutElasticsearch do
4
- let(:klass) { described_class }
5
- let(:instance) { klass.new(valid_attributes) }
6
- let(:valid_attributes) {
7
- {}
8
- }
9
-
10
- describe "#valid?" do
11
- it "should be valid" do
12
- params = valid_attributes.dup
13
- klass.new(params).should be_valid
14
- end
15
- end
16
-
17
- describe "#plugin_name" do
18
- subject { instance.plugin_name }
19
- it { should == "elasticsearch" }
20
- end
21
-
22
- describe "#plugin_type" do
23
- subject { instance.plugin_type }
24
- it { should == "output" }
25
- end
26
-
27
- describe "#to_config" do
28
- subject { instance.to_config.to_s }
29
- it { should include("@type elasticsearch") }
30
- end
31
- end
@@ -1,62 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Fluentd::Setting::OutMongo do
4
- let(:klass) { described_class }
5
- let(:instance) { klass.new(valid_attributes) }
6
- let(:valid_attributes) {
7
- {
8
- pattern: "mongo.*.*",
9
- host: "example.com",
10
- port: 12345,
11
- database: "mongodb",
12
- tag_mapped: "true",
13
- }
14
- }
15
-
16
- describe "#valid?" do
17
- it "should be invalid if database parameter is missing" do
18
- params = valid_attributes.dup
19
- params.delete(:database)
20
- instance = klass.new(params)
21
- instance.should_not be_valid
22
- instance.errors.full_messages.should == ["connection_string or database parameter is required"]
23
- end
24
-
25
- it "should be invalid if collection is missing" do
26
- params = {
27
- pattern: "mongo.*.*",
28
- host: "example.com",
29
- port: 12345,
30
- database: "mongodb",
31
- }
32
- instance = klass.new(params)
33
- instance.should_not be_valid
34
- instance.errors.full_messages.should == ["normal mode requires collection parameter"]
35
- end
36
- end
37
-
38
- describe "#plugin_name" do
39
- subject { instance.plugin_name }
40
- it { should == "mongo" }
41
- end
42
-
43
- describe "#plugin_type" do
44
- it { instance.plugin_type.should == "output" }
45
- end
46
-
47
- describe "#to_config" do
48
- subject { instance.to_config.to_s }
49
- let(:expected) {
50
- <<-CONFIG
51
- <match mongo.*.*>
52
- @type mongo
53
- database mongodb
54
- host example.com
55
- port 12345
56
- tag_mapped true
57
- </match>
58
- CONFIG
59
- }
60
- it { should == expected}
61
- end
62
- end
@@ -1,128 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Fluentd::Setting::OutS3 do
4
- let(:klass) { described_class }
5
- let(:instance) { klass.new(valid_attributes) }
6
- let(:valid_attributes) {
7
- {
8
- s3_bucket: "bucketname"
9
- }
10
- }
11
-
12
- describe "#valid?" do
13
- it "should be valid" do
14
- params = valid_attributes.dup
15
- instance = klass.new(params)
16
- instance.should be_valid
17
- end
18
- end
19
-
20
- describe "#invalid?" do
21
- it "should be invalid if s3_bucket parameter is missing" do
22
- params = valid_attributes.dup
23
- params.delete(:s3_bucket)
24
- instance = klass.new(params)
25
- instance.should be_invalid
26
- end
27
- end
28
-
29
- describe "#plugin_name" do
30
- subject { instance.plugin_name }
31
- it { should == "s3" }
32
- end
33
-
34
- describe "#plugin_type" do
35
- subject { instance.plugin_type }
36
- it { should == "output" }
37
- end
38
-
39
- describe "#to_config" do
40
- subject { instance.to_config.to_s }
41
- it { should include("@type s3") }
42
- end
43
-
44
- describe "with assume_role_credentials" do
45
- let(:valid_attributes) {
46
- {
47
- pattern: "s3.*",
48
- s3_bucket: "bucketname",
49
- assume_role_credentials: {
50
- "0" => {
51
- role_arn: "arn",
52
- role_session_name: "session_name",
53
- }
54
- }
55
- }
56
- }
57
- let(:expected) {
58
- <<-CONFIG
59
- <match s3.*>
60
- @type s3
61
- s3_bucket bucketname
62
- <assume_role_credentials>
63
- role_arn arn
64
- role_session_name session_name
65
- </assume_role_credentials>
66
- </match>
67
- CONFIG
68
- }
69
- subject { instance.to_config.to_s }
70
- it { should == expected }
71
- end
72
-
73
- describe "with instance_profile_credentials" do
74
- let(:valid_attributes) {
75
- {
76
- pattern: "s3.*",
77
- s3_bucket: "bucketname",
78
- instance_profile_credentials: {
79
- "0" => {
80
- port: 80
81
- }
82
- }
83
- }
84
- }
85
- let(:expected) {
86
- <<-CONFIG
87
- <match s3.*>
88
- @type s3
89
- s3_bucket bucketname
90
- <instance_profile_credentials>
91
- port 80
92
- </instance_profile_credentials>
93
- </match>
94
- CONFIG
95
- }
96
- subject { instance.to_config.to_s }
97
- it { should == expected }
98
- end
99
-
100
- describe "with shared_credentials" do
101
- let(:valid_attributes) {
102
- {
103
- pattern: "s3.*",
104
- s3_bucket: "bucketname",
105
- shared_credentials: {
106
- "0" => {
107
- path: "$HOME/.aws/credentials",
108
- profile_name: "default",
109
- }
110
- }
111
- }
112
- }
113
- let(:expected) {
114
- <<-CONFIG
115
- <match s3.*>
116
- @type s3
117
- s3_bucket bucketname
118
- <shared_credentials>
119
- path $HOME/.aws/credentials
120
- profile_name default
121
- </shared_credentials>
122
- </match>
123
- CONFIG
124
- }
125
- subject { instance.to_config.to_s }
126
- it { should == expected }
127
- end
128
- end
@@ -1,31 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Fluentd::Setting::OutStdout do
4
- let(:klass) { described_class }
5
- let(:instance) { klass.new(valid_attributes) }
6
- let(:valid_attributes) {
7
- {}
8
- }
9
-
10
- describe "#valid?" do
11
- it "should be valid" do
12
- params = valid_attributes.dup
13
- klass.new(params).should be_valid
14
- end
15
- end
16
-
17
- describe "#plugin_name" do
18
- subject { instance.plugin_name }
19
- it { should == "stdout" }
20
- end
21
-
22
- describe "#plugin_type" do
23
- subject { instance.plugin_type }
24
- it { should == "output" }
25
- end
26
-
27
- describe "#to_config" do
28
- subject { instance.to_config.to_s }
29
- it { should include("@type stdout") }
30
- end
31
- end