Commit Graph

2943 Commits

Author SHA1 Message Date
Brad Fitzpatrick 12894d4630 all: Windows fixes (don't listen on file descriptors in test.World, etc)
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
2018-05-01 21:38:19 -07:00
Brad Fitzpatrick 31857ec50b test/integration: skip more symlink tests on Windows
Change-Id: I555a4db1e048e65517471090d4a10ad16f5f0167
2018-05-01 14:40:30 -07:00
Brad Fitzpatrick e25375ca22 schema: skip symlink tests on Windows
Change-Id: I7b076d886883ac0ed19df0cc5d3797cfc04b1c75
2018-05-01 14:17:35 -07:00
Brad Fitzpatrick 3b1828d79f pkg/test: remove check that GOPATH is set
We can also use the implicit one, so don't require an explicit one.

Change-Id: Ie4712be849f40b8f8cc30f99d019dd863944289f
2018-05-01 14:13:41 -07:00
Brad Fitzpatrick f5de76de22 diskpacked: fix tests on Windows
Delete some test code I don't see the value of (not sure what it's
testing).

Change-Id: I7c27bce5601e1b2780eb8bb6eeadf45f7ea97d00
2018-05-01 13:14:41 -07:00
Brad Fitzpatrick b1abccd287 devcam, localhost, storagetest: fixes for Windows
Unset CGO_ENABLED if no sign of gcc.

The localdisk renaming stuff was fixed in Go ages ago in
golang/go#13673 and https://golang.org/cl/6140

And a defer in storagetest meant Windows couldn't delete files
because a file was still open.

Change-Id: I57aef85f24653b19ce10e3d1e18c778cee2d48f6
2018-05-01 10:46:19 -07:00
Brad Fitzpatrick b1c1d1be68 blobserver/localdisk: be sure to implement SubFetcher for blobpacked
My fault for not running the (slow) integration tests before I broke
things in a4d0cc6ab7.

Fixes #1136

Change-Id: Ia30051da02974d0c3e79e0b220ff86dcab5771e4
2018-04-30 16:23:43 -07:00
Brad Fitzpatrick a4d0cc6ab7 blobserver/{localdisk,files}: move generic localdisk code to the files package
Just code movement.

Except I did delete some 5 year old localdisk migration code that's no
longer relevant.

Updates #1111 (this is prep for SFTP support)

Change-Id: Ibe1de1d4d804a6c86919a9df454ab125027e4c33
2018-04-29 20:59:42 -07:00
Brad Fitzpatrick c25b330d8d test/integration: fix tests after earlier change to root handler
In f8bc4ac6e5 I made the root handler start returning 404s for
unknown URLs, which broke this test. Update this tests.

Fixes #1132

Change-Id: I6e14811dda00e741d80e1c5603f849ffcb26f361
2018-04-29 10:15:21 -07:00
Brad Fitzpatrick 0ff6a4954e pkg/blobserver/gethandler: fix vet error
Change-Id: Ib3a86f74230f76c5fa9e3965d360e82c07a41e80
2018-04-29 10:07:54 -07:00
Brad Fitzpatrick b0c1faccfe importer: add missing file from earlier commit
I missed this file from 2c05f1a3d9 for #1105.

Change-Id: I38d95f2944fba8a0e6fe5176e1987f8fbe5b63bd
2018-04-28 07:42:23 -07:00
Brad Fitzpatrick f8bc4ac6e5 ui: link to mobile setup in UI drop-down
Updates #1120

Change-Id: I2185c656038637aec04a44a5754e67a6de20fee0
2018-04-27 17:22:13 -07:00
Brad Fitzpatrick 2c05f1a3d9 importer: refresh importer root page, add Titles, Descriptions, TODO bugs
And also speed up /importer/TYPE page's query by saying it's unsorted, which
gets us a better index. Hacky workaround. Should fix it in the query planner
later instead.

Fixes #1105

Change-Id: I140ffb40456ec802844584568d2f1a7a38b26e41
2018-04-27 17:06:59 -07:00
Brad Fitzpatrick c698ff5add misc/docker/heiftojpeg: switch to ImageMagick
Still slow, but no more ffmpeg child processes, and I'm confident
ImageMagick will improve over time. There are actually ImageMagick
commits in the past few hours that look promising. We have a demo
tomorrow, so we're not going to bump our git rev & Docker image to the
latest ImageMagick master yet.

Updates #969

Change-Id: I7a8545821cae4214ea521d7cb46aa235ae3f0ed3
2018-04-27 16:26:14 -07:00
Brad Fitzpatrick 3d5c28511f Log instead of panicking in HTTP handler on GET to /index/ (no Fetcher)
And change two Camlistore instances to Perkeep.

Change-Id: Id515480ecdc0c997e1700204d63ef4cc6a8c8cc4
2018-04-27 13:29:01 -07:00
Brad Fitzpatrick 6b88e2a73f internal/images: broaden pattern that matches HEIC images
A bunch of mine had a larger initial ftyp box, which broke the second
part of the pattern. But the second part of the pattern doesn't matter
anyway.  This only needs to casually recognize them. A later full
parse will determine what they really are.

This also adds some new debugging when CAMLI_DEBUG is true.

Change-Id: Ib4adc9b5447a64ba4682624e42b55f1d65779ef7
2018-04-27 12:29:00 -07:00
Brad Fitzpatrick 2b720aa101 search, index: rewrite, fix the "map" sort algorithm, index camliNodeType
Change-Id: Idb0e44c3f61bea9fc2cc76619223b86aa5aa4c58
2018-04-26 15:19:03 -07:00
Brad Fitzpatrick ad0b3918b7 search: optimize searching for a single blob
Fixes #1118

Change-Id: I6e63faeb3f994a3cc4718d92894f513d38ac371f
2018-04-26 13:56:32 -07:00
Mathieu Lonjaret 11dfa3850d Merge "internal/geocode: change Lookup behavior wrt to AltLookupFn" 2018-04-26 02:22:21 +00:00
mpl 8b30515218 internal/geocode: change Lookup behavior wrt to AltLookupFn
Even when AltLookupFun was defined, Lookup used to fallthrough after the
AltLookupFn, depending on what AltLookupFn returned.
This means in some cases, our tests in pkg/search did end up calling the
Google API (which was not intended). We found out because with the new
dependency on an API key for the Google service, we now rely on reading
the key from the config dir, which is wired to panic if it is accessed
during tests.

This change therefore simplifies Lookup, by making it return the results
of the AltLookupFn call, if AltLookupFn exists.

Change-Id: Ie196f892f36d309c725a6e869094364d49cffdc8
2018-04-25 18:01:39 -07:00
Brad Fitzpatrick bc24f7920a importer: change some camlistore.org to perkeep.org; fix devcam --makethings
Change-Id: I517a77a5ef2dd7495402c1357f99a6223fe8481a
2018-04-25 13:23:18 -07:00
Brad Fitzpatrick dcbe9bfbd8 Merge "pkg/test/docker: force the MySQL version to 5" 2018-04-25 04:39:39 +00:00
Brad Fitzpatrick b04b2a7618 Merge "blobserver/{files,localdisk}: add VFS layer for use by localdisk" 2018-04-25 04:38:48 +00:00
mpl 7247d11107 pkg/test/docker: force the MySQL version to 5
Since we don't support the latest MySQL version, our tests in Travis CI
are failing since they pull the latest docker image.

We should fix the issue
(https://github.com/perkeep/perkeep/issues/1114), but in the meantime,
we might as well restrict the tests to MySQL 5, so that CI tests keep on
being useful to alert us about other errors.

Change-Id: I32a2cc1dc5a4194c891183d96498dee14c759baf
2018-04-24 19:45:27 -07:00
mpl 1aeadf4a8a pkg/index: on slurping bogus gps coordinate, log instead of panicking
If a GPS coordinate is bogus, we should have caught it when receiving
the blob, and not write it out as an index row.
If we did not, we end up catching it when trying to slurp it to the
corpus. At this point there's no reason to penalize the user by
panicking, we can instead skip it and log about the error.

Change-Id: Ie40479befca78d8b5da343ef1a8420f703f07cb7
2018-04-24 17:53:33 -07:00
Brad Fitzpatrick 8a67582cf9 blobserver/{files,localdisk}: add VFS layer for use by localdisk
For now, no user-visible changes.

But this will permit an SFTP blobstorage layer in the future.

Next step will be moving 90% of the code from the localdisk package
into the files package.

Updates #1111

Change-Id: I62b924e3d69ca47e7c0fa83c78a77808a71ea33e
2018-04-24 16:30:08 -07:00
mpl 66e6766571 pkg/gpgchallenge: use long form when looking for key ID
We migrated to using the long form for key IDs sometime ago, but we
never updated the client of the gpgchallenge accordingly, so in
functions that take a keyID as an argument, it would fail to find the
given long keyID within a key ring.

However, for usability reasons, we want to keep the short form in the
hostname of the instance (and hence as the DNS entry), so we revert to
using the short form when perkeepd is setting its host name.

Change-Id: I8373016671fdead32780a04f6d64045e81cc9cd1
2018-04-23 21:44:25 -07:00
mpl 4a562043e0 pkg/sorted/sqlkv: make multiple close safe
Change-Id: I3d0f81e201a944b43bfd484e6393aed7cc52b7e3
2018-04-23 17:44:59 -07:00
mpl a2760b9767 pkg/deploy/gce: rename tarball name with perkeepd
Change-Id: I2dad2c783cdac7bd995f00e1ff22fc37d8bbb358
2018-04-23 14:06:48 -07:00
mpl 7a27eb42eb cmd: rename camget to pk-get, and make it a mode of pk
A couple of related fixes and renames too.

Updates #981
Fixes #1056

Change-Id: Id47a933c77422edfb9db41d34c38ed9d0d7a1846
2018-04-22 20:50:54 -07:00
Mathieu Lonjaret c87c026e7e Merge "pkg/test: do not expect binaries in ./bin" 2018-04-22 18:59:48 +00:00
mpl e778290117 pkg/test: do not expect binaries in ./bin
As make.go now does not install binaries in ./bin, but rather let them be
installed wherever go install does, the test World should now rely on
os/exec's LookPath to find the binaries it needs.

Fixes related failing tests

Change-Id: I256e79673ca994001e831aed9e7a3ab5ba485ead
2018-04-22 11:59:12 -07:00
Brad Fitzpatrick a062b701c9 all: more log spam & logging consistency cleanup
Change-Id: Ibc38c2eed86e75afb064ba25ba586494c813f56c
2018-04-22 11:30:02 -07:00
Brad Fitzpatrick ab797685bf importer: rename foursquare to swarm, add Properties to Importer interface
Foursquare was rebranded Swarm (for check-ins) some time ago, so
rename our implementation to match the upstream branding. But still
store "foursquare" as the permanode importer type, to not break old
users. That override is now added to the new Properties struct, and
all importers now return their properties.

More stuff will be added to Properties later: WIP flag, bug link,
proper title, icon?

Change-Id: I31cbe2feec3dbf9c6bdb0c866056d9c6966313e3
2018-04-22 11:29:50 -07:00
Brad Fitzpatrick 38d0075c3a all: make log lines a bit more consistent
Change-Id: I06c5bbe072c9857ca3afbf97d14146b9cd96a49e
2018-04-22 08:51:43 -07:00
Mathieu Lonjaret 892dd7b0f3 Merge "pkg/search: allow empty expression" 2018-04-22 04:42:13 +00:00
Brad Fitzpatrick 915299b8b6 importer/twitter: remove some log spam, clean up a comment
Change-Id: I5709a27424a56fafe84f43358b1a735c496fedd1
2018-04-21 21:02:38 -07:00
mpl aaac9635d2 pkg/search: allow empty expression
We had checks in place to return an error if a search query had both
no constraint and no expression. However:
1) we accepted " " as a valid search expression (which is the
work-around that was used by the web UI for the index page)
2) the rest of the code seems to be coping well if we remove these
checks, which this CL does.

This allows us to remove the q=" " trick in the web UI, which does not
seem to be breaking anything, and has the side-effect of improving the
map aspect story (issue 1081). Because with this change, the index page
is not considered anymore as the result of a search query, which means
if one then clicks on an image, one then gets to the image permanode as
a "standalone" item, instead of as one item part of set.
As a consequence:
1) If one then clicks on the map aspect, one gets only this item on the
map (with the proper zoom level), instead of all the items from the
index page.
2) The other side of the coin is left/right navigation does not "work"
anymore in this context, since the item is not part of a set anymore.

In other words, this change makes the index page (i.e. the empty search)
a somewhat particular case, and makes it behave a little differently
from the result of any other (non-empty) search.

Updates issue #1081

Change-Id: Ibbb1711c67c7cf8adaf94ab5d2c68c3755e4983b
2018-04-21 17:44:43 -07:00
mpl 2bb666ccf6 all: rename remaining occurrences of camput
Also removed misc/buildbot while at it (which contained camput
references) since we don't use it anymore at all.

TODO: the OSX app seems to be relying on finding a binary in ../bin,
which we do not use anymore. This will probably need fixing.

Updates #981

Change-Id: I14220fbad2e81181330fca4bb2d2e5fe170e1bd6
2018-04-21 16:20:24 -07:00
Brad Fitzpatrick 54578ea062 pkg/blobserver/blobpacked: log before starting integrity check
Fixes #1097

Change-Id: I3abea84a9cee090309098634e655721272386092
2018-04-21 12:05:41 -07:00
Brad Fitzpatrick ca76a40bbc Rename camlistored to perkeepd.
Updates #981

Change-Id: I8fe43c240c149074c23128a89ab426af9cbf94b4
2018-04-21 11:06:09 -07:00
mpl ce4658abfc cmd: rename camput to pk-put, and make "pk put" call it
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
2018-04-21 10:26:55 -07:00
Brad Fitzpatrick a13abdeb8c cmd/camput: add flag to specify hash function for raw blobs
Also a bit more logging around indexing in debug mode.

Change-Id: I2eb67cfec12cff102ba64b17de0369bde38e416a
2018-04-20 21:02:43 -07:00
Brad Fitzpatrick 61de9881da pkg/index: redo indexing of a blob when CAMLI_REDO_INDEX_ON_RECEIVE is set
So an upcoming HEIC reindexing tool.

Updates #969

Change-Id: If194904d770bb670fa581c4e5e09c303806bc784
2018-04-20 19:40:11 -07:00
Brad Fitzpatrick 973df545ef search: support wildcards in filename search
Change-Id: Ic8a1b2cdad3215f7e850bcc47467e0b4f8e92c4f
2018-04-20 13:36:43 -07:00
Mathieu Lonjaret b1e655219c Merge "pkg/index: read EXIF bytes when HEIC file" 2018-04-18 15:40:49 +00:00
mpl 3014bd7413 pkg/index: read EXIF bytes when HEIC file
Updates #969

Change-Id: I11cc1668b853fe5bc2d076addda1a60c08be1dc5
2018-04-18 17:39:38 +02:00
Brad Fitzpatrick b489cfa6bf Merge "internal/images: reset err to nil on no EXIF found" 2018-04-18 01:51:09 +00:00
mpl 149212b828 internal/images: reset err to nil on no EXIF found
the changes to DecodeConfig in ce955adf48
moved the call to image.DecodeConfig to before the call to exif.Decode,
because we need to do that for the HEIF case.

After the call to exif.Decode, if err is nil and is not a short read
error, we ignore the error and the code goes on. To mark that intent,
we should have explicitly set the err to nil at this point. However,
that omission did not matter before
ce955adf48 because image.DecodeConfig
was the last setter of the error.

Now that it has moved up, we do have to explicitly reset the err to nil.
While we were at it, we rewrote the whole logic to be easier to read.

This seems to fix all the tests in pkg/index and pkg/search.

Change-Id: Id0b711179ccb1365b851d3e86ecb70d47ac358b4
2018-04-18 03:41:14 +02:00
Brad Fitzpatrick f41a431595 importer: add test that fails at Go tip
Updates #1090

Change-Id: I16ee3cfd49ba9af2b98cdef470932ca000d768dc
2018-04-17 14:31:00 -07:00