webroar 0.3.1 → 0.4.0
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.
- data/CHANGELOG +48 -1
- data/README +11 -14
- data/Rakefile +1 -1
- data/conf/mime_type.yml +172 -166
- data/conf/server_internal_config.yml +30 -8
- data/doc/user-guide.html +294 -153
- data/doc/user-guide.txt +9 -13
- data/lib/command_runner.rb +1 -0
- data/lib/dependencies.rb +18 -15
- data/lib/installer.rb +115 -50
- data/src/admin_panel/app/controllers/admin_controller.rb +1 -15
- data/src/admin_panel/app/controllers/application_controller.rb +2 -2
- data/src/admin_panel/app/controllers/application_specification_controller.rb +2 -1
- data/src/admin_panel/app/controllers/headers_controller.rb +73 -0
- data/src/admin_panel/app/controllers/mail_specification_controller.rb +10 -0
- data/src/admin_panel/app/controllers/server_specification_controller.rb +14 -0
- data/src/admin_panel/app/helpers/admin_helper.rb +0 -85
- data/src/admin_panel/app/models/app.rb +1 -1
- data/src/admin_panel/app/models/application_specification.rb +33 -25
- data/src/admin_panel/app/models/headers.rb +116 -0
- data/src/admin_panel/app/models/mail_specification.rb +20 -5
- data/src/admin_panel/app/models/server_specification.rb +2 -7
- data/src/admin_panel/app/views/admin/configuration.html.erb +10 -5
- data/src/admin_panel/app/views/exceptions/_exception_list_partial.html.erb +4 -4
- data/src/admin_panel/app/views/graph/_graph_page.html.erb +3 -0
- data/src/admin_panel/app/views/headers/_add_expires_text_box.html.erb +35 -0
- data/src/admin_panel/app/views/headers/_expires_by_type_form.html.erb +65 -0
- data/src/admin_panel/app/views/headers/_headers_table.html.erb +113 -0
- data/src/admin_panel/app/views/mail_specification/_current_spec.html.erb +168 -0
- data/src/admin_panel/app/views/{admin → server_specification}/_add_div.html.erb +1 -1
- data/src/admin_panel/config/initializers/application_constants.rb +6 -0
- data/src/admin_panel/lib/control.rb +6 -3
- data/src/admin_panel/lib/scgi.rb +74 -21
- data/src/admin_panel/lib/yaml_writer.rb +51 -17
- data/src/admin_panel/public/javascripts/application.js +20 -1
- data/src/head/wr_access_log.c +2 -2
- data/src/head/wr_application.c +294 -236
- data/src/head/wr_application.h +8 -8
- data/src/head/wr_configurator.c +451 -517
- data/src/head/wr_configurator.h +10 -115
- data/src/head/wr_connection.c +26 -25
- data/src/head/wr_connection.h +2 -3
- data/src/head/wr_controller.c +110 -93
- data/src/head/wr_controller.h +6 -6
- data/src/head/wr_main.c +31 -24
- data/src/head/wr_request.c +70 -93
- data/src/head/wr_request.h +0 -4
- data/src/head/wr_resolver.c +21 -15
- data/src/head/wr_resolver.h +2 -2
- data/src/head/wr_server.c +36 -26
- data/src/head/wr_server.h +5 -5
- data/src/head/wr_worker.c +551 -512
- data/src/head/wr_worker.h +33 -20
- data/src/helper/wr_config.c +316 -0
- data/src/helper/wr_config.h +235 -0
- data/src/helper/wr_helper.h +1 -5
- data/src/helper/wr_logger.c +4 -4
- data/src/helper/wr_scgi.c +3 -4
- data/src/helper/wr_scgi.h +2 -0
- data/src/helper/wr_string.h +2 -2
- data/src/helper/wr_util.c +3 -1
- data/src/helper/wr_util.h +0 -0
- data/src/helper/wr_yaml_parser.c +30 -0
- data/src/helper/wr_yaml_parser.h +1 -0
- data/src/ruby_lib/exception_tracker/instrumentation/action_controller.rb +2 -1
- data/src/ruby_lib/mailer/smtpmail.rb +7 -4
- data/src/ruby_lib/profiler/instrumentation/action_controller.rb +2 -1
- data/src/ruby_lib/profiler/instrumentation/active_record.rb +3 -0
- data/src/ruby_lib/rack/adapter/rails.rb +14 -7
- data/src/ruby_lib/ruby_interface/client.rb +1 -1
- data/src/ruby_lib/ruby_interface/version.rb +2 -2
- data/src/ruby_lib/webroar_app_loader.rb +4 -2
- data/src/worker/wkr_controller.c +200 -140
- data/src/worker/wkr_http.c +14 -28
- data/src/worker/wkr_http.h +4 -4
- data/src/worker/wkr_http_request.c +12 -11
- data/src/worker/wkr_http_request.h +7 -8
- data/src/worker/wkr_http_response.c +10 -14
- data/src/worker/wkr_http_response.h +0 -1
- data/src/worker/wkr_main.c +74 -140
- data/src/worker/wkr_static.c +295 -108
- data/src/worker/wkr_static.h +20 -7
- data/src/worker/worker.c +245 -70
- data/src/worker/worker.h +46 -34
- data/tasks/compile.rake +128 -175
- data/tasks/test.rake +345 -469
- data/test/spec/webroar_command_spec.rb +23 -0
- metadata +173 -43
- data/src/admin_panel/vendor/plugins/action_mailer_optional_tls/README +0 -34
- data/src/admin_panel/vendor/plugins/action_mailer_optional_tls/Rakefile +0 -13
- data/src/admin_panel/vendor/plugins/action_mailer_optional_tls/init.rb +0 -5
- data/src/admin_panel/vendor/plugins/action_mailer_optional_tls/lib/action_mailer_tls.rb +0 -16
- data/src/admin_panel/vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb +0 -123
- data/src/admin_panel/vendor/plugins/action_mailer_optional_tls/test/tls_test.rb +0 -42
- data/src/head/wr_config.h +0 -165
- data/src/ruby_lib/mailer/action_mailer_tls.rb +0 -16
- data/src/ruby_lib/mailer/smtp_tls.rb +0 -123
|
@@ -183,89 +183,4 @@ module AdminHelper
|
|
|
183
183
|
end
|
|
184
184
|
return block
|
|
185
185
|
end
|
|
186
|
-
|
|
187
|
-
#To help the configuration page to display the mail configuration.
|
|
188
|
-
def mail_config_block()
|
|
189
|
-
if File.exist?(MAIL_FILE_PATH) and info = YAML::load_file(MAIL_FILE_PATH)
|
|
190
|
-
if info['smtp']
|
|
191
|
-
block = "<table width = 95%>
|
|
192
|
-
<tr>
|
|
193
|
-
<td class = 'table_header_link' width = 50% colspan = 2><b>Mail Settings :- SMTP</b>
|
|
194
|
-
<span class = 'help_link'>
|
|
195
|
-
#{link_to_function('Help', :onclick => 'addHelp("mail");')}
|
|
196
|
-
</span>
|
|
197
|
-
<br/> <div id = 'mail' class = 'font_size_12'></div>
|
|
198
|
-
</td>
|
|
199
|
-
<td class = 'table_header_link' width = 25%>#{link_to_remote 'Sendmail', :update => 'mail_div', :url => {:controller => 'mail_specification', :action => 'sendmail_form'}}</td>
|
|
200
|
-
<td class = 'table_header_link' width = 25%>#{link_to_remote 'Edit', :update => 'mail_div', :url => {:controller => 'mail_specification', :action => 'edit_smtp', :smtp => info['smtp']}}</td>
|
|
201
|
-
</tr>
|
|
202
|
-
<tr>
|
|
203
|
-
<td class = 'BG_dark_gray' width = 25%>Server</td>
|
|
204
|
-
<td class = 'BG_dark_gray' width = 25%>#{info['smtp']['address']}</td>
|
|
205
|
-
<td class = 'BG_dark_gray' width = 25%>Port</td>
|
|
206
|
-
<td class = 'BG_dark_gray' width = 25%>#{info['smtp']['port']}</td>
|
|
207
|
-
</tr>
|
|
208
|
-
<tr>
|
|
209
|
-
<td class = 'BG_white'>Domain</td>
|
|
210
|
-
<td class = 'BG_white'>#{info['smtp']['domain']}</td>
|
|
211
|
-
<td class = 'BG_white'>Authenitcation</td>
|
|
212
|
-
<td class = 'BG_white'>#{info['smtp']['authentication']}</td>
|
|
213
|
-
</tr>
|
|
214
|
-
<tr>
|
|
215
|
-
<td class = 'BG_dark_gray'>User Name</td>
|
|
216
|
-
<td class = 'BG_dark_gray'>#{info['smtp']['user_name']}</td>
|
|
217
|
-
<td class = 'BG_dark_gray'>Password</td>
|
|
218
|
-
<td class = 'BG_dark_gray'>**************</td>
|
|
219
|
-
</tr>
|
|
220
|
-
<tr>
|
|
221
|
-
<td class = 'BG_white'>Sender's Email Address</td>
|
|
222
|
-
<td class = 'BG_white'>#{info['smtp']['from']}</td>
|
|
223
|
-
<td class = 'BG_white'>Recipient Email Addresses</td>
|
|
224
|
-
<td class = 'BG_white'>#{info['smtp']['recipients']}</td>
|
|
225
|
-
</tr>
|
|
226
|
-
<tr>
|
|
227
|
-
</tr>
|
|
228
|
-
</table><br/><br/>"
|
|
229
|
-
elsif info['sendmail']
|
|
230
|
-
block = "<table width = 95%>
|
|
231
|
-
<tr>
|
|
232
|
-
<td class = 'table_header_link' width = 50%><b>Mail Settings :- Sendmail</b>
|
|
233
|
-
<span class = 'help_link'>
|
|
234
|
-
#{link_to_function('Help', :onclick => 'addHelp("mail");')}
|
|
235
|
-
</span>
|
|
236
|
-
<br/> <div id = 'mail' class = 'font_size_12'></div>
|
|
237
|
-
</td>
|
|
238
|
-
<td class = 'table_header_link' width = 25%>#{link_to_remote 'SMTP', :update => 'mail_div', :url => {:controller => 'mail_specification', :action => 'smtp_form'}}</td>
|
|
239
|
-
<td class = 'table_header_link' width = 25%>#{link_to_remote 'Edit', :update => 'mail_div', :url => {:controller => 'mail_specification', :action => 'edit_sendmail', :sendmail => info['sendmail']}}</td>
|
|
240
|
-
</tr>
|
|
241
|
-
<tr>
|
|
242
|
-
<td class = 'BG_dark_gray' width = 50%>Location</td>
|
|
243
|
-
<td colspan = 2 class = 'BG_dark_gray'width = 50%>#{info['sendmail']['location']}</td>
|
|
244
|
-
</tr>
|
|
245
|
-
<tr>
|
|
246
|
-
<td class = 'BG_white'>Sender's Email Address</td>
|
|
247
|
-
<td colspan = 2 class = 'BG_white'>#{info['sendmail']['from']}</td>
|
|
248
|
-
</tr>
|
|
249
|
-
<tr>
|
|
250
|
-
<td class = 'BG_dark_gray'>Recipient Email Addresses</td>
|
|
251
|
-
<td colspan = 2 class = 'BG_dark_gray'>#{info['sendmail']['recipients']}</td>
|
|
252
|
-
</tr>
|
|
253
|
-
</table><br/><br/>"
|
|
254
|
-
end
|
|
255
|
-
else
|
|
256
|
-
block = "<table width = 95%>
|
|
257
|
-
<tr>
|
|
258
|
-
<td class = 'table_header_link' width = 80%><b>Mail Settings</b>
|
|
259
|
-
<span class = 'help_link'>
|
|
260
|
-
#{link_to_function('Help', :onclick => 'addHelp("mail");')}
|
|
261
|
-
</span>
|
|
262
|
-
<br/> <div id = 'mail' class = 'font_size_12'></div>
|
|
263
|
-
</td>
|
|
264
|
-
<td class = 'table_header_link' width = 10%>#{link_to_remote 'SMTP', :update => 'mail_div', :url => {:controller => 'mail_specification', :action => 'smtp_form'}}</td>
|
|
265
|
-
<td class = 'table_header_link' width = 10%>#{link_to_remote 'Sendmail', :update => 'mail_div', :url => {:controller => 'mail_specification', :action => 'sendmail_form'}}</td>
|
|
266
|
-
</tr>
|
|
267
|
-
</table><br/><br/>"
|
|
268
|
-
end
|
|
269
|
-
return block
|
|
270
|
-
end
|
|
271
186
|
end
|
|
@@ -76,7 +76,7 @@ class App < ActiveRecord::Base
|
|
|
76
76
|
begin
|
|
77
77
|
reply, err_log = ctl.restart
|
|
78
78
|
rescue Exception => e
|
|
79
|
-
reply = "An error occurred while sending '
|
|
79
|
+
reply = "An error occurred while sending 'restart' request for application '#{app_name}'. Please refer the '/var/log/webroar/#{app_name}.log' file for details."
|
|
80
80
|
end
|
|
81
81
|
return reply, err_log
|
|
82
82
|
end
|
|
@@ -42,25 +42,19 @@ class ApplicationSpecification < PseudoModel
|
|
|
42
42
|
# validates_format_of :baseuri, :with => /^\/[A-Za-z0-9_\-\/]*$/i, :message => "must start with '/' and contains characters A-Z, a-z, 0-9 , _ , - and /."
|
|
43
43
|
|
|
44
44
|
def write
|
|
45
|
-
|
|
46
|
-
info= YAML::load_file(CONFIG_FILE_PATH) rescue nil
|
|
47
|
-
if info
|
|
48
|
-
|
|
49
|
-
i = info['Application Specification'].size
|
|
50
|
-
info['Application Specification'][i] = obj_to_hash
|
|
51
|
-
data = info['Application Specification']
|
|
52
|
-
else
|
|
53
|
-
data = Array[obj_to_hash]
|
|
54
|
-
end
|
|
55
|
-
else
|
|
56
|
-
data = Array[obj_to_hash]
|
|
45
|
+
|
|
46
|
+
info = YAML::load_file(CONFIG_FILE_PATH) rescue nil
|
|
47
|
+
if not (info and info['Application Specification'])
|
|
48
|
+
info['Application Specification'] = Array.new
|
|
57
49
|
end
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
|
|
51
|
+
info['Application Specification'].push(obj_to_hash)
|
|
52
|
+
|
|
53
|
+
YAMLWriter.write(info, CONFIG_FILE_PATH, YAMLConfig::CONFIG)
|
|
54
|
+
|
|
60
55
|
end
|
|
61
56
|
|
|
62
57
|
def self.remove(app_name)
|
|
63
|
-
server_specification = ServerSpecification.get_hash
|
|
64
58
|
info = YAML::load_file(CONFIG_FILE_PATH) rescue nil
|
|
65
59
|
|
|
66
60
|
if info and info['Application Specification']
|
|
@@ -69,12 +63,10 @@ class ApplicationSpecification < PseudoModel
|
|
|
69
63
|
info['Application Specification'].delete(x)
|
|
70
64
|
end
|
|
71
65
|
end
|
|
72
|
-
|
|
73
|
-
info = Hash['Server Specification' => server_specification] if info['Application Specification'].length == 0
|
|
74
|
-
|
|
66
|
+
info.delete('Application Specification') if info['Application Specification'].length == 0
|
|
75
67
|
end
|
|
76
68
|
|
|
77
|
-
YAMLWriter.write(info, CONFIG_FILE_PATH,
|
|
69
|
+
YAMLWriter.write(info, CONFIG_FILE_PATH, YAMLConfig::CONFIG)
|
|
78
70
|
end
|
|
79
71
|
|
|
80
72
|
def remove
|
|
@@ -92,7 +84,7 @@ class ApplicationSpecification < PseudoModel
|
|
|
92
84
|
def update(app_id)
|
|
93
85
|
info = YAML::load_file(CONFIG_FILE_PATH) rescue nil
|
|
94
86
|
info['Application Specification'][app_id] = obj_to_hash
|
|
95
|
-
YAMLWriter.write(info, CONFIG_FILE_PATH,
|
|
87
|
+
YAMLWriter.write(info, CONFIG_FILE_PATH, YAMLConfig::CONFIG)
|
|
96
88
|
end
|
|
97
89
|
|
|
98
90
|
#this method is used to validate the various fields of the apps model.
|
|
@@ -304,10 +296,9 @@ class ApplicationSpecification < PseudoModel
|
|
|
304
296
|
info = YAML::load_file(CONFIG_FILE_PATH) rescue nil
|
|
305
297
|
app_name = info['Application Specification'][app_id]["name"]
|
|
306
298
|
info['Application Specification'].delete_at(app_id)
|
|
307
|
-
if
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
YAMLWriter.write(info,CONFIG_FILE_PATH,"config")
|
|
299
|
+
info.delete('Application Specification') if info['Application Specification'].length == 0
|
|
300
|
+
|
|
301
|
+
YAMLWriter.write(info,CONFIG_FILE_PATH, YAMLConfig::CONFIG)
|
|
311
302
|
return app_name
|
|
312
303
|
end
|
|
313
304
|
|
|
@@ -360,6 +351,23 @@ class ApplicationSpecification < PseudoModel
|
|
|
360
351
|
i +=1
|
|
361
352
|
end
|
|
362
353
|
return i
|
|
363
|
-
end
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
def analytics_enabled?(application_name)
|
|
357
|
+
info = YAML::load_file(CONFIG_FILE_PATH) rescue nil
|
|
358
|
+
i = 0
|
|
359
|
+
while info['Application Specification']
|
|
360
|
+
if info['Application Specification'][i]['name'] == application_name
|
|
361
|
+
if info['Application Specification'][i]['analytics'].downcase == "enabled".downcase
|
|
362
|
+
return true
|
|
363
|
+
else
|
|
364
|
+
return false
|
|
365
|
+
end
|
|
366
|
+
end
|
|
367
|
+
i +=1
|
|
368
|
+
end
|
|
369
|
+
false
|
|
370
|
+
end
|
|
371
|
+
|
|
364
372
|
end
|
|
365
373
|
end
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# WebROaR - Ruby Application Server - http://webroar.in/
|
|
3
|
+
# Copyright (C) 2009 Goonj LLC
|
|
4
|
+
#
|
|
5
|
+
# This file is part of WebROaR.
|
|
6
|
+
#
|
|
7
|
+
# WebROaR is free software: you can redistribute it and/or modify
|
|
8
|
+
# it under the terms of the GNU General Public License as published by
|
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
# (at your option) any later version.
|
|
11
|
+
#
|
|
12
|
+
# WebROaR is distributed in the hope that it will be useful,
|
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
# GNU General Public License for more details.
|
|
16
|
+
#
|
|
17
|
+
# You should have received a copy of the GNU General Public License
|
|
18
|
+
# along with WebROaR. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
#++
|
|
20
|
+
|
|
21
|
+
class Headers < PseudoModel
|
|
22
|
+
class << self
|
|
23
|
+
|
|
24
|
+
def get_expires_value
|
|
25
|
+
@conf = YAML::load_file(CONFIG_FILE_PATH)
|
|
26
|
+
if @conf['Headers'] and @conf['Headers']['expires']
|
|
27
|
+
@conf['Headers']['expires']
|
|
28
|
+
else
|
|
29
|
+
"Off"
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def get_expires_by_type_array
|
|
34
|
+
@conf = YAML::load_file(CONFIG_FILE_PATH)
|
|
35
|
+
return @conf['Headers']['expires_by_type'] if @conf['Headers'] and @conf['Headers']['expires_by_type'] and @conf['Headers']['expires_by_type'].length > 0
|
|
36
|
+
[]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def delete_expires_by_type(index)
|
|
40
|
+
@conf = YAML::load_file(CONFIG_FILE_PATH)
|
|
41
|
+
if @conf['Headers'] and @conf['Headers']['expires_by_type']
|
|
42
|
+
@conf['Headers']['expires_by_type'].delete_at(index)
|
|
43
|
+
end
|
|
44
|
+
@conf['Headers'].delete('expires_by_type') if @conf['Headers']['expires_by_type'].empty?
|
|
45
|
+
@conf.delete('Headers') if @conf['Headers'].empty?
|
|
46
|
+
YAMLWriter.write(@conf, CONFIG_FILE_PATH, YAMLConfig::CONFIG)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def validate_and_write_expires_value(old_value, data)
|
|
50
|
+
expires = old_value
|
|
51
|
+
error_message = ""
|
|
52
|
+
data = data.strip
|
|
53
|
+
if data.empty?
|
|
54
|
+
error_message = EMPTY_STRING
|
|
55
|
+
return expires, error_message
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
if data.to_s.downcase == 'off'
|
|
59
|
+
expires = 'Off'
|
|
60
|
+
write_expires_value("Off")
|
|
61
|
+
elsif data =~ /^\d+$/ and data.to_i > 0
|
|
62
|
+
expires = data.to_i
|
|
63
|
+
write_expires_value(expires)
|
|
64
|
+
else
|
|
65
|
+
error_message = EXPIRES_VALIDATION
|
|
66
|
+
end
|
|
67
|
+
return expires, error_message
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def validate_and_write_expires_by_type(ext, expires)
|
|
71
|
+
ext = ext.strip
|
|
72
|
+
expires = expires.strip
|
|
73
|
+
err_msg = nil
|
|
74
|
+
if ext.empty?
|
|
75
|
+
err_msg = "<ul>"
|
|
76
|
+
err_msg += "<li>File extensions can not be empty.</li>"
|
|
77
|
+
end
|
|
78
|
+
if expires.empty?
|
|
79
|
+
err_msg += "<li>Expires value can not be empty</li>"
|
|
80
|
+
end
|
|
81
|
+
unless expires =~ /^\d+$/ and expires.to_i > 0
|
|
82
|
+
err_msg += "<li>Possible value for expires is no. of seconds</li>"
|
|
83
|
+
end
|
|
84
|
+
if err_msg
|
|
85
|
+
err_msg += "</ul>"
|
|
86
|
+
return err_msg
|
|
87
|
+
end
|
|
88
|
+
write_expires_by_type_value(ext, expires.to_i)
|
|
89
|
+
return ''
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def write_expires_by_type_value(ext, expires)
|
|
93
|
+
@conf = YAML::load_file(CONFIG_FILE_PATH)
|
|
94
|
+
@conf['Headers'] = Hash.new unless @conf['Headers']
|
|
95
|
+
@conf['Headers']['expires_by_type'] = Array.new unless @conf['Headers']['expires_by_type']
|
|
96
|
+
@conf['Headers']['expires_by_type'].push(Hash['ext' => ext, 'expires' => expires])
|
|
97
|
+
YAMLWriter.write(@conf, CONFIG_FILE_PATH, YAMLConfig::CONFIG)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def write_expires_value(expires)
|
|
101
|
+
@conf = YAML::load_file(CONFIG_FILE_PATH)
|
|
102
|
+
if expires.to_s.downcase == 'off'
|
|
103
|
+
if @conf['Headers'] and @conf['Headers']['expires']
|
|
104
|
+
@conf['Headers'].delete('expires')
|
|
105
|
+
@conf.delete('Headers') if @conf['Headers'].empty?
|
|
106
|
+
end
|
|
107
|
+
else
|
|
108
|
+
@conf['Headers'] = Hash.new unless @conf['Headers']
|
|
109
|
+
@conf['Headers']['expires'] = expires
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
YAMLWriter.write(@conf, CONFIG_FILE_PATH, YAMLConfig::CONFIG)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
end
|
|
116
|
+
end
|
|
@@ -50,8 +50,8 @@ class MailSpecification
|
|
|
50
50
|
|
|
51
51
|
def save_sendmail_specification(sendmail)
|
|
52
52
|
data = sendmail_specification_hash(sendmail)
|
|
53
|
-
data = {'sendmail' => data}
|
|
54
|
-
YAMLWriter.write(data, MAIL_FILE_PATH,
|
|
53
|
+
data = {'sendmail' => data, 'email_notification' => 'enabled'}
|
|
54
|
+
YAMLWriter.write(data, MAIL_FILE_PATH, YAMLConfig::SENDMAIL)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def sendmail_specification_hash(sendmail=nil)
|
|
@@ -106,8 +106,8 @@ class MailSpecification
|
|
|
106
106
|
|
|
107
107
|
def save_smtp_specification(smtp)
|
|
108
108
|
data = smtp_specification_hash(smtp)
|
|
109
|
-
data = {'smtp' => data}
|
|
110
|
-
YAMLWriter.write(data, MAIL_FILE_PATH,
|
|
109
|
+
data = {'smtp' => data, 'email_notification' => 'enabled'}
|
|
110
|
+
YAMLWriter.write(data, MAIL_FILE_PATH, YAMLConfig::SMTP)
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
def smtp_specification_hash(smtp=nil)
|
|
@@ -134,6 +134,21 @@ class MailSpecification
|
|
|
134
134
|
'recipients' => ""
|
|
135
135
|
]
|
|
136
136
|
end
|
|
137
|
-
end
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def update_notification_status(status)
|
|
140
|
+
@notification_conf = YAML::load_file(MAIL_FILE_PATH)
|
|
141
|
+
case status
|
|
142
|
+
when :enable
|
|
143
|
+
@notification_conf['email_notification'] = 'enabled'
|
|
144
|
+
when :disable
|
|
145
|
+
@notification_conf['email_notification'] = 'disabled'
|
|
146
|
+
end
|
|
147
|
+
yaml_obj = YAML::dump(@notification_conf)
|
|
148
|
+
File.open(MAIL_FILE_PATH, 'w') do |f|
|
|
149
|
+
f.puts yaml_obj
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
138
153
|
end
|
|
139
154
|
end
|
|
@@ -91,13 +91,8 @@ class ServerSpecification
|
|
|
91
91
|
|
|
92
92
|
#Method is use to write server specification into the config file
|
|
93
93
|
def write(info, server_specification)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
data = Hash['Server Specification' => server_specification, 'Application Specification' => application_specification]
|
|
97
|
-
else
|
|
98
|
-
data = Hash['Server Specification' => server_specification]
|
|
99
|
-
end
|
|
100
|
-
YAMLWriter.write(data,CONFIG_FILE_PATH, "config")
|
|
94
|
+
info['Server Specification'] = server_specification
|
|
95
|
+
YAMLWriter.write(info, CONFIG_FILE_PATH, YAMLConfig::CONFIG)
|
|
101
96
|
end
|
|
102
97
|
|
|
103
98
|
def get_fields
|
|
@@ -30,7 +30,7 @@ along with WebROaR. If not, see <http://www.gnu.org/licenses/>.
|
|
|
30
30
|
<tr>
|
|
31
31
|
<td width = 40% class = 'BG_dark_gray'> Port </td>
|
|
32
32
|
<td width = 40% class = 'BG_dark_gray'><div id = 'port_div'><%=h(port)%></div></td>
|
|
33
|
-
<td width = 20% class = 'BG_dark_gray'><%=link_to_remote 'Edit', :update => 'port_div', :url => {:action => 'add_text_box', :div_id => 'port_div'}%></td>
|
|
33
|
+
<td width = 20% class = 'BG_dark_gray'><%=link_to_remote 'Edit', :update => 'port_div', :url => {:controller => 'server_specification', :action => 'add_text_box', :div_id => 'port_div'}%></td>
|
|
34
34
|
</tr>
|
|
35
35
|
<tr>
|
|
36
36
|
<td class = 'BG_white'>Minimum number of workers
|
|
@@ -40,7 +40,7 @@ along with WebROaR. If not, see <http://www.gnu.org/licenses/>.
|
|
|
40
40
|
<br/> <div id = 'minworker' class = 'font_size_12'></div>
|
|
41
41
|
</td>
|
|
42
42
|
<td class = 'BG_white'><div id = 'min_pro_div'><%=h(min_worker)%></div></td>
|
|
43
|
-
<td class = 'BG_white'><%=link_to_remote 'Edit', :update => 'min_pro_div', :url => {:action => 'add_text_box', :div_id => 'min_pro_div'}%></td>
|
|
43
|
+
<td class = 'BG_white'><%=link_to_remote 'Edit', :update => 'min_pro_div', :url => {:controller => 'server_specification', :action => 'add_text_box', :div_id => 'min_pro_div'}%></td>
|
|
44
44
|
</tr>
|
|
45
45
|
<tr>
|
|
46
46
|
<td class = 'BG_dark_gray'>Maximum number of workers
|
|
@@ -50,7 +50,7 @@ along with WebROaR. If not, see <http://www.gnu.org/licenses/>.
|
|
|
50
50
|
<br/> <div id = 'maxworker' class = 'font_size_12'></div>
|
|
51
51
|
</td>
|
|
52
52
|
<td class = 'BG_dark_gray'><div id = 'max_pro_div'><%=h(max_worker)%></td>
|
|
53
|
-
<td class = 'BG_dark_gray'><%=link_to_remote 'Edit', :update => 'max_pro_div', :url => {:action => 'add_text_box', :div_id => 'max_pro_div'}%></td>
|
|
53
|
+
<td class = 'BG_dark_gray'><%=link_to_remote 'Edit', :update => 'max_pro_div', :url => {:controller => 'server_specification', :action => 'add_text_box', :div_id => 'max_pro_div'}%></td>
|
|
54
54
|
</tr>
|
|
55
55
|
<tr>
|
|
56
56
|
<td class = 'BG_white'>Log Level
|
|
@@ -60,7 +60,7 @@ along with WebROaR. If not, see <http://www.gnu.org/licenses/>.
|
|
|
60
60
|
<br/> <div id = 'log_level' class = 'font_size_12'></div>
|
|
61
61
|
</td>
|
|
62
62
|
<td class = 'BG_white'><div id = 'log_div'><%=h(log_level)%></div></td>
|
|
63
|
-
<td class = 'BG_white'><%=link_to_remote 'Edit', :update => 'log_div', :url => {:action => 'add_text_box', :div_id => 'log_div'}%></td>
|
|
63
|
+
<td class = 'BG_white'><%=link_to_remote 'Edit', :update => 'log_div', :url => {:controller => 'server_specification', :action => 'add_text_box', :div_id => 'log_div'}%></td>
|
|
64
64
|
</tr>
|
|
65
65
|
</table>
|
|
66
66
|
<br/><br/>
|
|
@@ -71,9 +71,14 @@ along with WebROaR. If not, see <http://www.gnu.org/licenses/>.
|
|
|
71
71
|
<%elsif flash[:smtp_errors]%>
|
|
72
72
|
<%=render :partial => 'mail_specification/smtp_form'%>
|
|
73
73
|
<%else%>
|
|
74
|
-
<%=
|
|
74
|
+
<%=render :partial => 'mail_specification/current_spec' %>
|
|
75
75
|
<%end%>
|
|
76
76
|
</div>
|
|
77
|
+
<div id = 'headers_div'>
|
|
78
|
+
<%= render :partial => 'headers/headers_table' %>
|
|
79
|
+
</div>
|
|
80
|
+
<br/>
|
|
81
|
+
<br/>
|
|
77
82
|
<div id = 'application_list_table'>
|
|
78
83
|
<%=render :partial => 'application_table', :locals => {:start => 0}%>
|
|
79
84
|
</div>
|
|
@@ -49,15 +49,15 @@ along with WebROaR. If not, see <http://www.gnu.org/licenses/>.
|
|
|
49
49
|
<% end -%>
|
|
50
50
|
<tr>
|
|
51
51
|
<td colspan = 6>
|
|
52
|
-
Take Action
|
|
52
|
+
<b>Take Action:</b>
|
|
53
53
|
<% unless current_status == OPEN_EXCEPTION %>
|
|
54
|
-
|
|
54
|
+
<b><%=link_to_remote 'Reopen', :condition => "checkMarked()", :url => {:controller => 'exceptions', :action => 'change_status', :status_name => "open", :current_status => status_name, :app_name => @application_name, :page => @exceptions.current_page }, :submit => 'form_exception_list', :method => :put %></b>
|
|
55
55
|
<% end %>
|
|
56
56
|
<% unless current_status == CLOSED_EXCEPTION %>
|
|
57
|
-
|
|
57
|
+
<b><%=link_to_remote 'Close', :condition => "checkMarked()", :url => {:controller => 'exceptions', :action => 'change_status', :status_name => "close", :current_status => status_name, :app_name => @application_name, :page => @exceptions.current_page }, :submit => 'form_exception_list', :method => :put %></b>
|
|
58
58
|
<% end %>
|
|
59
59
|
<% unless current_status == IGNORED_EXCEPTION %>
|
|
60
|
-
|
|
60
|
+
<b><%=link_to_remote 'Ignore', :condition => "checkMarked()", :url => {:controller => 'exceptions', :action => 'change_status', :status_name => "ignore", :current_status => status_name, :app_name => @application_name, :page => @exceptions.current_page }, :submit => 'form_exception_list', :method => :put %></b>
|
|
61
61
|
<% end %>
|
|
62
62
|
<%#=link_to_remote 'Delete', :condition => "checkMarked('delete')", :url => {:controller => 'exceptions', :action => 'change_status', :status_name => "delete", :current_status => status_name, :app_name => @application_name, :page => @exceptions.current_page }, :submit => 'form_exception_list', :method => :put %>
|
|
63
63
|
</td>
|
|
@@ -29,6 +29,9 @@ along with WebROaR. If not, see <http://www.gnu.org/licenses/>.
|
|
|
29
29
|
<div id = 'reload'>Select Graph: <%=select :graph,:name,%w{URL-Breakup URL-Calls Database-Usage Throughput Resource-Usage},:selected=>session[:graph_type]%></div>
|
|
30
30
|
<hr/>
|
|
31
31
|
<div style = "font-weight:bold;font-size:14;">Application Name : <%=@application_name%> </div>
|
|
32
|
+
<% unless ApplicationSpecification.analytics_enabled?(@application_name) %>
|
|
33
|
+
<span style = "color:red">Analytics for this application is currently disabled. You can still view the reports on captured data.</span>
|
|
34
|
+
<% end %>
|
|
32
35
|
<hr/>
|
|
33
36
|
<div id = 'graphs'>
|
|
34
37
|
<%=render :partial => get_partial(session[:graph_type])%>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
WebROaR - Ruby Application Server - http://webroar.in/
|
|
3
|
+
Copyright (C) 2009 Goonj LLC
|
|
4
|
+
|
|
5
|
+
This file is part of WebROaR.
|
|
6
|
+
|
|
7
|
+
WebROaR is free software: you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the GNU General Public License as published by
|
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
(at your option) any later version.
|
|
11
|
+
|
|
12
|
+
WebROaR is distributed in the hope that it will be useful,
|
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
GNU General Public License for more details.
|
|
16
|
+
|
|
17
|
+
You should have received a copy of the GNU General Public License
|
|
18
|
+
along with WebROaR. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
<%old_value = Headers.get_expires_value()%>
|
|
22
|
+
|
|
23
|
+
<div id = 'div_add_expires_text_box'>
|
|
24
|
+
<span style = "height:20px;float:left">
|
|
25
|
+
<%remote_form_for :data, :update => params[:div_id], :url => {:controller => 'headers', :action => 'save_expires_value', :div_id => params[:div_id], :old_value => old_value}do%>
|
|
26
|
+
<%=text_field :data, :value, :size => '10', :value => h(old_value)%>
|
|
27
|
+
<%=submit_tag 'Save'%>
|
|
28
|
+
<%end%>
|
|
29
|
+
</span>
|
|
30
|
+
<span style = "height:20px;float:left;">
|
|
31
|
+
<%remote_form_for :cancel, :update => params[:div_id], :url => {:controller => 'headers', :action => 'cancel_expires_value_edit', :div_id => params[:div_id], :old_value => old_value} do%>
|
|
32
|
+
<%=submit_tag 'Cancel'%>
|
|
33
|
+
<%end%>
|
|
34
|
+
</span>
|
|
35
|
+
</div>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
WebROaR - Ruby Application Server - http://webroar.in/
|
|
3
|
+
Copyright (C) 2009 Goonj LLC
|
|
4
|
+
|
|
5
|
+
This file is part of WebROaR.
|
|
6
|
+
|
|
7
|
+
WebROaR is free software: you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the GNU General Public License as published by
|
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
(at your option) any later version.
|
|
11
|
+
|
|
12
|
+
WebROaR is distributed in the hope that it will be useful,
|
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
GNU General Public License for more details.
|
|
16
|
+
|
|
17
|
+
You should have received a copy of the GNU General Public License
|
|
18
|
+
along with WebROaR. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<%remote_form_for :data, :url => {:controller => 'headers', :action => 'save_expires_by_type_value' } do %>
|
|
23
|
+
|
|
24
|
+
<table width = 95% cellpadding = "4">
|
|
25
|
+
<% if @error_message %>
|
|
26
|
+
<tr>
|
|
27
|
+
<td colspan = 3 class = 'BG_white'><span id='error_div'><%= @error_message %></td> </span>
|
|
28
|
+
</tr>
|
|
29
|
+
<% end%>
|
|
30
|
+
<tr>
|
|
31
|
+
<td width = 40% class = 'BG_white'>
|
|
32
|
+
<span style = "height:20px;float:left">
|
|
33
|
+
Extension <span class = 'help_link'><%=link_to_function "Help", :onclick => "addHelp('expires_by_type_ext')" %></span>
|
|
34
|
+
|
|
35
|
+
<%=text_field :data, :ext, :size => '20' %>
|
|
36
|
+
</span>
|
|
37
|
+
<br/>
|
|
38
|
+
<div id = 'expires_by_type_ext' class = 'font_size_12'>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
</td>
|
|
42
|
+
<td width = 40% class = 'BG_white'>
|
|
43
|
+
<span style = "height:20px;float:left">
|
|
44
|
+
Expires <span class = 'help_link'><%=link_to_function "Help", :onclick => "addHelp('expires_by_type_expires_value')" %></span>
|
|
45
|
+
|
|
46
|
+
<%=text_field :data, :expires, :size => '10' %>
|
|
47
|
+
</span>
|
|
48
|
+
<br/>
|
|
49
|
+
<div id = 'expires_by_type_expires_value' class = 'font_size_12'>
|
|
50
|
+
</div>
|
|
51
|
+
</td>
|
|
52
|
+
<td width = 20% class = 'BG_white'>
|
|
53
|
+
<span style = "height:20px;float:left">
|
|
54
|
+
<%=submit_tag 'Save' %>
|
|
55
|
+
<%=button_to_remote 'Cancel', :update => 'expires_by_type_form', :url => {:controller => 'headers', :action => 'cancel_expires_by_type_value'} %>
|
|
56
|
+
<%end %>
|
|
57
|
+
</span>
|
|
58
|
+
</td>
|
|
59
|
+
</tr>
|
|
60
|
+
</table>
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|