'type' => 'text',
},
+ {
+ 'key' => 'dump-pgpid',
+ 'section' => '',
+ 'description' => "Optional PGP public key user or key id for database dumps. The public key should exist on the freeside user's public keyring, and the gpg binary and GnuPG perl module should be installed.",
+ 'type' => 'text',
+ },
+
{
'key' => 'users-allow_comp',
'section' => '',
}
}
-#local hack
my $conf = new FS::Conf;
my $dest = $conf->config('dump-scpdest');
if ( $dest ) {
} else {
die "database dumps not yet supported for ". driver_name;
}
- scp("/var/tmp/$database.sql", $dest);
+ if ( $conf->config('dump-pgpid') ) {
+ eval 'use GnuPG';
+ my $gpg = new GnuPG;
+ $gpg->encrypt( plaintext => "/var/tmp/$database.sql",
+ output => "/var/tmp/$database.gpg",
+ recipient => $conf->config('dump-pgpid'),
+ );
+ scp("/var/tmp/$database.gpg", $dest);
+ unlink "/var/tmp/$database.gpg" or die $!;
+ } else {
+ scp("/var/tmp/$database.sql", $dest);
+ }
unlink "/var/tmp/$database.sql" or die $!;
}