The publisher app required GopherJS which has been behind upstream Go
for many years. This just removes all GopherJS stuff, breaking the publisher
app in the process. We'll have to rewrite it.
Signed-off-by: Brad Fitzpatrick <brad@danga.com>
Index:
- Handle bad signatures on permanodes just like we handled them on
claims.
Importer tests:
- Make pkg/client's UploadPublicKey method public so that we can ensure
that the key was uploaded before uploading permanodes in importer
tests. This would otherwise be done automatically by methods such as
UploadNewPermanode but the importer uses the Blobserver API, it
uploads blobs with ReceiveBlob. ReceiveBlob does not know if blobs
are schemas or regular blobs, so it couldn't know if it is
appropriate to upload the key.
* propagate more context cancelations from pkg/client
* convert ErrCancel to fuse.EINTR to enable clients to handle interrupts
* improve interrupt handling in fs_test.go
* fix race in mutDir between rename and first populate
`signer.KeyId()` was only used in a counter-productive way
by comparing it with half of a long ID.
Also use this opportunity to return the full fingerprint from
ParseArmoredPublicKey. NewSigner was the only caller of this
function.
Some code was merged without being fmt-compliant. This
PR runs `go fmt ./...` and adds a test to github workflows
to verify that pull requests are fmt-compliant.
Calling 'GetPermanodesWithAttr', as currently written, will return an
empty list for any unindexed parameters.
Rather than always returning an empty list if the user asks for a
unindexed attribute, error out.
Also add documentation of this potential foot-gun for users of the
client.
Change-Id: Iadc1b5a00aa709584affb89a1397e82aaffb692f
In 877eafa49b , pkg/server started
importing pkg/client , since the server has to be able to fetch blobs
from a share claim of another server. This introduced a circular
dependency in tests, as pkg/client/upload_test.go instantiates a server.
As the test uses both a client and a server, and tests uploading between
the two, it seems fitting to move it to pkg/test/integration, which
breaks the circular dep.
Change-Id: I2458ffd72912ff6e9c1a0f67e187d54cc895c2e9
This change has two major parts, which were interwoven enough to do
them in one change:
1) make serverinit.Config fully opaque, in prep for TOML configs #1134
2) shrink the massive server/perkeepd/camlistored.go file. It was out
of control and had a bunch of code that better belonged
elsewhere. This change moves a few hundred lines of code from
camlistored.go into more logical places: internal/osutil/gce for
GCE stuff, serverinit for config stuff (KeyRingAndId), etc.
I also added a TODO to make it possible to compile perkeepd without
any GCE stuff, which I saw as a possible and worthy goal only after
moving everything away.
Updates #1134
Change-Id: Iea6f84c5aca9c70b97806f4a201ec35e0f630e3b
test/integration: don't listen on file descriptors.
make.go: unrelated, but options to make it much faster.
internal/images: t.Skip on HEIC dependency failures
Fixes#1140
Updates golang/go#25210
Change-Id: I8092155411826d6ed1f8d85230b753d1369044af
A new "put" mode is added to the pk command, so that the "pk put"
command can be used to create and upload blobs.
What this command does is actually just call the previously named
"camput" executable, which is renamed to "pk-put" in this change.
This involves adding a new way to register a mode in cmdmain, when such
a mode is just meant to call an external binary. To emphasize the
distinction, the existing func (to register a sub-command, or a mode) is
renamed from RegisterCommand to RegisterMode, and RegisterCommand is now
the name of the new func/way.
Updates #981
Updates #1056
Change-Id: Ief954c17aa88a376f551df7de4b4e9fe41ad96d1
Since the search API changed at
2018-01-13-6e8a5930c9fee81640c6c75a9a549fec98064186, a server built
before that revision is incompatible with a client built at or after
that revision.
This change adds a check that is run when this incompatibility could
manifest by a JSON parsing error, in order to clarify the error message.
As a side note, even if there was not this search API breakage, a server
built before 27bacd3df1 would panic anyway
if a client built at or after 38f10a7bd0
tried uploading to it. Because of the wrong assumption that br.Hash()
is never nil, which can actually happen after sha224 is introduced
(client-side), and the server does not know about sha224.
Fixes#1074
Change-Id: I3dabf25c0200625e177e0f26308465cd35e8c750
The android uploader used to only accept a server TLS certificate when
its fingerprint was specified as trusted in the client configuration. As
a result, certificates obtained by Let's Encrypt (or other CAs, for that
matter) were rejected unless treated as self-signed.
With this change, any connection verified by the standard TLS client
(using the system's root CA pool) is accepted as long as no
additional certificate fingerprint is given.
Closes#974
Change-Id: I499d41e9f48df709dda60724c6f55eca888feeb7
- correct logging that logged functions instead of their value
- use ID vs Id naming
- use correct function names in comments
Change-Id: I61562cef7ebac7337ec6c85312cdf7915cb1a84b
when its wholeref index lines contain any "sha1-" wholeref lines.
Then, have the client use that info when uploading files to also
compute the sha-1 (in addition to the sha-224) and ask the server for
both.
By client, we mean changes to cmd/camput, to pkg/client functions (for
camput and other Go clients, such as the apps), and to the web UI.
Also, add a -sha1 mode to devcam server, as well as the
CAMLI_SHA1_ENABLED env var, to facilitate testing/debugging of the
legacy sha1 mode. Fix/document unrelated options in devcam server
while we're at it.
Change-Id: I369679d2a4719f6f8b409f78dd4d065e13a3f62f
This removes NewDefault and NewFromParams.
Now the default way to create a client is:
client.New() -> (*Client, error)
Specifying a server is optional and now requires
client.OptionServer(server).
If the caller really wants to log.Fatal on error, they can use
client.NewOrFail.
Also, some of the boilerplate from GopherJS callers is now promoted to
be the default behavior in the client package.
Change-Id: Icb106cf3e13cc492fe5b2f7f240e1ad4227eaf33
I had intended for this to be a small change.
I was going to just add context.Context to the BlobReceiver interface,
but then I saw blob.Fetcher could also use one, so I decided to do two
in one CL.
And then it got a bit infectious and ended up touching everything.
I ended up doing SubFetch in the process by necessity.
At a certain point I finally started using context.TODO() in a few
spots, but not too many. But removing context.TODO() will come in the
future. There are more blob storage interfaces lacking context, too,
like RemoveBlobs.
Updates #733
Change-Id: Idf273180b3f8e397ac5929c6d7f520ccc5cdce08
Remove the blob.SHA{1,224}From{Bytes,String} constructors too. No
longer used. This adds blob.RefFromBytes which was missing. We had
blob.RefFromString. Now everything uses blob.RefFrom* instead of
specifying a hash function.
Some tests set a flag to force use of SHA-1 because there was too much
golden data to update. We can remove those one-by-one over time as we
fix up tests.
Updates #537
Change-Id: Ibe6428089a6221594c2b751f53f98b03b5a28dc2
This addresses a long-standing TODO in the BlobStatter interface to
clean it up. Just like all new Go programmers, I misused channels in
APIs. I should've cleaned this up years ago.
While here, I also added a context.
The rest should get contexts later.
This also cleans up a few things here & there.
The pkg/client statting no longer does batching, which added a lot of
complexity. There was a comment saying something like "once we have
SPDY, we can delete this". Well, we have HTTP/2 now, so seems
deletable.
All tests pass.
Change-Id: I034ce07d9b70e5cc9e5482213368993e638d4bc8
Calls to net.Dial* are prohibited with GopherJS. This can happen if the
client's transport is set by the user.
This change forces transportForConfig to return nil when the client
package is compiled with gopherjs, in order to make sure that a call to
newClient returns a client with a nil transport.
Change-Id: I577457bd7d924d31710168086dc2b394df3d1ae0
Part of the project renaming, issue #981.
After this, users will need to mv their $GOPATH/src/camlistore.org to
$GOPATH/src/perkeep.org. Sorry.
This doesn't yet rename the tools like camlistored, camput, camget,
camtool, etc.
Also, this only moves the lru package to internal. More will move to
internal later.
Also, this doesn't yet remove the "/pkg/" directory. That'll likely
happen later.
This updates some docs, but not all.
devcam test now passes again, even with Go 1.10 (which requires vet
checks are clean too). So a bunch of vet tests are fixed in this CL
too, and a bunch of other broken tests are now fixed (introduced from
the past week of merging the CL backlog).
Change-Id: If580db1691b5b99f8ed6195070789b1f44877dd4
Otherwise, the android app fails to connect with a server that uses
Let's Encrypt (because it relies on SNI, which requires the ServerName
to be set).
Change-Id: I9f25486bea68e83c68584a83817c98bfc84f62b9