2011-05-16 04:54:57 +00:00
|
|
|
#!/usr/bin/perl
|
2011-01-01 22:44:19 +00:00
|
|
|
|
2011-05-16 04:54:57 +00:00
|
|
|
use strict;
|
|
|
|
use FindBin qw($Bin);
|
2011-11-16 10:41:38 +00:00
|
|
|
use Getopt::Long;
|
2012-03-27 17:37:21 +00:00
|
|
|
require "$Bin/misc/devlib.pl";
|
2011-05-16 04:54:57 +00:00
|
|
|
|
2011-11-16 10:41:38 +00:00
|
|
|
sub usage {
|
|
|
|
die "Usage: dev-camput [--tls] -- camput_args";
|
|
|
|
}
|
|
|
|
|
|
|
|
my $opt_tls;
|
2013-06-15 23:44:31 +00:00
|
|
|
my $opt_path = "/";
|
2011-12-06 05:02:44 +00:00
|
|
|
Getopt::Long::Configure("pass_through");
|
2013-06-15 23:44:31 +00:00
|
|
|
GetOptions(
|
|
|
|
"tls" => \$opt_tls,
|
|
|
|
"path=s" => \$opt_path,
|
|
|
|
) or usage();
|
2011-11-16 10:41:38 +00:00
|
|
|
|
2012-03-27 17:37:21 +00:00
|
|
|
my $camput = build_bin("./cmd/camput");
|
|
|
|
|
2011-05-30 19:38:26 +00:00
|
|
|
# Respected by camli/osutil:
|
2011-05-16 04:54:57 +00:00
|
|
|
$ENV{"CAMLI_CONFIG_DIR"} = "$Bin/config/dev-client-dir";
|
2011-05-30 19:38:26 +00:00
|
|
|
|
|
|
|
# Respected by env expansions in config/dev-client-dir/config
|
2012-05-13 15:07:04 +00:00
|
|
|
$ENV{"CAMLI_SECRET_RING"} = "$Bin/pkg/jsonsign/testdata/test-secring.gpg";
|
2011-06-02 23:57:49 +00:00
|
|
|
$ENV{"CAMLI_KEYID"} = "26F5ABDA";
|
2011-05-30 19:38:26 +00:00
|
|
|
$ENV{"CAMLI_DEV_KEYBLOBS"} = "$Bin/config/dev-client-dir/keyblobs";
|
2012-03-05 15:42:46 +00:00
|
|
|
$ENV{"CAMLI_AUTH"} = "userpass:camlistore:pass3179";
|
2013-06-15 23:44:31 +00:00
|
|
|
my $blobserver = "http://localhost:3179${opt_path}";
|
2011-11-16 10:41:38 +00:00
|
|
|
if ($opt_tls) {
|
|
|
|
$blobserver =~ s/^http/https/;
|
|
|
|
}
|
2012-05-13 15:07:04 +00:00
|
|
|
if ($ENV{"CAMLI_WANT_CAMPUT_PASSWORD"}) { # Set by dev-pass-camput
|
|
|
|
$ENV{"CAMLI_SECRET_RING"} = "$Bin/pkg/jsonsign/testdata/password-foo-secring.gpg";
|
|
|
|
$ENV{"CAMLI_KEYID"} = "C7C3E176";
|
|
|
|
$ENV{"CAMLI_DEV_KEYBLOBS"} = "$Bin/config/dev-client-dir/keyblobs";
|
|
|
|
print "**\n** Note: password is \"foo\"\n**\n";
|
|
|
|
}
|
2011-05-30 19:38:26 +00:00
|
|
|
|
2013-07-29 17:15:59 +00:00
|
|
|
my $verbose = "true";
|
|
|
|
$verbose = "false" if $ENV{CAMLI_QUIET};
|
|
|
|
|
2012-03-27 17:37:21 +00:00
|
|
|
exec("$camput",
|
2013-07-29 17:15:59 +00:00
|
|
|
"--verbose=$verbose",
|
2013-01-26 00:23:31 +00:00
|
|
|
"--server=$blobserver",
|
2011-09-21 01:29:10 +00:00
|
|
|
@ARGV);
|
2012-03-05 15:42:46 +00:00
|
|
|
die "Failure running camput: $!";
|