- make sure camliType is set to "file" in UploadFile
- fileMapFromDuplicate uses the blob ref calculated from the
file schema blob in the call to ReceiveBlob
- add test for above changes
- TestTransportSetup updated after field name change
- hasComponent fixed for case fullpath[:len(component)] == component
- hasComponent returns true if the first match is missing either separator,
but there is another match down the path
- add special handling for Windows in hasCompontent and TestIgnoreFns
Change-Id: I96325b060e9421709bd9f684bcc9eceed7135f7b
Also add a flag to camtool discovery:
$ camtool discovery -httpversion
HTTP/2.0
Fixescamlistore/camlistore#661
Change-Id: I6db392e01bd176a2757ebdb4a0e881eebaec9b03
Most of the code related to uploading a file with a client is actually
locked into the camput code. And uploading a file is something the
scanning cabinet app needs to do.
Refactoring the camput file code into pkg/client, and cleaning up
pkc/client is a lot of work. Therefore I propose with this change to
first introduce the minimum I need in pkg/client that I can use in
the scanning cabinet app.
Change-Id: Ie8690e66f0332be76a3a41fa060db410d01798e2
Previously pkg/jsonconfig and pkg/errorutil
Copied from go4.org at rev d1b8a2fb2de6160036e4801aa5e4d855571078b8
Change-Id: I673ed55b0825baa2607289b6082f205100261d7a
Previously pkg/wkfs
Copied from go4.org at rev 3970dd22c0e7e2397304ad626a20b72f8db41b58
Note that pkg/wkfs/gcs has not been moved yet (for dependencies
reasons).
Change-Id: I737e88a360bccfc643e1fa43541f65f2384c3157
They were internal packages (under pkg), which we are now moving to
go4.org, so we in turn need to vendor them in now.
Change-Id: I92224f731404d0bd4ca1c57492bed37cb3367ed4
We can now use DialTLS when we need a custom TLS setup, i.e. with
android, or when using self-signed certificates, or when totally
skipping certificates verification.
This allows us to get rid of the scheme rewriting hack, which simplifies
things, in particular because we have less tricky URL/host parsing to
do.
For the sake of tests and not affecting "real" code, I introduced the
fake_android build tag, so the tests can use custom functions to
simulate testing whether we're on android.
Fixes#566
Change-Id: I72ac2bb69ad2365e98dd6ca2e7016ce9c2d7c57e
I also wonder if we want to take a more comprehensive approach to
environment variables, perhaps populating a struct at startup that other
code can consult later. But it might be too soon for that kind of thing
in this project.
Change-Id: I65a34622bf906c1256ceb357ba983bc5acd6b887
url.Parse in Go 1.5 now fails with the scheme://IPv6:/foo form (trailing
colon). But it still works when the hostname is an actual hostname, or
an IPv4, which seems inconsistent.
This CL therefore not only accepts this new failure (which comes with Go
1.5) but also considers any host with a trailing colon as an invalid URL
and refuses to rewrite it.
There probably are other places in Camlistore where we should the same.
See https://github.com/golang/go/issues/12200
Change-Id: Ib9ea95a71013b5b53f2fd99415015ec916bb4d9d
Signhandler was moved from the ui to the root handler and genconfig
adjusted accordingly.
New discovery struct types to replace the JSON maps are defined in
pkg/types/camtypes. The changes are related to Issue #539.
Change-Id: Ib3f12feeaf6fa81107de2d468cab491723e590ae
Otherwise it can't send Describe Rules.
Also in this commit: a bunch of new tests from when I thought I was going crazy
and trying to debug the search system, before I realized the problem was that the
client was doing a GET request and dropping most of my DescribeRequest.
Change-Id: I4ea9bed80f0d7d6b86814527b63acc3586ac1d06
There are several places where we're using a *search.Handler, when we
only want to be able to do query and describe requests. When these
places need to be moved also out of the context of camlistored, (like
when making a server app such as the publisher), the QueryDescriber can
be used, and the adequate implementation (*search.Handler,
*client.Client, or any other) is used depending on the context.
Change-Id: Ie1c5bb6f1bbba32c24a8eb2d1175af95ffcc8335
Go 1.4 (Go tip currently) defines a new GOOS=android, and a GOOS.go file is ignored on
other operating systems. But these android.go aren't actually meant to be only run on
GOOS=android, since we just build Linux binaries on Android for now.
And remove all mentions of CAMLI_CLIENT_IDENTITY because there isn't any
need for the both of them.
http://camlistore.org/issue/412
Change-Id: I0d6b8cff0f23738231de98171a23550d82f05fe9
1) Removed exec call to gpg, because it automatically looks in .gnupg/,
which we don't use anymore as a default.
2) Now taking into account global --secret-keyring flag.
This flag is now in osutil.
3) New or modified funcs in osutil
4) Made sure --gpgkey works too.
5) Cleaned up error messages and hints.
Context: http://camlistore.org/issue/364http://camlistore.org/issue/368
Change-Id: I2e51032ed0597da656db100d72f5588b37308e1a
StreamingFetcher is now just Fetcher, and its FetchStreaming is now
just Fetch.
SeekFetcher is gone. Blobs are max 16 MB anyway, so we can slurp to
memory when needed. The main thing that cared about SeekFetcher
was the GET handler, ServeBlobref, because http.ServeContent needed
one for range requests. That's rewritten in an earlier commit, using
the FakeSeeker from another earlier commit.
Lot of code got simpler as a result.
Change-Id: Ib819413e48a8f9b8d97f596d0fbf771dab211f11
Because of Go's rules regaring closures (function literals) and bound
variables, in the case in which there were multiple patterns in the
ignoredFiles configuration variable, the entire slice (vector) of
registered matching functions was being called with the
last-configured ignoredFiles pattern as the first variable. This meant
that ignoredFiles did not work if it contained more than one pattern
and in certain circumstances, such a configuration would lead to a
crash.
Change-Id: I0b991aa74d079d4ce27fc0ba373e2ee2cf9eb772