You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(6) |
Oct
(4) |
Nov
(3) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(2) |
Feb
(9) |
Mar
(5) |
Apr
(2) |
May
(8) |
Jun
|
Jul
|
Aug
(17) |
Sep
(14) |
Oct
(1) |
Nov
|
Dec
|
|
From: <ta...@us...> - 2010-10-20 14:43:50
|
Revision: 81
http://astor.svn.sourceforge.net/astor/?rev=81&view=rev
Author: tanches
Date: 2010-10-20 14:43:43 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
domain user support and samba shares support removed
Modified Paths:
--------------
branches/iscsi-only/app/controllers/application_controller.rb
branches/iscsi-only/app/controllers/portal_controller.rb
branches/iscsi-only/app/controllers/system_users_controller.rb
branches/iscsi-only/app/controllers/volume_controller.rb
branches/iscsi-only/app/models/lvm.rb
branches/iscsi-only/app/models/raid.rb
branches/iscsi-only/app/models/service.rb
branches/iscsi-only/app/views/portal/_menu.erb
branches/iscsi-only/app/views/portal/index.erb
branches/iscsi-only/app/views/raid/logical.rhtml
branches/iscsi-only/app/views/system_groups/list.rhtml
branches/iscsi-only/app/views/system_groups/show.rhtml
branches/iscsi-only/app/views/system_users/edit.rhtml
branches/iscsi-only/app/views/system_users/list.rhtml
branches/iscsi-only/app/views/system_users/show.rhtml
Modified: branches/iscsi-only/app/controllers/application_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/application_controller.rb 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/controllers/application_controller.rb 2010-10-20 14:43:43 UTC (rev 81)
@@ -84,9 +84,6 @@
end
- def fetch_fstab
- @fstab = params['fstab'] || Fstab.new
- end
def fetch_lvm
@lvm = params['lvm'] || LVM.new
Modified: branches/iscsi-only/app/controllers/portal_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/portal_controller.rb 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/controllers/portal_controller.rb 2010-10-20 14:43:43 UTC (rev 81)
@@ -124,10 +124,9 @@
def preprocess_disks
begin
- @prefetched['fstab'] = @fstab = Fstab.new
@prefetched['lvm'] = @lvm = LVM.new
@adapters = Raid.adapters(:full => 0,
- :fstab => @fstab, :lvm => @lvm)
+ :lvm => @lvm)
@adapters.each do |adapter|
adapter[:portal] = {
Modified: branches/iscsi-only/app/controllers/system_users_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/system_users_controller.rb 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/controllers/system_users_controller.rb 2010-10-20 14:43:43 UTC (rev 81)
@@ -90,7 +90,7 @@
@user = @pre unless @user
f = SystemGroupsController.filter_object(session, params)
@group_options, @group_filter = f.options(@pre && @pre.external? ? 'external' : 'local')
- @groups = f.filter_groups(@group_filter)
+ @groups = f.filter_groups(@group_filter)
end
def new
Modified: branches/iscsi-only/app/controllers/volume_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/volume_controller.rb 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/controllers/volume_controller.rb 2010-10-20 14:43:43 UTC (rev 81)
@@ -54,17 +54,6 @@
@vgs = lvm.vgs
@group_info = @vgs.find { |g| g.name == session['lvm_group_info'] } if session['lvm_group_info']
@lvs = lvm.lvs
- fstab = Fstab.new
- @lvs.each do |vol|
- if sh = fstab.find_by_device(vol.device) and sh.uuid
- class << vol
- def uuid
- @uuid
- end
- end
- vol.instance_variable_set :@uuid, sh.uuid
- end
- end
@include_javascript << 'volume_logic'
@min_size = Xfs::MIN_VOLUME_SIZE / 1024
end
Modified: branches/iscsi-only/app/models/lvm.rb
===================================================================
--- branches/iscsi-only/app/models/lvm.rb 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/models/lvm.rb 2010-10-20 14:43:43 UTC (rev 81)
@@ -135,47 +135,46 @@
end
def remove
- begin
- fstab = Fstab.new
- dev = fstab.find_by_device(device)
- fstab.del!(dev) if dev
- end
+# begin
+# fstab = Fstab.new
+# dev = fstab.find_by_device(device)
+# fstab.del!(dev) if dev
+# end
system "lvremove -f #{vg.name}/#{name}"
end
def resize(size)
return true if size == self.size
- fstab = Fstab.new
- vol = fstab.find_by_device(device)
+# fstab = Fstab.new
+# vol = fstab.find_by_device(device)
- if size > self.size
- io = IO.popen "lvresize -L #{size} #{vg.name}/#{name}", "w+"
- io.print "y\n"
- returning(!io.grep(/Logical volume #{name} successfully resized/).empty?) do |ok|
- raise "Failed to resize volume #{ name }" unless ok
- if ok && vol
- vol.grow
- end
- end
- else
+# if size > self.size
+# io = IO.popen "lvresize -L #{size} #{vg.name}/#{name}", "w+"
+# io.print "y\n"
+# returning(!io.grep(/Logical volume #{name} successfully resized/).empty?) do |ok|
+# raise "Failed to resize volume #{ name }" unless ok
+# if ok && vol
+# vol.grow
+# end
+# end
+# else
# for now we try to remount volume when shrinkin for every fs type
# fstab.remount takes care of devices without fstab entries
- err = nil
- fstab.remount(vol) do
- if vol
- err = "Failed to shrink fs on volume #{ name }" unless vol.shrink(size - 1)
- end
- unless err
+# err = nil
+# fstab.remount(vol) do
+# if vol
+# err = "Failed to shrink fs on volume #{ name }" unless vol.shrink(size - 1)
+# end
+# unless err
io = IO.popen "lvresize -L #{size} #{vg.name}/#{name}", "w+"
io.print "y\n"
err = "Failed to resize volume #{ name }" if io.grep(/Logical volume #{name} successfully resized/).empty?
- end
- end
+# end
+# end
raise err if err
- end
+# end
- Quotas.check_quotas(device)
end
end
@@ -196,19 +195,19 @@
end
def remove
- begin
- fstab = Fstab.new
- dev = fstab.find_by_device(device)
- fstab.del!(dev) if dev
- end
+# begin
+# fstab = Fstab.new
+# dev = fstab.find_by_device(device)
+# fstab.del!(dev) if dev
+# end
system "lvremove -f /dev/#{vg.name}/#{name}"
end
def resize(size)
return true if size == self.size
- fstab = Fstab.new
+# fstab = Fstab.new
- vol = fstab.find_by_device(device)|| device
+# vol = fstab.find_by_device(device)|| device
if size > self.size
io = IO.popen "lvresize -L #{size} #{vg.name}/#{name}", "w+"
@@ -293,13 +292,13 @@
dev = "/dev/#{vg.name}/#{a.first}"
fsdrv.create dev
# FIXME: if filesystem creation succeeds update /etc/fstab and mount the new volume
- fstab = Fstab.new
- returning fstab.add!(dev, nil, lvname) do |ok|
- if ok
- vol = fstab.find_by_device(dev)
- Quotas.create_files(vol.mount_point)
- end
- end
+# fstab = Fstab.new
+# returning fstab.add!(dev, nil, lvname) do |ok|
+# if ok
+# vol = fstab.find_by_device(dev)
+# Quotas.create_files(vol.mount_point)
+# end
+# end
end
end
@@ -312,8 +311,6 @@
if (a = `lvcreate -s -n '#{ lvname }' -L #{size} #{lv.device}`.collect { |s| s =~ e and $1 }.compact).empty?
raise "Can't create snapshot for #{lv.name} volume"
end
- fstab = Fstab.new
- fstab.add!("/dev/#{lv.vg.name}/#{a.first}", nil, lvname)
end
def refresh(options = nil)
@@ -326,36 +323,36 @@
c.module_eval { def to_s ; self.class.pretty_print self ; end }
end
- def unmount_volumes
- fstab = Fstab.new
- @lvs.each do |v|
- begin
- fstab.umount(v)
- end
- end
- end
+# def unmount_volumes
+# fstab = Fstab.new
+# @lvs.each do |v|
+# begin
+# fstab.umount(v)
+# end
+# end
+# end
- def mount_volumes
- fstab = Fstab.new
- @lvs.each do |v|
- begin
- fstab.mount(v)
- end
- end
- end
+# def mount_volumes
+# fstab = Fstab.new
+# @lvs.each do |v|
+# begin
+# fstab.mount(v)
+# end
+# end
+# end
def stop
return if status == :stopped
- begin
- unmount_volumes
- rescue
- mount_volumes
- raise 'ERROR: Failed to stop LVM'
- end
+# begin
+# unmount_volumes
+# rescue
+# mount_volumes
+# raise 'ERROR: Failed to stop LVM'
+# end
ok = @lvs.inject(true) { |b, l| b &&= system "lvchange -a n #{ l.vg.name }/#{ l.name }" }
unless _unload_modules
_restore_lvm
- mount_volumes
+# mount_volumes
raise 'ERROR: Failed to stop LVM'
end
end
@@ -370,7 +367,7 @@
b and lsmod !~ Regexp.compile(mod) || _unload_module(mod)
end
end
-
+
def _load_module(mod)
system "modprobe #{ mod }"
end
@@ -385,7 +382,7 @@
return if status == :running
raise 'ERROR: Failed to restart LVM' unless _load_modules
_restore_lvm
- mount_volumes
+# mount_volumes
end
def status
Modified: branches/iscsi-only/app/models/raid.rb
===================================================================
--- branches/iscsi-only/app/models/raid.rb 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/models/raid.rb 2010-10-20 14:43:43 UTC (rev 81)
@@ -88,7 +88,6 @@
services = {}
if options[:full]
services[:lvm] = options[:lvm] || LVM.new
- services[:fstab] = options[:fstab] || Fstab.new
end
adapters.each do |a|
_adapter(a, options)
@@ -328,18 +327,18 @@
def self.extend2(adapter, services = {})
adapter = extend(adapter, services[:lvm])
- fstab = services[:fstab] || Fstab.new
+# fstab = services[:fstab] || Fstab.new
+#
+# adapter[:logicals].each do |logical|
+# logical[:shares] = (logical[:lvs] + logical[:snapshots]).inject({}) do |hash, lv|
+# mountpoint = fstab.find_by_device(lv.device)
+# hash[lv] = {
+# :mountpoint => mountpoint,
+# }
+# hash
+# end
+# end
- adapter[:logicals].each do |logical|
- logical[:shares] = (logical[:lvs] + logical[:snapshots]).inject({}) do |hash, lv|
- mountpoint = fstab.find_by_device(lv.device)
- hash[lv] = {
- :mountpoint => mountpoint,
- }
- hash
- end
- end
-
adapter
end
Modified: branches/iscsi-only/app/models/service.rb
===================================================================
--- branches/iscsi-only/app/models/service.rb 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/models/service.rb 2010-10-20 14:43:43 UTC (rev 81)
@@ -42,8 +42,8 @@
end
def default_runlevel
- @default_runlevel ||= File.open('/etc/init/rc-sysinit.conf').grep(/^\s*env\s+DEFAULT_RUNLEVEL\s*=\s*(\d+)/).first =~ /(\d+)/ && $1.to_i
-# @default_runlevel ||= File.open('/etc/inittab').grep(/:initdefault:/).first =~ /id:(\d+):/ && $1.to_i
+# @default_runlevel ||= File.open('/etc/init/rc-sysinit.conf').grep(/^\s*env\s+DEFAULT_RUNLEVEL\s*=\s*(\d+)/).first =~ /(\d+)/ && $1.to_i
+ @default_runlevel ||= File.open('/etc/inittab').grep(/:initdefault:/).first =~ /id:(\d+):/ && $1.to_i
end
def enabled?
Modified: branches/iscsi-only/app/views/portal/_menu.erb
===================================================================
--- branches/iscsi-only/app/views/portal/_menu.erb 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/views/portal/_menu.erb 2010-10-20 14:43:43 UTC (rev 81)
@@ -16,7 +16,6 @@
<% end %>
<% menu.item( _("Services") ) do | sv | %>
<%= sv.item( _("NTP service"), "ntp_service" ) %>
- <%= sv.item( _("SMB service"), "daemon_samba" ) %>
<% end %>
<% menu.item(_("Networking")) do |net| %>
<% @cards.each do |card| %>
Modified: branches/iscsi-only/app/views/portal/index.erb
===================================================================
--- branches/iscsi-only/app/views/portal/index.erb 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/views/portal/index.erb 2010-10-20 14:43:43 UTC (rev 81)
@@ -30,6 +30,8 @@
<%= applet({ :controller => 'account_portal', :action => 'signup' }, :viewport => 'signup', :class => 'wide') %>
+ <%= render :partial => 'monitoring' %>
+
<%= render :partial => 'networking' %>
</div>
Modified: branches/iscsi-only/app/views/raid/logical.rhtml
===================================================================
--- branches/iscsi-only/app/views/raid/logical.rhtml 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/views/raid/logical.rhtml 2010-10-20 14:43:43 UTC (rev 81)
@@ -80,24 +80,19 @@
<% minimum_size = 16 ; maximum_size = free %>
<ul class="volumes">
+ <% p @logical[:lvs]%>
<% if @logical[:lvs] %>
<% @logical[:lvs].each do |lv| %>
- <% shares = @logical[:shares][lv] %>
<% form_id = "lv_#{lv.name}" %>
<li>
+
+ <script type="text/javascript">
+ $(function() { bind_slider('<%= form_id %>', 0, 0); } );
+ </script>
+
<a href="#" id="a_<%= form_id %>" class="lvToggle viewportToggle" title="<%= _('volume') %>"><%= lv['name'].blank? ? lv.name : lv['name'] %></a>
- <% if shares[:mountpoint] && shares[:mountpoint].free %>
- <% vol = shares[:mountpoint] %>
- <%= gauge(:value => vol.allocated, :max => vol.total,
- :text => sprintf("%.2fGB", vol.total / 1024), :class => ['green', 'lvsize'],
- :title => _("fs total : %{total}, fs occupied : %{occupied}, fs available : %{available}") % {
- :total=> sprintf("%.2fGB", vol.total / 1024),
- :available=> sprintf("%.2fGB", vol.free / 1024),
- :occupied => sprintf("%.2fGB", vol.allocated / 1024)
- }) %>
- <% else %>
+
<%= gauge(:value => 0, :text => "???", :title => _("???"), :class => ['green', 'lvsize']) %>
- <% end %>
<% form_tag(url_for('controller' => 'raid', 'action' => 'update_lv'), :id => form_id, :class => "lvForm #{ @lvname == lv.name ? '' : 'hidden' }") do %>
@@ -135,76 +130,12 @@
<br>
<% end %>
- <% form_tag(url_for(:controller => 'raid', 'action' => 'samba_apply'), :id => "samba_#{ form_id }", :class => 'lvForm hidden') do %>
- <% samba = shares[:samba] %>
- <%= hidden_field_tag 'raid', @logical[:num] %>
- <%= hidden_field_tag 'driver', @logical[:adapter][:driver] %>
- <%= hidden_field_tag 'num', @logical[:adapter][:num] %>
- <%= hidden_field_tag 'lvname', lv.name %>
- <%= label_tag 'enabled', _('Sharing is') %>
- <%= radio_button_tag 'enabled', 'true', samba && samba.enabled? %><%= _('on') %>
- <%= radio_button_tag 'enabled', '', !samba || !samba.enabled? %><%= _('off') %>
- <%= label_tag 'name', _('Share name') %>
- <%= text_field_tag 'name', samba ? samba.name : lv['name'].blank? ? lv.name : lv['name'] %>
- <%= label_tag 'comment', _('Share comment') %>
- <%= text_field_tag 'comment', samba ? samba['comment'] : lv['comment'] %>
- <br class='clear' />
- <%= label_tag 'writable', _('Options') %>
- <%= check_box_tag 'writable', 'yes', samba && samba['writable'] %><%= _('writable') %>
- <%= check_box_tag 'public', 'yes', samba && samba['public'] %><%= _('public') %>
- <%= label_tag 'allowed_users', _('Allowed users') %>
- <fieldset class='mover'>
- <% valid_users = samba ? samba.valid_users.delete_if {|a| a == "nobody"} : [] %>
- <% users = @users.collect { |user| user.name } %>
- <%= select_tag('available_users', options_for_select(users - valid_users), :multiple => true, :size => 7, :class => 'left') %>
- <%= select_tag('valid_users', options_for_select(valid_users), :multiple => true, :size => 7, :class => 'right') %>
- <div class='buttons'>
- <button type="button">
- ←
- </button>
- <button type="button">
- ⇇
- </button>
- <button type="button">
- ⇉
- </button>
- <button type="button">
- →
- </button>
- </div>
- </fieldset>
- <%= label_tag 'allowed_groups', _('Allowed groups') %>
- <fieldset class='mover'>
- <% valid_groups = samba ? samba.valid_groups : [] %>
- <% groups = @groups.collect { |group| group.name } %>
- <%= select_tag('available_groups', options_for_select(groups - valid_groups), :multiple => true, :size => 7, :class => 'left') %>
- <%= select_tag('valid_groups', options_for_select(valid_groups), :multiple => true, :size => 7, :class => 'right') %>
- <div class='buttons'>
- <button type="button">
- ←
- </button>
- <button type="button">
- ⇇
- </button>
- <button type="button">
- ⇉
- </button>
- <button type="button">
- →
- </button>
- </div>
- </fieldset>
- <%= submit_tag _('Apply') %>
- <% end %>
-
- </li>
- <script type="text/javascript">
- $(function() { bind_slider('<%= form_id %>',
- <%= shares[:mountpoint] && shares[:mountpoint].prohibits_shrink? ? lv.size : minimum_size %>,
- <%= shares[:mountpoint] && shares[:mountpoint].prohibits_grow? ? lv.size : lv.size + @logical[:vg].free %>);
- });
- </script>
+
+
+ </li>
+
+
<% end %>
<% end %>
<% if @logical[:state] == 'normal' %>
@@ -244,7 +175,6 @@
<br />
<ul class='snapshots'>
<% @logical[:snapshots].each do |lv| %>
- <% shares = @logical[:shares][lv] %>
<% form_id = "lv_#{lv.name}" %>
<li>
<a name="<%= "anchor_#{form_id}" %>" />
@@ -252,70 +182,9 @@
<%= gauge(:value => lv.allocated, :class => ['orange', 'snapsize']) %>
- <a href="#" id="a_samba_<%= form_id %>" class="sambaToggle service"><%= _('samba') %> <%= shares[:samba] && shares[:samba].enabled? ? _('on') : _('off') %></a>
- <% form_tag(url_for(:controller => 'raid', 'action' => 'samba_apply'), :id => "samba_#{ form_id }", :class => 'lvForm hidden') do %>
- <% samba = shares[:samba] %>
- <%= hidden_field_tag 'raid', @logical[:num] %>
- <%= hidden_field_tag 'driver', @logical[:adapter][:driver] %>
- <%= hidden_field_tag 'num', @logical[:adapter][:num] %>
- <%= hidden_field_tag 'lvname', lv.name %>
- <%= label_tag 'enabled', _('Sharing is') %>
- <%= radio_button_tag 'enabled', 'true', samba && samba.enabled? %><%= _('on') %>
- <%= radio_button_tag 'enabled', '', !samba || !samba.enabled? %><%= _('off') %>
- <%= label_tag 'name', _('Share name') %>
- <%= text_field_tag 'name', samba ? samba.name : lv['name'].blank? ? lv.name : lv['name'] %>
- <%= label_tag 'comment', _('Share comment') %>
- <%= text_field_tag 'comment', samba ? samba['comment'] : lv['comment'] %>
- <br class='clear' />
- <%= label_tag 'writable', _('Options') %>
- <%= check_box_tag 'writable', 'yes', samba && samba['writable'] %><%= _('writable') %>
- <%= check_box_tag 'public', 'yes', samba && samba['public'] %><%= _('public') %>
- <%= label_tag 'allowed_users', _('Allowed users') %>
- <fieldset class='mover'>
- <% valid_users = samba ? samba.valid_users : [] %>
- <% users = @users.collect { |user| user.name } %>
- <%= select_tag('available_users', options_for_select(users - valid_users), :multiple => true, :size => 7, :class => 'left') %>
- <%= select_tag('valid_users', options_for_select(valid_users), :multiple => true, :size => 7, :class => 'right') %>
- <div class='buttons'>
- <button type="button">
- ←
- </button>
- <button type="button">
- ⇇
- </button>
- <button type="button">
- ⇉
- </button>
- <button type="button">
- →
- </button>
- </div>
- </fieldset>
- <%= label_tag 'allowed_groups', _('Allowed groups') %>
- <fieldset class='mover'>
- <% valid_groups = samba ? samba.valid_groups : [] %>
- <% groups = @groups.collect { |group| group.name } %>
- <%= select_tag('available_groups', options_for_select(groups - valid_groups), :multiple => true, :size => 7, :class => 'left') %>
- <%= select_tag('valid_groups', options_for_select(valid_groups), :multiple => true, :size => 7, :class => 'right') %>
- <div class='buttons'>
- <button type="button">
- ←
- </button>
- <button type="button">
- ⇇
- </button>
- <button type="button">
- ⇉
- </button>
- <button type="button">
- →
- </button>
- </div>
- </fieldset>
- <%= submit_tag _('Apply') %>
- <% end %>
-
+
+
</li>
<script type="text/javascript">
$(function() { bind_slider('<%= form_id %>', <%= minimum_size %>, <%= lv.size + @logical[:vg].free %>); });
Modified: branches/iscsi-only/app/views/system_groups/list.rhtml
===================================================================
--- branches/iscsi-only/app/views/system_groups/list.rhtml 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/views/system_groups/list.rhtml 2010-10-20 14:43:43 UTC (rev 81)
@@ -18,7 +18,6 @@
<div class='barshelp'>
<span class='hint'><%= _('Group icons explained:') %></span>
- <pre class='glued'><span class='domaingroupbar'>domain group</span></pre>
<pre class='glued'><span class='groupbar'>local group</span></pre>
<pre class='glued'><span class='systemgroupbar'>local system group</span></pre>
</div>
Modified: branches/iscsi-only/app/views/system_groups/show.rhtml
===================================================================
--- branches/iscsi-only/app/views/system_groups/show.rhtml 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/views/system_groups/show.rhtml 2010-10-20 14:43:43 UTC (rev 81)
@@ -40,7 +40,10 @@
<%= submit_tag('Apply') %>
<% end %>
<% end %>
- <div class='barshelp'><span class='hint'><%= _('User icons explained:') %></span> <pre class='glued'><span class='domainuserbar'>domain user</span></pre> <pre class='glued'><span class='userbar'>local user</span></pre> <pre class='glued'><span class='systembar'>local system user</span></pre></div>
+ <div class='barshelp'><span class='hint'><%= _('User icons explained:') %></span>
+ <pre class='glued'><span class='userbar'>local user</span></pre>
+ <pre class='glued'><span class='systembar'>local system user</span></pre>
+ </div>
<% unless @pre.external? %>
</fieldset></li>
<li><%= _('Or you may choose to ') %><%= link_to image_tag('erase.png') + _(' delete this group'), :action => :delete, :id => @pre.id %>.</li>
Modified: branches/iscsi-only/app/views/system_users/edit.rhtml
===================================================================
--- branches/iscsi-only/app/views/system_users/edit.rhtml 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/views/system_users/edit.rhtml 2010-10-20 14:43:43 UTC (rev 81)
@@ -35,15 +35,17 @@
<%= _('The following groups have the user as a memeber') %><br /><span class='hint'><%= sprintf _('(click on %1$s icon to the right of the group remove the user from it)'), image_tag('remove.png') %></span>
<div class='bars'>
<% (@pre.groups.sort { |a, b| a.undecorate <=> b.undecorate }).each do |g| %>
- <pre class='glued'><%= link_to(g.undecorate, { :controller => 'system_groups', :action => :show, :anchor => 'users', :id => g.id }, :another_viewport => true, :class => (g.system? ? 'systemgroup' : g.external? ? 'domaingroup' : 'group') + 'bar') %><%= link_to((image_tag 'remove.png'), { :action => :remove_group, :id => @pre.id, :gid => g.id }, :class => 'glue_right') %></pre>
+ <pre class='glued'><%= link_to(g.undecorate, { :controller => 'system_groups', :action => :show, :anchor => 'users', :id => g.id }, :another_viewport => true, :class => (g.system? ? 'systemgroup' : 'group') + 'bar') %><%= link_to((image_tag 'remove.png'), { :action => :remove_group, :id => @pre.id, :gid => g.id }, :class => 'glue_right') %></pre>
<% end %>
</div>
<br />
<% end %>
<span class=hint><%= sprintf _('Click on %1$s icon to add user to one of the following groups.'), image_tag('add.png') %> </span>
<div class="bars">
+
+
<% @groups.delete_if { |f| @pre.groups.include? f or f == @pre.primary_group }.sort { |a, b| a.undecorate <=> b.undecorate }.each do |g| %>
- <pre class='glued'><%= link_to(g.undecorate, { :controller => 'system_groups', :action => :show, :anchor => 'users', :id => g.id }, :another_viewport => true, :class => (g.system? ? 'systemgroup' : g.external? ? 'domaingroup' : 'group') + 'bar') %><%= link_to((image_tag 'add.png'), { :action => :add_group, :id => @pre.id, :gid => g.id }, :class => 'glue_right') %></pre>
+ <pre class='glued'><%= link_to(g.undecorate, { :controller => 'system_groups', :action => :show, :anchor => 'users', :id => g.id }, :another_viewport => true, :class => (g.system? ? 'systemgroup' : 'group') + 'bar') %><%= link_to((image_tag 'add.png'), { :action => :add_group, :id => @pre.id, :gid => g.id }, :class => 'glue_right') %></pre>
<% end %>
</div>
<% form_tag(:action => :filter_groups, :id => @pre.id, :anchor => 'groups') do %>
Modified: branches/iscsi-only/app/views/system_users/list.rhtml
===================================================================
--- branches/iscsi-only/app/views/system_users/list.rhtml 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/views/system_users/list.rhtml 2010-10-20 14:43:43 UTC (rev 81)
@@ -17,7 +17,10 @@
<%= select_tag('filter', options_for_select( @options, @filter)) %>
<%= submit_tag('Apply') %>
<% end %><br class='clear'/>
- <div class='barshelp'><span class='hint'><%= _('User icons explained:') %></span> <pre class='glued'><span class='domainuserbar'>domain user</span></pre> <pre class='glued'><span class='userbar'>local user</span></pre> <pre class='glued'><span class='systembar'>local system user</span></pre></div>
+ <div class='barshelp'><span class='hint'><%= _('User icons explained:') %></span>
+ <pre class='glued'><span class='userbar'>local user</span></pre>
+ <pre class='glued'><span class='systembar'>local system user</span></pre>
+ </div>
</div>
<% unless session['passwd_user_filter'] == 'external' %>
Modified: branches/iscsi-only/app/views/system_users/show.rhtml
===================================================================
--- branches/iscsi-only/app/views/system_users/show.rhtml 2010-09-22 13:32:14 UTC (rev 80)
+++ branches/iscsi-only/app/views/system_users/show.rhtml 2010-10-20 14:43:43 UTC (rev 81)
@@ -15,7 +15,10 @@
<%= link_to(g.undecorate, { :controller => 'system_groups', :action => :show, :id => g.id }, :another_viewport => true, :class => (g.system? ? 'systemgroup' : g.external? ? 'domaingroup' : 'group') +'bar') %>
<% end %>
</div>
- <div class='barshelp'><span class='hint'><%= _('Group icons explained:') %></span> <pre class='glued'><span class='domaingroupbar'>domain group</span></pre> <pre class='glued'><span class='groupbar'>local group</span></pre> <pre class='glued'><span class='systemgroupbar'>local system group</span></pre></div>
+ <div class='barshelp'><span class='hint'><%= _('Group icons explained:') %></span>
+ <pre class='glued'><span class='groupbar'>local group</span></pre>
+ <pre class='glued'><span class='systemgroupbar'>local system group</span></pre>
+ </div>
<% end %>
<% unless @user.external? %>
<%= _('You may choose to ') %>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ta...@us...> - 2010-09-22 13:32:22
|
Revision: 80
http://astor.svn.sourceforge.net/astor/?rev=80&view=rev
Author: tanches
Date: 2010-09-22 13:32:14 +0000 (Wed, 22 Sep 2010)
Log Message:
-----------
removed stale/no longer used files
Modified Paths:
--------------
branches/iscsi-only/app/models/service.rb
Removed Paths:
-------------
branches/iscsi-only/app/controllers/samba_controller.rb
branches/iscsi-only/app/controllers/security_controller.rb
branches/iscsi-only/app/models/domain_group.rb
branches/iscsi-only/app/models/domain_user.rb
branches/iscsi-only/app/models/samba.rb
branches/iscsi-only/app/models/winbind.rb
Deleted: branches/iscsi-only/app/controllers/samba_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/samba_controller.rb 2010-09-22 13:10:25 UTC (rev 79)
+++ branches/iscsi-only/app/controllers/samba_controller.rb 2010-09-22 13:32:14 UTC (rev 80)
@@ -1,59 +0,0 @@
-# Astor - network attached storage configurable via Web-interface
-# Copyright (C) 2009 ETegro Technologies, PLC
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-class SambaController < ApplicationController
-
- init_gettext controller_name
-
- DEFAULT_TAGS = [N_('services')]
- DESCRIPTION = N_("SMB service")
- ICON = "samba"
-
- def index
- @smb = Samba.new
- @wb = Winbind.new
- end
-
- def status
- i = params['meta_refresh'].to_i
- @meta_refresh = i > 0 ? i : 5
- @smb = Samba.new
- end
-
- def save
- begin
- @smb = Samba.new
- @wb = Winbind.new
- opts = [ "workgroup", "server string" ]
- params['workgroup'].blank? and opts.delete 'workgroup'
-
- @wb.enabled = @smb.enabled = params['enabled'] == 'on' if ['on', 'off'].include? params['enabled']
- opts.each { |v| @smb[v] = params[v] }
- if params['share'].blank?
- @smb.security = 'user' if @smb.security == 'share'
- else
- @smb.security = 'share' if @smb.security == 'user'
- end
- @smb.sync
- @smb.restart if @smb.enabled?
- flash[:success] = _('Service setting saved')
- rescue
- flash[:error] = $!
- end
- redirect_to :action => 'index'
- end
-
-end
Deleted: branches/iscsi-only/app/controllers/security_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/security_controller.rb 2010-09-22 13:10:25 UTC (rev 79)
+++ branches/iscsi-only/app/controllers/security_controller.rb 2010-09-22 13:32:14 UTC (rev 80)
@@ -1,159 +0,0 @@
-# Astor - network attached storage configurable via Web-interface
-# Copyright (C) 2009 ETegro Technologies, PLC
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-class SecurityController < ApplicationController
-
- init_gettext controller_name
-
- DEFAULT_TAGS = [N_('security')]
- DESCRIPTION = N_("Security and authentication")
- ICON = "security"
-
- def index
- advanced
- end
-
- def advanced
- begin
- smb = Samba.new
- @security = [ 'security', 'workgroup', 'realm', 'password server', 'kdc', 'domain' ].inject({}) { |h, o| h[o] = smb[o] ; h }
- auth_serv = @security['password server']
- if auth_serv && auth_serv.include?(':')
- a = auth_serv.split(':')
- @security['port'] = a.last
- @security['password server'] = a.first
- elsif auth_serv
- @security['port'] = Samba::LDAP_PORT
- end
- rescue
- flash[:errors] = $!.to_s
- end
- end
-
- def advanced_save
- @advanced = params['advanced']
- begin
- if !params['password server'].blank? && params['port'] && (i = params['port'].to_i) > 0 && i != Samba::LDAP_PORT
- params['password server'] = "#{ params['password server'] }:#{ params['port'] }"
- end
- do_save
- flash[:success] = _('Security settings saved')
- redirect_to :action => 'index'
- rescue
- flash[:error] = $!.to_s
- index
- render :action => 'index'
- end
- end
-
- def enter
- old = Samba.new
- smb = Samba.new
- net = Networking.new
- info = Samba.domain_info(params['workgroup'])
- [ 'workgroup', 'realm', 'password server' ].inject({}) do |h, o|
- h[o] = params[o].blank? ? info[o] : params[o]
- h
- end.each do |k, v|
- smb[k] = v
- end
- if smb['password server'].blank?
- raise _('Failed to autodetect domain configuration. Use advaced tab.')
- end
- smb.security = params['security']
- smb.sync
- smb.restart
-
- names = [ net.hostname, net.domain_name ]
-
- net = Networking.new
- dom = params['domain'].blank? ? info['domain'] : params['domain']
- net.set_hostname(net.hostname, dom)
-
- begin
- smb.enter_domain(params['account'], params['password'], (params['kdc'].blank? ? info['kdc'] : params['kdc']), dom)
- rescue Exception => e
- net.set_hostname *names
- old.sync
- old.restart
- raise e
- end
-
- # TODO: the following fragment tries to set ACLs/user permissions according to
- # the change of user database; this area has to be invetigated more throughly
- Winbind.new.restart
- wb = Winbind.new
- user = wb.admin_user
- group = wb.admin_group
- raise _("Joined domain, but failed to set share owner to domain admin") if user.blank? or group.blank?
- smb = Samba.new
- smb.shares.each { |s| s['valid users'] = "\"#{user}\" \"@#{group}\"" }
- smb.sync
- smb.restart
- err = nil
- smb.shares.each do |s|
- begin
- FileUtils.chown(user, group, s['path'])
- rescue
- err = $!
- end
- end
- raise _("Error when setting permissions") if err
- end
-
- def leave
- smb = Samba.new
- smb.leave_domain params['account'], params['password'], params['force']
- smb.security = 'user'
- smb.sync
- smb.restart
- Winbind.new.restart
- err = nil
- smb.shares.each do |s|
- begin
- FileUtils.chown(PasswdUser.default, PasswdGroup.default, s['path']) and FileUtils.chmod(0775, s['path'])
- rescue
- end
- end
- raise _("Error when setting permissions") if err
- end
-
- def do_save
- smb = Samba.new
- case params['security']
- when 'user'
- leave if smb.in_domain?
- when 'domain'
- params['security'] = 'ads'
- enter unless smb.in_domain?
- end
- end
-
- def save
- @advanced = params['advanced']
- begin
- do_save
- flash[:success] = _('Security settings saved')
- redirect_to :action => 'index'
- rescue
- flash[:error] = $!.to_s
- index
- render :action => 'index'
- end
- end
-
-end
-
Deleted: branches/iscsi-only/app/models/domain_group.rb
===================================================================
--- branches/iscsi-only/app/models/domain_group.rb 2010-09-22 13:10:25 UTC (rev 79)
+++ branches/iscsi-only/app/models/domain_group.rb 2010-09-22 13:32:14 UTC (rev 80)
@@ -1,89 +0,0 @@
-# Astor - network attached storage configurable via Web-interface
-# Copyright (C) 2009 ETegro Technologies, PLC
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-class DomainGroup
-
- attr_accessor :name, :users, :gid, :sid, :external, :system, :enabled
-
- alias_method :system?, :system
- alias_method :external?, :external
-
- def initialize
- @users = []
- @external = true
- @system = false
- @enabled = true
- @undecorated = nil
- end
-
- @@groups = nil
-
- def undecorate
- @undecorated
- end
-
- attr_writer :undecorated
-
- def self.groups
- @@groups = nil
- end
-
- def self.find(which = :all, &condition)
- fetch_all
- unless which.is_a? Symbol
- id = which
- which = :first
- end
- case which
- when :all
- @@groups
- when :first
- group = nil
- if id
- group = @@groups.find { |f| f.gid == id.to_s }
- raise "No group found with gid #{id}" unless user
- elsif condition
- group = @@groups.find &condition
- else
- group = users[0]
- end
- group
- end
- end
-
- def self.fetch_all
- group_fields = [ nil, nil, :gid ]
- sepa = Samba.new['winbind separator']
- repl = Samba::WINBIND_SPACE_REPLACEMENT
- name = Networking.new.hostname
- patt = "#{ name }#{ sepa }".upcase
- builtin = "BUILTIN#{ sepa }".upcase
- @@groups = `wbinfo -g`.split("\n").collect do |g|
- next if g.upcase.starts_with?(patt) or g.upcase.starts_with?(builtin)
- domain, name = g.split(sepa)
- group = DomainGroup.new
- group.undecorated = g
- group.name = "#{ domain }#{ sepa }#{ name.gsub(' ', repl) }"
- # attrs = `wbinfo --group-info='#{ group.undecorate }'`.chomp.split(":")
- # (0 .. attrs.size-1).each { |i| group.send("#{group_fields[i]}=".to_sym, attrs[i]) if group_fields[i] }
- # group.sid = `wbinfo -G #{ group.gid }`
- # group.users = users.find_all { |user| user.groups.include?(group.gid) }
- group
- end.compact
- end
-
-end
-
Deleted: branches/iscsi-only/app/models/domain_user.rb
===================================================================
--- branches/iscsi-only/app/models/domain_user.rb 2010-09-22 13:10:25 UTC (rev 79)
+++ branches/iscsi-only/app/models/domain_user.rb 2010-09-22 13:32:14 UTC (rev 80)
@@ -1,94 +0,0 @@
-# Astor - network attached storage configurable via Web-interface
-# Copyright (C) 2009 ETegro Technologies, PLC
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-class DomainUser
-
- attr_accessor :name, :shell, :passwd, :uid, :long_name, :gid, :home,
- :sid, :groups, :external, :system, :enabled, :primary_group
-
- alias_method :system?, :system
- alias_method :external?, :external
-
- def initialize
- @groups = []
- @external = true
- @system = false
- @enabled = true
- @undecorated = nil
- end
-
- def undecorate
- @undecorated
- end
-
- attr_writer :undecorated
-
- @@groups = nil
- @@users = nil
-
- def self.find(which = :all, &condition)
- fetch_all
- unless which.is_a? Symbol
- id = which
- which = :first
- end
- case which
- when :all
- @@users
- when :first
- user = nil
- if id
- user = @@users.find { |f| f.uid == id.to_s }
- raise "No user found with uid #{id}" unless user
- elsif condition
- user = @@users.find &condition
- else
- user = @@users[0]
- end
- user
- end
- end
-
- def self.groups
- @@groups
- end
-
- def self.users
- @@users
- end
-
- def self.fetch_all
- user_fields = [ nil, nil, :uid, :gid, :long_name, :home, :shell ]
- sepa = Samba.new['winbind separator']
- repl = Samba::WINBIND_SPACE_REPLACEMENT
- name = Networking.new.hostname
- patt = "#{ name }#{ sepa }".upcase
- @@users = `wbinfo -u`.split.collect do |u|
- next if u.upcase.starts_with? patt
- domain, name = u.split(sepa)
- user = DomainUser.new
- user.undecorated = u
- user.name = "#{ domain}#{ sepa }#{ name.gsub(' ', repl) }"
- attrs = `wbinfo -i '#{ user.undecorate }'`.chomp.split(":")
- (0 .. attrs.size-1).each { |i| user.send("#{user_fields[i]}=".to_sym, attrs[i]) if user_fields[i] }
- # user.sid = `wbinfo -U #{ user.uid }`;
- # user.groups = `wbinfo -r '#{ user.name }'`.split
- user
- end.compact
- end
-
-end
-
Deleted: branches/iscsi-only/app/models/samba.rb
===================================================================
--- branches/iscsi-only/app/models/samba.rb 2010-09-22 13:10:25 UTC (rev 79)
+++ branches/iscsi-only/app/models/samba.rb 2010-09-22 13:32:14 UTC (rev 80)
@@ -1,394 +0,0 @@
-# Astor - network attached storage configurable via Web-interface
-# Copyright (C) 2009 ETegro Technologies, PLC
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-class Samba
-
- SMB_CONFIG = '/etc/samba/smb.conf'
-
- include Service
-
- def service
- "samba"
- end
-
- def status
- system("smbcontrol nmbd ping") ? :running : :not_running
- end
-
- def self.reload
- system "smbcontrol smbd reload-config"
- end
-
- def reload
- Samba.reload
- end
-
- WINBIND_SPACE_REPLACEMENT = '_'
- WINBIND_DEFAULT_SEPARATOR = '\\'
-
- DEFAULT_OPTIONS = {
- "workgroup" => "WORKGROUP",
- "security" => "user",
- }
-
- STRONG_OPTIONS = {
- "unix extensions" => "no",
- "printcap name" => "/dev/null",
- "load printers" => "no",
- "printing" => "bsd",
- "disable spoolss" => "yes",
- "log file" => "/var/log/samba/log.%m",
- "max log size" => "50",
- "encrypt passwords" => "yes",
- "smb passwd file" => "/etc/samba/smbpasswd",
- "winbind uid" => "10000-20000",
- "winbind gid" => "10000-20000",
- "winbind enum users" => "yes",
- "winbind enum groups" => "yes",
- "winbind normalize names" => "yes",
- "template homedir" => "/tmp",
- "template shell" => "/bin/false",
- "socket options" => "TCP_NODELAY",
- "use sendfile" => "yes",
- "preferred master" => "no",
- "dns proxy" => "no",
- "lanman auth" => "yes",
- "log level" => "3",
- "enable privileges" => "yes",
- }
-
- LDAP_PORT = 389
-
- class Share
-
- attr_accessor :name, :restricted
-
- DEFAULT_OPTIONS = {
- }
-
- STRONG_OPTIONS = {
- }
-
- def initialize(name, options)
- @name = name
- @enabled = !options.delete(:disabled)
- @restricted = options.delete(:restricted)
- @options = options
- DEFAULT_OPTIONS.each { |k,v| @options[k] ||= v }
- @shadow = @options.dup
- @public = @options['public']
- end
-
- def [](key)
- key == 'name' ? @name : @options[key]
- end
-
- def []=(key, value)
- key == 'name' ? @name = value : @options[key] = value
- end
-
- def apply_strong_options
- @options.merge! STRONG_OPTIONS
- end
-
- def valid_users
- return [] if @options['valid users'].blank?
- returning [] do |ary|
- while m = (m || @options['valid users'].match(/^/)).post_match.match(/"(@)?([^"]+)"/) do
- ary << $2 unless $1
- end
- end
- end
-
- def valid_groups
- return [] if @options['valid users'].blank?
- returning [] do |ary|
- while m = (m || @options['valid users'].match(/^/)).post_match.match(/"(@)?([^"]+)"/) do
- ary << $2 if $1
- end
- end
- end
-
- def users_groups(users, groups)
- @options['valid users'] = ((users || []) + (groups || []).collect { |group| "@#{ group }" }).collect { |principal| "\"#{principal}\"" }.join(" ")
- end
-
- def to_s
- pref = @restricted ? ';@#$ ' : @enabled ? "" : "; "
- pref + "[#{@name}]\n" + @options.collect { |k, v| v ? "#{pref}\t#{k} = #{v}" : "" }.join("\n")
- end
-
- def enabled
- @enabled && !@restricted
- end
-
- def enabled?
- enabled
- end
-
- def enabled=(val)
- @enabled = val
- @restricted = false
- end
-
- def Share.create_default(name, options)
- Share.new name, options.merge(DEFAULT_OPTIONS)
- end
-
- def apply_security_options(security)
- case security
- when 'user', 'ads', 'domain'
- @options['guest only'] = nil
- @options['valid users'] = nil unless @options['public'].blank?
- when 'share'
- @options['guest only'] = @options['public'] ? 'yes' : nil
- end
- end
-
- def restart
- system "smbcontrol smbd close-share '#{ @name }'" and Samba.reload
- end
- end
-
- attr_accessor :shares, :options, :security
-
- def _reread(fname)
- lines = []
- File.open fname do |f|
- r = /^([^\t #].*)/;
- lines = f.readlines.collect { |l| l.chomp.strip =~ r and $1.chomp }.compact
- end
- r_div = /\[(.*)\]/
- r_opt = /^([^=]+)\s*=\s*(.*)$/
- lines.inject [ {}, {}, nil ] do |s, l|
- if restricted = (a = l.split(';@#$') and a.size > 1 and a.first.strip.empty?)
- l = a[1]
- elsif disabled = (a = l.split(";") and a.size > 1 and a.first.strip.empty?)
- l = a[1]
- end
- if l =~ r_div
- if $1 == 'global'
- s[-1] = s.first
- else
- raise "Share #{$1} defined already" if s[1].include? $i
- s[1][$1] = s[-1] = {}
- end
- elsif l =~ r_opt
- s.last[$1.strip] = $2.strip if s.last
- unless $1 == 'global'
- if disabled
- s.last[:disabled] = true
- elsif restricted
- s.last[:restricted] = true
- end
- end
- end
- s
- end.slice 0..1
- end
-
- def reread
- @options, sh_hashes = _reread SMB_CONFIG
- DEFAULT_OPTIONS.each { |k,v| @options[k] ||= v }
- @shares = sh_hashes.inject([]) { |a, b| a << Share.new(b.first, b.last) ; a }
- @shadow = @options.dup
- @security = @options['security']
- end
-
- def initialize
- reread
- # override the option by explicitly setting it
- @options['winbind separator'] = WINBIND_DEFAULT_SEPARATOR
- end
-
- def to_s
- "[global]\n" + @options.collect { |k, v| v ? "\t#{k} = #{v}" : "" }.join("\n") + "\n\n" + @shares.collect { |v| v.to_s }.join("\n\n")
- end
-
- def sync
- @options.merge! STRONG_OPTIONS
- @shares.each { |s| s.apply_strong_options ; s.apply_security_options(@security) }
- apply_security_options
- #override the options by removing it; samba will use sane defaults that we expect
- @options.delete 'winbind separator'
- File.open SMB_CONFIG, "w" do |f|
- f.write "#{ self.to_s }\n"
- end
- end
-
- def [](key)
- key == 'kdc' ? Samba.kdc : key =='domain' ? domain : @options[key]
- end
-
- def []=(key, value)
- @options[key] = value
- end
-
- def smbstatus
- `smbstatus`.split("\n")[2..-1].join("\n")
- end
-
- def enter_domain(login, password, kdc, domain)
- auth_serv = @options['password server'].split(':').first
- realm = @options['realm']
- File.open('/etc/krb5.conf', 'w') do |f|
- f << <<EOF
-[libdefaults]
- default_realm = #{ realm }
-[realms]
- #{ realm } = {
- kdc = #{ kdc }
- }
-[domain_realms]
- .#{ domain } = #{ realm }
- #{ domain } = #{ realm }
-EOF
- end
- Samba.update_time(auth_serv)
- returning system("net ads join -U '#{ login }%#{ password }'") do |result|
- if result
- wb = Winbind.new
- wb.restart
- admin_user, admin_group = wb.defaults
- system "net rpc rights -U '#{ login }%#{ password }' grant '#{ admin_group }' SeRestorePrivilege SeTakeOwnershipPrivilege"
- else
- raise "Failed to enter domain #{ @options['workgroup'] } as #{ login }"
- end
- end
- end
-
- def self.kdc
- begin
- l = File.open('/etc/krb5.conf').readlines.grep(/kdc = /).first
- l = l && l.split('=').last.strip || ''
- rescue
- l = ''
- end
- l
- end
-
- def domain
- begin
- l = File.open('/etc/krb5.conf').readlines.grep(/ = #{ @options['realm']}$/).select { |s| !s.index('default_realm = ') }.first
- if l
- l = l.split('=').first.strip
- l.index('.') == 0 ? l[1..-1] : l
- end
- rescue
- l = ''
- end
- end
-
- def leave_domain(login, password, force = false)
- begin
- Samba.update_time(@options['password server'].split(':').first)
- rescue
- # try to continue event when time fetching has failed
- end
- wb = Winbind.new
- admin_user, admin_group = wb.defaults
- system "net rpc rights -U '#{ login }%#{ password }' revoke '#{ admin_group }' SeRestorePrivilege SeTakeOwnershipPrivilege"
- returning system("net ads leave -U'#{ login }%#{ password }'") || force do |result|
- if result || force
- File.open('/etc/krb5.conf', 'w') do |f|
- nil
- end
- # winbind should be restarted _after_ samba has restarted
- # for smbcontrol to find its pid, however we cannot restart samba
- # here, as it only gets restarted by the caller, after the method
- # finishes...
- # wb.restart
- else
- raise "Failed to leave domain #{ @options['workgroup'] } as #{ login }"
- end
- end
- end
-
- def self.update_time(pdc)
- raise "Failed to fetch time from #{ pdc }" unless system "net time set -S #{ pdc }"
- end
-
- def domain_info
- Samba.domain_info(@options['workgroup'])
- end
-
- def self.domain_info(domain)
- info = `net ads info -w #{domain}`.inject({}) { |h, s| a = s.chomp.split(':') ; h[a.first.strip] = a.last.strip ; h }
- if info['LDAP server name']
- { 'password server' => info['LDAP server name'] + ((i = info['LDAP Port'].to_i) != LDAP_PORT && i > 0 ? ":#{ info['LDAP port'] }" : ""),
- 'kdc' => info['KDC server'],
- 'realm' => info['Realm'],
- 'domain' => info['LDAP server name'].split('.')[1..-1].join('.'),
- }
- else
- { }
- end
- end
-
- def in_domain?
- ['domain', 'ads'].include? @security
- end
-
- def clear_public_if_needed(security)
- clear_public if should_clear_public?(security)
- end
-
- def should_clear_public?(security)
- @options['security'] == 'share' && security != 'share'
- end
-
- def clear_public
- @shares.each do |share|
- share['public'] = nil
- share['guest only'] = nil
- end
- end
-
- def clear_valid
- @shares.each do |share|
- share['valid users'] = nil
- end
- end
-
- def should_clear_valid?(security)
- !in_domain? && ['ads', 'domain'].include?(security) or in_domain? && !['ads', 'domain'].include?(security)
- end
-
- def clear_valid_if_needed(security)
- clear_valid if should_clear_valid?(security)
- end
-
- def apply_security_options
- case @security
- when 'ads', 'domain'
- @options['map to guest'] = nil
- when 'share'
- @options['map to guest'] = 'Bad User'
- else
- @security = 'user'
- @options['map to guest'] = nil
- end
- @options['security'] = @security
- end
-
- def security=(security)
- clear_public_if_needed security
- clear_valid_if_needed security
- @security = security
- end
-
-end
-
Modified: branches/iscsi-only/app/models/service.rb
===================================================================
--- branches/iscsi-only/app/models/service.rb 2010-09-22 13:10:25 UTC (rev 79)
+++ branches/iscsi-only/app/models/service.rb 2010-09-22 13:32:14 UTC (rev 80)
@@ -42,8 +42,8 @@
end
def default_runlevel
-# @default_runlevel ||= File.open('/etc/init/rc-sysinit.conf').grep(/^\s*env\s+DEFAULT_RUNLEVEL\s*=\s*(\d+)/).first =~ /(\d+)/ && $1.to_i
- @default_runlevel ||= File.open('/etc/inittab').grep(/:initdefault:/).first =~ /id:(\d+):/ && $1.to_i
+ @default_runlevel ||= File.open('/etc/init/rc-sysinit.conf').grep(/^\s*env\s+DEFAULT_RUNLEVEL\s*=\s*(\d+)/).first =~ /(\d+)/ && $1.to_i
+# @default_runlevel ||= File.open('/etc/inittab').grep(/:initdefault:/).first =~ /id:(\d+):/ && $1.to_i
end
def enabled?
Deleted: branches/iscsi-only/app/models/winbind.rb
===================================================================
--- branches/iscsi-only/app/models/winbind.rb 2010-09-22 13:10:25 UTC (rev 79)
+++ branches/iscsi-only/app/models/winbind.rb 2010-09-22 13:32:14 UTC (rev 80)
@@ -1,115 +0,0 @@
-# Astor - network attached storage configurable via Web-interface
-# Copyright (C) 2009 ETegro Technologies, PLC
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-class Winbind
-
- include Service
-
- HOLD_USERS = 30.0
- HOLD_GROUPS = 30.0
-
- def service
- 'winbind'
- end
-
- def status
- system("smbcontrol winbind ping") ? :running : :not_running
- end
-
- def check_dc
- smb = Samba.new
- return true unless smb.in_domain?
- check_winbind(smb)
- end
-
- def check_winbind(smb = nil)
- smb ||= Samba.new
- if status == :running && smb.in_domain?
- doms = `wbinfo -m 2>/dev/null`.split("\n")
- wg = smb['workgroup']
- doms.include?(wg.upcase) || doms.include?(wg.downcase)
- end
- end
-
- def defaults
- smb = Samba.new
- if smb.in_domain?
- if check_winbind
- [ admin_user, admin_group ]
- else
- [ nil, nil ]
- end
- else
- [ PasswdUser.default, PasswdGroup.default ]
- end
- end
-
- def admin_user
- users.find { |u| `wbinfo -n '#{ u }' 2>/dev/null`.split.first =~ /^S-1-5-.*-500$/ }
- end
-
- def admin_group
- groups.find { |g| `wbinfo -n '#{ g }' 2>/dev/null`.split.first =~ /^S-1-5-.*-512$/ }
- end
-
- def etc_passwd
- users.map { |u| s = `wbinfo -i '#{ u }' 2>/dev/null` ; v = u.gsub(/([+])/) { |c| "\\#{$1}" } ; s =~ /^#{ v }:/ ? (s.chomp.chomp) : nil }.compact
- end
-
- def etc_group
- gg = groups.inject({}) { |h, g| s = `wbinfo --group-info='#{ g }' 2>/dev/null`.chomp.chomp ; f = g.gsub(/([+])/) { |m| "\\#{$1}" } ; s =~ /^#{ f }:x:(\d+)/ and h[$1] = { :base => s.chomp.chomp, :users => [] } ; h }
- users.each { |u| `wbinfo -r '#{ u }' 2>/dev/null`.split("\n").each { |g| gg.keys.include?(g) && gg[g][:users] << u } }
- gg.collect { |k,v| v[:base] + ':' + v[:users].join(',') }
- end
-
- def users
- if @cached_users && Time.new - @user_time > HOLD_USERS
- @cached_users
- else
- @user_time = Time.new
- @cached_users = `wbinfo -u 2>/dev/null`.split("\n").collect { |s| s.strip.gsub(" ", Samba::WINBIND_SPACE_REPLACEMENT) }
- end
- end
-
- def groups
- if @cached_groups && Time.new - @group_time > HOLD_GROUPS
- @cached_groups
- else
- @group_time = Time.new
- @cached_groups = `wbinfo -g 2>/dev/null`.split("\n").collect { |s| s.strip.gsub(" ", Samba::WINBIND_SPACE_REPLACEMENT) }
- end
- end
-
- def purge
- @cached_groups = @cached_users = nil
- end
-
- def restart
- purge
- super
- end
-
- def stop
- purge
- super
- end
-
- def start
- purge
- super
- end
-
-end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ta...@us...> - 2010-09-22 13:10:32
|
Revision: 79
http://astor.svn.sourceforge.net/astor/?rev=79&view=rev
Author: tanches
Date: 2010-09-22 13:10:25 +0000 (Wed, 22 Sep 2010)
Log Message:
-----------
samba and domain membership are removed now
Modified Paths:
--------------
branches/iscsi-only/app/controllers/application_controller.rb
branches/iscsi-only/app/controllers/networking_controller.rb
branches/iscsi-only/app/controllers/portal_controller.rb
branches/iscsi-only/app/controllers/raid_controller.rb
branches/iscsi-only/app/controllers/share_controller.rb
branches/iscsi-only/app/controllers/system_groups_controller.rb
branches/iscsi-only/app/controllers/system_users_controller.rb
branches/iscsi-only/app/helpers/application_helper.rb
branches/iscsi-only/app/models/fstab.rb
branches/iscsi-only/app/models/passwd_group.rb
branches/iscsi-only/app/models/passwd_group2.rb
branches/iscsi-only/app/models/passwd_user.rb
branches/iscsi-only/app/models/passwd_user2.rb
branches/iscsi-only/app/models/raid.rb
branches/iscsi-only/app/models/service.rb
branches/iscsi-only/app/views/portal/_menu.erb
branches/iscsi-only/app/views/portal/index.erb
branches/iscsi-only/app/views/share/list.rhtml
branches/iscsi-only/app/views/share/share.rhtml
Modified: branches/iscsi-only/app/controllers/application_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/application_controller.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/controllers/application_controller.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -83,11 +83,7 @@
end
end
- def fetch_samba
- @samba = params['samba'] || Samba.new
- end
-
def fetch_fstab
@fstab = params['fstab'] || Fstab.new
end
@@ -108,10 +104,6 @@
@users = params['system_users']
if @users.blank?
@users = PasswdUser.find(:all)
- wb = Winbind.new
- if wb.check_winbind
- @users += DomainUser.find(:all)
- end
end
end
@@ -119,10 +111,6 @@
@groups = params['system_groups']
if @groups.blank?
@groups = PasswdGroup.find(:all)
- wb = Winbind.new
- if wb.check_winbind
- @groups += DomainGroup.find(:all)
- end
end
end
Modified: branches/iscsi-only/app/controllers/networking_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/networking_controller.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/controllers/networking_controller.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -39,7 +39,7 @@
end
def list
- @in_domain = Samba.new.in_domain?
+# @in_domain = Samba.new.in_domain?
end
def show_card
@@ -112,7 +112,7 @@
def set_hostname
begin
- raise _('Wouldn\'t change hostname/domain name while a memeber of a domain') if Samba.new.in_domain?
+# raise _('Wouldn\'t change hostname/domain name while a memeber of a domain') if Samba.new.in_domain?
flash[:success] = _("Hostname saved") if @net.set_hostname( params['hostname'], params['domain_name'])
rescue
Modified: branches/iscsi-only/app/controllers/portal_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/portal_controller.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/controllers/portal_controller.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -111,13 +111,8 @@
def preprocess_principals
begin
- @winbind = Winbind.new
@users = PasswdUser.find(:all)
@groups = PasswdGroup.find(:all)
- if @winbind.check_winbind
- @users += DomainUser.find(:all)
- @groups += DomainGroup.find(:all)
- end
@prefetched['system_users'] = @users
@prefetched['system_groups'] = @groups
rescue
@@ -129,11 +124,9 @@
def preprocess_disks
begin
- @prefetched['samba'] = @samba = Samba.new
@prefetched['fstab'] = @fstab = Fstab.new
@prefetched['lvm'] = @lvm = LVM.new
@adapters = Raid.adapters(:full => 0,
- :samba => @samba,
:fstab => @fstab, :lvm => @lvm)
@adapters.each do |adapter|
Modified: branches/iscsi-only/app/controllers/raid_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/raid_controller.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/controllers/raid_controller.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -279,46 +279,10 @@
end
- def samba_apply
- @lvname = params['lvname']
- begin
- lv = (@logical[:lvs] + @logical[:snapshots]).find { |lv| lv.name == @lvname }
- mountpoint = @logical[:shares][lv][:mountpoint]
- raise _("Mountpoint not defined for logical volume") unless mountpoint
- share = @samba.shares.find { |sh| sh['path'] == mountpoint.mount_point }
- opts = [ "name", "writable", "comment", "public" ]
- if !share && !params['enabled'].blank?
- share = Samba::Share.new params['name'], { "path" => mountpoint.mount_point }
- @samba.shares << share
- end
- if share
- opts.each { |v| share[v] = params[v] }
- share.enabled = !params['enabled'].blank?
- share.users_groups(params['valid_users'], params['valid_groups'])
-
- if params['public']
- share['invalid users'] = nil
- else
- share['invalid users'] = share['valid users'] = ['"nobody"'] unless params['valid_users'] || params['valid_groups']
- end
-
- @samba.sync
- @samba.reload
- end
- flash[:success] = _("Samba configuration successfully updated")
- redirect_to :action => 'logical', :driver => @logical[:adapter][:driver], :num => @logical[:adapter][:num],
- :raid => @logical[:num], :lvname => @lvname
- rescue
- flash[:error] = $!.to_s
- render :action =>'logical'
- end
- end
-
before_filter :fetch_adapter
- before_filter :fetch_logical, :only => [:logical, :logical_delete, :create_lv, :remove_lv, :resize_lv, :update_lv, :samba_apply ]
- before_filter :fetch_samba, :only => [ :samba_apply ]
+ before_filter :fetch_logical, :only => [:logical, :logical_delete, :create_lv, :remove_lv, :resize_lv, :update_lv ]
before_filter :fetch_principals, :except => [ :new, :physical, :physical_hotspare, :smart ]
Modified: branches/iscsi-only/app/controllers/share_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/share_controller.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/controllers/share_controller.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -25,7 +25,6 @@
def share
shares = Fstab.new.shares
@share = shares.find { |s| s.uuid == params['uuid'] }
- @samba = Samba.new.shares.find { |s| s["path"] == @share.mount_point }
session['share_volume_info'] = params['uuid']
fetch_share_info(shares)
end
@@ -42,10 +41,8 @@
def list
shares = Fstab.new.shares
- samba = Samba.new
lvm = LVM.new
fetch_share_info(shares)
- @shares = shares.inject([]) { |a, s| a << { :share => s, :samba => samba.shares.find { |sh| sh["path"] == s.mount_point }, :mfs => nfs.filesystems.find { |fs| fs.path == s.mount_point } } }
end
def fetch_share_info(shares)
@@ -55,113 +52,5 @@
end
end
- def samba
- @samba, @share, smb = get_samba
- user_names, group_names = get_samba_users(@samba)
- all_users = PasswdUser.find(:all)
- all_groups = PasswdGroup.find(:all)
- @enabled_users = all_users.find_all { |u| user_names.include? u.name }
- @potential_users = all_users.find_all { |u| ((smb.in_domain? && u.external?) || (!smb.in_domain? && !u.external?)) && !u.system? && !user_names.include?(u.name) }
- @enabled_groups = all_groups.find_all { |g| group_names.include? "#{ g.name }" }
- @potential_groups = all_groups.find_all { |g| ((smb.in_domain? && g.external?) || (!smb.in_domain? && !g.external?)) && !g.system? && !group_names.include?(g.name) }
- end
- protected
-
- def get_samba
- share = Fstab.new.shares.find { |s| s.uuid == params['uuid'] }
- smb = Samba.new
- samba = smb.shares.find { |s| s["path"] == share.mount_point }
- return [samba, share, smb]
- end
-
- def get_samba_users(samba)
- user_names = []
- group_names = []
- if samba and splt = samba['valid users']
- splt = splt.split('"').inject([]) {|h, s| h << s unless s.strip.empty? ; h}
- user_names = splt.find_all { |s| s.index('@') != 0 }
- group_names = splt.find_all { |s| s.index('@') == 0 }.collect { |s| s[1 .. -1] }
- end
- return [user_names, group_names]
- end
-
- public
-
- def smb_add_user
- @samba, @share, smb = get_samba
- user_names, group_names = get_samba_users(@samba)
- user = PasswdUser.find(params['uid'])
- if ((smb.in_domain? && user.external?) || (!smb.in_domain? && !user.external?)) && !user.system? && !user_names.include?(user.name)
- @samba['valid users'] = [@samba['valid users'], "\"#{ user.name }\""].compact.join(' ')
- smb.sync
- smb.reload
- end
- redirect_to :action => 'samba', :uuid => @share.uuid
- end
-
- def smb_remove_user
- @samba, @share, smb = get_samba
- user_names, group_names = get_samba_users(@samba)
- user = PasswdUser.find(params['uid'])
- if user_names.include?(user.name)
- @samba['valid users'] = user_names.delete_if { |u| u == "\"#{user.name}\"" }.join(' ')
- smb.sync
- smb.reload
- end
- redirect_to :action => 'samba', :uuid => @share.uuid
- end
-
- def smb_add_group
- @samba, @share, smb = get_samba
- user_names, group_names = get_samba_users(@samba)
- group = PasswdGroup.find(params['gid'])
- if ((smb.in_domain? && group.external?) || (!smb.in_domain? && !group.external?)) && !group.system? && !group_names.include?(group.name)
- @samba['valid users'] += [@samba['vaild user'], "\"@#{ group.name }\""].compact.join(' ')
- smb.sync
- smb.reload
- end
- redirect_to :action => 'samba', :uuid => @share.uuid
- end
-
- def smb_remove_group
- @samba, @share, smb = get_samba
- user_names, group_names = get_samba_users(@samba)
- group = PasswdGroup.find(params['gid'])
- if group_names.include?(group.name)
- @samba['valid users'] = group_names.delete_if { |g| g == "\"#{group.name}\"" }.join(' ')
- smb.sync
- smb.reload
- end
- redirect_to :action => 'samba', :uuid => @share.uuid
- end
-
-
-
- def samba_apply
- @share = Fstab.new.shares.find { |s| s.uuid == params['uuid'] }
- smb = Samba.new
- @samba = smb.shares.find { |s| s["path"] == @share.mount_point }
- new_share = ! @samba
- opts = [ "name", "writable", "comment", "public" ]
- if params['enabled'].blank?
- if !@samba
- redirect_to :action => 'share', :uuid => @share.uuid
- return
- end
- @samba.enabled = false
- else
- if new_share
- @samba = Samba::Share.new params['name'], { "path" => @share.mount_point }
- smb.shares << @samba
- end
-
- opts.each { |v| @samba[v] = params[v] }
- @samba.enabled = true
- end
- smb.sync
- smb.reload
- redirect_to :action => 'share', :uuid => @share.uuid
- end
-
end
Modified: branches/iscsi-only/app/controllers/system_groups_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/system_groups_controller.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/controllers/system_groups_controller.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -22,24 +22,16 @@
DESCRIPTION = N_("Local groups")
ICON = "groups"
- before_filter :check_ads
module Filter
include ApplicationHelper
def options(action = nil)
- dom = Samba.new.in_domain?
- options = dom ?
- [ [_('Domain groups'), 'external' ],
-# [_('Nonsystem groups'), 'nonsystem'],
- [_('Local nonsystem'), 'local_nonsystem'],
-# [_('Local and system groups'), 'local'],
-# [_('All groups'), 'all']
- ] : [
+ options = [
[_('Nonsystem groups'), 'local_nonsystem'],
# [_('All groups'), 'all']
]
- filter = session['passwd_group_filter'] || (action == 'local' ? 'local_nonsystem' : dom ? 'external' : 'local_nonsystem' )
+ filter = session['passwd_group_filter'] || (action == 'local_nonsystem' )
[options, filter]
end
@@ -158,11 +150,6 @@
render:action => :show
end
- private
- def check_ads
- flash[:error] = _("Failed to contact domain controller") unless Winbind.new.check_dc
- end
-
end
Modified: branches/iscsi-only/app/controllers/system_users_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/system_users_controller.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/controllers/system_users_controller.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -22,23 +22,15 @@
DESCRIPTION = N_("Local users")
ICON = "users"
- before_filter :check_ads
module Filter
include ApplicationHelper
def options(action = nil)
- dom = Samba.new.in_domain?
- options = dom ?
- [ [_('Domain users'), 'external' ],
-# [_('Nonsystem users'), 'nonsystem'],
- [_('Local nonsystem'), 'local_nonsystem'],
-# [_('Local and system users'), 'local'],
-# [_('All users'), 'all']
- ] : [
+ options = [
[_('Nonsystem users'), 'local_nonsystem'],
# [_('All users'), 'all']
]
- filter = session['passwd_user_filter'] || (action == 'local' ? 'local_nonsystem' : dom ? 'external' : 'local_nonsystem' )
+ filter = session['passwd_user_filter'] || (action == 'local_nonsystem' )
[options, filter]
end
@@ -183,11 +175,6 @@
render :action => 'edit'
end
- private
- def check_ads
- flash[:error] = _("Failed to contact domain controller") unless Winbind.new.check_dc
- end
-
end
Modified: branches/iscsi-only/app/helpers/application_helper.rb
===================================================================
--- branches/iscsi-only/app/helpers/application_helper.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/helpers/application_helper.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -161,10 +161,6 @@
@users = params['system_users']
if @users.blank?
@users = PasswdUser.find(:all)
- wb = Winbind.new
- if wb.check_winbind
- @users += DomainUser.find(:all)
- end
end
end
@@ -172,10 +168,6 @@
@groups = params['system_groups']
if @groups.blank?
@groups = PasswdGroup.find(:all)
- wb = Winbind.new
- if wb.check_winbind
- @groups += DomainGroup.find(:all)
- end
end
end
Modified: branches/iscsi-only/app/models/fstab.rb
===================================================================
--- branches/iscsi-only/app/models/fstab.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/models/fstab.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -265,35 +265,4 @@
volume
end
- def start_services_for(volume)
- Samba.service_eval do |samba|
- share = samba.shares.find { |s| s['path'] == volume.mount_point }
- if share && share.restricted
- share.enabled = true
- samba.sync
- share.restart
- end
- end
-
- end
-
- def stop_services_for(volume, remove = nil)
- Samba.service_eval do |samba|
- share = samba.shares.find { |s| s['path'] == volume.mount_point }
- if share
- if remove || share.enabled?
- if remove
- samba.shares.delete(share)
- elsif share.enabled?
- share.restricted = true
- end
- samba.sync
- share.restart if samba.status == :running
- end
- end
- end
-
-
- end
-
end
Modified: branches/iscsi-only/app/models/passwd_group.rb
===================================================================
--- branches/iscsi-only/app/models/passwd_group.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/models/passwd_group.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -28,20 +28,7 @@
@@registry = {}
@@purge = nil
- def self.samba_gids
- @@samba_gids
- end
- def self.winbind_separator
- @@winbind_separator
- end
-
- def self.refresh_samba
- smb = Samba.new
- @@samba_gids = smb['winbind gid'].split('-').map { |i| i.to_i }
- @@winbind_separator = smb['winbind separator']
- end
-
alias_method :id, :gid
alias_method :id=, :gid=
@@ -69,12 +56,11 @@
i = @gid.to_i
# @external = i >= self.class.samba_gids.first && i <= self.class.samba_gids.last
@system = i < SYSTEM_GIDS || @name == 'nogroup'
- @undecorated = @external ? name.gsub(self.class.winbind_separator, EXTERNAL_SEPARATOR) : name
+ @undecorated = name #@external ? name.gsub(self.class.winbind_separator, EXTERNAL_SEPARATOR) : name
end
def self.find(which = :all, &condition)
- refresh_samba
- PasswdUser.refresh_samba
+# PasswdUser.refresh_samba
unless which.is_a? Symbol
id = which
which = :first
Modified: branches/iscsi-only/app/models/passwd_group2.rb
===================================================================
--- branches/iscsi-only/app/models/passwd_group2.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/models/passwd_group2.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -25,20 +25,7 @@
@@fields.push a[0]
end
- def self.samba_gids
- @@samba_gids
- end
- def self.winbind_separator
- @@winbind_separator
- end
-
- def self.refresh_samba
- smb = Samba.new
- @@samba_gids = smb['winbind gid'].split('-').map { |i| i.to_i }
- @@winbind_separator = smb['winbind separator']
- end
-
alias_method :id, :gid
alias_method :id=, :gid=
@@ -66,13 +53,12 @@
entry.entries.each { |e| self.send "#{e[0]}=".to_sym, e[1] }
@users = entry.users || []
i = @gid.to_i
- @external = i >= self.class.samba_gids.first && i <= self.class.samba_gids.last
+# @external = i >= self.class.samba_gids.first && i <= self.class.samba_gids.last
@system = i < SYSTEM_GIDS || @name == 'nogroup'
- @undecorated = @external ? name.gsub(self.class.winbind_separator, EXTERNAL_SEPARATOR) : name
+# @undecorated = @external ? name.gsub(self.class.winbind_separator, EXTERNAL_SEPARATOR) : name
end
def self.find(which = :all, &condition)
- refresh_samba
PasswdUser2.fetch_all
groups = PasswdUser2.groups
unless which.is_a? Symbol
Modified: branches/iscsi-only/app/models/passwd_user.rb
===================================================================
--- branches/iscsi-only/app/models/passwd_user.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/models/passwd_user.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -41,19 +41,11 @@
@@registry = {}
@@purge = nil
- def self.winbind_separator
- @@winbind_separator
- end
def self.external_uids
@@external_uids
end
- def self.refresh_samba
- smb = Samba.new
- @@external_uids = smb['winbind uid'].split('-').map { |i| i.to_i }
- @@winbind_separator = smb['winbind separator']
- end
def initialize(arr = nil)
@new_record = true
@@ -70,7 +62,7 @@
i = @uid.to_i
# @external = i >= self.class.external_uids.first && i <= self.class.external_uids.last
@system = @uid.to_i < SYSTEM_UIDS || SYSTEM_NAMES.include?(@name)
- @undecorated = @external ? name.gsub(self.class.winbind_separator, EXTERNAL_SEPARATOR) : name
+ @undecorated = name #@external ? name.gsub(self.class.winbind_separator, EXTERNAL_SEPARATOR) : name
end
def attributes=(arr)
@@ -100,9 +92,6 @@
end
def self.find(which = :all, &condition)
- #refresh samba winbind separator
- refresh_samba
- PasswdGroup.refresh_samba
unless which.is_a? Symbol
id = which
which = :first
@@ -142,10 +131,10 @@
def save(option = nil)
unless @uid
result = self.new_user
- if result and @password
- self.add_smbuser
- result = self.save_passwd
- end
+# if result and @password
+# self.add_smbuser
+# result = self.save_passwd
+# end
else
user = self.class.find(@uid)
user.check_state
@@ -167,7 +156,7 @@
def destroy()
self.class.purge self
- system "smbpasswd -x '#{@name}'"
+# system "smbpasswd -x '#{@name}'"
system "userdel '#{@name}'" and EtcPasswd.reload
end
@@ -236,20 +225,6 @@
end
end
- def add_smbuser
- Open3.popen3("smbpasswd -L -s -a '#{@name}'") do |i,o,e|
- i << "#{@password}\n#{@password}\n"
- i.close
- o.readlines
- o.close
- e.readlines
- e.close
- end
- succ = $?.success?
- warn "Failed to add user '#{@name}' to samba password list " unless succ
- succ
- end
-
def save_passwd
Open3.popen3("passwd '#{@name}'") do |i,o,e|
i << "#{@password}\n#{@password}\n"
@@ -259,20 +234,20 @@
e.readlines
e.close
end
- succ1 = $?.success?
- if succ1
- Open3.popen3("smbpasswd -L -s '#{@name}'") do |i,o,e|
- i << "#{@password}\n#{@password}\n"
- i.close
- o.readlines
- o.close
- e.readlines
- e.close
- end
- end
- succ2 = $?.success?
- warn "Failed to set smb password for #{ @name }" unless succ2
- succ1
+# succ1 = $?.success?
+# if succ1
+# Open3.popen3("smbpasswd -L -s '#{@name}'") do |i,o,e|
+# i << "#{@password}\n#{@password}\n"
+# i.close
+# o.readlines
+# o.close
+# e.readlines
+# e.close
+# end
+# end
+# succ2 = $?.success?
+# warn "Failed to set smb password for #{ @name }" unless succ2
+# succ1
end
def lock
Modified: branches/iscsi-only/app/models/passwd_user2.rb
===================================================================
--- branches/iscsi-only/app/models/passwd_user2.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/models/passwd_user2.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -45,26 +45,17 @@
@@groups
end
- def self.winbind_separator
- @@winbind_separator
- end
def self.external_uids
@@external_uids
end
- def self.refresh_samba
- smb = Samba.new
- @@external_uids = smb['winbind uid'].split('-').map { |i| i.to_i }
- @@winbind_separator = smb['winbind separator']
- end
def self.fetch_all
EtcPasswd.reload
user_entries = EtcPasswd.passwd
group_entries = EtcPasswd.group
- refresh_samba
- PasswdGroup2.refresh_samba
+# PasswdGroup2.refresh_samba
users = Hash[*user_entries.collect() { |u| [u.name, PasswdUser2.new(u)] }.flatten ]
groups = Hash[*group_entries.collect() { |g| [g.name, PasswdGroup2.new(g)] }.flatten ]
@@users = users.values
@@ -97,7 +88,7 @@
i = @uid.to_i
@external = i >= self.class.external_uids.first && i <= self.class.external_uids.last
@system = @uid.to_i < SYSTEM_UIDS || @name == 'nobody'
- @undecorated = @external ? name.gsub(self.class.winbind_separator, EXTERNAL_SEPARATOR) : name
+ @undecorated = name #@external ? name.gsub(self.class.winbind_separator, EXTERNAL_SEPARATOR) : name
end
def attributes=(arr)
@@ -167,10 +158,10 @@
def save(option = nil)
unless @uid
result = self.new_user
- if result and @password
- self.add_smbuser
- result = self.save_passwd
- end
+# if result and @password
+# self.add_smbuser
+# result = self.save_passwd
+# end
else
user = self.class.find(@uid)
user.check_state
@@ -191,7 +182,7 @@
end
def destroy()
- system "smbpasswd -x '#{@name}'"
+# system "smbpasswd -x '#{@name}'"
system "userdel '#{@name}'" and EtcPasswd.reload
self.fetch_all
end
@@ -234,19 +225,19 @@
end
end
- def add_smbuser
- Open3.popen3("smbpasswd -L -s -a '#{@name}'") do |i,o,e|
- i << "#{@password}\n#{@password}\n"
- i.close
- o.readlines
- o.close
- e.readlines
- e.close
- end
- succ = $?.success?
- warn "Failed to add user '#{@name}' to samba password list " unless succ
- succ
- end
+# def add_smbuser
+# Open3.popen3("smbpasswd -L -s -a '#{@name}'") do |i,o,e|
+# i << "#{@password}\n#{@password}\n"
+# i.close
+# o.readlines
+# o.close
+# e.readlines
+# e.close
+# end
+# succ = $?.success?
+# warn "Failed to add user '#{@name}' to samba password list " unless succ
+# succ
+# end
def save_passwd
Open3.popen3("passwd '#{@name}'") do |i,o,e|
@@ -257,20 +248,20 @@
e.readlines
e.close
end
- succ1 = $?.success?
- if succ1
- Open3.popen3("smbpasswd -L -s '#{@name}'") do |i,o,e|
- i << "#{@password}\n#{@password}\n"
- i.close
- o.readlines
- o.close
- e.readlines
- e.close
- end
- end
- succ2 = $?.success?
- warn "Failed to set smb password for #{ @name }" unless succ2
- succ1
+# succ1 = $?.success?
+# if succ1
+# Open3.popen3("smbpasswd -L -s '#{@name}'") do |i,o,e|
+# i << "#{@password}\n#{@password}\n"
+# i.close
+# o.readlines
+# o.close
+# e.readlines
+# e.close
+# end
+# end
+# succ2 = $?.success?
+# warn "Failed to set smb password for #{ @name }" unless succ2
+# succ1
end
def lock
Modified: branches/iscsi-only/app/models/raid.rb
===================================================================
--- branches/iscsi-only/app/models/raid.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/models/raid.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -88,7 +88,6 @@
services = {}
if options[:full]
services[:lvm] = options[:lvm] || LVM.new
- services[:samba] = options[:samba] || Samba.new
services[:fstab] = options[:fstab] || Fstab.new
end
adapters.each do |a|
@@ -330,14 +329,12 @@
adapter = extend(adapter, services[:lvm])
fstab = services[:fstab] || Fstab.new
- samba = services[:samba] || Samba.new
adapter[:logicals].each do |logical|
logical[:shares] = (logical[:lvs] + logical[:snapshots]).inject({}) do |hash, lv|
mountpoint = fstab.find_by_device(lv.device)
hash[lv] = {
:mountpoint => mountpoint,
- :samba => mountpoint && samba.shares.find { |sh| sh['path'] == mountpoint.mount_point },
}
hash
end
Modified: branches/iscsi-only/app/models/service.rb
===================================================================
--- branches/iscsi-only/app/models/service.rb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/models/service.rb 2010-09-22 13:10:25 UTC (rev 79)
@@ -42,8 +42,8 @@
end
def default_runlevel
- @default_runlevel ||= File.open('/etc/init/rc-sysinit.conf').grep(/^\s*env\s+DEFAULT_RUNLEVEL\s*=\s*(\d+)/).first =~ /(\d+)/ && $1.to_i
-# @default_runlevel ||= File.open('/etc/inittab').grep(/:initdefault:/).first =~ /id:(\d+):/ && $1.to_i
+# @default_runlevel ||= File.open('/etc/init/rc-sysinit.conf').grep(/^\s*env\s+DEFAULT_RUNLEVEL\s*=\s*(\d+)/).first =~ /(\d+)/ && $1.to_i
+ @default_runlevel ||= File.open('/etc/inittab').grep(/:initdefault:/).first =~ /id:(\d+):/ && $1.to_i
end
def enabled?
Modified: branches/iscsi-only/app/views/portal/_menu.erb
===================================================================
--- branches/iscsi-only/app/views/portal/_menu.erb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/views/portal/_menu.erb 2010-09-22 13:10:25 UTC (rev 79)
@@ -12,7 +12,6 @@
<% menu.item(_("Security")) do |sec| %>
<%= sec.item(_("System users"), "system_users") %>
<%= sec.item(_("System groups"), "system_groups") %>
- <%= sec.item(_("Domain membership"), "security") %>
<%= sec.item(_("Master password"), "signup") %>
<% end %>
<% menu.item( _("Services") ) do | sv | %>
Modified: branches/iscsi-only/app/views/portal/index.erb
===================================================================
--- branches/iscsi-only/app/views/portal/index.erb 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/views/portal/index.erb 2010-09-22 13:10:25 UTC (rev 79)
@@ -25,7 +25,6 @@
<%= applet({ :controller => 'snmpd', :action => 'index' }, :viewport => 'daemon_snmp', :class => 'daemon', :vp_class => 'ifaceVp') %>
- <%= applet({ :controller => 'security', :action => 'index' }, :viewport => 'security', :class => 'wide') %>
<%= applet({ :controller => 'locale', :action => 'index' }, :viewport => 'locale') %>
Modified: branches/iscsi-only/app/views/share/list.rhtml
===================================================================
--- branches/iscsi-only/app/views/share/list.rhtml 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/views/share/list.rhtml 2010-09-22 13:10:25 UTC (rev 79)
@@ -15,9 +15,6 @@
<% @shares.each do |share| %>
<tr>
<td><%= link_to share[:share].volume['name'], :action => 'share', :uuid => share[:share].uuid %> <%= link_to image_tag('zoom.png'), :action => 'volume_info', :uuid => share[:share].uuid %> </td>
- <td>
- <%= link_to (share[:samba] && share[:samba].enabled) ? _('on') : _('off'), :action => 'samba', :uuid => share[:share].uuid %>
- </td>
</tr>
<tr>
<td colspan='*'><span class='hint'><%= share[:share].volume['comment'] %></span></td>
Modified: branches/iscsi-only/app/views/share/share.rhtml
===================================================================
--- branches/iscsi-only/app/views/share/share.rhtml 2010-09-15 14:18:58 UTC (rev 78)
+++ branches/iscsi-only/app/views/share/share.rhtml 2010-09-22 13:10:25 UTC (rev 79)
@@ -5,27 +5,12 @@
<ul id='tabs'>
<li id="current"><%= _('Overview') %></li>
- <li><%= link_to(_('SMB'), { :action => 'samba', :uuid => @share.uuid }) %></li>
<li><%= link_to(_('WebDAV'), { :action => 'dav', :uuid => @share.uuid }) %></li> -->
</ul>
<div id="task">
- <fieldset>
- <legend>SMB</legend>
- <% form_tag :action => 'samba_apply', :uuid => @share.uuid do %>
- <%= hidden_field_tag 'name', @samba && @samba['name'] || @share.volume['name'] %>
- <%= hidden_field_tag 'comment', @samba && @samba['comment'] || @share.volume['comment'] %>
- <table><tr><td><label for='enabled'><%= _('Sharing is') %></td><td>
- <%= radio_button_tag 'enabled', 'true', @samba && @samba.enabled %> <%= _('On') %> <br />
- <%= radio_button_tag 'enabled', '', !@samba || !@samba.enabled %> <%= _('Off') %> </td>
- </tr><tr><td><%= _('Options') %></td><td><%= check_box_tag 'writable', 'yes', @samba && @samba['writable'] %> <%= _('Writable') %><br /><%= check_box_tag 'public', 'yes', @samba && @samba['public'] %> <%= _('Public') %></td></tr>
- <tr><td></td><td><%= submit_tag _('Apply') %></td></tr>
- </table>
- <% end %>
- </fieldset>
-
<!-- <fieldset>
<legend>FTP</legend>
<strong>TODO</strong>
@@ -53,7 +38,6 @@
<ul>
<li><%= link_to(image_tag('share.png') + _('Shares overview'), { :controller => 'share' }, :class => "app_launcher") %></li>
<li><%= link_to(image_tag('lvm.png') + _('Volumes setup'), { :controller => 'volume', :action => 'lvs' }, :class => "app_launcher") %></li>
- <li><%= link_to(image_tag('samba.png') + _('SMB service'), { :controller => 'samba' }, :class => "app_launcher") %></li>
<li><%= link_to(image_tag('dav.png') + _('WebDAV service'), { :controller => 'dav' }, :class => "app_launcher") %></li>
</ul>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-09-15 14:19:05
|
Revision: 78
http://astor.svn.sourceforge.net/astor/?rev=78&view=rev
Author: stargrave
Date: 2010-09-15 14:18:58 +0000 (Wed, 15 Sep 2010)
Log Message:
-----------
iSCSI target config reader and writer.
Added Paths:
-----------
branches/iscsi-only/app/models/iscsitarget_config.rb
Added: branches/iscsi-only/app/models/iscsitarget_config.rb
===================================================================
--- branches/iscsi-only/app/models/iscsitarget_config.rb (rev 0)
+++ branches/iscsi-only/app/models/iscsitarget_config.rb 2010-09-15 14:18:58 UTC (rev 78)
@@ -0,0 +1,108 @@
+# Astor - network attached storage configurable via Web-interface
+# Copyright (C) 2009-2010 ETegro Technologies, PLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+FILE_PATH = "/etc/ietd.conf"
+
+class IscsitargetConfig
+
+ attr_accessor :config
+
+ def initialize
+ read_config
+ end
+
+ def read_config
+ @config = { :global => {} }
+ target = :global
+ File.open( FILE_PATH, "r" ).readlines.collect { |l| l.chomp.gsub( /^\s*/, "" ) }.reject { |l| l =~ /#/ or l =~ /^\s*$/ }.each { |l|
+ key, value = l.split(/\s+/)[0], l.split(/\s+/)[1 .. -1].join(" ")
+ case key
+ when "Target"
+ target = value
+ @config[ target ] = {}
+ when "Lun"
+ @config[ target ][ "Lun" ] = {} unless @config[ target ].has_key?( "Lun" )
+ number, options = value.split(/\s+/)
+ @config[ target ][ "Lun" ][ number ] = {}
+ options.split(",").each { |o|
+ k, v = o.split( "=" )
+ @config[ target ][ "Lun" ][ number ][ k ] = v
+ }
+ when "IncomingUser"
+ @config[ target ][ "IncomingUser" ] = {} unless @config[ target ].has_key?( "IncomingUser" )
+ user, password = value.split(/\s+/)
+ @config[ target ][ "IncomingUser" ][ user ] = password
+ else
+ @config[ target ][ key ] = value
+ end
+ }
+ end
+
+ def check_config
+ available_options = [
+ "IncomingUser",
+ "OutgoingUser",
+ "Lun",
+ "Alias",
+ "HeaderDigest",
+ "DataDigest",
+ "MaxConnections",
+ "InitialR2T",
+ "ImmediateData",
+ "MaxRecvDataSegmentLength",
+ "MaxXmitDataSegmentLength",
+ "MaxBurstLength",
+ "FirstBurstLength",
+ "DefaultTime2Wait",
+ "DefaultTime2Retain",
+ "MaxOutstandingR2T",
+ "DataPDUInOrder",
+ "DataSequenceInOrder",
+ "ErrorRecoveryLevel",
+ "Wthreads",
+ "QueuedCommands" ]
+ @config.delete_if { |t, v| not @config[ t ].has_key?( "Lun" ) and t != :global }
+ @config.keys.each { |t|
+ @config[ t ].delete_if { |k, v| not available_options.include?( k ) }
+ }
+ end
+
+ def write_config
+ check_config
+ File.open( FILE_PATH, File::WRONLY|File::TRUNC|File::CREAT ) do |f|
+ @config[:global].each_pair { |k, v| f.puts "#{k} #{v}" }
+ @config.keys.reject { |t| t == :global }.each { |t|
+ f.puts "Target #{t}"
+ @config[ t ].each_pair{ |k, v|
+ case k
+ when "Lun"
+ @config[ t ][ k ].each_pair { | n, os |
+ f.puts " #{k} #{n} " + os.keys.collect{ | key | key + "=" + @config[ t ][ k ][ n ][ key ] }.join( "," )
+ }
+ when "IncomingUser"
+ @config[ t ][ k ].each_pair { |u, p|
+ f.puts " #{k} #{u} #{p}"
+ }
+ else
+ f.puts " #{k} #{v}"
+ end
+ }
+ f.puts ""
+ }
+ end
+ end
+
+end
Property changes on: branches/iscsi-only/app/models/iscsitarget_config.rb
___________________________________________________________________
Added: svn:keywords
+ Date Revision
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-09-03 13:44:10
|
Revision: 77
http://astor.svn.sourceforge.net/astor/?rev=77&view=rev
Author: stargrave
Date: 2010-09-03 13:44:04 +0000 (Fri, 03 Sep 2010)
Log Message:
-----------
As was discovered, webUI has already skipped USB drives.
Removed Paths:
-------------
branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc
Property Changed:
----------------
branches/iscsi-only/build/chroot/
Property changes on: branches/iscsi-only/build/chroot
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/build/chroot:54-60,67-68,70
+ /trunk/build/chroot:54-60,67-68,70,75
Deleted: branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc
===================================================================
--- branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc 2010-09-03 13:41:52 UTC (rev 76)
+++ branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc 2010-09-03 13:44:04 UTC (rev 77)
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-sed -i 's/^.*# \(next if usb_device.*\)$/\1/' $CHROOT_PATH/usr/local/lib/site_ruby/1.8/raid/software.rb
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-09-03 13:41:58
|
Revision: 76
http://astor.svn.sourceforge.net/astor/?rev=76&view=rev
Author: stargrave
Date: 2010-09-03 13:41:52 +0000 (Fri, 03 Sep 2010)
Log Message:
-----------
Merged r75.
Modified Paths:
--------------
branches/iscsi-only/build/chroot/gems
branches/iscsi-only/build/chroot/packages
Modified: branches/iscsi-only/build/chroot/gems
===================================================================
--- branches/iscsi-only/build/chroot/gems 2010-09-03 13:34:23 UTC (rev 75)
+++ branches/iscsi-only/build/chroot/gems 2010-09-03 13:41:52 UTC (rev 76)
@@ -1,19 +1,19 @@
-rake
+rake 0.8.7
activesupport 2.3.2
activerecord 2.3.2
actionpack 2.3.2
actionmailer 2.3.2
activeresource 2.3.2
rails 2.3.2
-locale
-locale_rails
-ip
-sqlite3-ruby 1.3.0
-gettext
-gettext_activerecord
-gettext_rails
-gem_plugin
+locale 2.0.4
+locale_rails 2.0.4
+ip 0.2.2
+sqlite3-ruby 1.2.5
+gettext 2.0.4
+gettext_activerecord 2.0.4
+gettext_rails 2.0.4
+gem_plugin 0.2.3
daemons 1.0.10
-fastthread
-cgi_multipart_eof_fix
-mongrel
+fastthread 1.0.7
+cgi_multipart_eof_fix 2.5.0
+mongrel 1.1.5
Modified: branches/iscsi-only/build/chroot/packages
===================================================================
--- branches/iscsi-only/build/chroot/packages 2010-09-03 13:34:23 UTC (rev 75)
+++ branches/iscsi-only/build/chroot/packages 2010-09-03 13:41:52 UTC (rev 76)
@@ -54,7 +54,6 @@
# We need following to install sqlite gem
gcc
make
-libsqlite3-ruby
# For debugging purposes
# OpenSSH depends on X11 - so it is very heavy
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-09-03 13:34:29
|
Revision: 75
http://astor.svn.sourceforge.net/astor/?rev=75&view=rev
Author: stargrave
Date: 2010-09-03 13:34:23 +0000 (Fri, 03 Sep 2010)
Log Message:
-----------
Force gems version specifying.
Modified Paths:
--------------
trunk/build/chroot/gems
trunk/build/chroot/packages
Modified: trunk/build/chroot/gems
===================================================================
--- trunk/build/chroot/gems 2010-09-03 08:45:58 UTC (rev 74)
+++ trunk/build/chroot/gems 2010-09-03 13:34:23 UTC (rev 75)
@@ -1,19 +1,19 @@
-rake
+rake 0.8.7
activesupport 2.3.2
activerecord 2.3.2
actionpack 2.3.2
actionmailer 2.3.2
activeresource 2.3.2
rails 2.3.2
-locale
-locale_rails
-ip
-sqlite3-ruby 1.3.0
-gettext
-gettext_activerecord
-gettext_rails
-gem_plugin
+locale 2.0.4
+locale_rails 2.0.4
+ip 0.2.2
+sqlite3-ruby 1.2.5
+gettext 2.0.4
+gettext_activerecord 2.0.4
+gettext_rails 2.0.4
+gem_plugin 0.2.3
daemons 1.0.10
-fastthread
-cgi_multipart_eof_fix
-mongrel
+fastthread 1.0.7
+cgi_multipart_eof_fix 2.5.0
+mongrel 1.1.5
Modified: trunk/build/chroot/packages
===================================================================
--- trunk/build/chroot/packages 2010-09-03 08:45:58 UTC (rev 74)
+++ trunk/build/chroot/packages 2010-09-03 13:34:23 UTC (rev 75)
@@ -54,7 +54,6 @@
# We need following to install sqlite gem
gcc
make
-libsqlite3-ruby
# For debugging purposes
# OpenSSH depends on X11 - so it is very heavy
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-09-03 08:46:04
|
Revision: 74
http://astor.svn.sourceforge.net/astor/?rev=74&view=rev
Author: stargrave
Date: 2010-09-03 08:45:58 +0000 (Fri, 03 Sep 2010)
Log Message:
-----------
Fixed incorrect regexp.
Modified Paths:
--------------
branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc
Modified: branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc
===================================================================
--- branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc 2010-09-02 13:43:27 UTC (rev 73)
+++ branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc 2010-09-03 08:45:58 UTC (rev 74)
@@ -1,3 +1,3 @@
#!/bin/sh
-sed -i 's/^.*# \(next if usb_device\).*$/\1/' $CHROOT_PATH/usr/local/lib/site_ruby/1.8/raid/software.rb
+sed -i 's/^.*# \(next if usb_device.*\)$/\1/' $CHROOT_PATH/usr/local/lib/site_ruby/1.8/raid/software.rb
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-09-02 13:43:33
|
Revision: 73
http://astor.svn.sourceforge.net/astor/?rev=73&view=rev
Author: stargrave
Date: 2010-09-02 13:43:27 +0000 (Thu, 02 Sep 2010)
Log Message:
-----------
Disable USB devices in Einarc in iscsi-only branch for development purposes.
Modified Paths:
--------------
branches/iscsi-only/app/models/smartd_config.rb
Added Paths:
-----------
branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc
Property Changed:
----------------
branches/iscsi-only/app/models/
Property changes on: branches/iscsi-only/app/models
___________________________________________________________________
Added: svn:mergeinfo
+ /trunk/app/models:68,72
Modified: branches/iscsi-only/app/models/smartd_config.rb
===================================================================
--- branches/iscsi-only/app/models/smartd_config.rb 2010-09-02 12:15:47 UTC (rev 72)
+++ branches/iscsi-only/app/models/smartd_config.rb 2010-09-02 13:43:27 UTC (rev 73)
@@ -1,3 +1,19 @@
+# Astor - network attached storage configurable via Web-interface
+# Copyright (C) 2009-2010 ETegro Technologies, PLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
FILE_PATH = '/etc/smartd.conf'
OPTIONS = '-S on -o on -a -H'
@@ -150,4 +166,4 @@
end
end
-end
\ No newline at end of file
+end
Added: branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc
===================================================================
--- branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc (rev 0)
+++ branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc 2010-09-02 13:43:27 UTC (rev 73)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+sed -i 's/^.*# \(next if usb_device\).*$/\1/' $CHROOT_PATH/usr/local/lib/site_ruby/1.8/raid/software.rb
Property changes on: branches/iscsi-only/build/chroot/steps/20disable_usb_devices_in_einarc
___________________________________________________________________
Added: svn:keywords
+ Date Revision
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-09-02 12:15:57
|
Revision: 72
http://astor.svn.sourceforge.net/astor/?rev=72&view=rev
Author: stargrave
Date: 2010-09-02 12:15:47 +0000 (Thu, 02 Sep 2010)
Log Message:
-----------
Missing copyright information.
Modified Paths:
--------------
trunk/app/models/smartd_config.rb
Modified: trunk/app/models/smartd_config.rb
===================================================================
--- trunk/app/models/smartd_config.rb 2010-09-02 09:48:51 UTC (rev 71)
+++ trunk/app/models/smartd_config.rb 2010-09-02 12:15:47 UTC (rev 72)
@@ -1,3 +1,19 @@
+# Astor - network attached storage configurable via Web-interface
+# Copyright (C) 2009-2010 ETegro Technologies, PLC
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
FILE_PATH = '/etc/smartd.conf'
OPTIONS = '-S on -o on -a -H'
@@ -150,4 +166,4 @@
end
end
-end
\ No newline at end of file
+end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-09-02 09:48:58
|
Revision: 71
http://astor.svn.sourceforge.net/astor/?rev=71&view=rev
Author: stargrave
Date: 2010-09-02 09:48:51 +0000 (Thu, 02 Sep 2010)
Log Message:
-----------
Merged r50-r70 revision to iscsi-only branch.
Modified Paths:
--------------
branches/iscsi-only/build/chroot/packages
branches/iscsi-only/build/flash/steps/10generate_grub_menu
branches/iscsi-only/documentation/ru/index.rst
Property Changed:
----------------
branches/iscsi-only/
branches/iscsi-only/build/chroot/
branches/iscsi-only/build/flash/steps/
branches/iscsi-only/documentation/ru/
Property changes on: branches/iscsi-only
___________________________________________________________________
Modified: svn:mergeinfo
-
+ /trunk:68
Property changes on: branches/iscsi-only/build/chroot
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/build/chroot:54-60,67-68
+ /trunk/build/chroot:54-60,67-68,70
Modified: branches/iscsi-only/build/chroot/packages
===================================================================
--- branches/iscsi-only/build/chroot/packages 2010-09-02 09:46:03 UTC (rev 70)
+++ branches/iscsi-only/build/chroot/packages 2010-09-02 09:48:51 UTC (rev 71)
@@ -54,6 +54,7 @@
# We need following to install sqlite gem
gcc
make
+libsqlite3-ruby
# For debugging purposes
# OpenSSH depends on X11 - so it is very heavy
Property changes on: branches/iscsi-only/build/flash/steps
___________________________________________________________________
Added: svn:mergeinfo
+ /trunk/build/flash/steps:65-66,68
Modified: branches/iscsi-only/build/flash/steps/10generate_grub_menu
===================================================================
--- branches/iscsi-only/build/flash/steps/10generate_grub_menu 2010-09-02 09:46:03 UTC (rev 70)
+++ branches/iscsi-only/build/flash/steps/10generate_grub_menu 2010-09-02 09:48:51 UTC (rev 71)
@@ -2,6 +2,7 @@
mkdir -p $CHROOT_PATH/boot/grub
+# vol_id call can be replaced by: blkid -o udev
partition1=`vol_id /dev/mapper/${LOOP_NODE}p1 | sed -n 's/^ID_FS_UUID=\(.*\)$/\1/p'`
partition2=`vol_id /dev/mapper/${LOOP_NODE}p2 | sed -n 's/^ID_FS_UUID=\(.*\)$/\1/p'`
Property changes on: branches/iscsi-only/documentation/ru
___________________________________________________________________
Added: svn:mergeinfo
+ /trunk/documentation/ru:50-69
Modified: branches/iscsi-only/documentation/ru/index.rst
===================================================================
--- branches/iscsi-only/documentation/ru/index.rst 2010-09-02 09:46:03 UTC (rev 70)
+++ branches/iscsi-only/documentation/ru/index.rst 2010-09-02 09:48:51 UTC (rev 71)
@@ -1,11 +1,11 @@
-======================
+=============
aStor project
-======================
+=============
.. contents::
О продукте
-=====
+==========
aStor is a network attached storage configurable via user-friendly
web-interface. Based on Einarc (a universal storage RAID command line
interface) and GNU/Linux. aStor provides file-based access. Currently
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-09-02 09:46:09
|
Revision: 70
http://astor.svn.sourceforge.net/astor/?rev=70&view=rev
Author: stargrave
Date: 2010-09-02 09:46:03 +0000 (Thu, 02 Sep 2010)
Log Message:
-----------
Latest sqlite gem is not working without at least that library, because of incorrect library linking.
Modified Paths:
--------------
trunk/build/chroot/packages
Modified: trunk/build/chroot/packages
===================================================================
--- trunk/build/chroot/packages 2010-09-01 13:12:35 UTC (rev 69)
+++ trunk/build/chroot/packages 2010-09-02 09:46:03 UTC (rev 70)
@@ -54,6 +54,7 @@
# We need following to install sqlite gem
gcc
make
+libsqlite3-ruby
# For debugging purposes
# OpenSSH depends on X11 - so it is very heavy
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-09-01 13:12:46
|
Revision: 69
http://astor.svn.sourceforge.net/astor/?rev=69&view=rev
Author: stargrave
Date: 2010-09-01 13:12:35 +0000 (Wed, 01 Sep 2010)
Log Message:
-----------
Merged r66-r68.
Modified Paths:
--------------
branches/iscsi-only/build/chroot/config
branches/iscsi-only/build/chroot/create.sh
branches/iscsi-only/build/chroot/steps/15install_rorapp
branches/iscsi-only/build/chroot/steps/20add_revision_file
Property Changed:
----------------
branches/iscsi-only/build/chroot/
Property changes on: branches/iscsi-only/build/chroot
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/build/chroot:54-60
+ /trunk/build/chroot:54-60,67-68
Modified: branches/iscsi-only/build/chroot/config
===================================================================
--- branches/iscsi-only/build/chroot/config 2010-09-01 13:06:57 UTC (rev 68)
+++ branches/iscsi-only/build/chroot/config 2010-09-01 13:12:35 UTC (rev 69)
@@ -9,6 +9,7 @@
# Nas-related
NAS_DIR=/usr/local/nas
+RORAPP_SRC_URL=https://astor.svn.sourceforge.net/svnroot/astor/branches/iscsi-only
# Einarc modules, e.g
# EINARC_MODULES="software,lsi_megacli"
@@ -18,4 +19,3 @@
# Modules for lnsensors mib, eg
# LM_SENSORS_MODULES="ipmi-si ipmisensors w83627hf coretemp"
LM_SENSORS_MODULES=
-
Modified: branches/iscsi-only/build/chroot/create.sh
===================================================================
--- branches/iscsi-only/build/chroot/create.sh 2010-09-01 13:06:57 UTC (rev 68)
+++ branches/iscsi-only/build/chroot/create.sh 2010-09-01 13:12:35 UTC (rev 69)
@@ -3,7 +3,7 @@
. ../functions
. ./config
-export CHROOT_PATH $LOCALE BRANCH REPOSITORY_URL NAS_DIR RUBYGEMS_URL EINARC_MODULES EINARC_FORCE_PROPRIETARY_AGREED LM_SENSORS_MODULES
+export CHROOT_PATH $LOCALE BRANCH REPOSITORY_URL NAS_DIR RUBYGEMS_URL EINARC_MODULES EINARC_FORCE_PROPRIETARY_AGREED LM_SENSORS_MODULES RORAPP_SRC_URL
for step in steps/*; do
message "Running $step"
Modified: branches/iscsi-only/build/chroot/steps/15install_rorapp
===================================================================
--- branches/iscsi-only/build/chroot/steps/15install_rorapp 2010-09-01 13:06:57 UTC (rev 68)
+++ branches/iscsi-only/build/chroot/steps/15install_rorapp 2010-09-01 13:12:35 UTC (rev 69)
@@ -1,4 +1,4 @@
#!/bin/sh
rm -fr ${CHROOT_PATH}${NAS_DIR}
-svn export https://astor.svn.sourceforge.net/svnroot/astor/branches/iscsi-only ${CHROOT_PATH}${NAS_DIR}
+svn export ${RORAPP_SRC_URL} ${CHROOT_PATH}${NAS_DIR}
Modified: branches/iscsi-only/build/chroot/steps/20add_revision_file
===================================================================
--- branches/iscsi-only/build/chroot/steps/20add_revision_file 2010-09-01 13:06:57 UTC (rev 68)
+++ branches/iscsi-only/build/chroot/steps/20add_revision_file 2010-09-01 13:12:35 UTC (rev 69)
@@ -1,6 +1,6 @@
#!/bin/sh
pushd ${CHROOT_PATH}${NAS_DIR} >/dev/null
-revision=`svn status --verbose | sed -n 's/^\s*\([0-9]*\).*\.$/\1/p'`
+revision=`svn info ${RORAPP_SRC_URL} | sed -n 's/Revision: \([0-9]*\)$/\1/p'`
popd >/dev/null
echo "$revision" > $CHROOT_PATH/etc/revision
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-09-01 13:07:04
|
Revision: 68
http://astor.svn.sourceforge.net/astor/?rev=68&view=rev
Author: stargrave
Date: 2010-09-01 13:06:57 +0000 (Wed, 01 Sep 2010)
Log Message:
-----------
Retrieve revision number from remote repository, as we are doing export, not checkout.
Modified Paths:
--------------
trunk/build/chroot/steps/20add_revision_file
Modified: trunk/build/chroot/steps/20add_revision_file
===================================================================
--- trunk/build/chroot/steps/20add_revision_file 2010-09-01 13:05:30 UTC (rev 67)
+++ trunk/build/chroot/steps/20add_revision_file 2010-09-01 13:06:57 UTC (rev 68)
@@ -1,6 +1,6 @@
#!/bin/sh
pushd ${CHROOT_PATH}${NAS_DIR} >/dev/null
-revision=`svn status --verbose | sed -n 's/^\s*\([0-9]*\).*\.$/\1/p'`
+revision=`svn info ${RORAPP_SRC_URL} | sed -n 's/Revision: \([0-9]*\)$/\1/p'`
popd >/dev/null
echo "$revision" > $CHROOT_PATH/etc/revision
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-09-01 13:05:36
|
Revision: 67
http://astor.svn.sourceforge.net/astor/?rev=67&view=rev
Author: stargrave
Date: 2010-09-01 13:05:30 +0000 (Wed, 01 Sep 2010)
Log Message:
-----------
Move aStor's repository URL to separate configure option.
Modified Paths:
--------------
trunk/build/chroot/config
trunk/build/chroot/create.sh
trunk/build/chroot/steps/15install_rorapp
Modified: trunk/build/chroot/config
===================================================================
--- trunk/build/chroot/config 2010-08-30 12:43:21 UTC (rev 66)
+++ trunk/build/chroot/config 2010-09-01 13:05:30 UTC (rev 67)
@@ -9,6 +9,7 @@
# Nas-related
NAS_DIR=/usr/local/nas
+RORAPP_SRC_URL=https://astor.svn.sourceforge.net/svnroot/astor/trunk
# Einarc modules, e.g
# EINARC_MODULES="software,lsi_megacli"
@@ -18,4 +19,3 @@
# Modules for lnsensors mib, eg
# LM_SENSORS_MODULES="ipmi-si ipmisensors w83627hf coretemp"
LM_SENSORS_MODULES=
-
Modified: trunk/build/chroot/create.sh
===================================================================
--- trunk/build/chroot/create.sh 2010-08-30 12:43:21 UTC (rev 66)
+++ trunk/build/chroot/create.sh 2010-09-01 13:05:30 UTC (rev 67)
@@ -3,7 +3,7 @@
. ../functions
. ./config
-export CHROOT_PATH $LOCALE BRANCH REPOSITORY_URL NAS_DIR RUBYGEMS_URL EINARC_MODULES EINARC_FORCE_PROPRIETARY_AGREED LM_SENSORS_MODULES
+export CHROOT_PATH $LOCALE BRANCH REPOSITORY_URL NAS_DIR RUBYGEMS_URL EINARC_MODULES EINARC_FORCE_PROPRIETARY_AGREED LM_SENSORS_MODULES RORAPP_SRC_URL
for step in steps/*; do
message "Running $step"
Modified: trunk/build/chroot/steps/15install_rorapp
===================================================================
--- trunk/build/chroot/steps/15install_rorapp 2010-08-30 12:43:21 UTC (rev 66)
+++ trunk/build/chroot/steps/15install_rorapp 2010-09-01 13:05:30 UTC (rev 67)
@@ -1,4 +1,4 @@
#!/bin/sh
rm -fr ${CHROOT_PATH}${NAS_DIR}
-svn export https://astor.svn.sourceforge.net/svnroot/astor/trunk ${CHROOT_PATH}${NAS_DIR}
+svn export ${RORAPP_SRC_URL} ${CHROOT_PATH}${NAS_DIR}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ta...@us...> - 2010-08-30 12:43:32
|
Revision: 66
http://astor.svn.sourceforge.net/astor/?rev=66&view=rev
Author: tanches
Date: 2010-08-30 12:43:21 +0000 (Mon, 30 Aug 2010)
Log Message:
-----------
NFS is removed now
Modified Paths:
--------------
branches/iscsi-only/app/controllers/application_controller.rb
branches/iscsi-only/app/controllers/portal_controller.rb
branches/iscsi-only/app/controllers/raid_controller.rb
branches/iscsi-only/app/controllers/share_controller.rb
branches/iscsi-only/app/models/fstab.rb
branches/iscsi-only/app/models/raid.rb
branches/iscsi-only/app/views/portal/_menu.erb
branches/iscsi-only/app/views/raid/logical.rhtml
branches/iscsi-only/app/views/share/list.rhtml
branches/iscsi-only/app/views/share/share.rhtml
Modified: branches/iscsi-only/app/controllers/application_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/application_controller.rb 2010-08-30 11:39:01 UTC (rev 65)
+++ branches/iscsi-only/app/controllers/application_controller.rb 2010-08-30 12:43:21 UTC (rev 66)
@@ -87,11 +87,7 @@
@samba = params['samba'] || Samba.new
end
- def fetch_nfs
- @nfs = params['nfs'] || NFS.new
- end
-
def fetch_fstab
@fstab = params['fstab'] || Fstab.new
end
Modified: branches/iscsi-only/app/controllers/portal_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/portal_controller.rb 2010-08-30 11:39:01 UTC (rev 65)
+++ branches/iscsi-only/app/controllers/portal_controller.rb 2010-08-30 12:43:21 UTC (rev 66)
@@ -130,11 +130,10 @@
def preprocess_disks
begin
@prefetched['samba'] = @samba = Samba.new
- @prefetched['nfs'] = @nfs = NFS.new
@prefetched['fstab'] = @fstab = Fstab.new
@prefetched['lvm'] = @lvm = LVM.new
@adapters = Raid.adapters(:full => 0,
- :samba => @samba, :nfs => @nfs,
+ :samba => @samba,
:fstab => @fstab, :lvm => @lvm)
@adapters.each do |adapter|
Modified: branches/iscsi-only/app/controllers/raid_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/raid_controller.rb 2010-08-30 11:39:01 UTC (rev 65)
+++ branches/iscsi-only/app/controllers/raid_controller.rb 2010-08-30 12:43:21 UTC (rev 66)
@@ -314,55 +314,11 @@
end
end
- def nfs_apply
- @lvname = params['lvname']
- begin
- lv = (@logical[:lvs] + @logical[:snapshots]).find { |lv| lv.name == @lvname }
- mountpoint = @logical[:shares][lv][:mountpoint]
- raise _("Mountpoint not defined for logical volume") unless mountpoint
- fs = @nfs.filesystems.find { |fs| fs.path == mountpoint.mount_point }
- host = nil
- if fs && fs.default
- host = fs.default
- else
- host = NFS::Host.new('*', { 'mountpoint' => mountpoint.mount_point } )
- fs.hosts << host if fs
- end
- if params['rw'] == 'yes'
- host['rw'] = true
- else
- host['ro'] = true
- end
- if params['anonymous'] == 'yes'
- host['all_squash'] = true
- else
- host['no_all_squash'] = true
- end
- if !fs and params['enabled'] == 'yes'
- @nfs.add NFS::Filesystem.new(mountpoint.mount_point, [ host ])
- elsif fs
- if fs.enabled? && params['enabled'] != 'yes'
- @nfs.disable fs
- elsif !fs.enabled? && params['enabled'] == 'yes'
- @nfs.enable fs
- else
- @nfs.sync
- end
- end
- flash[:success] = _("NFS configuration successfully updated")
- redirect_to :action => 'logical', :driver => @logical[:adapter][:driver], :num => @logical[:adapter][:num],
- :raid => @logical[:num], :lvname => @lvname
- rescue
- flash[:error] = $!.to_s
- render :action => 'logical'
- end
- end
before_filter :fetch_adapter
- before_filter :fetch_logical, :only => [:logical, :logical_delete, :create_lv, :remove_lv, :resize_lv, :update_lv, :samba_apply, :nfs_apply ]
+ before_filter :fetch_logical, :only => [:logical, :logical_delete, :create_lv, :remove_lv, :resize_lv, :update_lv, :samba_apply ]
before_filter :fetch_samba, :only => [ :samba_apply ]
- before_filter :fetch_nfs, :only => [ :nfs_apply ]
before_filter :fetch_principals, :except => [ :new, :physical, :physical_hotspare, :smart ]
Modified: branches/iscsi-only/app/controllers/share_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/share_controller.rb 2010-08-30 11:39:01 UTC (rev 65)
+++ branches/iscsi-only/app/controllers/share_controller.rb 2010-08-30 12:43:21 UTC (rev 66)
@@ -26,7 +26,6 @@
shares = Fstab.new.shares
@share = shares.find { |s| s.uuid == params['uuid'] }
@samba = Samba.new.shares.find { |s| s["path"] == @share.mount_point }
- @nfs = NFS.new.filesystems.find { |fs| fs.path == @share.mount_point }
session['share_volume_info'] = params['uuid']
fetch_share_info(shares)
end
@@ -44,7 +43,6 @@
def list
shares = Fstab.new.shares
samba = Samba.new
- nfs = NFS.new
lvm = LVM.new
fetch_share_info(shares)
@shares = shares.inject([]) { |a, s| a << { :share => s, :samba => samba.shares.find { |sh| sh["path"] == s.mount_point }, :mfs => nfs.filesystems.find { |fs| fs.path == s.mount_point } } }
@@ -139,31 +137,7 @@
end
- def nfs
- @share = Fstab.new.shares.find { |s| s.uuid == params['uuid'] }
- @nfs = NFS.new.filesystems.find { |fs| fs.path == @share.mount_point }
- end
- def nfs_apply
- @share = Fstab.new.shares.find { |s| s.uuid == params['uuid'] }
- nfs = NFS.new
- @nfs = nfs.filesystems.find { |fs| fs.path == @share.mount_point }
- host = ( @nfs && @nfs.default ) ? @nfs.default : NFS::Host.new('*', { 'mountpoint' => @share.mount_point } )
- @nfs.hosts << host if @nfs && !@nfs.default
- if params['rw'] == 'yes' then host['rw'] = true else host['ro'] = true end
- if params['anonymous'] == 'yes' then host['all_squash'] = true else host['no_all_squash'] = true end
- if !@nfs and params['enabled'] == 'yes'
- nfs.add NFS::Filesystem.new(@share.mount_point, [ host ])
- elsif @nfs && @nfs.enabled? && params['enabled'] != 'yes'
- nfs.disable @nfs
- elsif @nfs && !@nfs.enabled? && params['enabled'] == 'yes'
- nfs.enable @nfs
- end
- nfs.sync
- print nfs.filesystems.find { |fs| fs.path == @share.mount_point }
- redirect_to :action => :share, :uuid => @share.uuid
- end
-
def samba_apply
@share = Fstab.new.shares.find { |s| s.uuid == params['uuid'] }
smb = Samba.new
Modified: branches/iscsi-only/app/models/fstab.rb
===================================================================
--- branches/iscsi-only/app/models/fstab.rb 2010-08-30 11:39:01 UTC (rev 65)
+++ branches/iscsi-only/app/models/fstab.rb 2010-08-30 12:43:21 UTC (rev 66)
@@ -275,13 +275,6 @@
end
end
- NFS.service_eval do |nfs|
- fs = nfs.filesystems.find { |fs| fs.path == volume.mount_point }
- if fs and fs.restricted?
- nfs.enable fs
- end
- end
-
end
def stop_services_for(volume, remove = nil)
@@ -300,18 +293,7 @@
end
end
- NFS.service_eval do |nfs|
- fs = nfs.filesystems.find { |fs| fs.path == volume.mount_point }
- if fs
- if remove
- nfs.del fs
- elsif fs.enabled?
- nfs.restrict fs
- end
- end
- end
-
end
end
Modified: branches/iscsi-only/app/models/raid.rb
===================================================================
--- branches/iscsi-only/app/models/raid.rb 2010-08-30 11:39:01 UTC (rev 65)
+++ branches/iscsi-only/app/models/raid.rb 2010-08-30 12:43:21 UTC (rev 66)
@@ -90,7 +90,6 @@
services[:lvm] = options[:lvm] || LVM.new
services[:samba] = options[:samba] || Samba.new
services[:fstab] = options[:fstab] || Fstab.new
- services[:nfs] = options[:nfs] || NFS.new
end
adapters.each do |a|
_adapter(a, options)
@@ -332,7 +331,6 @@
fstab = services[:fstab] || Fstab.new
samba = services[:samba] || Samba.new
- nfs = services[:nfs] || NFS.new
adapter[:logicals].each do |logical|
logical[:shares] = (logical[:lvs] + logical[:snapshots]).inject({}) do |hash, lv|
@@ -340,7 +338,6 @@
hash[lv] = {
:mountpoint => mountpoint,
:samba => mountpoint && samba.shares.find { |sh| sh['path'] == mountpoint.mount_point },
- :nfs => mountpoint && nfs.filesystems.find { |fs| fs.path == mountpoint.mount_point },
}
hash
end
Modified: branches/iscsi-only/app/views/portal/_menu.erb
===================================================================
--- branches/iscsi-only/app/views/portal/_menu.erb 2010-08-30 11:39:01 UTC (rev 65)
+++ branches/iscsi-only/app/views/portal/_menu.erb 2010-08-30 12:43:21 UTC (rev 66)
@@ -18,7 +18,6 @@
<% menu.item( _("Services") ) do | sv | %>
<%= sv.item( _("NTP service"), "ntp_service" ) %>
<%= sv.item( _("SMB service"), "daemon_samba" ) %>
- <%= sv.item( _("NFS service"), "daemon_nfs" ) %>
<% end %>
<% menu.item(_("Networking")) do |net| %>
<% @cards.each do |card| %>
Modified: branches/iscsi-only/app/views/raid/logical.rhtml
===================================================================
--- branches/iscsi-only/app/views/raid/logical.rhtml 2010-08-30 11:39:01 UTC (rev 65)
+++ branches/iscsi-only/app/views/raid/logical.rhtml 2010-08-30 12:43:21 UTC (rev 66)
@@ -197,24 +197,7 @@
<%= submit_tag _('Apply') %>
<% end %>
- <% form_tag(url_for(:controller => 'raid', 'action' => 'nfs_apply'), :id => "nfs_#{ form_id }", :class => 'lvForm hidden') do %>
- <% nfs = shares[:nfs] %>
- <%= hidden_field_tag 'raid', @logical[:num] %>
- <%= hidden_field_tag 'driver', @logical[:adapter][:driver] %>
- <%= hidden_field_tag 'num', @logical[:adapter][:num] %>
- <%= hidden_field_tag 'lvname', lv.name %>
- <%= label_tag 'enabled', _('Sharing is') %>
- <%= radio_button_tag 'enabled', 'yes', nfs && nfs.enabled? %><%= _('on') %>
- <%= radio_button_tag 'enabled', '', !nfs || !nfs.enabled? %><%= _('off') %>
- <br class='clear' />
- <%= label_tag 'rw', _('Options') %>
- <%= check_box_tag 'rw', 'yes', nfs && nfs.default && nfs.default['rw'] %><%= _('Writable') %>
- <%= check_box_tag 'anonymous', 'yes', nfs && nfs.default && nfs.default['all_squash'] %><%= _('Public') %>
- <%= submit_tag _('Apply') %>
- <% end %>
-
-
</li>
<script type="text/javascript">
$(function() { bind_slider('<%= form_id %>',
@@ -270,7 +253,6 @@
<%= gauge(:value => lv.allocated, :class => ['orange', 'snapsize']) %>
<a href="#" id="a_samba_<%= form_id %>" class="sambaToggle service"><%= _('samba') %> <%= shares[:samba] && shares[:samba].enabled? ? _('on') : _('off') %></a>
- <a href="#" id="a_nfs_<%= form_id %>" class="nfsToggle service"><%= _('nfs') %> <%= shares[:nfs] && shares[:nfs].enabled? ? _('on') : _('off') %></a>
<% form_tag(url_for(:controller => 'raid', 'action' => 'samba_apply'), :id => "samba_#{ form_id }", :class => 'lvForm hidden') do %>
<% samba = shares[:samba] %>
<%= hidden_field_tag 'raid', @logical[:num] %>
@@ -333,24 +315,7 @@
<%= submit_tag _('Apply') %>
<% end %>
- <% form_tag(url_for(:controller => 'raid', 'action' => 'nfs_apply'), :id => "nfs_#{ form_id }", :class => 'lvForm hidden') do %>
- <% nfs = shares[:nfs] %>
- <%= hidden_field_tag 'raid', @logical[:num] %>
- <%= hidden_field_tag 'driver', @logical[:adapter][:driver] %>
- <%= hidden_field_tag 'num', @logical[:adapter][:num] %>
- <%= hidden_field_tag 'lvname', lv.name %>
- <%= label_tag 'enabled', _('Sharing is') %>
- <%= radio_button_tag 'enabled', 'yes', nfs && nfs.enabled? %><%= _('on') %>
- <%= radio_button_tag 'enabled', '', !nfs || !nfs.enabled? %><%= _('off') %>
- <br class='clear' />
- <%= label_tag 'rw', _('Options') %>
- <%= check_box_tag 'rw', 'yes', nfs && nfs.default && nfs.default['rw'] %><%= _('Writable') %>
- <%= check_box_tag 'anonymous', 'yes', nfs && nfs.default && nfs.default['all_squash'] %><%= _('Public') %>
- <%= submit_tag _('Apply') %>
- <% end %>
-
-
</li>
<script type="text/javascript">
$(function() { bind_slider('<%= form_id %>', <%= minimum_size %>, <%= lv.size + @logical[:vg].free %>); });
Modified: branches/iscsi-only/app/views/share/list.rhtml
===================================================================
--- branches/iscsi-only/app/views/share/list.rhtml 2010-08-30 11:39:01 UTC (rev 65)
+++ branches/iscsi-only/app/views/share/list.rhtml 2010-08-30 12:43:21 UTC (rev 66)
@@ -18,9 +18,6 @@
<td>
<%= link_to (share[:samba] && share[:samba].enabled) ? _('on') : _('off'), :action => 'samba', :uuid => share[:share].uuid %>
</td>
- <td>
- <%= link_to (share[:nfs] && share[:nfs].enabled?) ? _('on') : _('off'), :action => 'share', :uuid => share[:share].uuid %>
- </td>
</tr>
<tr>
<td colspan='*'><span class='hint'><%= share[:share].volume['comment'] %></span></td>
Modified: branches/iscsi-only/app/views/share/share.rhtml
===================================================================
--- branches/iscsi-only/app/views/share/share.rhtml 2010-08-30 11:39:01 UTC (rev 65)
+++ branches/iscsi-only/app/views/share/share.rhtml 2010-08-30 12:43:21 UTC (rev 66)
@@ -6,7 +6,6 @@
<ul id='tabs'>
<li id="current"><%= _('Overview') %></li>
<li><%= link_to(_('SMB'), { :action => 'samba', :uuid => @share.uuid }) %></li>
- <li><%= link_to(_('NFS'), { :action => 'nfs', :uuid => @share.uuid }) %></li>
<li><%= link_to(_('WebDAV'), { :action => 'dav', :uuid => @share.uuid }) %></li> -->
</ul>
@@ -26,19 +25,6 @@
<% end %>
</fieldset>
- <fieldset>
- <legend>NFS</legend>
- <% form_tag :action => 'nfs_apply', :uuid => @share.uuid do %>
- <table><tr><td><label for='enabled'><%= _('Exporting is') %></td><td>
- <%= radio_button_tag 'enabled', 'yes', @nfs && @nfs.enabled? %> <%= _('On') %><br />
- <%= radio_button_tag 'enabled', '', !@nfs || !@nfs.enabled? %> <%= _('Off') %></td></tr>
- <tr><td><%= _('Options') %></td><td>
- <%= check_box_tag 'rw', 'yes', @nfs && @nfs.default &&(@nfs.default['rw']) %> <%= _('Writable') %><br />
- <%= check_box_tag 'anonymous', 'yes', @nfs && @nfs.default && (!@nfs.default['no_all_squash'] || @nfs.default['all_squash']) %> <%= _('Public') %></td></tr>
- <tr><td></td><td> <%= submit_tag _('Apply') %></td></tr>
- </table>
- <% end %>
- </fieldset>
<!-- <fieldset>
<legend>FTP</legend>
@@ -68,8 +54,6 @@
<li><%= link_to(image_tag('share.png') + _('Shares overview'), { :controller => 'share' }, :class => "app_launcher") %></li>
<li><%= link_to(image_tag('lvm.png') + _('Volumes setup'), { :controller => 'volume', :action => 'lvs' }, :class => "app_launcher") %></li>
<li><%= link_to(image_tag('samba.png') + _('SMB service'), { :controller => 'samba' }, :class => "app_launcher") %></li>
- <li><%= link_to(image_tag('nfs.png') + _('NFS service'), { :controller => 'nfs' }, :class => "app_launcher") %></li>
- <li><%= link_to(image_tag('ftp.png') + _('FTP service'), { :controller => 'nfs' }, :class => "app_launcher") %></li>
<li><%= link_to(image_tag('dav.png') + _('WebDAV service'), { :controller => 'dav' }, :class => "app_launcher") %></li>
</ul>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-08-30 11:39:07
|
Revision: 65
http://astor.svn.sourceforge.net/astor/?rev=65&view=rev
Author: stargrave
Date: 2010-08-30 11:39:01 +0000 (Mon, 30 Aug 2010)
Log Message:
-----------
Some systems may omit vol_id utility. Currently just remark about that.
Modified Paths:
--------------
trunk/build/flash/steps/10generate_grub_menu
Modified: trunk/build/flash/steps/10generate_grub_menu
===================================================================
--- trunk/build/flash/steps/10generate_grub_menu 2010-08-30 11:34:39 UTC (rev 64)
+++ trunk/build/flash/steps/10generate_grub_menu 2010-08-30 11:39:01 UTC (rev 65)
@@ -2,6 +2,7 @@
mkdir -p $CHROOT_PATH/boot/grub
+# vol_id call can be replaced by: blkid -o udev
partition1=`vol_id /dev/mapper/${LOOP_NODE}p1 | sed -n 's/^ID_FS_UUID=\(.*\)$/\1/p'`
partition2=`vol_id /dev/mapper/${LOOP_NODE}p2 | sed -n 's/^ID_FS_UUID=\(.*\)$/\1/p'`
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ta...@us...> - 2010-08-30 11:34:46
|
Revision: 64
http://astor.svn.sourceforge.net/astor/?rev=64&view=rev
Author: tanches
Date: 2010-08-30 11:34:39 +0000 (Mon, 30 Aug 2010)
Log Message:
-----------
removed stale/no longer used files
Removed Paths:
-------------
branches/iscsi-only/app/controllers/ftp_controller.rb
branches/iscsi-only/app/controllers/nfs_controller.rb
branches/iscsi-only/app/models/ftp.rb
branches/iscsi-only/app/models/nfs.rb
branches/iscsi-only/app/views/ftp/
branches/iscsi-only/app/views/nfs/
branches/iscsi-only/app/views/quotas/
Deleted: branches/iscsi-only/app/controllers/ftp_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/ftp_controller.rb 2010-08-30 11:24:07 UTC (rev 63)
+++ branches/iscsi-only/app/controllers/ftp_controller.rb 2010-08-30 11:34:39 UTC (rev 64)
@@ -1,47 +0,0 @@
-# Astor - network attached storage configurable via Web-interface
-# Copyright (C) 2009 ETegro Technologies, PLC
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-class FtpController < ApplicationController
-
- init_gettext controller_name
-
- DEFAULT_TAGS = [ N_('services') ]
- DESCRIPTION = N_("FTP service")
- ICON = "ftp"
-
- def index
- @ftp = FTP.new
- end
-
- def status
- i = params['meta_refresh'].to_i
- @meta_refresh = i > 0 ? i : 5
- @ftp = FTP.new
- end
-
- def save
- begin
- @ftp = FTP.new
- @ftp.enabled = params['enabled'] == 'on' if ['on', 'off'].include? params['enabled']
- @ftp.restart if @ftp.enabled?
- flash[:success] = _('Service settings saved')
- rescue
- flash[:error] = $!.to_s
- end
- redirect_to :action => 'index'
- end
-
-end
Deleted: branches/iscsi-only/app/controllers/nfs_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/nfs_controller.rb 2010-08-30 11:24:07 UTC (rev 63)
+++ branches/iscsi-only/app/controllers/nfs_controller.rb 2010-08-30 11:34:39 UTC (rev 64)
@@ -1,47 +0,0 @@
-# Astor - network attached storage configurable via Web-interface
-# Copyright (C) 2009 ETegro Technologies, PLC
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-class NfsController < ApplicationController
-
- init_gettext controller_name
-
- DEFAULT_TAGS = [ N_('services') ]
- DESCRIPTION = N_("NFS service")
- ICON = "nfs"
-
- def index
- @nfs = NFS.new
- end
-
- def status
- i = params['meta_refresh'].to_i
- @meta_refresh = i > 0 ? i : 5
- @nfs = NFS.new
- end
-
- def save
- begin
- @nfs = NFS.new
- @nfs.enabled = params['enabled'] == 'on' if ['on', 'off'].include? params['enabled']
- @nfs.restart if @nfs.enabled?
- flash[:success] = _('Service settings saved')
- rescue
- flash[:error] = $!
- end
- redirect_to :action => 'index'
- end
-
-end
Deleted: branches/iscsi-only/app/models/ftp.rb
===================================================================
--- branches/iscsi-only/app/models/ftp.rb 2010-08-30 11:24:07 UTC (rev 63)
+++ branches/iscsi-only/app/models/ftp.rb 2010-08-30 11:34:39 UTC (rev 64)
@@ -1,196 +0,0 @@
-# Astor - network attached storage configurable via Web-interface
-# Copyright (C) 2009 ETegro Technologies, PLC
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-class FTP
-
- include Service
-
- class Directory
- attr_accessor :path, :public, :writeable, :allowed_users, :enabled, :restricted, :allowed_groups
-
- def initialize
- @allowed_users = []
- @allowed_groups = []
- end
-
- def enabled
- @enabled && !@restricted
- end
-
- alias_method :enabled?, :enabled
- end
-
- attr_accessor :directories, :require_email
-
- def initialize
- @require_email = true
-
- reread
- end
-
- def reread
- @pro = Proftpd.new
- @directories = {}
- anonymous = @pro[:anonymous] || {}
- @pro.directories.each do |entry|
- next if entry.path == Proftpd::ROOT
- dir = Directory.new
- dir.path = entry.path
- dir.restricted = !entry[:hide] || !entry[:hide].value
- dir.writeable = true
- dir.enabled = true
- entry.children.each do |limit|
- next unless limit.name == Proftpd::LIMIT
- order = limit[:order] && limit[:order].value
- allowed_users = limit[:allowed_users] && limit[:allowed_users].value
- allowed_groups = limit[:allowed_groups] && limit[:allowed_groups].value
- case limit.value
- when /#{Proftpd::READ}/, /#{Proftpd::DIRS}/, Proftpd::ALL
- dir.enabled = order != Proftpd::DENY
- dir.allowed_users = allowed_users.split(',').delete_if { |username| username == Proftpd::ANY } if allowed_users
- dir.allowed_groups = allowed_groups.split(',').delete_if { |groupname| groupname == Proftpd::ANY } if allowed_groups
- when Proftpd::WRITE
- dir.writeable = order != Proftpd::DENY
- end
- end
- dir.public = true
- if anon_entry = anonymous[dir.path]
- anon_entry.children.each do |limit|
- next unless limit.name == Proftpd::LIMIT
- if limit.value == Proftpd::ALL
- dir.public = !limit[:order] || limit[:order].value != Proftpd::DENY
- end
- end
- end
- @directories[dir.path] = dir
- end
- end
-
- def sync
- pro = Proftpd.new(:empty => true)
- anonymous = pro[:anonymous]
-
- @directories.each do |path, dir|
- entry = Proftpd::Directory.new(path)
- pro[path] = entry
-
- unless dir.writeable
- entry << limit_disallow_write
- end
- if dir.enabled
- unless dir.writeable
- entry << limit_allow_read(dir.allowed_users, dir.allowed_groups)
- else
- entry << limit_allow_all(dir.allowed_users, dir.allowed_groups)
- end
- else
- entry << limit_disallow_all(dir.allowed_users, dir.allowed_groups)
- end
- unless dir.restricted
- entry << Proftpd::Entry.new(Proftpd::HIDE, true)
- end
-
- anon_entry = Proftpd::Directory.new(path)
- anonymous[path] = anon_entry
- if dir.enabled && dir.public
- unless dir.writeable
- anon_entry << limit_disallow_write
- end
- else
- anon_entry << limit_disallow_all
- end
- unless dir.restricted
- anon_entry << Proftpd::Entry.new(Proftpd::HIDE, true)
- end
- end
-
- pro.require_email = @require_email
- pro.sync
- reread
- end
-
- def rewrite_message(services = {})
- lvm = services[:lvm] || LVM.new
- fstab = services[:fstab] || Fstab.new
- File.open(Proftpd::MESSAGE, "w+") do |f|
- lvm.lvs.each do |lv|
- vol = fstab.find_by_device lv.device
- next unless vol
- dir = @directories.values.find { |dir| dir.path == vol.mount_point }
- if dir && (dir.enabled || dir.restricted)
- name = lv['name'].blank? ? lv.name : lv['name']
- f.printf("%-20.20s %-35.35s -> %s\n", name, lv['comment'] && lv['comment'] || "", dir.path.split('/').last)
- end
- end
- end
- def_user, def_group = Winbind.new.defaults
- FileUtils.chown(def_user, def_group, Proftpd::MESSAGE)
- end
-
- def limit_allow_read(users = [], groups = [])
- returning Proftpd::Entry.new(Proftpd::LIMIT, Proftpd::READ, Proftpd::DIRS) do |limit|
- limit << Proftpd::Entry.new(Proftpd::USER_BLACK_LIST, Proftpd::ANY)
- limit << Proftpd::Entry.new(Proftpd::GROUP_BLACK_LIST, Proftpd::ANY)
- users = users.blank? ? Proftpd::ANY : users.join(",")
- groups = groups.blank? ? Proftpd::ANY : groups.join(",")
- limit << Proftpd::Entry.new(Proftpd::USER_WHITE_LIST, users)
- limit << Proftpd::Entry.new(Proftpd::GROUP_WHITE_LIST, groups)
- limit << Proftpd::Entry.new(Proftpd::ORDER, Proftpd::ALLOW)
- end
- end
-
- def limit_allow_all(users = [], groups = [])
- returning Proftpd::Entry.new(Proftpd::LIMIT, Proftpd::ALL) do |limit|
- limit << Proftpd::Entry.new(Proftpd::USER_BLACK_LIST, Proftpd::ANY)
- limit << Proftpd::Entry.new(Proftpd::GROUP_BLACK_LIST, Proftpd::ANY)
- users = users.blank? ? Proftpd::ANY : users.join(",")
- groups = groups.blank? ? Proftpd::ANY : groups.join(",")
- limit << Proftpd::Entry.new(Proftpd::USER_WHITE_LIST, users)
- limit << Proftpd::Entry.new(Proftpd::GROUP_WHITE_LIST, groups)
- limit << Proftpd::Entry.new(Proftpd::ORDER, Proftpd::ALLOW)
- end
- end
-
- def limit_disallow_write(users = [], groups = [])
- returning Proftpd::Entry.new(Proftpd::LIMIT, Proftpd::WRITE) do |limit|
- limit << Proftpd::Entry.new(Proftpd::USER_BLACK_LIST, Proftpd::ANY)
- limit << Proftpd::Entry.new(Proftpd::GROUP_BLACK_LIST, Proftpd::ANY)
- users = users.blank? ? Proftpd::ANY : users.join(",")
- groups = groups.blank? ? Proftpd::ANY : groups.join(",")
- limit << Proftpd::Entry.new(Proftpd::USER_WHITE_LIST, users)
- limit << Proftpd::Entry.new(Proftpd::GROUP_WHITE_LIST, groups)
- limit << Proftpd::Entry.new(Proftpd::ORDER, Proftpd::DENY)
- end
- end
-
- def limit_disallow_all(users = [], groups = [])
- returning Proftpd::Entry.new(Proftpd::LIMIT, Proftpd::ALL) do |limit|
- limit << Proftpd::Entry.new(Proftpd::USER_BLACK_LIST, Proftpd::ANY)
- limit << Proftpd::Entry.new(Proftpd::GROUP_BLACK_LIST, Proftpd::ANY)
- users = users.blank? ? Proftpd::ANY : users.join(",")
- groups = groups.blank? ? Proftpd::ANY : groups.join(",")
- limit << Proftpd::Entry.new(Proftpd::USER_WHITE_LIST, users)
- limit << Proftpd::Entry.new(Proftpd::GROUP_WHITE_LIST, groups)
- limit << Proftpd::Entry.new(Proftpd::ORDER, Proftpd::DENY)
- end
- end
-
- def service
- @pro.service
- end
-
-end
-
Deleted: branches/iscsi-only/app/models/nfs.rb
===================================================================
--- branches/iscsi-only/app/models/nfs.rb 2010-08-30 11:24:07 UTC (rev 63)
+++ branches/iscsi-only/app/models/nfs.rb 2010-08-30 11:34:39 UTC (rev 64)
@@ -1,251 +0,0 @@
-# Astor - network attached storage configurable via Web-interface
-# Copyright (C) 2009 ETegro Technologies, PLC
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-class NFS
-
- EXPORTS='/etc/exports'
-
- include Service
-
- def service
- 'nfs-kernel-server'
- end
-
- def initialize
- reread
- end
-
- class Host
-
- DEFAULT_OPTIONS = {
- "secure" => true,
- "rw" => false,
- "sync" => true,
- "wdelay" => true,
- "secure_locks" => true,
- "acl" => true,
- "root_squash" => true,
- "anonuid" => 65534,
- "anongid" => 65534,
- "no_all_squash" => true,
- "hide" => true,
- };
-
- STRONG_OPTIONS = {
- "anonuid" => 65534,
- "anongid" => 65534,
- "hide" => true,
- "root_squash" => true,
- "secure_locks" => true,
- "sync" => true,
- "subtree_check" => true
- };
-
- attr_accessor :name, :type, :options
-
- def [](key)
- @options[key]
- end
-
- def []=(key, value)
- @options = NFS.merge_options(@options, { key => value })
- value
- end
-
- def initialize(name, options)
- @name = name
- @options = NFS.merge_options(DEFAULT_OPTIONS, options)
- end
-
- def apply_strong_options
- @options = NFS.merge_options(@options, STRONG_OPTIONS)
- end
-
- def to_s
- (opts = @options.dup).delete_if { |k, v| DEFAULT_OPTIONS[k] == v }
- "#{ @name }" + ( opts.empty? ? '' : '(' + opts.collect { |k,v| v != true ? "#{k}=#{v}" : k }.join(",") + ')' )
- end
- end
-
- class Filesystem
- attr_accessor :path, :hosts, :default
- attr_writer :restricted
-
- def restricted?
- @restricted
- end
-
- def enabled?
- @enabled && !@restricted
- end
-
- def enabled=(val)
- @enabled = val
- @restricted = false
- end
-
- def initialize(path, hosts, enabled = true, restricted = false)
- @path = path
- @hosts = hosts
- @enabled = enabled
- @restricted = restricted
- @default = hosts.find { |h| h.name == '*' }
- end
-
- def apply_strong_options
- @hosts.each {|h| h.apply_strong_options }
- end
-
- def to_s
- (@restricted ? RESTRICT_PREF : @enabled ? '' : DISAB_PREF) + sprintf("%-24s %s", @path, @hosts.collect { |h| h.to_s }.join(' '))
- end
- end
-
- DISAB_PREF = '#$%&'
- RESTRICT_PREF = '#&%$'
-
- attr_accessor :filesystems
-
- def restrict(fs)
- unexport(fs)
- fs.restricted = true
- sync
- end
-
- def add(fs)
- @filesystems << fs
- sync
- reexport
- end
-
- def del(fs)
- unexport(fs)
- @filesystems.delete fs
- sync
- end
-
- def enable(fs)
- fs.enabled = true
- sync
- reexport
- end
-
- def disable(fs)
- unexport(fs)
- fs.enabled = false
- sync
- end
-
- def restrict(fs)
- unexport(fs)
- fs.restricted = true
- sync
- end
-
-# def export(path)
-# path = path.path if path.respond_to? :path
-# system "exportfs '#{path}'"
-# end
-
- def unexport(path)
- path = path.path if path.respond_to? :path
- raise 'Failed to unexport #{ fs.path }' unless system "exportfs -u *:'#{path}'"
- end
-
- def reexport
- system 'exportfs -r'
- end
-
- def reread
- @filesystems = _reread
- end
-
- def _reread
- @r ||= /^\s*([^#]+)|^#{DISAB_PREF.gsub(/(.)/) { |m| "[#{$1}]" }}\s*(.+)|^#{RESTRICT_PREF.gsub(/(.)/) { |m| "[#{$1}]" }}\s*(.+)/
- File.open(EXPORTS).readlines.inject([]) do |hsh, str|
- disabled = str.index(DISAB_PREF) == 0
- restricted = str.index(RESTRICT_PREF) == 0
- unless (useful = str.chomp =~ @r ? $1 || $2 || $3 : "").empty?
- toks = useful.split
- path = toks.first
- defaults = {}
- hsh << Filesystem.new(path, toks[1..-1].inject([]) do |hosts, str|
- case str
- when @r2 ||= /^([^(]+)\((.+)\)/ then hosts << Host.new($1, NFS.merge_options(defaults, into_options($2.split(','))))
- when @r3 ||= /^([^-(][^()]*)/ then hosts << Host.new($1, defaults)
- when @r4 ||= /^\((.*)\)/ then hosts << Host.new('*', NFS.merge_options(defaults, into_options($1.split(','))))
- when @r5 ||= /^-(.+)/ then defaults = into_options($1.split(','))
- end
- hosts
- end, !disabled, restricted)
- end
- hsh
- end
- end
-
- def into_options(array)
- array.inject({}) do |h, a|
- if a =~ (@option_reg ||= /^(.+)=(.+)$/)
- h[$1] = $2
- else
- h[a] = true
- end
- h
- end
- end
-
- def self.merge_options(default, specific)
- default = default.dup
- specific.each { |ok, ov| default.delete_if { |dk, dv| option_replaces?(ok, dk) } }
- default.merge(specific)
- end
-
- def self.option_replaces?(new, old)
- (@replacements ||= [
- [ 'sync', 'async' ],
- [ 'secure', 'insecure' ],
- [ 'all_squash', 'no_all_squash' ],
- [ 'root_squash', 'no_root_squash' ],
- [ 'rw', 'ro' ],
- [ 'wdelay', 'no_wdelay'],
- [ 'hide', 'nohide' ],
- [ 'insecure_locks' , 'secure_locks' ],
- [ 'no_auth_nlm', 'auth_nlm' ],
- [ 'insecure_locks', 'auth_nlm' ],
- [ 'secure_locks', 'no_auth_nlm' ],
- [ 'subtree_check', 'no_subtree_check' ]
- ].map { |a| { a.first => 0, a.last => 0 } }).include?({ new => 0, old => 0 })
- end
-
- def to_s
- @filesystems.collect { |fs| fs.to_s }.join("\n")
- end
-
- def nfsstat
- `nfsstat --verbose`
- end
-
- def sync
- File.open(EXPORTS, "w") do |f|
- @filesystems.each { |fs| fs.apply_strong_options }
- f << to_s
- end
- reread
- reexport
- end
-
-end
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ta...@us...> - 2010-08-30 11:24:13
|
Revision: 63
http://astor.svn.sourceforge.net/astor/?rev=63&view=rev
Author: tanches
Date: 2010-08-30 11:24:07 +0000 (Mon, 30 Aug 2010)
Log Message:
-----------
ftp is deleted now
Modified Paths:
--------------
branches/iscsi-only/app/controllers/application_controller.rb
branches/iscsi-only/app/controllers/portal_controller.rb
branches/iscsi-only/app/controllers/raid_controller.rb
branches/iscsi-only/app/models/fstab.rb
branches/iscsi-only/app/models/raid.rb
branches/iscsi-only/app/views/portal/_menu.erb
branches/iscsi-only/app/views/portal/index.erb
branches/iscsi-only/app/views/raid/logical.rhtml
branches/iscsi-only/app/views/share/share.rhtml
Modified: branches/iscsi-only/app/controllers/application_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/application_controller.rb 2010-08-30 10:57:39 UTC (rev 62)
+++ branches/iscsi-only/app/controllers/application_controller.rb 2010-08-30 11:24:07 UTC (rev 63)
@@ -91,9 +91,6 @@
@nfs = params['nfs'] || NFS.new
end
- def fetch_ftp
- @ftp = params['ftp'] || FTP.new
- end
def fetch_fstab
@fstab = params['fstab'] || Fstab.new
Modified: branches/iscsi-only/app/controllers/portal_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/portal_controller.rb 2010-08-30 10:57:39 UTC (rev 62)
+++ branches/iscsi-only/app/controllers/portal_controller.rb 2010-08-30 11:24:07 UTC (rev 63)
@@ -131,11 +131,10 @@
begin
@prefetched['samba'] = @samba = Samba.new
@prefetched['nfs'] = @nfs = NFS.new
- @prefetched['ftp'] = @ftp = FTP.new
@prefetched['fstab'] = @fstab = Fstab.new
@prefetched['lvm'] = @lvm = LVM.new
@adapters = Raid.adapters(:full => 0,
- :samba => @samba, :nfs => @nfs, :ftp => @ftp,
+ :samba => @samba, :nfs => @nfs,
:fstab => @fstab, :lvm => @lvm)
@adapters.each do |adapter|
Modified: branches/iscsi-only/app/controllers/raid_controller.rb
===================================================================
--- branches/iscsi-only/app/controllers/raid_controller.rb 2010-08-30 10:57:39 UTC (rev 62)
+++ branches/iscsi-only/app/controllers/raid_controller.rb 2010-08-30 11:24:07 UTC (rev 63)
@@ -278,36 +278,6 @@
end
end
- def ftp_apply
- @lvname = params['lvname']
- begin
- lv = (@logical[:lvs] + @logical[:snapshots]).find { |lv| lv.name == @lvname }
- mountpoint = @logical[:shares][lv][:mountpoint]
- raise _("Mountpoint not defined for logical volume") unless mountpoint
- dir = @ftp.directories[mountpoint.mount_point]
- if !dir && params[:enabled] == 'yes'
- dir = FTP::Directory.new
- dir.path = mountpoint.mount_point
- @ftp.directories[dir.path] = dir
- end
- if dir
- dir.enabled = params[:enabled] == 'yes'
- dir.writeable = params[:writeable] == 'yes'
- dir.public = params[:public] == 'yes'
- dir.allowed_users = params[:allowed_users] || []
- dir.allowed_groups = params[:allowed_groups] || []
- @ftp.sync
- @ftp.rewrite_message(:lvm => @lvm, :fstab => @fstab)
- @ftp.restart if @ftp.status == :running
- end
- flash[:success] = _("FTP configuration successfully updated")
- redirect_to :action => 'logical', :driver => @logical[:adapter][:driver], :num => @logical[:adapter][:num],
- :raid => @logical[:num], :lvname => @lvname
- rescue
- flash[:error] = $!.to_s
- render :action => 'logical'
- end
- end
def samba_apply
@lvname = params['lvname']
@@ -390,12 +360,9 @@
end
before_filter :fetch_adapter
- before_filter :fetch_logical, :only => [:logical, :logical_delete, :create_lv, :remove_lv, :resize_lv, :update_lv, :samba_apply, :nfs_apply, :ftp_apply ]
+ before_filter :fetch_logical, :only => [:logical, :logical_delete, :create_lv, :remove_lv, :resize_lv, :update_lv, :samba_apply, :nfs_apply ]
before_filter :fetch_samba, :only => [ :samba_apply ]
before_filter :fetch_nfs, :only => [ :nfs_apply ]
- before_filter :fetch_ftp, :only => [ :ftp_apply ]
- before_filter :fetch_fstab, :only => [ :ftp_apply ]
- before_filter :fetch_lvm, :only => [ :ftp_apply ]
before_filter :fetch_principals, :except => [ :new, :physical, :physical_hotspare, :smart ]
Modified: branches/iscsi-only/app/models/fstab.rb
===================================================================
--- branches/iscsi-only/app/models/fstab.rb 2010-08-30 10:57:39 UTC (rev 62)
+++ branches/iscsi-only/app/models/fstab.rb 2010-08-30 11:24:07 UTC (rev 63)
@@ -282,15 +282,6 @@
end
end
- FTP.service_eval do |ftp|
- dir = ftp.directories[volume.mount_point]
- if dir && dir.restricted?
- dir.enabled = true
- ftp.sync
- ftp.rewrite_message
- ftp.restart if ftp.status == :running
- end
- end
end
def stop_services_for(volume, remove = nil)
@@ -320,21 +311,6 @@
end
end
- FTP.service_eval do |ftp|
- dir = ftp.directories[volume.mount_point]
- if dir
- if remove || dir.enabled?
- if remove
- ftp.directories.delete(volume.mount_point)
- elsif fs.enabled?
- dir.restricted = true
- end
- ftp.sync
- ftp.rewrite_message
- ftp.restart if ftp.status == :running
- end
- end
- end
end
Modified: branches/iscsi-only/app/models/raid.rb
===================================================================
--- branches/iscsi-only/app/models/raid.rb 2010-08-30 10:57:39 UTC (rev 62)
+++ branches/iscsi-only/app/models/raid.rb 2010-08-30 11:24:07 UTC (rev 63)
@@ -91,7 +91,6 @@
services[:samba] = options[:samba] || Samba.new
services[:fstab] = options[:fstab] || Fstab.new
services[:nfs] = options[:nfs] || NFS.new
- services[:ftp] = options[:ftp] || FTP.new
end
adapters.each do |a|
_adapter(a, options)
@@ -334,7 +333,6 @@
fstab = services[:fstab] || Fstab.new
samba = services[:samba] || Samba.new
nfs = services[:nfs] || NFS.new
- ftp = services[:ftp] || FTP.new
adapter[:logicals].each do |logical|
logical[:shares] = (logical[:lvs] + logical[:snapshots]).inject({}) do |hash, lv|
@@ -343,7 +341,6 @@
:mountpoint => mountpoint,
:samba => mountpoint && samba.shares.find { |sh| sh['path'] == mountpoint.mount_point },
:nfs => mountpoint && nfs.filesystems.find { |fs| fs.path == mountpoint.mount_point },
- :ftp => mountpoint && ftp.directories[mountpoint.mount_point]
}
hash
end
Modified: branches/iscsi-only/app/views/portal/_menu.erb
===================================================================
--- branches/iscsi-only/app/views/portal/_menu.erb 2010-08-30 10:57:39 UTC (rev 62)
+++ branches/iscsi-only/app/views/portal/_menu.erb 2010-08-30 11:24:07 UTC (rev 63)
@@ -18,7 +18,6 @@
<% menu.item( _("Services") ) do | sv | %>
<%= sv.item( _("NTP service"), "ntp_service" ) %>
<%= sv.item( _("SMB service"), "daemon_samba" ) %>
- <%= sv.item( _("FTP service"), "daemon_ftp" ) %>
<%= sv.item( _("NFS service"), "daemon_nfs" ) %>
<% end %>
<% menu.item(_("Networking")) do |net| %>
Modified: branches/iscsi-only/app/views/portal/index.erb
===================================================================
--- branches/iscsi-only/app/views/portal/index.erb 2010-08-30 10:57:39 UTC (rev 62)
+++ branches/iscsi-only/app/views/portal/index.erb 2010-08-30 11:24:07 UTC (rev 63)
@@ -22,8 +22,6 @@
<%= applet({ :controller => 'updates', :action => 'index' }, :viewport => 'system_update') %>
<div class='daemonsWrapper'></div>
- <%= applet({ :controller => 'nfs', :action => 'index' }, :viewport => 'daemon_nfs', :class => 'daemon', :vp_class => 'ifaceVp') %>
- <%= applet({ :controller => 'ftp', :action => 'index' }, :viewport => 'daemon_ftp', :class => 'daemon', :vp_class => 'ifaceVp') %>
<%= applet({ :controller => 'snmpd', :action => 'index' }, :viewport => 'daemon_snmp', :class => 'daemon', :vp_class => 'ifaceVp') %>
Modified: branches/iscsi-only/app/views/raid/logical.rhtml
===================================================================
--- branches/iscsi-only/app/views/raid/logical.rhtml 2010-08-30 10:57:39 UTC (rev 62)
+++ branches/iscsi-only/app/views/raid/logical.rhtml 2010-08-30 11:24:07 UTC (rev 63)
@@ -212,63 +212,9 @@
<%= check_box_tag 'anonymous', 'yes', nfs && nfs.default && nfs.default['all_squash'] %><%= _('Public') %>
<%= submit_tag _('Apply') %>
<% end %>
- <% form_tag(url_for(:controller => 'raid', 'action' => 'ftp_apply'), :id => "ftp_#{ form_id }", :class => 'lvForm hidden') do %>
- <% ftp = shares[:ftp] %>
- <%= hidden_field_tag 'raid', @logical[:num] %>
- <%= hidden_field_tag 'driver', @logical[:adapter][:driver] %>
- <%= hidden_field_tag 'num', @logical[:adapter][:num] %>
- <%= hidden_field_tag 'lvname', lv.name %>
- <%= label_tag 'enabled', _('Sharing is') %>
- <%= radio_button_tag 'enabled', 'yes', ftp && ftp.enabled? %><%= _('on') %>
- <%= radio_button_tag 'enabled', '', !ftp || !ftp.enabled? %><%= _('off') %>
- <br class='clear' />
- <%= label_tag 'writeable', _('Options') %>
- <%= check_box_tag 'writeable', 'yes', ftp && ftp.writeable %><%= _('Writable') %>
- <%= check_box_tag 'public', 'yes', ftp && ftp.public %><%= _('Public') %>
- <%= label_tag 'allowed_users', _('Allowed users') %>
- <fieldset class='mover'>
- <% allowed_users = ftp ? ftp.allowed_users : [] %>
- <% users = @users.collect { |user| user.name } %>
- <%= select_tag('available_users', options_for_select(users - allowed_users), :multiple => true, :size => 7, :class => 'left') %>
- <%= select_tag('allowed_users', options_for_select(allowed_users), :multiple => true, :size => 7, :class => 'right') %>
- <div class='buttons'>
- <button type="button">
- ←
- </button>
- <button type="button">
- ⇇
- </button>
- <button type="button">
- ⇉
- </button>
- <button type="button">
- →
- </button>
- </div>
- </fieldset>
- <%= label_tag 'allowed_groups', _('Allowed groups') %>
- <fieldset class='mover'>
- <% allowed_groups = ftp ? ftp.allowed_groups : [] %>
- <% groups = @groups.collect { |group| group.name } %>
- <%= select_tag('available_groups', options_for_select(groups - allowed_groups), :multiple => true, :size => 7, :class => 'left') %>
- <%= select_tag('allowed_groups', options_for_select(allowed_groups), :multiple => true, :size => 7, :class => 'right') %>
- <div class='buttons'>
- <button type="button">
- ←
- </button>
- <button type="button">
- ⇇
- </button>
- <button type="button">
- ⇉
- </button>
- <button type="button">
- →
- </button>
- </div>
- </fieldset>
- <%= submit_tag _('Apply') %>
- <% end %>
+
+
+
</li>
<script type="text/javascript">
$(function() { bind_slider('<%= form_id %>',
@@ -325,7 +271,6 @@
<a href="#" id="a_samba_<%= form_id %>" class="sambaToggle service"><%= _('samba') %> <%= shares[:samba] && shares[:samba].enabled? ? _('on') : _('off') %></a>
<a href="#" id="a_nfs_<%= form_id %>" class="nfsToggle service"><%= _('nfs') %> <%= shares[:nfs] && shares[:nfs].enabled? ? _('on') : _('off') %></a>
- <a href="#" id="a_ftp_<%= form_id %>" class="ftpToggle service"><%= _('ftp') %> <%= shares[:ftp] && shares[:ftp].enabled? ? _('on') : _('off') %></a>
<% form_tag(url_for(:controller => 'raid', 'action' => 'samba_apply'), :id => "samba_#{ form_id }", :class => 'lvForm hidden') do %>
<% samba = shares[:samba] %>
<%= hidden_field_tag 'raid', @logical[:num] %>
@@ -403,63 +348,9 @@
<%= check_box_tag 'anonymous', 'yes', nfs && nfs.default && nfs.default['all_squash'] %><%= _('Public') %>
<%= submit_tag _('Apply') %>
<% end %>
- <% form_tag(url_for(:controller => 'raid', 'action' => 'ftp_apply'), :id => "ftp_#{ form_id }", :class => 'lvForm hidden') do %>
- <% ftp = shares[:ftp] %>
- <%= hidden_field_tag 'raid', @logical[:num] %>
- <%= hidden_field_tag 'driver', @logical[:adapter][:driver] %>
- <%= hidden_field_tag 'num', @logical[:adapter][:num] %>
- <%= hidden_field_tag 'lvname', lv.name %>
- <%= label_tag 'enabled', _('Sharing is') %>
- <%= radio_button_tag 'enabled', 'yes', ftp && ftp.enabled? %><%= _('on') %>
- <%= radio_button_tag 'enabled', '', !ftp || !ftp.enabled? %><%= _('off') %>
- <br class='clear' />
- <%= label_tag 'writeable', _('Options') %>
- <%= check_box_tag 'writeable', 'yes', ftp && ftp.writeable %><%= _('Writable') %>
- <%= check_box_tag 'public', 'yes', ftp && ftp.public %><%= _('Public') %>
- <%= label_tag 'allowed_users', _('Allowed users') %>
- <fieldset class='mover'>
- <% allowed_users = ftp ? ftp.allowed_users : [] %>
- <% users = @users.collect { |user| user.name } %>
- <%= select_tag('available_users', options_for_select(users - allowed_users), :multiple => true, :size => 7, :class => 'left') %>
- <%= select_tag('allowed_users', options_for_select(allowed_users), :multiple => true, :size => 7, :class => 'right') %>
- <div class='buttons'>
- <button type="button">
- ←
- </button>
- <button type="button">
- ⇇
- </button>
- <button type="button">
- ⇉
- </button>
- <button type="button">
- →
- </button>
- </div>
- </fieldset>
- <%= label_tag 'allowed_groups', _('Allowed groups') %>
- <fieldset class='mover'>
- <% allowed_groups = ftp ? ftp.allowed_groups : [] %>
- <% groups = @groups.collect { |group| group.name } %>
- <%= select_tag('available_groups', options_for_select(groups - allowed_groups), :multiple => true, :size => 7, :class => 'left') %>
- <%= select_tag('allowed_groups', options_for_select(allowed_groups), :multiple => true, :size => 7, :class => 'right') %>
- <div class='buttons'>
- <button type="button">
- ←
- </button>
- <button type="button">
- ⇇
- </button>
- <button type="button">
- ⇉
- </button>
- <button type="button">
- →
- </button>
- </div>
- </fieldset>
- <%= submit_tag _('Apply') %>
- <% end %>
+
+
+
</li>
<script type="text/javascript">
$(function() { bind_slider('<%= form_id %>', <%= minimum_size %>, <%= lv.size + @logical[:vg].free %>); });
Modified: branches/iscsi-only/app/views/share/share.rhtml
===================================================================
--- branches/iscsi-only/app/views/share/share.rhtml 2010-08-30 10:57:39 UTC (rev 62)
+++ branches/iscsi-only/app/views/share/share.rhtml 2010-08-30 11:24:07 UTC (rev 63)
@@ -7,7 +7,6 @@
<li id="current"><%= _('Overview') %></li>
<li><%= link_to(_('SMB'), { :action => 'samba', :uuid => @share.uuid }) %></li>
<li><%= link_to(_('NFS'), { :action => 'nfs', :uuid => @share.uuid }) %></li>
-<!-- <li><%= link_to(_('FTP'), { :action => 'ftp', :uuid => @share.uuid }) %></li>
<li><%= link_to(_('WebDAV'), { :action => 'dav', :uuid => @share.uuid }) %></li> -->
</ul>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-08-30 10:57:45
|
Revision: 62
http://astor.svn.sourceforge.net/astor/?rev=62&view=rev
Author: stargrave
Date: 2010-08-30 10:57:39 +0000 (Mon, 30 Aug 2010)
Log Message:
-----------
iscsi-only branch should install itself while building chroot.
Modified Paths:
--------------
branches/iscsi-only/build/chroot/steps/15install_rorapp
Modified: branches/iscsi-only/build/chroot/steps/15install_rorapp
===================================================================
--- branches/iscsi-only/build/chroot/steps/15install_rorapp 2010-08-30 10:56:25 UTC (rev 61)
+++ branches/iscsi-only/build/chroot/steps/15install_rorapp 2010-08-30 10:57:39 UTC (rev 62)
@@ -1,4 +1,4 @@
#!/bin/sh
rm -fr ${CHROOT_PATH}${NAS_DIR}
-svn export https://astor.svn.sourceforge.net/svnroot/astor/trunk ${CHROOT_PATH}${NAS_DIR}
+svn export https://astor.svn.sourceforge.net/svnroot/astor/branches/iscsi-only ${CHROOT_PATH}${NAS_DIR}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-08-30 10:56:31
|
Revision: 61
http://astor.svn.sourceforge.net/astor/?rev=61&view=rev
Author: stargrave
Date: 2010-08-30 10:56:25 +0000 (Mon, 30 Aug 2010)
Log Message:
-----------
Merged r53-r60 changes.
Modified Paths:
--------------
branches/iscsi-only/build/chroot/config
branches/iscsi-only/build/chroot/gems
branches/iscsi-only/build/chroot/packages_remove
branches/iscsi-only/build/chroot/steps/09install_rubygem
branches/iscsi-only/build/chroot/steps/15install_rorapp
Removed Paths:
-------------
branches/iscsi-only/build/chroot/steps/21remove_subversion_files
Property Changed:
----------------
branches/iscsi-only/build/chroot/
Property changes on: branches/iscsi-only/build/chroot
___________________________________________________________________
Added: svn:mergeinfo
+ /trunk/build/chroot:54-60
Modified: branches/iscsi-only/build/chroot/config
===================================================================
--- branches/iscsi-only/build/chroot/config 2010-08-30 10:43:00 UTC (rev 60)
+++ branches/iscsi-only/build/chroot/config 2010-08-30 10:56:25 UTC (rev 61)
@@ -5,7 +5,7 @@
REPOSITORY_URL=ftp://192.168.10.11/Linux/Repository/debian
# Gem-related
-RUBYGEMS_URL=http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz
+RUBYGEMS_URL=http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
# Nas-related
NAS_DIR=/usr/local/nas
Modified: branches/iscsi-only/build/chroot/gems
===================================================================
--- branches/iscsi-only/build/chroot/gems 2010-08-30 10:43:00 UTC (rev 60)
+++ branches/iscsi-only/build/chroot/gems 2010-08-30 10:56:25 UTC (rev 61)
@@ -8,12 +8,12 @@
locale
locale_rails
ip
-sqlite3-ruby
+sqlite3-ruby 1.3.0
gettext
gettext_activerecord
gettext_rails
gem_plugin
-daemons
+daemons 1.0.10
fastthread
cgi_multipart_eof_fix
mongrel
Modified: branches/iscsi-only/build/chroot/packages_remove
===================================================================
--- branches/iscsi-only/build/chroot/packages_remove 2010-08-30 10:43:00 UTC (rev 60)
+++ branches/iscsi-only/build/chroot/packages_remove 2010-08-30 10:56:25 UTC (rev 61)
@@ -1,3 +1,5 @@
gcc
make
python-docutils
+ruby-dev
+libsqlite3-dev
Modified: branches/iscsi-only/build/chroot/steps/09install_rubygem
===================================================================
--- branches/iscsi-only/build/chroot/steps/09install_rubygem 2010-08-30 10:43:00 UTC (rev 60)
+++ branches/iscsi-only/build/chroot/steps/09install_rubygem 2010-08-30 10:56:25 UTC (rev 61)
@@ -5,7 +5,7 @@
tarball=`echo "$RUBYGEMS_URL" | sed 's/^.*\///'`
rubygems_name=`basename $tarball .tgz`
message "Retrieving rubygems"
-[ -r "gem_cache/${rubygems_name}.tgz" ] || wget -O gem_cache/$tarball "$RUBYGEMS_URL"
+[ -s "gem_cache/${rubygems_name}.tgz" ] || wget -O gem_cache/$tarball "$RUBYGEMS_URL"
tar xfC gem_cache/$tarball $CHROOT_PATH
Modified: branches/iscsi-only/build/chroot/steps/15install_rorapp
===================================================================
--- branches/iscsi-only/build/chroot/steps/15install_rorapp 2010-08-30 10:43:00 UTC (rev 60)
+++ branches/iscsi-only/build/chroot/steps/15install_rorapp 2010-08-30 10:56:25 UTC (rev 61)
@@ -1,4 +1,4 @@
#!/bin/sh
rm -fr ${CHROOT_PATH}${NAS_DIR}
-svn checkout https://astor.svn.sourceforge.net/svnroot/astor/trunk ${CHROOT_PATH}${NAS_DIR}
+svn export https://astor.svn.sourceforge.net/svnroot/astor/trunk ${CHROOT_PATH}${NAS_DIR}
Deleted: branches/iscsi-only/build/chroot/steps/21remove_subversion_files
===================================================================
--- branches/iscsi-only/build/chroot/steps/21remove_subversion_files 2010-08-30 10:43:00 UTC (rev 60)
+++ branches/iscsi-only/build/chroot/steps/21remove_subversion_files 2010-08-30 10:56:25 UTC (rev 61)
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-find $CHROOT_PATH -name .svn -type d | xargs rm -fr
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-08-30 10:43:06
|
Revision: 60
http://astor.svn.sourceforge.net/astor/?rev=60&view=rev
Author: stargrave
Date: 2010-08-30 10:43:00 +0000 (Mon, 30 Aug 2010)
Log Message:
-----------
No need to create metafiles to delete them after.
Modified Paths:
--------------
trunk/build/chroot/steps/15install_rorapp
Removed Paths:
-------------
trunk/build/chroot/steps/21remove_subversion_files
Modified: trunk/build/chroot/steps/15install_rorapp
===================================================================
--- trunk/build/chroot/steps/15install_rorapp 2010-08-30 09:59:38 UTC (rev 59)
+++ trunk/build/chroot/steps/15install_rorapp 2010-08-30 10:43:00 UTC (rev 60)
@@ -1,4 +1,4 @@
#!/bin/sh
rm -fr ${CHROOT_PATH}${NAS_DIR}
-svn checkout https://astor.svn.sourceforge.net/svnroot/astor/trunk ${CHROOT_PATH}${NAS_DIR}
+svn export https://astor.svn.sourceforge.net/svnroot/astor/trunk ${CHROOT_PATH}${NAS_DIR}
Deleted: trunk/build/chroot/steps/21remove_subversion_files
===================================================================
--- trunk/build/chroot/steps/21remove_subversion_files 2010-08-30 09:59:38 UTC (rev 59)
+++ trunk/build/chroot/steps/21remove_subversion_files 2010-08-30 10:43:00 UTC (rev 60)
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-find $CHROOT_PATH -name .svn -type d | xargs rm -fr
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-08-30 09:59:44
|
Revision: 59
http://astor.svn.sourceforge.net/astor/?rev=59&view=rev
Author: stargrave
Date: 2010-08-30 09:59:38 +0000 (Mon, 30 Aug 2010)
Log Message:
-----------
sqlite3-ruby does not compile on current stable Debian, because of an old development version of SQLite.
Modified Paths:
--------------
trunk/build/chroot/gems
Modified: trunk/build/chroot/gems
===================================================================
--- trunk/build/chroot/gems 2010-08-30 09:30:23 UTC (rev 58)
+++ trunk/build/chroot/gems 2010-08-30 09:59:38 UTC (rev 59)
@@ -8,7 +8,7 @@
locale
locale_rails
ip
-sqlite3-ruby
+sqlite3-ruby 1.3.0
gettext
gettext_activerecord
gettext_rails
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-08-30 09:30:29
|
Revision: 58
http://astor.svn.sourceforge.net/astor/?rev=58&view=rev
Author: stargrave
Date: 2010-08-30 09:30:23 +0000 (Mon, 30 Aug 2010)
Log Message:
-----------
There is no need in development packages in target image at all.
Modified Paths:
--------------
trunk/build/chroot/packages_remove
Modified: trunk/build/chroot/packages_remove
===================================================================
--- trunk/build/chroot/packages_remove 2010-08-30 09:29:41 UTC (rev 57)
+++ trunk/build/chroot/packages_remove 2010-08-30 09:30:23 UTC (rev 58)
@@ -1,3 +1,5 @@
gcc
make
python-docutils
+ruby-dev
+libsqlite3-dev
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sta...@us...> - 2010-08-30 09:29:48
|
Revision: 57
http://astor.svn.sourceforge.net/astor/?rev=57&view=rev
Author: stargrave
Date: 2010-08-30 09:29:41 +0000 (Mon, 30 Aug 2010)
Log Message:
-----------
Moving to use newer rubygems 1.3.5, as some packages (their latest versions) need at least it.
Modified Paths:
--------------
trunk/build/chroot/config
Modified: trunk/build/chroot/config
===================================================================
--- trunk/build/chroot/config 2010-08-30 09:29:03 UTC (rev 56)
+++ trunk/build/chroot/config 2010-08-30 09:29:41 UTC (rev 57)
@@ -5,7 +5,7 @@
REPOSITORY_URL=ftp://192.168.10.11/Linux/Repository/debian
# Gem-related
-RUBYGEMS_URL=http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz
+RUBYGEMS_URL=http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
# Nas-related
NAS_DIR=/usr/local/nas
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|