Commit Graph

230 Commits

Author SHA1 Message Date
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 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 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 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
Brad Fitzpatrick 915299b8b6 importer/twitter: remove some log spam, clean up a comment
Change-Id: I5709a27424a56fafe84f43358b1a735c496fedd1
2018-04-21 21:02:38 -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 f41a431595 importer: add test that fails at Go tip
Updates #1090

Change-Id: I16ee3cfd49ba9af2b98cdef470932ca000d768dc
2018-04-17 14:31:00 -07:00
mpl 01e22b9035 pkg/importer/gphotos: use "drive" space as "photos" is deprecated
I have not found any doc stating that the photos Space is not supposed
to work anymore, but Brad said so in the bug, and some testing seemed to
confirm it. So this change switches to using the "drive" Space which
contains all files in Google Drive, including the photos from Google
Photos, as long as the option to have the Google Photos folder in Drive
is enabled.

Fortunately, we can still request the Spaces property of the file, and
use that to filter out all of the non-photos files. For now...

Fixes #987

Change-Id: I7f257b70804fd72c730ded158173ec6ae64fde5b
2018-04-02 02:56:32 +02:00
mpl 7bdd826360 pkg/importer: pick the "best" importer account when several exist
We still need to figure out the root cause of the problem, i.e.
why a sha224 importer node was created in the first place, when a
valid sha1 one already existed. Next CL.

Updates #1069

Change-Id: I00b4aab9a4f67b9c4ee198774378630615f6d11d
2018-03-02 16:02:18 +01:00
mpl 5df7a8c8d3 all: fix search owner use for integration tests
Follow-up of b89bf256d1

Change-Id: I26b9f71b7131b591e185781b61a80221c503ab6e
2018-02-09 02:22:01 +01:00
Paul Lindner 84b2c6b3e4 all: various lint fixes
- correct logging that logged functions instead of their value
- use ID vs Id naming
- use correct function names in comments

Change-Id: I61562cef7ebac7337ec6c85312cdf7915cb1a84b
2018-02-05 11:59:00 -08:00
Paul Lindner 459c75410e all: more renaming of Camlistore to Perkeep
Change-Id: I118e3cbcf20d80afeffc84f001388c4556f21628
2018-01-30 03:02:56 -08:00
Brad Fitzpatrick d4ff75359c pkg/client: reduce the number of New constructors, return error by default
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
2018-01-24 07:42:04 -08:00
Paul Lindner 6d2d9714de all: simpify constructs by running gofmt -s on all code
Change-Id: Idc12ddcfe8f735d77c6baa942f5bb7a2c7d9b40b
2018-01-21 10:27:12 -08:00
Brad Fitzpatrick 194d4f9443 blobserver, all: add contexts to ReceiveBlob, Fetch & million resulting deps
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
2018-01-18 16:22:16 -08:00
Paul Lindner b88b82f1ee all: convert imports of golang.org/x/net/context to context
Change-Id: I01cfa903ab2b97a1ad3ea57eb29fe88819216a3f
2018-01-13 16:37:49 -08:00
Brad Fitzpatrick 38f10a7bd0 all, testhooks: use sha224 by default, add hook for some tests to use sha-1
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
2018-01-09 20:03:38 -08:00
Paul Lindner 463832ed76 clients/web/embed: Move vendor/embed to clients/web/embed and adjust paths
Addresses #889
Fixes #1024

Change-Id: I9fa1dc246b0a3a1a4e4ec7abab0a7828fdfdb41e
2018-01-09 22:33:03 +00:00
Brad Fitzpatrick 9265c980de all: change github.com/camlistore/camlistore to github.com/perkeep/perkeep
Change-Id: I0d612bf450e9e8d9ce0767c5a0cb0c44c0d8704f
2018-01-05 19:49:59 -08:00
Brad Fitzpatrick 57648c6b83 all: update copyright holder from Google Inc to The Perkeep Authors
The AUTHORS file is the list of copyright holders.
2018-01-03 16:52:49 -08:00
Brad Fitzpatrick c3d05cdce9 Move more packages out of pkg/ and into internal/
Moved hashutil, httputil, osutil, netutil,
images, media, magic, video, and rollsum.
2018-01-02 21:03:30 -08:00
Brad Fitzpatrick d6a0b05df0 Rename import paths from camlistore.org to perkeep.org.
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
2018-01-01 16:03:34 -08:00
Brad Fitzpatrick f164f43cf3 Merge "pkg/importer/picasa: better tests" 2017-12-30 06:44:28 +00:00
Tamás Gulácsi f54c06afd9 pkg/importer/picasa: better tests
Add more thorough testing for importAlbums.

Change-Id: Id5f139052464113fa1194fccb39b81277361e514
2017-12-30 06:44:21 +00:00
mpl 99e71732b9 cmd/pk-devimport: command that runs a local importer
Change-Id: I62e35db0040cda51f2bc5ede4560974e3f3442cc
2017-12-20 17:58:56 +01:00
Brad Fitzpatrick 95e119f16f importer/gphotos: don't return channels in internal API, use foreach funcs
This code previously had methods returning channels. Such APIs are
always error-prone and difficult to use. Switch to a synchronous func
callback pattern instead, with contexts propagated.

Change-Id: Iaa1b91227c0daf4c8562fcba8d27dbcd7ab755c5
2017-12-17 17:43:23 -08:00
Brad Fitzpatrick ac517f7b75 Merge "importer/gphotos: more little cleanups" 2017-12-17 20:06:24 +00:00
Brad Fitzpatrick 77a37d01b3 importer/gphotos: more little cleanups
Change-Id: Ia97d56eb3e3f302f60c30af08a220cfa011936e2
2017-12-17 08:29:50 -08:00
mpl c45893a69b importer/gphotos: add enabling Drive API to instructions
Fixes #984

Change-Id: I12126318cf836536306fd7a861a730fc3196c7b7
2017-12-15 19:08:51 +01:00
Brad Fitzpatrick fcd5ff14e9 importer/gphotos: misc rate limit cleanups
Remove dynamic rate limit adjustment for now. It was racy.

No need to be super fast, anyway, as long as it catches up eventually.

But we can make it smarter later. I wanted to get it correct first.

Change-Id: Id5b5fc946546d8d9c0720f1c0ec2f341a17cdd01
2017-12-14 22:16:57 -08:00
Paul Lindner 1383869054 all: lint fixes for "receiver name should be consistent with previous receiver name"
Change-Id: I05275cd20c92349e37365e2cbd29fa9f8d834101
2017-12-13 11:31:25 -08:00
Paul Lindner c58e07942e all: lint fixes for "if block ends with a return statement"
Change-Id: I1c244f14995478860c19695695f287d541a7a39c
2017-12-13 11:31:25 -08:00
Paul Lindner ba92702834 all: lint fixes for "should omit 2nd value from range"
Change-Id: I7bb19d376f96a39ecae7dbdb4d6808f704bae5fb
2017-12-13 11:31:25 -08:00
Paul Lindner 15feaeb24c all: lint fixes for 'error strings should not be capitalized or end with punctuation or a newline'
Change-Id: I9c3766a51ac8be694ae76befff4b6fa9a85e34eb
2017-12-11 06:13:25 -08:00
Paul Lindner 680b296c2e pkg: simplify code - use time.Until and time.Since
Change-Id: I9c023bd4bb312e05bfbd6b1e33425500bbc5aada
2017-12-05 11:22:37 -08:00
Paul Lindner b09cd377d7 Switch to stdlib context from golang.org/x/net/context
This switches most usages of the pre-1.7 context library to use the
standard library.  Remaining usages are in:

  app/publisher/main.go
  pkg/fs/...

Change-Id: Ia74acc39499dcb39892342a2c9a2776537cf49f1
2017-11-26 01:12:26 -08:00
Paul Lindner 3654a0f623 vendor: update go-charset, atom, html, text packages
to Rev 9dfe39835686865bff950a07b394c12a98ddc811 for golang.org/x/html
to Rev 88f656faf3f37f690df1a32515b479415e1a6769 for golang.org/x/text

These packages moved from code.google.com to their new home
in golang.org/x/html and golang.org/x/text

Change-Id: I4ee45ae1e18eb05ef7b0a8ec69e2f1f11d140340
2017-11-20 10:37:56 -08:00
mpl a3bbb6ca3d pkg/importer/allimporters: enable gphotos
Change-Id: I4ea6d12c7d41d64e55654e9a539aaa62e9473d73
2017-09-21 01:41:19 +02:00
Paul Lindner fa46c3935d Correct various misspelled words
Change-Id: I236e880526e4c2b0bd318da041983d557e0aa885
2017-09-11 08:33:31 -07:00
mpl e60a1d4edd importer/gphotos: rm broken, and now useless, test
Because mediaURLsEqual was removed in
c848e5ecd8

Change-Id: I951d633103200863e43acddec825a09dcb81baf0
2017-06-23 16:53:04 +02:00
mpl c848e5ecd8 pkg/importer/gphotos: dedup with photos from picasa importer
The picasa importer and the gphotos importer fetch items in different
ways (one using the Picasa API, and the other the Google Drive API). But
most of the time a photo object downloaded from Picasa should result in
the same file as if downloaded from the Google Photos folder in Google
Drive (which is as it should be, really). Therefore the corresponding
file schemas in Camlistore should be identical as well. When that's the
case, there is no reason for the two importers to each create a
permanode if they're going to have the same camliContent. Especially
since it would look like duplicates (in the web UI in particular).

This change fixes the gphotos importer so that when it imports a photo,
and creates a file schema for it, it looks for an existing picasa
permanode having the same file schema as a camliContent. If one is found
it is reused, and the permanode ends up with an attributes set that is a
merge of the picasa-based attributes and the drive-based ones.

One caveat: the files in the Google Photos folder in Google Drive are
never updated with whatever modifications are done "at the source" (i.e.
on the items in Google Photos), they always stay as they were originally
uploaded.
(https://productforums.google.com/forum/#!msg/drive/HbNOd1o40CQ/VfIJCncyAAAJ).
As a result, such photos are different when imported from Picasa and
when imported from Drive, so they result in different files in
Camlistore.

In a subsequent CL, we'll modify the picasa importer in a similar manner
as what's done in this here CL.

Issues #874 #896

Change-Id: I6a3c89de1af404556f01ca61d92861933fd35158
2017-06-23 16:30:36 +02:00
Tamás Gulácsi 0bfa352bae pkg/importer: add gphotos, a Google Photos importer
Uses the Google Drive API to import photos from the Google Photos folder
in Google Drive.

Still a work in progress, so not yet added to allimporters.

Issues #874 #896

Change-Id: I9b9bffe071434b2a55be667579c3699a3addb8ed
2017-05-08 18:41:34 +02:00
Michael Morrissey f35578a2e2 Initial cut at importing financial transactions using Plaid.com. No Plaid-specific UI in this first pass; just import/data model only.
vendor: add github.com/plaid/plaid-go at rev 02b6af68061bf89a293eaf15dc6c955ce02dd22b

Change-Id: I1003d1d21416b9f2c7eb40085e62ec8481a0c6ed
2017-03-25 10:41:01 -04:00
mpl 47d9ea03f7 importer/pinboard: fix test
Change-Id: Ib824e083d91d83256627f027a889c73878cf04dc
2016-06-03 23:08:15 +02:00
Mathieu Lonjaret 2222045ae9 Merge "pkg/importer: Unescape tweet content during import" 2016-05-27 12:58:52 +00:00
Eric Drechsel eae4e77419 pkg/importer: Unescape tweet content during import
Bumps twitter.runCompleteVersion to 5 to fix previously
imported text containing & or <.

Adds an integration test for importing tweets from the API
and from a zip archive. Test data was exported from account
camlistore_test, which we can update later if needed. The zip
archive was skinnyfied to include only the data/ directory.

Factored out importer integration test setup code from pinboard
importer tests.

Fixes #476

Change-Id: Idc7355caefaa2173823dd1f86fe02ae81f974a0e
2016-05-25 12:48:09 -07:00
Brad Fitzpatrick c29ad2786f importer/foursquare: fix attempts to download empty string URLs
Fixes #781

Change-Id: I04a1f0122af5cc2bde9056ddd574a306d4d3b89b
2016-05-24 08:59:50 -07:00