Commit Graph

7217 Commits

Author SHA1 Message Date
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
mpl 4866c7c62e misc/docker/synology: tag images and build stages
Tagging images depending on the selected arch allows us to preserve
docker caching even when switching arches.

Also, since the first build stage was not tagged, it was considered as
dangling, so it was getting removed by 'docker rmi'. So we now tag it as
well to keep it cached.

Change-Id: I0c36c625e7bd459192f97052d26d76084a03bea7
2018-08-06 19:52:33 +02:00
Mathieu Lonjaret 82925c5010 Merge "perkeepd: remove map zoom guided by loc: or locrect:" 2018-08-02 18:11:12 +00:00
Mathieu Lonjaret e66f5ce20a Merge "server/perkeepd/ui: display search query errors" 2018-08-02 17:56:49 +00:00
mpl 5e271c0e08 perkeepd: remove map zoom guided by loc: or locrect:
As well as the rectangle which was drawn to show the area corresponding
to the requested location.

The initial zoom is now only based on the location of the search
results.

As (the intended) side-effect, geocoding requests are not needed
anymore, since the map aspect does not need to know the coordinates of a
loc: request anymore. Which allowed to trim down the
server/perkeepd/ui/goui/geo pkg.

Updates #1115

Change-Id: I22983661fd482b652d8bf34a63fa88d7b7695d5e
2018-08-02 03:41:07 +02: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
Mathieu Lonjaret 78a6583793 Merge ".gitignore: keepy zembeds" 2018-07-27 00:48:31 +00:00
mpl 431c7df1ef .gitignore: keepy zembeds
Change-Id: I8b9539cc2ba26afe01c2e021c0b7a3677c5f0ecf
2018-07-27 02:47:47 +02: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 4906b8803e doc/synology: update latest tarballs
Also mention synology packages on download page.

Change-Id: I76118d6dc93d8ba44ce5af6eb422ee12971dfae5
2018-07-26 03:28:50 +02:00
Mathieu Lonjaret 62ec6f94b0 Merge "misc/docker/synology: package Perkeep for Synology" 2018-07-26 01:04:34 +00:00
mpl b75529b5da pkg/importer/twitter: update importer account instruction
Fixes #1130

Change-Id: I0ad7de5e09f00e8079e6ce498a0dbb38998f22a5
2018-07-26 02:58:10 +02:00
Mathieu Lonjaret de69ead3cb Merge "pkg/client: return error for unindexed attr search" 2018-07-25 23:47:53 +00: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 61d5e4e05d misc/docker/synology: package Perkeep for Synology
Fixes #986

Change-Id: I63b506944e3d71a3e864d9f4b37a1e0b1abd8b9c
2018-07-25 20:36:46 +02:00
mpl 8b537a6630 server/perkeepd: readd log about using Lets Encrypt
Change-Id: Ia3df8ba3e10d568e8033b7b69ed8ef13e554898c
2018-07-25 19:51:48 +02:00
mpl 7d198eed67 vendor: add golang.org/x/crypto/internal/subtle
I forgot to include it in 3f1b2f475d

Change-Id: Ib53c54985d536df83eac830750e4ad98351960e3
2018-07-24 19:24:13 +02: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 38e3e3d07a Merge "vendor: update myitcv.io" 2018-07-23 19:15:06 +00:00
Euan Kemp 4c3d497fc1 vendor: update myitcv.io
to bf2c84553c7827a1cb6cecf19424fdb93b887d5b.

This is required per the change mentioned in
https://github.com/myitcv/react/issues/116#issuecomment-405631245.

Without this change, 'dep ensure' can't be run, unless the upstream
myitcv.io html is reverted/updated or dep fixes a few issues allowing
project-root calculations to be overridden.

Change-Id: I63ab98b8701dcea753d4e67828f47227801638be
2018-07-23 09:56:03 -07:00
mpl 022e7ddd80 make.go: build embeds for keepy
Forgot to add that change to ba5aa9d3b9

Change-Id: I6a83c9f5a651d3bf629d1a734faee24399839dd6
2018-07-20 02:39:52 +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
mpl bb8bb2ac63 doc: add files vs permanodes explanation
The confusion of users regarding files VS permanodes and the related
questions comes back very often on IRC or on the mailing-lists.
Therefore, this small explanation that we can point them to should help
alleviate that confusion.

Change-Id: I02acd38754f866acb4fe91c4dfa7e93ef80ac8ea
2018-07-17 01:35:06 +02: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
Mathieu Lonjaret 9c7ceeb90a Merge "pk-web: push commit to perkeep repo instead of camlistore one" 2018-07-10 18:49:29 +00:00
Neil Pankey 97c4bd0ffa website: replace 'camtool env' with 'pk env'
Change-Id: I97c1ed8c7800ff7af13759d2c03238b9c46e2dde
2018-07-08 14:25:41 -07:00
mpl 28f7599a8f pk-web: push commit to perkeep repo instead of camlistore one
We were still pushing to the camlistore repository. That worked, thanks to the
redirect, but we might as well push directly to the correct one now.

Change-Id: Ide4668ee587568cba928cb360289000aa106e955
2018-07-03 17:58:28 +02: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
Mathieu Lonjaret 05ec6c32ba Merge "pkg/client: move upload test to pkg/test/integration" 2018-06-27 19:49:59 +00: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 d723f068f3 Merge "pk-web: add paging on timeout for docker runs" 2018-06-27 18:08:31 +00:00
mpl b3381cc58d pk-web: add paging on timeout for docker runs
It happens somewhat regularly that pk-web stops syncing commits to
github, and sending e-mails about it, because any docker run process
seems to get stucked. Invariably, restarting the docker service
(systemctl restart docker), seems to fix the problem.

This change adds a timeout mechanism for functions running a docker run
exec, so that after the timeout, we get notified by e-mail about what
function is blocked.

Change-Id: I16bd4f5abc7864ceb176a0e69c5300165194b18f
2018-06-27 20:06:02 +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
Euan Kemp feef4b6b0d devcam hook: correct pathspec for older gits
Older git versions (prior to 2.13 / commit
859b7f1d0e)
required a more explicit pattern.

This also reorders the gofmt one to put the positive before the negative
match for consistency.

Fixes #1191

Change-Id: Ie74e3c3d434f667d76d5ebbb76811b4f304800c8
2018-06-18 18:23:28 -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 887e87845b Merge "devcam hook: ignore vendor in whitespace check" 2018-06-18 18:57:11 +00:00
Euan Kemp 944677f3a1 C+A: Add Euan (Individual CLA)
Adding myself per the contributing guide's recommendation.

Change-Id: I0460d76a872a44cfd493b57e59cf172bb34fca51
2018-06-15 16:50:44 -07:00
Mathieu Lonjaret f92f9b80a3 Merge "pkg/blobserver/s3: fix tests" 2018-06-15 00:35:19 +00:00
Mathieu Lonjaret 14c67d2821 Merge "C+A: add Niklas Merz (Individual CLA)" 2018-06-15 00:34:37 +00:00
Niklas Merz e8d33d10ca
C+A: add Niklas Merz (Individual CLA)
Change-Id: I4561ea9a46138695075ba4c1bf2816ff1e2e1724
2018-06-15 00:38:12 +02: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
mpl 1abff5383c website: fix sender for commit msg with mailgun
Change-Id: I58163e568914ef821d48399da62082275f1734b5
2018-06-14 20:11:16 +02:00
Mathieu Lonjaret b0cdf13a0f Merge "importer/pinboard: add incremental import" 2018-06-14 13:45:20 +00:00