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
|
|
|
|
2012-03-05 15:42:46 +00:00
|
|
|
unless ($ENV{GOPATH}) {
|
|
|
|
$ENV{GOPATH} = "$Bin/gopath"
|
|
|
|
}
|
|
|
|
|
|
|
|
system("go", "install", "camlistore.org/cmd/camput") and die "failed to build camput";
|
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;
|
2011-12-06 05:02:44 +00:00
|
|
|
Getopt::Long::Configure("pass_through");
|
2011-11-16 10:41:38 +00:00
|
|
|
GetOptions("tls" => \$opt_tls)
|
|
|
|
or usage();
|
|
|
|
|
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";
|
2011-11-16 10:41:38 +00:00
|
|
|
my $blobserver = "http://localhost:3179/bs";
|
|
|
|
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
|
|
|
|
2012-03-27 17:37:21 +00:00
|
|
|
exec("$camput",
|
2011-09-21 01:29:10 +00:00
|
|
|
"--verbose",
|
2011-11-16 10:41:38 +00:00
|
|
|
"--blobserver=$blobserver",
|
2011-09-21 01:29:10 +00:00
|
|
|
@ARGV);
|
2012-03-05 15:42:46 +00:00
|
|
|
die "Failure running camput: $!";
|