Commit Graph

138 Commits

Author SHA1 Message Date
Brad Fitzpatrick 17ab1c238f Change strutil.StringFromBytes to depend on Go 1.3.
Change-Id: I83fd1369a199dba7ef41227df4d0b95d9a16aabb
2014-08-14 12:59:54 -07:00
Brad Fitzpatrick 766919ec33 schema: more minor FileReader cleanups
Change-Id: Ia37d82024faf16c262f339d8f7f807d23670edda
2014-08-11 17:32:00 -07:00
Brad Fitzpatrick 71a1a1ff8d schema: reduce FileReader blob reads 32-85x by caching the last blob read
Little reads into big blobs kept re-reading the same blob.

Change-Id: I098c9d9a9443dacc93f60f96fff1edd421ced198
2014-08-11 15:55:50 -07:00
Brad Fitzpatrick fe481e5da7 schema: some FileReader cleanups: use blob.Ref as map key, simplify zeroReader
Change-Id: I37ec27bfe9673e7d5566216269d94d109215ac99
2014-08-11 15:53:33 -07:00
Brad Fitzpatrick da3ce4a13b schema: use existing constant instead of literal
Change-Id: Ia988f4c897788be696326de9a75973161ae3d550
2014-08-07 11:04:09 -07:00
mpl 2437ada83f foursquare: some attributes cleanup
Change-Id: I7a1d794e58b47edeef06c3d181991c8aa1eb0534
2014-07-31 01:50:36 +02:00
Brad Fitzpatrick 95492813b1 picasa: clean up album attributes, add tests, fix keywords with spaces
Change-Id: I32faae16334e3999731f3980502eb6a1a6d38595
2014-07-30 15:50:34 -07:00
Brad Fitzpatrick 80e543efe2 nodeattr: add more, rearrange, clean up some comments.
Change-Id: Ifc1809ed07166c18253cf0a82e708fccb3071f08
2014-07-28 13:56:43 -07:00
Brad Fitzpatrick b531c32f11 nodeattr: moving more from importer/attrs.go
Change-Id: Iebf336c44af77ccbe655aadbe1e57ad339ba5201
2014-07-25 14:48:03 -07:00
Brad Fitzpatrick d0fbfd9751 nodeattr: rename Content to CamliContent, since Content also exists.
Change-Id: I305ca3cecf9b223a125fb9207966995c9dbf83b8
2014-07-25 14:41:17 -07:00
Brad Fitzpatrick fad3a60a77 picasa: some importer attribute cleanup
Use nodeattr constants. Don't set lat/long when unknown.
2014-07-25 13:24:46 -07:00
Brad Fitzpatrick f2b9657be6 nodeattr: fix up comment style
And use nodeattr.Title in twitter.
2014-07-25 13:16:10 -07:00
mpl 7e86255cac importer/flickr: set DateCreated attribute
Also cleaned up a few vars.
Moved some attributes to nodeattr pkg.

Change-Id: Iea496d50b12e67132fe88f371a89534c2fe32761
2014-07-25 00:57:10 +02:00
Brad Fitzpatrick c2dd9a1fce schema: add test of time.ParseInLocation with UnknownLocation
Change-Id: I23c1007b53d794e36e9eeaad03e9d11a4cd3c397
2014-07-24 13:44:31 -07:00
Brad Fitzpatrick 804f11d49e schema/nodeattr: new leaf package for permanode attributes
All the attributes from pkg/importer/attrs.go should eventually move here.

Change-Id: I252749ca32fdb0f367dfa906e728d0a679e8eb5b
2014-07-24 13:37:45 -07:00
Brad Fitzpatrick ab885a369c schema: add UnknownLocation and IsZoneKnown
Change-Id: Ia056d03a367502ea4d06e5748cc7de7072c3e12c
2014-07-24 13:35:18 -07:00
Brad Fitzpatrick 077763fcbb schema: use GPS location to find timezone from EXIF when UTC offset is unknown
Change-Id: Ia3590424db36508b491d8f19829738fe102e5c3d
2014-07-13 10:26:54 -07:00
Brad Fitzpatrick af4df6f8c5 schema: rewrite symlink test to not delete testdata, not use asserts
Change-Id: I238ee5d55203f5c53b294d82e2cc626c4ef78ef2
2014-07-13 10:02:30 -07:00
tnt 4ac9938c8b Fixed some formatting functions that were called with invalid number/type of arguments.
Change-Id: I261c6fb732a6cf1e54e01fa3e5388c39c6deb720
2014-07-01 12:48:33 +02:00
tnt 5d8eeb534b Fixed wrong calls to formatting functions.
E.g: fmt.Println("%s", "hello world") -> fmt.Printf("%s", "hello world")

Change-Id: I51c0bd54c14173e074fafd86c83a5287fcdb1520
2014-06-30 22:05:22 +02:00
Brad Fitzpatrick f3a519d3e5 schema: remove FileReader.FileSchema returning private type
Change-Id: I66af87155edfb7672294072fe18878af0811cf62
2014-06-13 15:47:14 -07:00
Brad Fitzpatrick 26bdefc4b0 osutil: remove err error stutter, add osutil.ErrNotSupported
Change-Id: I483f30d3d4db39a9ffa0f83c1e055d7a59edba4b
2014-05-31 10:42:44 +09:00
Brian Gitonga Marete 53ab352fa7 pkg/schema, cmd/camget, cmd/camput: Support sockets.
This patch:

1. Introduces a JSON schema for unix domain sockets (socket files).
2. Adds support for the new schema to pkg/schema.
3. Adds support for uploading and restoring sockets to camput and
camget respectively.

Depends on CL 2706 (https://camlistore-review.googlesource.com/2706/)

Change-Id: Ib0d6e9f9ebd348f55efee5a08cd774f3969d0760
2014-05-21 18:51:14 +03:00
Brian Gitonga Marete e9dd1af195 cmd/camget, cmd/camput, pkg/schema: Support FIFOs.
This patch:

1. Introduces a JSON schema for FIFOs (named pipes).
2. Adds support for uploading and restoring FIFOs to camput and camget
respectively.

It includes tests for the basic schema support in pkg/schema and
integration tests for camput and camget.

This CL does not add FIFO support to the HTTP server and fs (cammount
support) code. Those will be addressed in a subsequent patch.

Change-Id: Iab926073c36e653d25e693a559178bea9bf19b9a
2014-05-21 14:52:23 +03:00
Brad Fitzpatrick bf9909028f schema: improved mixedArrayFromString
Change-Id: Iff9d68a498e13e5a90cd68c07ee9986c3407a8cc
2014-05-14 16:07:22 -07:00
Edward Sheffler III 04a38a2515 schema: unexport NewClaim
Change-Id: If088d7b8dd521f89093376282b84a64c59c7b778
2014-04-18 13:25:01 -07:00
Brad Fitzpatrick eabeac6616 schema: add paranoia error check about slashes in file schema blobs
Change-Id: I6abad1a3d387270dcbeb45b50b5ca7b52cbb2230
2014-04-12 19:29:02 -07:00
Brian Gitonga Marete 88b94b686d pkg/schema: Move two non-utf8-handling utility funcs to schema.go.
As per review comments.

Change-Id: I0240f697d0cb180a9fb2e9b1ddda7ac18869b4ad
2014-03-15 07:39:08 +03:00
Brad Fitzpatrick bf94a73859 Get rid of SeekFetcher vs StreamingFetcher distinction and complexity.
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
2014-03-14 12:29:13 -07:00
Brian Gitonga Marete 68074bbadd pkg/schema: Fix camput panic on non-utf8 filenames or symlink targets.
Also implement the relevant integration tests for camput and camget.

Depends on CL 2216.

Change-Id: I3f541efd4e583674e9817473292fa3de8a3cdabc
2014-03-10 21:01:51 -07:00
Brian Gitonga Marete 0c4b67d3bf cmd/camget: Support restoring symbolic links when writing to filesystem.
This patch adds support for restoring symbolic links when camget is
called with the -o option.

This fixes an issue which caused `camget -o' to write an incomplete
snapshot to the target directory when it encountered a symlink.

Note that no attempt is made to restore the symlink metadata since: a)
A symlink's permissions do not matter and are fixed to 1777 on some
systems b) Go's os.Chtimes() always acts on the symlink target c)
os.Chown() is not currently called for any file in the current code.

Tested on Linux.

Change-Id: I7099592dcd5cc513c2685671be6f6b165f8f8053
2014-03-08 05:14:59 +03:00
Tamás Gulácsi 97520583b8 Use 'uint32' instead of 'int64' for blob sizes everywhere.
Not just in blob.SizedRef, but in blobserver.Fetch and
blobserver.FetchStreaming, too.
Blobs have a max size of 10-32 MB anyway, and the index.Corpus is now using
uint32 to save memory.

Change-Id: I1172445c2f9463fdaee55bfe0f1218d44be4aa53
2014-02-08 17:58:12 +01:00
Brad Fitzpatrick f4d9fab966 schema: don't use ReceiveBlob directly
Change-Id: I268165cdaa4e4c8fea720a57a58cccc0f934cdf2
2014-01-26 21:56:39 -08:00
Brad Fitzpatrick c6b78818b8 schema: better test for issue 305
Change-Id: I791d2cd614f8cdc5921a05a0c91589f8965ed06f
2013-12-30 20:17:30 -08:00
Brad Fitzpatrick 339b8c8af4 schema: fix blob.Builder JSON clone bug; issue 305
Change-Id: I8ef981f96abdac1a7e2c101e1c9c3cde52fb6f5f
2013-12-30 19:40:58 -08:00
Brad Fitzpatrick a06555872c schema: a new tests that doesn't test anything yet
Change-Id: I30c79f10fa68d3441c6e937344927d0b996dcf70
2013-12-30 11:53:55 -08:00
mpl 2c2ce61ffa schema: missing claimType conversion
Change-Id: I92edb2b3148df8b79c6c39ea88a8c7d04cf3f789
2013-11-04 22:57:05 +01:00
Brad Fitzpatrick 05f11b5bbc schema: avoid a potential crash.
also, bb.m should only contain a string, not a typed string.

Change-Id: I235beaa460c8463f65be93ac6c78c8481fe1b758
2013-11-02 18:13:40 -07:00
mpl d4b5e413a2 schema: add delete claim
Also rename other claim types for consistent style.

http://camlistore.org/issue/191

Change-Id: I1dc1283bd961481ad793b92262cf5ce641d9fdc8
2013-11-03 00:37:49 +01:00
Brad Fitzpatrick ee57e351d2 Remove debug cruft actually submitted.
Change-Id: Iaa805afd2d6e76108319edf06113de8a260f7e46
2013-10-24 22:49:18 -07:00
Brad Fitzpatrick 0324143892 importer: make the schema.Signer available to the importer
Change-Id: Iad1a2f3bfe381b31a381957edb85d6d4aa21b38c
2013-10-24 22:45:28 -07:00
Brad Fitzpatrick cf15b2be90 client: use the schema.Signer API, remove Client.SignBlob method
Change-Id: I177c78f4f7f4ca54afd021d4ada866a35eea06eb
2013-10-22 07:26:44 -07:00
Brad Fitzpatrick 5c3b57682e schema: integrate with the jsonsign package.
Signing schema blobs (permanodes and claims) was too hard before, and
the code was scattered in weird places.

The pkg/jsonsign code tries pretty hard to be Camlistore-neutral, so
it remains so.

The pkg/client code (which deals mostly with HTTP access to a remote
camlistore server) had the signing the logic in it before, mostly
because that's where we originally needed it (for camput), but that
should be fixed in subsequent changes, to remove most of its signing
logic and use pkg/schema's instead.

The schema package now depends on jsonsign, which I think is an
acceptable dependency edge, since the Camlistore schema does logically
depend no signed claims (and that was a gaping hole in its public
API), and it seems safe cyclic-wise, especially if jsonsign continues
to be a leaf package.

Change-Id: I10229ec5d880ddd801cb1ba77ac26b654693036d
2013-10-21 22:08:45 -07:00
Brad Fitzpatrick 4cc81262b4 schema: clarify that WriteFileFromReader's filename is optional
Change-Id: I0df3783b282492db1dac29ed3c07e9a38df30a5e
2013-10-20 12:24:32 -07:00
Tamás Gulácsi e056081be1 add capctime flag to camput
I can recreate the file, set the modification time, but can't forge creation
time, thus cannot recreate the exact same uploaded file twice.
This change targets this problem.

As this is a very rarely used flag, this is enabled only if the CAMLI_DEBUG
environment variable is true - such as the other "gross" options
(statcache, sqlitecache...).

Change-Id: I99c7805898ed97883043de4e7dcec23a472e462c
2013-10-09 21:06:51 +02:00
mpl 304f5c4b38 camput attr: support -del
Change-Id: I28460fed5b572ba9a83cfcb04f38e42124fa723f
2013-10-03 15:07:43 +02:00
Brad Fitzpatrick 99ea128752 schema: fix a race on errors in FileReader.GetChunkOffsets, add tests
Change-Id: I51635d01c3c88c5f97ac15172c5b565f07dde350
2013-09-22 13:10:16 +01:00
Brad Fitzpatrick e70f258b0b Merge two copies of StatsReceiver into common location.
Change-Id: I05bd36aef3293927fb518296b43a088f284356ea
2013-09-22 11:19:10 +01:00
Aaron Boodman 43135068a5 Check IsTransitive in share handler and add tests.
Also fix a bug in interpretation of via chain, which caused sharing
to be overly permissive.

BUG=https://code.google.com/p/camlistore/issues/detail?id=226

Change-Id: I4459a67d1b40e4a50f111ce708dbfcbd975f3f15
2013-09-21 13:16:01 +01:00
Brad Fitzpatrick 740b8eec48 Close static-set blob after done parsing it.
Fixes http://camlistore.org/issue/230 I think.

No test, though.

Change-Id: I3b23d7e4c39bd19ba6ca9e33ec382fe3e0fd33f2
2013-09-20 12:23:28 +01:00