Commit Graph

3018 Commits

Author SHA1 Message Date
Mathieu Lonjaret aa7ab23772 Merge "pkg/importer: add "instapaper" importer for Instapaper service" 2018-12-03 15:07:30 +00:00
Angel 3dbb01138f pkg/importer: add "instapaper" importer for Instapaper service
A working importer for the Instapaper service. The importer imports
bookmarks, full text articles, and highlights. A blob item handler for
Instapaper highlight permanodes is included to show summarized highlight
content from the server UI.

Also, this CL updates github.com/garyburd.com/go-auth to rev
bca2e7f09a178fd36b034107a00e2323bca6a82e in order to get support for
XAuth requests.

Fixes #1208

Change-Id: I72e0c40b245c7eec4a44bb475fcaa96a0ee9a1c5
2018-11-26 07:57:08 -05:00
mpl 8130bd61ef server/perkeepd/ui/goui: suppress basic auth on OmitAuthToken
The javascript code was taking into account the OmitAuthToken signal
that there should be no auth, but it hadn't been done in the gopherjs
code yet as well.

Fixes #1221

Change-Id: I3eda0cc12c99664739d6073cc1aeba1aeed8a88a
2018-09-26 20:00:36 +02:00
mpl b26a440e4b pkg/server: fix camlistore.org refs on help page
Change-Id: I11f1b362460f411939a4608ddb83a4027cb12e7e
2018-09-14 03:21:03 +02:00
mpl c243487bdb pkg/index/sqlite: fix tests
Long broken since the sha224 switch.

Updates #1085

Change-Id: I2dda3dac6bd3c8006be0974bdc9be402e25b7429
2018-08-29 03:39:05 +02:00
mpl 5ca78c73d2 cmd/pk-mount: add schema summary to doc
Change-Id: I516d6fe5c364b6eb1d7f8977a67791ca399d214e
2018-08-28 18:55:20 +02:00
Mathieu Lonjaret 9a49f0959d Merge "importer/twitter: add likes import" 2018-08-21 23:53:37 +00:00
Mathieu Lonjaret 2820453dd3 Merge "pkg/importer/twitter: update importer account instruction" 2018-08-21 23:50:29 +00:00
mpl 0888d28260 all: fix misc bugs found with go test ./...
Change-Id: If5bda860c9cc6bdc14c2977646516c58d17d62de
2018-08-17 02:17:54 +02:00
Niklas Merz 05f86e7846
importer/twitter: add likes import
Import liked tweets via favorites API

Change-Id: I8000bcd20cd895e540ec4d3b36035531172c7cb6
2018-08-14 17:49:37 +02:00
Philip Silva 457a636722 pkg/auth: userpass: compare strings in constant time
Makes the http auth more secure against timing attacks.

Resolves #1205

Change-Id: I6069331d9a6da454a2e664a57cb425f53dea0016
2018-08-09 15:48:42 +02:00
Mathieu Lonjaret ba70be6b46 Merge "pkg/search: fix dir search with logical not constraints" 2018-08-08 15:12:27 +00:00
Robert Günzler f7cc51f83b pkg/search: fix dir search with logical not constraints
As demonstrated by the test case added in this commit, a
search panics if the DirConstraint contains a LogicalConstraint
with Op set to "not". This is because the isFileOrDirConstraint
function doesn't account for unset "B".

Change-Id: I111ace62486160254ba22ab1498de78cde2a5e9b
2018-08-08 02:55:29 +02:00
mpl e007f66b76 vendor: update github.com/go-sql-driver/mysql
To rev 99ff426eb706cffe92ff3d058e168b278cabf7c7

To support the new default authentication plugin in MySQL 8.

Interestingly, the update also revealed an error unseen so far.
Each of the pkg/sorted/mysql test uses a docker container. If we did not
kill the container at the end of a test, docker would use a new,
different, IP address for each mysql container (which would dodge the
error I'm about to mention). But since we do clean up and remove the
container for each test, then each test gets a container with the same
(first in the range) IP address, because docker "thinks" everything
about the previous container was properly removed.
However, it turns out that since we had forgotten to tell the client
code to close the connection to the mysql server, then the server-side
IP:port is still seen as occupied (even though the server is gone). And
since the second (or nth) test client tries connecting to the same
IP:port, the connection fails.

TL;DR: we also need to close the connection to the DB on the client
side, even though the server in container goes away after each test.

Fixes #1114

Change-Id: I76ce4ac2ee7703f92a9431116cd82ab75da541f7
2018-08-07 21:20:11 +02:00
Mathieu Lonjaret e66f5ce20a Merge "server/perkeepd/ui: display search query errors" 2018-08-02 17:56:49 +00:00
Euan Kemp 90042fe296 pkg/blobserver/s3: use official aws client
vendor: add github.com/aws/aws-sdk-go at rev bc3f534c19ffdf835e524e11f0f825b3eaf541c3

This changes all uses of the s3 client to be the official aws-sdk-go. As
such, it also deletes the previous client maintained in internal.

There are a few notable changes that come with this:

1. An 'aws_region' key is added to the low-level config. The
   'get-bucket-location' call is used to identify the correct region
   rather than using the redirect returned to determine it.
2. Deleting multiple objects at once is much faster (batches of up to
   1000 vs 1 at a time).
3. Retriable errors are retried automatically (see #1184).
4. Newer APIs are used for some operations (v2 / batch apis).

An unfortunate result of 4 is that this is technically a backwards
incompatible change. An IAM policy which used to be sufficient for
perkeep may no longer permit some of the new api calls (even if they're
not doing anything different really).

Fixes #1184, #911

Change-Id: I077fe88def18b7e9a14267820773245e7003634c
2018-07-31 15:51:31 -07:00
Euan Kemp d456c989b1 pkg/index: correct test for unindexed attribute
Fixes #1199

Change-Id: I294bd6f09aef1ea50dda7e20038aee7993ffd181
2018-07-26 12:25:41 -07:00
mpl b75529b5da pkg/importer/twitter: update importer account instruction
Fixes #1130

Change-Id: I0ad7de5e09f00e8079e6ce498a0dbb38998f22a5
2018-07-26 02:58:10 +02:00
Euan Kemp 13a8e94895 pkg/client: return error for unindexed attr search
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
2018-07-25 12:56:40 -07:00
mpl 3f1b2f475d vendor: update golang.org/x/crypto
to c126467f60eb25f8f27e5a981f32a87e3965053f

For acme tls-alpn-01 support.
And enable it in perkeepd.
Remove http-01 challenge support.

Fixes #1078 (by making it obsolote)

Change-Id: I45220b6269024a2ff7a181f69cf708869705dca7
2018-07-24 04:03:16 +02:00
Mathieu Lonjaret b5c76a70e8 Merge "server/perkeepd/ui: replace pudgy with keepy" 2018-07-18 17:58:09 +00:00
Mathieu Lonjaret 2c080dda3b Merge "blobserver/s3: add unit test for endpoint handling" 2018-07-17 15:19:07 +00:00
Mathieu Lonjaret 0f73329557 Merge "importer: Add a Mastodon importer" 2018-07-17 14:41:12 +00:00
D Anzorge c06d31eda4 importer: Add a Mastodon importer
The Mastodon importer uses the Mastodon API (implemented by Mastodon and
Pleroma) to import posts into Perkeep. The webui also now recognizes
Mastodon posts, and displays their text.

The importer does some things differently than most other Perkeep
importers, since it needs to be able to import from arbitrary URLs. It
does not share any credentials globally between all accounts, to enable
use of multiple accounts on multiple servers.

This also introduces new dependencies of go-mastodon and linkheader
(both under the MIT license).

Resolves #1183

Change-Id: I9a532bbd5720992482fc758f14286c11d5bf6ef0
2018-07-17 00:20:37 +02:00
Euan Kemp d48b74f223 blobserver/s3: add unit test for endpoint handling
The s3 blobserver's endpoint handling is complex enough it makes sense
to record some of its constraints in a unit test.

Change-Id: Ife1637a33ba5c3265b3fdfd75307d7784e7c9524
2018-07-16 11:10:01 -07:00
mpl ba5aa9d3b9 server/perkeepd/ui: replace pudgy with keepy
-busy/munching pudgy is replaced with a "dancing" keepy
-sad pudgy replaced by a sad keepy
-everywhere else is normal keepy (which is one sprite of the dancing
keepy animation)
-we still need an "interested" keepy for when the user is about to drop
something on the d&d area
-glitch embedy directory has not been removed yet, to keep the pudgy
animations technique as a reference for future work.

We also need to update the animation in the GCE launcher.

Updates #1177

Change-Id: I95fe53cb51f93b8f498c8f026eddc07285c20db7
2018-06-29 21:48:11 +02:00
mpl a538874c07 pkg/client: move upload test to pkg/test/integration
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
2018-06-27 21:08:46 +02:00
Mathieu Lonjaret 2409082b78 Merge "pkg/blobserver/files: remove use of 'asserts' pkg" 2018-06-26 16:01:25 +00:00
mpl 933ecd89df server/perkeepd/ui: display search query errors
This change:
-on startup, makes perkeepd log instruction about the Google geocoding
key, if it is not found in Perkeep configuration directory.
-in the web UI, makes search query errors from the search session show
up in a dialog, instead of just being logged in the javascript console.
Among other things, it will allow users to be more readily informed
that their loc: queries are failing because they don't have a geocode
key setup.

According to the Google geocoding team, we should not share a geocoding
API key (too risky/expensive), and using an API key is the only way to
make geocoding requests. So we have to let users deal with it themselves
unfortunately.

Updates #1115
Fixes #1116

Change-Id: I461e7f06a04ffd874678ab8233185999024cb3d8
2018-06-26 02:25:32 +02:00
Mathieu Lonjaret e2133b5407 Merge "perkeepd/ui: add dialog to import shared items" 2018-06-25 23:17:51 +00:00
mpl 7f17c0483f pkg/serverinit: call readFields on GCE too
Fixes #1193

Change-Id: Ic82af5ec94e010d5d0d4d63df814daf4ad9e0542
2018-06-19 18:28:33 +02:00
Euan Kemp fc575bc8c0 pkg/blobserver/files: remove use of 'asserts' pkg
The asserts pkg, per the note at the top, shouldn't be used.

Change-Id: Ia00c6dd3b2b924e745a6c7d31c31450285750696
2018-06-18 22:42:10 -07:00
mpl 877eafa49b perkeepd/ui: add dialog to import shared items
This change adds an 'Import share' entry in the main menu bar. This
entry creates a dialog that allows the user to enter the URL of a share
claim (the "shareURL" in the following).

That shareURL is sent to the server, which takes care of importing all
the blobs transitively reachable (directory children, and files
contents) through the share claim.

The web UI also keeps on polling the server to update the dialog on the
state of the importing process.

To handle the posted shareURL, and the polling, the server now has a new
HTTP handler: the shareImporter, installed at /ui/importshare.

In a future CL, another approach would be to integrate this handler as
yet another importer. But it would probably be better to do so once we have
a way for importers to report on their progress at any time. For now this
importer has its own dialog to do so, similar to the one for uploads.

Change-Id: I94cd03f834d7d1e9f4ec5c016ffdf16d911856c5
2018-06-19 02:05:23 +02:00
Mathieu Lonjaret f92f9b80a3 Merge "pkg/blobserver/s3: fix tests" 2018-06-15 00:35:19 +00:00
Euan Kemp 039d51906e pkg/blobserver/s3: fix tests
The storage test for s3 have been broken since
https://perkeep-review.googlesource.com/c/perkeep/+/15846.

The introduction of a proxycache made a type assertion in the test
panic, and thus the tests reliably failed when run.

The simplest fix for now is to get them back to their previous passing
state by disabling the proxycache for tests.

Change-Id: Ib75b5eabd36decebd8785ba50d4b979a7a0db653
2018-06-14 15:10:47 -07:00
Mathieu Lonjaret b0cdf13a0f Merge "importer/pinboard: add incremental import" 2018-06-14 13:45:20 +00:00
Niklas Merz 2e1b075acf
importer/pinboard: add incremental import
Enable "SupportsIncremental"

Fixes #1182

Change-Id: I75202fba95f5e481f68cfd95f20e40d32e33b377
2018-06-13 18:05:46 +02:00
mpl b48e2de0c6 pkg/blobserver: print RemoveBlobs errors
Both on server and client sides. So far we did on neither.

Fixes #1186

Change-Id: I7ff3484d82329b4f83a5f3fa8f150ac7ad7f732c
2018-06-11 19:32:35 +02:00
Will Norris b2f5e85b51 pkg/importer/swarm: update importer URLs
update URLs used when registering Foursquare App to use updated importer
name.

Fixes #1179

Change-Id: If0889c3d4a9f323b2729d6061549524cdfc4d148
2018-05-29 14:51:10 +00:00
Stephen Searles d6c616c615 server/sync: add sha-224 to the sync'd prefixes
Updates #1172

Change-Id: Ic9e927aad5f90e926bd50a5ab4a17d540c3f5a2b
2018-05-19 22:05:29 -04:00
Brad Fitzpatrick 9d0472a968 Merge "pk/fs: add Logger, set it to discard when not debugging" 2018-05-19 02:44:04 +00:00
Stephen Searles a462466f37 perkeepd: added --keep-going flag to start after index/recovery errors
In order to facilitate manual recovery in severe scenarios, the
--keep-going flag will make the server come back online even when there
are index or recovery errors. This will allow further querying on the
unhealthy server to identify missing data or to extract data for
migration to a new/healthy instance.

Fixes #1166

Change-Id: I4153905757d9e7d8014780dd5660a862cb8ba1ab
2018-05-18 22:29:12 -04:00
Brad Fitzpatrick 41ed0359e1 client, serverinit: fix tests from API change in earlier change
I forgot to fix these as part of 8e71a705d.

Fixes #1171

Change-Id: I22402dfad36bc26fc598b760ab4514cee71e1e38
2018-05-18 09:48:17 -07:00
Brad Fitzpatrick 05d5ea0ab0 Merge "pkg/serverinit: remove reindex parameter to InstallHandlers" 2018-05-18 02:53:14 +00:00
Brad Fitzpatrick 0ccf258ca4 blob: specify "oh, nevermind" error value for optional SubFetcher interface
To support composition, all optional interfaces in Go need a way to
say, at runtime, that "oh, nevermind, I defensively implemented this
interface but it turns out the thing I'm wrapping doesn't support it".

We learned that lesson only in the past few years, but SubFetcher
predates that.

So do that here and make proxycache implemented SubFetcher and make
everything respect the fallback oh-nevermind error value.

Fixes #1170

Change-Id: I3c0958cf6692a324e98f526571d10a352a8e18b4
2018-05-17 19:49:02 -07:00
mpl 079024338d pkg/test: append .exe to bin name on Windows
Change-Id: I3de5f33768dffafd79cbe973e3e0435b0614bd9e
2018-05-17 21:10:21 +02:00
mpl 17c1685159 pk/fs: add Logger, set it to discard when not debugging
Change-Id: I66914d436b7e3d15416a8089fac0d1c1107ce13e
2018-05-16 20:08:56 +02:00
mpl 5789ec4b8d pkg/fs: add sha224-xx...xx hint dir
And fix sha1 assumption for file name.

Fixes #1169

Change-Id: I2a907c6cf11631a4a86268a4dc393c64402b5d35
2018-05-16 18:03:18 +02:00
mpl 0ce4a8b2a4 pkg/test: give the World a GOBIN
I have tested that, starting with an empty $GOPATH/bin, after running
devcam test, $GOPATH/bin still has none of the Perkeep related binaries.

Fixes #1139

Change-Id: I60b63ff917cf91c8d424b448f874f40a18e1c23b
2018-05-16 01:34:22 +02:00
Brad Fitzpatrick e984a6aa88 Merge "pkg/serverinit: revert change that enabled https if cert or key was specified" 2018-05-15 17:33:27 +00:00