oxidized-web 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of oxidized-web might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c961dc5e881fa1ff198d051155548ce78c83aa28
4
- data.tar.gz: 96c4683669a7be4399b5861b5c71ef6dc71ec474
3
+ metadata.gz: 9f535950760aee39a4e30a06d062f80675eb9752
4
+ data.tar.gz: c15e51396c6d3d0aa4b0485b7757cac040f0eaad
5
5
  SHA512:
6
- metadata.gz: e1d2f501cb2325ceb4cd30d601d11ee395a80d8f06ea5f0ff2b38a977c9ad09718cc772b2ed1a35ec07aff624ce7ae8894e6c35303a3199937eedea8e4319924
7
- data.tar.gz: ae93b452c2d73f24c86b4e1d696e6f48c01bb981d41f8f31d556ee80ff9c9ad76a7dc3dd01aa25a050ce2b983bab40bdd631a311b511e53d8300f8759ce4a268
6
+ metadata.gz: 7ee8abf9bbe65d8a7e1a473aa3bdd40b126e15f2ed0111005f776c77f49d74df4f6b66320dd82fdbbd3ed28aa820d58601d9a55e730c2bb5224a13b94bd048d4
7
+ data.tar.gz: 9d158c520bedbe442b7a4d79403f1346ebef8fb7cc76e0b3dff77ef67b7fb9de146d7a038eefec259367c49e66e9fb0d7ec11cc4a7f1b82a1b8cedb7005822ba
data/lib/oxidized/web.rb CHANGED
@@ -9,7 +9,7 @@ module Oxidized
9
9
  def initialize nodes, listen
10
10
  require 'oxidized/web/webapp'
11
11
  listen, uri = listen.split '/'
12
- addr, port = listen.split ':'
12
+ addr, _, port = listen.rpartition ':'
13
13
  port, addr = addr, nil if not port
14
14
  uri = '/' + uri.to_s
15
15
  @opts = {
@@ -71,10 +71,10 @@ $(function() {
71
71
  $('.btn-file :file').on('fileSelect', function(e, numFiles, label) {
72
72
  $(this).parents('.input-group').find(':text').val(label);
73
73
  });
74
-
74
+
75
75
  // Reloads the nodes from a source by calling the /reload.json URI
76
76
  $('#reload').click(function() {
77
- $.get('/reload.json')
77
+ $.get(window.location.pathname.replace(/nodes.*/g, '')+'reload.json')
78
78
  .done(function(data) {
79
79
  $('#flashMessage')
80
80
  .removeClass('alert-danger')
@@ -94,9 +94,7 @@ $(function() {
94
94
  });
95
95
 
96
96
  // Update timestamp on next button click for DataTables
97
- $('.paginate_button').on('click', function() {
97
+ $('.paginate_button').on('click', function() {
98
98
  convertTime();
99
99
  });
100
100
  });
101
-
102
-
@@ -23,7 +23,7 @@
23
23
  .col-sm-6
24
24
  - params = "node=#{@info[:node]}&group=#{@info[:group]}&oid=#{@info[:oid]}"
25
25
  - params = "#{params}&date=#{@info[:date]}&num=#{@info[:num]}"
26
- %form{action: "/node/version/diffs?#{params}", method: 'post', role: 'form'}
26
+ %form{action: url_for("/node/version/diffs?#{params}"), method: 'post', role: 'form'}
27
27
  .form-group
28
28
  %select.form-control#oid2{name: 'oid2'}
29
29
  - diff2 = {}
@@ -49,36 +49,55 @@
49
49
  .diffs_old
50
50
  - @diff[:old_diff].each do |line|
51
51
  - if /^\+.*/.match(line)
52
- .added> #{line}
52
+ .added>
53
+ :escaped
54
+ #{line}
53
55
 
54
56
  - elsif /^\-.*/.match(line)
55
- .deleted> #{line}
57
+ .deleted>
58
+ :escaped
59
+ #{line}
56
60
 
57
61
  - elsif /^@@\s.*@@.*$/.match(line)
58
- .diff-index> #{line}
62
+ .diff-index>
63
+ :escaped
64
+ #{line}
59
65
 
60
66
  - elsif /^empty_line /.match(line)
61
67
  - line.slice! "empty_line"
62
- .diff-empty> #{line}
68
+ .diff-empty>
69
+ :escaped
70
+ #{line}
63
71
 
64
72
  - else
65
- %div> #{line}
73
+ %div>
74
+ :escaped
75
+ #{line}
66
76
 
67
77
  .diffs_new
68
78
  - @diff[:new_diff].each do |line|
69
79
  - if /^\+.*/.match(line)
70
- .added> #{line}
80
+ .added>
81
+ :escaped
82
+ #{line}
71
83
 
72
84
  - elsif /^\-.*/.match(line)
73
- .deleted> #{line}
85
+ .deleted>
86
+ :escaped
87
+ #{line}
74
88
 
75
89
  - elsif /^@@\s.*@@.*$/.match(line)
76
- .diff-index> #{line}
90
+ .diff-index>
91
+ :escaped
92
+ #{line}
77
93
 
78
94
  - elsif /^empty_line /.match(line)
79
95
  - line.slice! "empty_line"
80
- .diff-empty> #{line}
96
+ .diff-empty>
97
+ :escaped
98
+ #{line}
81
99
 
82
100
  - else
83
- %div> #{line}
84
-
101
+ %div>
102
+ :escaped
103
+ #{line}
@@ -18,5 +18,6 @@
18
18
  .col-sm-12
19
19
  .diffs
20
20
  - @data.each_line do |line|
21
- %div> #{line}
22
-
21
+ %div>
22
+ :escaped
23
+ #{line}
@@ -5,6 +5,7 @@ require 'tilt/haml'
5
5
  require 'sass'
6
6
  require 'pp'
7
7
  require 'oxidized/web/mig'
8
+ require 'htmlentities'
8
9
  module Oxidized
9
10
  module API
10
11
  class WebApp < Sinatra::Base
@@ -174,7 +175,7 @@ module Oxidized
174
175
  num: params[:num]
175
176
  }
176
177
 
177
- @data = nodes.get_version node, @info[:group], @info[:oid]
178
+ @data = HTMLEntities.new.encode(nodes.get_version node, @info[:group], @info[:oid])
178
179
  out :version
179
180
  end
180
181
 
@@ -284,7 +285,7 @@ module Oxidized
284
285
  old_diff = []
285
286
  new_diff = []
286
287
 
287
- diff.each_line do |line|
288
+ HTMLEntities.new.encode(diff).each_line do |line|
288
289
  if /^\+/.match(line)
289
290
  new_diff.push(line)
290
291
  elsif /^\-/.match(line)
data/oxidized-web.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'oxidized-web'
3
- s.version = '0.8.0'
3
+ s.version = '0.9.0'
4
4
  s.licenses = %w( Apache-2.0 )
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Saku Ytti', 'Samer Abdel-Hafez']
@@ -15,10 +15,11 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.required_ruby_version = '>= 1.9.3'
17
17
  s.add_runtime_dependency 'oxidized', '~> 0.19'
18
- s.add_runtime_dependency 'puma', '~> 2.8'
18
+ s.add_runtime_dependency 'puma', '~> 3'
19
19
  s.add_runtime_dependency 'sinatra', '~> 1.4', '>= 1.4.6'
20
20
  s.add_runtime_dependency 'sinatra-contrib', '~> 1.4', '>= 1.4.6'
21
21
  s.add_runtime_dependency 'haml', '~> 4.0'
22
22
  s.add_runtime_dependency 'sass', '~> 3.3'
23
23
  s.add_runtime_dependency 'emk-sinatra-url-for', '~> 0.2'
24
+ s.add_runtime_dependency 'htmlentitites', '~> 4.3'
24
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oxidized-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saku Ytti
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-02 00:00:00.000000000 Z
12
+ date: 2017-05-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oxidized
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '2.8'
34
+ version: '3'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '2.8'
41
+ version: '3'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: sinatra
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -121,6 +121,20 @@ dependencies:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0.2'
124
+ - !ruby/object:Gem::Dependency
125
+ name: htmlentitites
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '4.3'
131
+ type: :runtime
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '4.3'
124
138
  description: puma+sinatra+haml webUI + REST API for oxidized
125
139
  email:
126
140
  - saku@ytti.fi