[Box Backup] Web Management Interface fixes

Achim J. Latz achim+box at qustodium.net
Sun Jul 17 22:22:15 BST 2011


Hello list:

I had a look at the Web Management Interface's [1] source code [2], and 
managed to update it in order to get it running under Ubuntu Lucid Lynx 
(10.04) with Perl 5.10.

Here are the updated instructions and some fixes to accounts.cgi and 
DiskSets.pm, mainly due to Scoped and formatting issues.

Perhaps somebody could update the source code and instructions on the 
web page and wiki to reflect this?

I hope this is helpful, Achim

PS: Visualising accounts worked, updating existing accounts does not work.

[1] <http://www.boxbackup.org/trac/wiki/WebManagementInterface>
[2] <http://www.boxbackup.org/trac/browser/box/trunk/contrib/bbadmin/>

============================================================================

1.
# install Perl module with:
# perl -MCPAN -e 'install Config::Scoped'

aptitude install libconfig-scoped-perl libconvert-asn1-perl liburi-perl

2.
# perl -MCPAN -e 'force install 
P/PT/PTHOMSEN/BoxBackup/BBConfig-0.03.tar.gz'

results in the same error as reported on this list in 2009 
<http://lists.boxbackup.org/pipermail/boxbackup/2009-July/005291.html> 
"Illegal division by zero at -e line 1."

Download and install the module manually:

wget 
http://search.cpan.org/CPAN/authors/id/P/PT/PTHOMSEN/BoxBackup/BBConfig-0.03.tar.gz
tar xvzf BBConfig-0.03.tar.gz
cd BBConfig-0.03

3.
vi lib/BoxBackup/Config/DiskSets.pm

change line 111
# my $parser = Config::Scoped->new( file => $disksetFile );
to
my $parser = Config::Scoped->new( file => $disksetFile, warnings => 'off' );
		
(otherwise you get the error: "is unsafe: owner is not root and not real 
uid at")

4.
perl Makefile.PL
(which will result in:

Checking if your kit is complete...
Warning: the following files are missing in your kit:
         lib/BoxBackup/Config/BBstored.pm
Please inform the author.
Writing Makefile for BBConfig
)

5.
make && make install

6.
wget http://backpan.perl.org/authors/id/L/LE/LEO/Convert-X509-0.3.tar.gz
tar xvzf Convert-X509-0.3.tar.gz
cd Convert-X509-0.3
perl Makefile.PL
make && make install

7.
get the latest versions of accounts.cgi, bb.css and apache.conf from 
<http://www.boxbackup.org/svn/box/trunk/contrib/bbadmin/>

8.
Configure apache according to apache.conf

9.
Apply the following patch to accounts.cgi for some small updates/fixes:


--- accounts_old.cgi        2008-11-11 01:26:11.000000000 +0100
+++ accounts.cgi      2011-07-17 23:16:23.255010198 +0200
@@ -22,18 +22,19 @@

  use strict;
  use warnings;
+use diagnostics;

  # Variables which you may need to change to match your installation
  # Changes to existing variables are NOT required to be published.

-my $box_dir = "/etc/box";
+my $box_dir = "/etc/boxbackup";
  my $bbstored_dir = "$box_dir/bbstored";
-my $ca_dir = "/mnt/backup/boxbackup/ca";
+my $ca_dir = "$box_dir/ca";

  # You should not need to change these unless you have a non-standard 
installation

  my $bbstored_conf_file = "$box_dir/bbstored.conf";
-my $bbstoreaccounts = "/usr/local/sbin/bbstoreaccounts";
+my $bbstoreaccounts = "/usr/sbin/bbstoreaccounts";
  my $accounts_db_file = undef;
  # my $accounts_db_file = "/etc/box/bbstored/accounts.txt";
  my $raidfile_conf_file = undef;
@@ -147,7 +148,7 @@

  check_access($bbstored_conf_file, "BBStoreD configuration file");

-my $bbstored_conf = Config::Scoped->new(file => 
$bbstored_conf_file)->parse();
+my $bbstored_conf = Config::Scoped->new(file => $bbstored_conf_file, 
warnings => 'off' )->parse();

  $accounts_db_file ||= $bbstored_conf->{'Server'}{'AccountDatabase'};
  die "Missing AccountDatabase in $bbstored_conf_file" unless 
$accounts_db_file;
@@ -336,7 +337,8 @@
         $cgi->th('Used'),               $cgi->th('%'),
         $cgi->th('Old files'),          $cgi->th('%'),
         $cgi->th('Deleted files'),      $cgi->th('%'),
-       $cgi->th('Directories'),        $cgi->th('%'),
+       #$cgi->th('Directories'),       $cgi->th('%'),
+        $cgi->th('# Directories'),
         $cgi->th('Soft limit'),         $cgi->th('%'),
         $cgi->th('Hard limit'),
         $cgi->th('Actions')
@@ -450,7 +452,8 @@
                 format_account_info($account_info->{'Used'}),
                 format_account_info($account_info->{'Old files'}),
                 format_account_info($account_info->{'Deleted files'}),
-               format_account_info($account_info->{'Directories'}),
+               #format_account_info($account_info->{'Directories'}),
+               $cgi->td($account_info->{'Directories'}),
                 format_account_info($account_info->{'Soft limit'}),
                 $cgi->td(human_format($account_info->{'Hard limit'}[0])),
                 $cgi->td($cgi->a({-href=>url($cgi, account=>$i)},
@@ -460,8 +463,11 @@

  print $cgi->end_table();

-my $account_no = $cgi->param("account");
+my $account_no = undef;
+if( $cgi->param("account")) {
+$account_no = $cgi->param("account");
  $account_no =~ tr/0-9a-fA-F//cd;
+}

  if (not $cgi->param("showcreate"))
  {



More information about the Boxbackup mailing list