bacuview 1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. data/AUTHORS +2 -0
  2. data/ChangeLog +454 -0
  3. data/README.bacuview +7 -0
  4. data/README.rails +153 -0
  5. data/Rakefile +94 -0
  6. data/app/controllers/application.rb +11 -0
  7. data/app/controllers/client_controller.rb +27 -0
  8. data/app/controllers/job_controller.rb +100 -0
  9. data/app/controllers/jobmedia_controller.rb +2 -0
  10. data/app/controllers/media_controller.rb +44 -0
  11. data/app/controllers/misc_controller.rb +14 -0
  12. data/app/controllers/pool_controller.rb +38 -0
  13. data/app/helpers/application_helper.rb +88 -0
  14. data/app/helpers/client_finder.rb +112 -0
  15. data/app/helpers/client_helper.rb +45 -0
  16. data/app/helpers/job_helper.rb +56 -0
  17. data/app/helpers/jobmedia_helper.rb +2 -0
  18. data/app/helpers/media_helper.rb +14 -0
  19. data/app/helpers/misc_helper.rb +15 -0
  20. data/app/helpers/pool_helper.rb +2 -0
  21. data/app/models/client.rb +14 -0
  22. data/app/models/job.rb +21 -0
  23. data/app/models/jobmedia.rb +9 -0
  24. data/app/models/media.rb +23 -0
  25. data/app/models/pool.rb +13 -0
  26. data/app/views/client/_spec.rhtml +1 -0
  27. data/app/views/client/check.rhtml +1 -0
  28. data/app/views/client/index.rhtml +27 -0
  29. data/app/views/client/show.rhtml +8 -0
  30. data/app/views/job/_spec.rhtml +7 -0
  31. data/app/views/job/index.rhtml +38 -0
  32. data/app/views/job/last.rhtml +52 -0
  33. data/app/views/job/show.rhtml +19 -0
  34. data/app/views/job/spec.rhtml +38 -0
  35. data/app/views/layouts/bacuview-layout.rhtml +50 -0
  36. data/app/views/media/_spec.rhtml +1 -0
  37. data/app/views/media/index.rhtml +30 -0
  38. data/app/views/media/show.rhtml +8 -0
  39. data/app/views/misc/about.rhtml +2 -0
  40. data/app/views/misc/help.rhtml +1 -0
  41. data/app/views/pool/_spec.rhtml +1 -0
  42. data/app/views/pool/index.rhtml +29 -0
  43. data/app/views/pool/show.rhtml +8 -0
  44. data/bin/bacuview +3 -0
  45. data/config/bacuview.yml.template +2 -0
  46. data/config/boot.rb +19 -0
  47. data/config/database.yml.template +13 -0
  48. data/config/environment.rb +87 -0
  49. data/config/environments/development.rb +19 -0
  50. data/config/environments/production.rb +19 -0
  51. data/config/environments/test.rb +19 -0
  52. data/config/routes.rb +61 -0
  53. data/log/development.log +0 -0
  54. data/log/production.log +0 -0
  55. data/log/test.log +0 -0
  56. data/public/404.html +8 -0
  57. data/public/500.html +8 -0
  58. data/public/bacu-bat.png +0 -0
  59. data/public/bacuweb.css +7 -0
  60. data/public/client-sophie-thumb.png +0 -0
  61. data/public/client-sophie.png +0 -0
  62. data/public/clients-thumb.png +0 -0
  63. data/public/clients.png +0 -0
  64. data/public/dispatch.cgi +10 -0
  65. data/public/dispatch.fcgi +24 -0
  66. data/public/dispatch.rb +10 -0
  67. data/public/favicon.ico +0 -0
  68. data/public/home.html +108 -0
  69. data/public/images/bacu-bat.png +0 -0
  70. data/public/images/busy.png +0 -0
  71. data/public/images/dunno.png +0 -0
  72. data/public/images/error.png +0 -0
  73. data/public/images/okay.png +0 -0
  74. data/public/images/pool_pie.png +0 -0
  75. data/public/install.html +156 -0
  76. data/public/javascripts/application.js +2 -0
  77. data/public/javascripts/client_check.js +24 -0
  78. data/public/javascripts/controls.js +815 -0
  79. data/public/javascripts/dragdrop.js +724 -0
  80. data/public/javascripts/effects.js +953 -0
  81. data/public/javascripts/prototype.js +1985 -0
  82. data/public/job-1449-thumb.png +0 -0
  83. data/public/job-1449.png +0 -0
  84. data/public/job-last-thumb.png +0 -0
  85. data/public/job-last.png +0 -0
  86. data/public/jobs-thumb.png +0 -0
  87. data/public/jobs.png +0 -0
  88. data/public/media-39-thumb.png +0 -0
  89. data/public/media-39.png +0 -0
  90. data/public/media-thumb.png +0 -0
  91. data/public/media.png +0 -0
  92. data/public/news.html +144 -0
  93. data/public/pool-lto3-thumb.png +0 -0
  94. data/public/pool-lto3.png +0 -0
  95. data/public/pools-thumb.png +0 -0
  96. data/public/pools.png +0 -0
  97. data/public/robots.txt +1 -0
  98. data/public/stylesheets/bacuview.css +37 -0
  99. data/script/about +3 -0
  100. data/script/breakpointer +3 -0
  101. data/script/console +3 -0
  102. data/script/destroy +3 -0
  103. data/script/generate +3 -0
  104. data/script/performance/benchmarker +3 -0
  105. data/script/performance/profiler +3 -0
  106. data/script/plugin +3 -0
  107. data/script/process/reaper +3 -0
  108. data/script/process/spawner +3 -0
  109. data/script/process/spinner +3 -0
  110. data/script/runner +3 -0
  111. data/script/server +3 -0
  112. metadata +168 -0
@@ -0,0 +1,14 @@
1
+ class Client < ActiveRecord::Base
2
+ Client.table_name = "client"
3
+ Client.primary_key = "clientid"
4
+
5
+ if MYSQL
6
+ Client.table_name = "Client"
7
+ def id; self.ClientId; end
8
+ def name; self.Name; end
9
+ def uname; self.Uname rescue ""; end
10
+ def autoprune?; self.AutoPrune?; end
11
+ def fileretention; self.FileRetention; end
12
+ def jobretention; self.JobRetention; end
13
+ end
14
+ end
data/app/models/job.rb ADDED
@@ -0,0 +1,21 @@
1
+ class Job < ActiveRecord::Base
2
+ Job.table_name = 'job'
3
+ Job.primary_key = 'jobid'
4
+
5
+ Job.inheritance_column = 'ruby_type'
6
+ def type; self.attributes['type']; end
7
+
8
+ if MYSQL
9
+ Job.table_name = "Job"
10
+ def id; self.JobId; end
11
+ def name; self.Name; end
12
+ def level; self.Level; end
13
+ def jobstatus; self.JobStatus; end
14
+ def jobfiles; self.JobFiles; end
15
+ def jobbytes; self.JobBytes; end
16
+ def schedtime; self.SchedTime; end
17
+ def starttime; self.StartTime; end
18
+ def endtime; self.EndTime; end
19
+ def type; self.attributes['Type']; end
20
+ end
21
+ end
@@ -0,0 +1,9 @@
1
+ class Jobmedia < ActiveRecord::Base
2
+ Jobmedia.table_name = 'jobmedia'
3
+ Jobmedia.primary_key = 'jobmediaid'
4
+
5
+ if MYSQL
6
+ Jobmedia.table_name = 'JobMedia'
7
+ def volumename; self.VolumeName; end
8
+ end
9
+ end
@@ -0,0 +1,23 @@
1
+ class Media < ActiveRecord::Base
2
+ Media.table_name = 'media'
3
+ Media.primary_key = 'mediaid'
4
+
5
+ if MYSQL
6
+ Media.table_name = 'Media'
7
+ def id; self.MediaId; end
8
+ def name; self.Name; end
9
+ def poolid; self.PoolId; end
10
+ def pooltype; self.PoolType; end
11
+ def volumename; self.VolumeName; end
12
+ def volstatus; self.VolStatus; end
13
+ def voljobs; self.VolJobs; end
14
+ def volfiles; self.VolFiles; end
15
+ def volbytes; self.VolBytes; end
16
+ def volretention; self.VolRetention; end
17
+ def mediatype; self.MediaType; end
18
+ def inchanger; self.InChanger; end
19
+ def lastwritten; self.LastWritten; end
20
+ def slot; self.Slot; end
21
+ def storageid; self.StorageId; end
22
+ end
23
+ end
@@ -0,0 +1,13 @@
1
+ class Pool < ActiveRecord::Base
2
+ Pool.table_name = 'pool'
3
+ Pool.primary_key = 'poolid'
4
+
5
+ if MYSQL
6
+ Pool.table_name = 'Pool'
7
+ def id; self.PoolId; end
8
+ def name; self.Name; end
9
+ def pooltype; self.PoolType; end
10
+ def volretention; self.VolRetention; end
11
+ def numvols; self.NumVols; end
12
+ end
13
+ end
@@ -0,0 +1 @@
1
+ <p> client </p>
@@ -0,0 +1 @@
1
+ <%= image_tag(client_image, :class => "em1") %>
@@ -0,0 +1,27 @@
1
+ <table>
2
+ <tr class="head">
3
+ <%= check_tag(0) %>
4
+ <%= client_header "Client", "name" %>
5
+ <%= client_header "Auto Prune", "prune" %>
6
+ <%= client_header "File Retention", "fretain" %>
7
+ <%= client_header "Job Retention", "jretain" %>
8
+ <%= client_header "System Type", "uname" %>
9
+ </tr>
10
+
11
+ <% @clients.each_with_index do |client, n| %>
12
+ <tr class="nowrap <%= n.odd? ? "gray" : "blue" %> ">
13
+ <%= check_tag(client.id) %>
14
+ <td><%= link_to client.name, :action => "show", :cid => client.id %></td>
15
+ <td><%= client.autoprune? %></td>
16
+ <td><%= client.fileretention/86400 %> days</td>
17
+ <td><%= client.jobretention/86400 %> days</td>
18
+ <td><%= client.uname %></td>
19
+ </tr>
20
+ <% end %>
21
+ </table>
22
+
23
+ <div id="js">
24
+ <p> A real-time client status check will become available once the
25
+ Javascript facility of your web browser has been enabled (unless
26
+ you're using Microsoft Internet Explorer.) </p>
27
+ </div>
@@ -0,0 +1,8 @@
1
+ <table>
2
+ <% for column in Client.content_columns %>
3
+ <tr>
4
+ <td class='key'> <%= pretty_key(column.name) %>: </td>
5
+ <td> <%=h pretty_val(column.name, @client.send(column.name)) %> </td>
6
+ </tr>
7
+ <% end %>
8
+ </table>
@@ -0,0 +1,7 @@
1
+ <p>
2
+ <%= start_form_tag(:action => :index) %>
3
+ <%= submit_tag("Show jobs...") %> <br/>
4
+ <%= selection("spec", "name", job_names, params["name"]) %> <br/>
5
+ <%= selection("spec", "days", day_names, params["days"]) %>
6
+ <%= end_form_tag %>
7
+ </p>
@@ -0,0 +1,38 @@
1
+ <% if @jobs.size == 0 %>
2
+ <p> There have been no
3
+ <%= params[:name] == "0" ? "" : "'#{params[:name]}'" %> jobs scheduled
4
+ <%= params[:days].to_i == 1 ? "today." :
5
+ "within the last #{params[:days]} days." %> </p>
6
+ <% else %>
7
+ <table>
8
+ <tr class="head">
9
+ <%= job_header "Id", "id" %>
10
+ <%= job_header "Name", "name" %>
11
+ <%= job_header "Type", "type" %>
12
+ <%= job_header "Level", "level" %>
13
+ <%= job_header "Status", "status" %>
14
+ <%= job_header "Bytes", "bytes" %>
15
+ <%= job_header "Rate", "rate" %>
16
+ <%= job_header "Time", "time" %>
17
+ <%= job_header "Sched", "sched" %>
18
+ <%= job_header "Start", "start" %>
19
+ <%= job_header "Finish", "finish" %>
20
+ </tr>
21
+
22
+ <% @jobs.each_with_index do |job, n| %>
23
+ <tr class="nowrap <%= n.odd? ? "gray" : "blue" %>">
24
+ <td> <%= link_to job.jobid, :action=>:show, :jid=>job.jobid %> </td>
25
+ <td> <%= link_to job.name, :action=>:last, :name=>job.name %> </td>
26
+ <td> <%= type_name(job.type) %> </td>
27
+ <td> <%= level_name(job.level) %> </td>
28
+ <%= status_style job.jobstatus %>
29
+ <td class="right"> <%= human_size_if_nz(job.jobbytes) %> </td>
30
+ <td class="right"> <%= human_size_if_nz(job.rate.to_i) %> </td>
31
+ <td class="right"> <%= job.time %> </td>
32
+ <td> <%= when_full(job.schedtime) %> </td>
33
+ <td> <%= when_tiny(job.starttime) %> </td>
34
+ <td> <%= when_tiny(job.endtime) %> </td>
35
+ </tr>
36
+ <% end %>
37
+ </table>
38
+ <% end %>
@@ -0,0 +1,52 @@
1
+ <% if !@full %>
2
+ <p> <b> No backup of <%= params[:name] %> has been performed. </b> </p>
3
+ <% else %>
4
+ <table>
5
+ <tr>
6
+ <td class="key"> Last Full Backup: </td>
7
+ <td> <%= distance_of_time_in_words_to_now(@full.starttime) %> ago </td>
8
+ </tr>
9
+ <tr>
10
+ <td> </td>
11
+ <td> <%= @full.starttime.strftime("%A, %B %d %Y, %X") %> </td>
12
+ </tr>
13
+ <tr>
14
+ <td> </td>
15
+ <td> <%= number_to_human_size(@full.jobbytes) %> in
16
+ <%= number_with_delimiter(@full.jobfiles) %> files </td>
17
+ </tr>
18
+ <% if @diff and @diff.starttime > @full.starttime %>
19
+ <tr><td>&nbsp</td></tr>
20
+ <tr>
21
+ <td class="key"> Last Differential Backup: </td>
22
+ <td> <%= distance_of_time_in_words_to_now(@diff.starttime) %> ago </td>
23
+ </tr>
24
+ <tr>
25
+ <td> </td>
26
+ <td> <%= @diff.starttime.strftime("%A, %B %d %Y, %X") %> </td>
27
+ </tr>
28
+ <tr>
29
+ <td> </td>
30
+ <td> <%= number_to_human_size(@diff.jobbytes) %> in
31
+ <%= number_with_delimiter(@diff.jobfiles) %> files </td>
32
+ </tr>
33
+ <% end %>
34
+ <% if @incr and @incr.starttime > @full.starttime and
35
+ ( not @diff or @incr.starttime > @diff.starttime ) %>
36
+ <tr><td>&nbsp</td></tr>
37
+ <tr>
38
+ <td class="key"> Last Incremental Backup: </td>
39
+ <td> <%= distance_of_time_in_words_to_now(@incr.starttime) %> ago </td>
40
+ </tr>
41
+ <tr>
42
+ <td> </td>
43
+ <td> <%= @incr.starttime.strftime("%A, %B %d %Y, %X") %> </td>
44
+ </tr>
45
+ <tr>
46
+ <td> </td>
47
+ <td> <%= number_to_human_size(@incr.jobbytes) %> in
48
+ <%= number_with_delimiter(@incr.jobfiles) %> files </td>
49
+ </tr>
50
+ <% end %>
51
+ </table>
52
+ <% end %>
@@ -0,0 +1,19 @@
1
+ <table>
2
+ <% for column in Job.content_columns %>
3
+ <tr>
4
+ <td class='key'> <%= pretty_key(column.name) %>: </td>
5
+ <td> <%=h pretty_val(column.name, @job.attributes[column.name]) %> </td>
6
+ </tr>
7
+ <% end %>
8
+
9
+ <tr>
10
+ <td class='key'> Job Volumes: </td>
11
+ <td>
12
+ <% for media in @jobmedia %>
13
+ <%= link_to media.attributes['volumename'],
14
+ :controller => 'media', :action => 'show',
15
+ :id => media.attributes['mediaid'] %> <br/>
16
+ <% end %>
17
+ </td>
18
+ </tr>
19
+ </table>
@@ -0,0 +1,38 @@
1
+ <% if @jobs.size == 0 %>
2
+ <p> There have been no
3
+ <%= params[:name] == "0" ? "" : "'#{params[:name]}'" %> jobs scheduled
4
+ <%= params[:days].to_i == 1 ? "today." :
5
+ "within the last #{params[:days]} days." %> </p>
6
+ <% else %>
7
+ <table>
8
+ <tr class="head">
9
+ <%= job_header "Id", "id" %>
10
+ <%= job_header "Name", "name" %>
11
+ <%= job_header "Type", "type" %>
12
+ <%= job_header "Level", "level" %>
13
+ <%= job_header "Status", "status" %>
14
+ <%= job_header "Bytes", "bytes" %>
15
+ <%= job_header "Rate", "rate" %>
16
+ <%= job_header "Time", "time" %>
17
+ <%= job_header "Sched", "sched" %>
18
+ <%= job_header "Start", "start" %>
19
+ <%= job_header "Finish", "finish" %>
20
+ </tr>
21
+
22
+ <% @jobs.each_with_index do |job, n| %>
23
+ <tr class="nowrap <%= n.odd? ? "gray" : "blue" %>">
24
+ <td> <%= link_to job.jobid, :action=>:show, :jid=>job.jobid %> </td>
25
+ <td> <%= link_to job.name, :action=>:last, :name=>job.name %> </td>
26
+ <td> <%= type_name(job.type) %> </td>
27
+ <td> <%= level_name(job.level) %> </td>
28
+ <%= status_style job.jobstatus %>
29
+ <td class="right"> <%= human_size_if_nz(job.jobbytes) %> </td>
30
+ <td class="right"> <%= human_size_if_nz(job.rate.to_i) %> </td>
31
+ <td class="right"> <%= job.time %> </td>
32
+ <td> <%= when_full(job.schedtime) %> </td>
33
+ <td> <%= when_tiny(job.starttime) %> </td>
34
+ <td> <%= when_tiny(job.endtime) %> </td>
35
+ </tr>
36
+ <% end %>
37
+ </table>
38
+ <% end %>
@@ -0,0 +1,50 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
+ "http://www.w3.org/TR/html4/loose.dtd">
3
+ <html>
4
+ <head>
5
+ <title> <%= "Bacuview: " + (@page_title || "") %> </title>
6
+ <%= stylesheet_link_tag "bacuview" %>
7
+ <%= javascript_include_tag "client_check" %>
8
+ </head>
9
+ <body onload="js_hide()">
10
+ <table>
11
+ <tr>
12
+ <td> </td>
13
+ <td>
14
+ <h1> <%= @page_title || "Bacuview" %> </h1>
15
+ <% if false %>
16
+ <%= render(:partial => "spec") %>
17
+ <% end %>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <td class="nowrap">
22
+ <ul>
23
+ <li> <%= link_to "Clients", :controller=>"client/" %> </li>
24
+ <li> <%= link_to "Media", :controller=>"media/" %> </li>
25
+ <li> <%= link_to "Pools", :controller=>"pool/" %> </li>
26
+ <li> <%= link_to "Jobs", :controller=>"job/" %> </li>
27
+ <% if true %>
28
+ <li> <b> Jobs last... </b> <br/>
29
+ <%= link_to "... day", :controller=>"job", "days" => "1" %> <br/>
30
+ <%= link_to "... week", :controller=>"job", "days" => "7" %> <br/>
31
+ <%= link_to "... month", :controller=>"job", "days" => "35" %> <br/>
32
+ <%= link_to "... year", :controller=>"job", "days" => "372" %> <br/>
33
+ <%= link_to "... all", :controller=>"job", "days" => "0" %> <br/>
34
+ </li>
35
+ <li> <b> Jobs... </b> <br/>
36
+ <% job_names.each do |job, opt| %>
37
+ <%= link_to "... " + job, :controller => "job",
38
+ "name" => opt, "jsort" => params[:jsort] %><br/>
39
+ <% end %>
40
+ </li>
41
+ <% end %>
42
+ </ul>
43
+ </td>
44
+ <td class="content">
45
+ <%= @content_for_layout %>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </body>
50
+ </html>
@@ -0,0 +1 @@
1
+ <p> media </p>
@@ -0,0 +1,30 @@
1
+ <table>
2
+ <tr class="head">
3
+ <%= media_header "Name", "name" %>
4
+ <%= media_header "Slot", "slot" %>
5
+ <%= media_header "Status", "stat" %>
6
+ <%= media_header "Jobs", "jobs" %>
7
+ <%= media_header "Bytes", "bytes" %>
8
+ <%= media_header "Expires", "expire" %>
9
+ <%= media_header "Retention", "retain" %>
10
+ <%= media_header "Pool Name", "pool" %>
11
+ <%= media_header "Pool Type", "ptype" %>
12
+ <%= media_header "Media", "mtype" %>
13
+ </tr>
14
+
15
+ <% @media.each_with_index do |media, n| %>
16
+ <tr class="nowrap <%= n.odd? ? "gray" : "blue" %> ">
17
+ <td><%= link_to media.volumename,
18
+ :action => "show", :id => media.mediaid %></td>
19
+ <td><%= slot_display(media.inchanger, media.storageid, media.slot)%></td>
20
+ <%= status_style(media.volstatus) %>
21
+ <td class="right"><%= media.voljobs %></td>
22
+ <td class="right"><%= number_to_human_size(media.volbytes) %></td>
23
+ <td><%= media.expire ? media.expire[0..9] : "-" %></td>
24
+ <td class="right"><%= media.volretention / 86400 %> days </td>
25
+ <td><%= media.name %></td>
26
+ <td><%= media.pooltype %></td>
27
+ <td><%= media.mediatype %></td>
28
+ </tr>
29
+ <% end %>
30
+ </table>
@@ -0,0 +1,8 @@
1
+ <table>
2
+ <% for column in Media.content_columns %>
3
+ <tr>
4
+ <td class='key'> <%= pretty_key(column.name) %>: </td>
5
+ <td> <%=h pretty_val(column.name, @media.send(column.name)) %> </td>
6
+ </tr>
7
+ <% end %>
8
+ </table>
@@ -0,0 +1,2 @@
1
+ <p> This is Bacuview, a backup system web monitor that compliments the
2
+ Bacula backup system. </p>
@@ -0,0 +1 @@
1
+ <p> <%= help_slogan %> </p>
@@ -0,0 +1 @@
1
+ <p> pool </p>
@@ -0,0 +1,29 @@
1
+ <table>
2
+ <tr class="head">
3
+ <%= pool_header "Name", "name" %>
4
+ <%= pool_header "Type", "type" %>
5
+ <%= pool_header "Retention", "retain" %>
6
+ <%= pool_header "Volumes", "vols" %>
7
+ <%= pool_header "Distribution", "vols" %>
8
+ </tr>
9
+
10
+ <% @pool.each_with_index do |pool, n| %>
11
+ <tr class="nowrap <%= n.odd? ? "gray" : "blue" %> ">
12
+ <td> <%= link_to pool.name, :action=>"show", :pid=>pool.poolid %> </td>
13
+ <td> <%= pool.pooltype %> </td>
14
+ <td> <%= pool.volretention / 86400 %> days </td>
15
+ <td> <%= pool.numvols %> </td>
16
+ <td>
17
+ <div class="graph">
18
+ <div class="bar" style="width: <%= 100*pool.numvols/@max_vols %>%;">
19
+ <%= 100*pool.numvols/@total_vols %>%
20
+ </div>
21
+ </div>
22
+ </td>
23
+ </tr>
24
+ <% end %>
25
+ </table>
26
+
27
+ <% if BACUVIEW['have_gruff'] %>
28
+ <%= tag "img", :src => "/pool/dist/" + params[:psort] %>
29
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <table>
2
+ <% for column in Pool.content_columns %>
3
+ <tr>
4
+ <td class='key'> <%= pretty_key(column.name) %>: </td>
5
+ <td> <%=h pretty_val(column.name, @pool.send(column.name)) %> </td>
6
+ </tr>
7
+ <% end %>
8
+ </table>
data/bin/bacuview ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/server'
@@ -0,0 +1,2 @@
1
+ config_path: /etc/bacula
2
+ config_glob: '*-dir.conf'
data/config/boot.rb ADDED
@@ -0,0 +1,19 @@
1
+ # Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
2
+
3
+ unless defined?(RAILS_ROOT)
4
+ root_path = File.join(File.dirname(__FILE__), '..')
5
+ unless RUBY_PLATFORM =~ /mswin32/
6
+ require 'pathname'
7
+ root_path = Pathname.new(root_path).cleanpath(true).to_s
8
+ end
9
+ RAILS_ROOT = root_path
10
+ end
11
+
12
+ if File.directory?("#{RAILS_ROOT}/vendor/rails")
13
+ require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
14
+ else
15
+ require 'rubygems'
16
+ require 'initializer'
17
+ end
18
+
19
+ Rails::Initializer.run(:set_load_path)
@@ -0,0 +1,13 @@
1
+ production:
2
+ adapter: postgresql
3
+ database: bacula
4
+ username: bacuview
5
+ password: bacuview
6
+ host: localhost
7
+
8
+ development:
9
+ adapter: postgresql
10
+ database: bacula
11
+ username: bacuview
12
+ password: bacuview
13
+ host: localhost
@@ -0,0 +1,87 @@
1
+ # Be sure to restart your web server when you modify this file.
2
+
3
+ # Uncomment below to force Rails into production mode when
4
+ # you don't control web/app server and can't set it the proper way
5
+ # ENV['RAILS_ENV'] ||= 'production'
6
+
7
+ # Bootstrap the Rails environment, frameworks, and default configuration
8
+ require File.join(File.dirname(__FILE__), 'boot')
9
+
10
+ Rails::Initializer.run do |config|
11
+ # Settings in config/environments/* take precedence those specified here
12
+
13
+ # Skip frameworks you're not going to use
14
+ # config.frameworks -= [ :action_web_service, :action_mailer ]
15
+
16
+ # Add additional load paths for your own custom dirs
17
+ # config.load_paths += %W( #{RAILS_ROOT}/extras )
18
+
19
+ # Force all environments to use the same logger level
20
+ # (by default production uses :info, the others :debug)
21
+ # config.log_level = :debug
22
+
23
+ # Use the database for sessions instead of the file system
24
+ # (create the session table with 'rake create_sessions_table')
25
+ # config.action_controller.session_store = :active_record_store
26
+
27
+ # Enable page/fragment caching by setting a file-based store
28
+ # (remember to create the caching directory and make it readable to
29
+ # the application) config.action_controller.fragment_cache_store =
30
+ # :file_store, "#{RAILS_ROOT}/cache"
31
+
32
+ # Activate observers that should always be running
33
+ # config.active_record.observers = :cacher, :garbage_collector
34
+
35
+ # Make Active Record use UTC-base instead of local time
36
+ # config.active_record.default_timezone = :utc Use Active Record's
37
+ # schema dumper instead of SQL when creating the test database
38
+ # (enables use of different database adapters for development and
39
+ # test environments) config.active_record.schema_format = :ruby
40
+
41
+ # See Rails::Configuration for more options
42
+ end
43
+
44
+ # Add new inflection rules using the following format
45
+ # (all these examples are active by default):
46
+ # Inflector.inflections do |inflect|
47
+ # inflect.plural /^(ox)$/i, '\1en'
48
+ # inflect.singular /^(ox)en/i, '\1'
49
+ # inflect.irregular 'person', 'people'
50
+ # inflect.uncountable %w( fish sheep )
51
+ # end
52
+
53
+ # Include your application configuration below
54
+
55
+ require "#{RAILS_ROOT}/app/helpers/client_finder.rb"
56
+
57
+ MYSQL = ActiveRecord::Base.configurations[RAILS_ENV]['adapter'] == 'mysql'
58
+ print 'MySQL work-arounds ', MYSQL ? 'in effect' : 'not required', "\n"
59
+
60
+ BACUVIEW = YAML::load(File.open("#{RAILS_ROOT}/config/bacuview.yml")) rescue {}
61
+ CLIENT_MAP = build_client_map(BACUVIEW['config_path'], BACUVIEW['config_glob'])
62
+ print "Found ", CLIENT_MAP.size, " client name to host name mappings\n"
63
+
64
+ os_list = []
65
+ Client.find(:all, :select => 'distinct Uname').each { |u|
66
+ os_list << u.uname.split(',')[1]
67
+ }
68
+ OS_LIST = os_list.uniq.compact.sort
69
+ print 'OS list holds ', OS_LIST.join(', '), "\n"
70
+
71
+ CHANGERS = Media.find(:all,
72
+ :select => "distinct storageid", :conditions => "inchanger=1").size
73
+ print "Found signs of #{CHANGERS} autochangers.\n"
74
+
75
+ TODAY = BACUVIEW['today']
76
+ print "Today is ", TODAY, "\n" if TODAY
77
+
78
+ begin
79
+ require 'gruff'
80
+ rescue MissingSourceFile
81
+ BACUVIEW.delete('have_gruff')
82
+ end
83
+ if BACUVIEW['have_gruff']
84
+ ENV["MAGICK_FONT_PATH"] = "/usr/share/fonts/bitstream-vera"
85
+ BACUVIEW.delete('have_gruff') unless Gruff::Pie.new
86
+ end
87
+ print "Gruff is #{BACUVIEW['have_gruff'] ? 'enabled' : 'disabled'}.\n"
@@ -0,0 +1,19 @@
1
+ # Settings specified here will take precedence over those in config/environment.rb
2
+
3
+ # In the development environment your application's code is reloaded on
4
+ # every request. This slows down response time but is perfect for development
5
+ # since you don't have to restart the webserver when you make code changes.
6
+ config.cache_classes = false
7
+
8
+ # Log error messages when you accidentally call methods on nil.
9
+ config.whiny_nils = true
10
+
11
+ # Enable the breakpoint server that script/breakpointer connects to
12
+ config.breakpoint_server = true
13
+
14
+ # Show full error reports and disable caching
15
+ config.action_controller.consider_all_requests_local = true
16
+ config.action_controller.perform_caching = false
17
+
18
+ # Don't care if the mailer can't send
19
+ config.action_mailer.raise_delivery_errors = false
@@ -0,0 +1,19 @@
1
+ # Settings specified here will take precedence over those in config/environment.rb
2
+
3
+ # The production environment is meant for finished, "live" apps.
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Use a different logger for distributed setups
8
+ # config.logger = SyslogLogger.new
9
+
10
+
11
+ # Full error reports are disabled and caching is turned on
12
+ config.action_controller.consider_all_requests_local = false
13
+ config.action_controller.perform_caching = true
14
+
15
+ # Enable serving of images, stylesheets, and javascripts from an asset server
16
+ # config.action_controller.asset_host = "http://assets.example.com"
17
+
18
+ # Disable delivery errors if you bad email addresses should just be ignored
19
+ # config.action_mailer.raise_delivery_errors = false
@@ -0,0 +1,19 @@
1
+ # Settings specified here will take precedence over those in config/environment.rb
2
+
3
+ # The test environment is used exclusively to run your application's
4
+ # test suite. You never need to work with it otherwise. Remember that
5
+ # your test database is "scratch space" for the test suite and is wiped
6
+ # and recreated between test runs. Don't rely on the data there!
7
+ config.cache_classes = true
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.action_controller.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Tell ActionMailer not to deliver emails to the real world.
17
+ # The :test delivery method accumulates sent emails in the
18
+ # ActionMailer::Base.deliveries array.
19
+ config.action_mailer.delivery_method = :test