Commit Graph

179 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 bcb0ec628e vendor: bump github.com/gopherjs/gopherjs
To rev 0fee806ad4970060e8f97d37a50fc58572426195, to support Go 1.11.1

Fixes #1227

Change-Id: I8cbb24ff60b3407bec3fad0d660957e36d998324
2018-10-07 04:36:24 +02:00
mpl 3f24764ea9 make.go: update to Go 1.11 as required version
Wich also means updating github.com/gopherjs/gopherjs to
rev 0210a2f0f73c96103378b0b935f39868e5731809

Fixes #1211

Change-Id: I9ae580bffda523237d471942f39ae157ff4bd303
2018-09-14 13:01:08 +00:00
mpl 592a9e046c vendor: add missing files in github.com/go-sql-driver/mysql
New files that I forgot to git add in the
e007f66b76 update.

Change-Id: Ic2a8177df16b178a346e2e6273ce2b6096f172c5
2018-08-08 18:08:59 +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
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
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
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
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
Euan Kemp 2e2b390d1b vendor: update github.com/syndtr/goleveldb
to db3ee9ee8931e51af7158114b9d02bf93d1a7811
and also update golang.org/x/crytpo to b47b1587369238182299fe4dad77d05b8b461e06

The golang.org/x/crypto change is to correct a typo in 'Gopkg.toml'
which resulted in the 'Gopkg.lock' not containing an actually locked
down revision.

The leveldb change fixes #1185

Change-Id: If14a0c4d6fc011716c2371351f2572b0ca2b588a
2018-06-08 10:47:36 -07:00
mpl b311ba008b vendor: update github.com/rwcarlsen/goexif
To rev 8d986c03457a2057c7b0fb0a48113f7dd48f9619

Fixes #1127

Change-Id: I1febf824d10f4f38075cab1bbd0d4540305d1016
2018-05-18 20:39:48 +02:00
Brad Fitzpatrick 8bde2a9e9e vendor: add files missing from b57013cb82
Change-Id: I6945e5c53150346dee2933a95d29c5afc3d5b77e
2018-05-13 15:21:53 -07:00
Brad Fitzpatrick b57013cb82 blobserver/sftp: add SFTP storage target
Fixes #1111

Change-Id: I4bedfa44241c1e6cc607658c991179ee04f9eb31
2018-05-11 20:53:50 -07:00
Paul Jolly e0d014a6fc
vendor: update gopherjs to 8dffc02ea1cb8398bb73f30424697c60fcf8d4c5
Revert back to using master of https://github.com/gopherjs/gopherjs.

Includes:

* recently-merged support for using a vendored GopherJS
* removes dependency on legacy golang.org/x/tools/go/gcimporter15,
switching to golang.org/x/tools/go/gcexportdata

Change-Id: I1f8b4c829bcfa8562614d9f8368c1d58edd10fab
2018-04-29 18:25:37 +01:00
mpl 951e9a45bf vendor: add golang.org/x/tools/go/buildutil
dep had computed it was needed, but apparently if I have it in my GOPATH
(and not in vendor), then building works (which seems weird?), which is
what made me miss it previously.

Change-Id: I979a107aea735e4f505882e4230a20c74eb5df04
2018-04-18 19:02:16 +02:00
mpl f8ef262ff9 make.go: clean up, notably remove the tmp source code mirroring
Fixes #1004

Change-Id: Iea01cfc601b8dd8f2a81fe5da40cdd272b164bb1
2018-04-17 19:39:46 +02:00
mpl 0376552051 vendor: update go4.org
To revision a2a47940e6bcb2098c42264fb0515cb027f2564a

Change-Id: I5dbce0d12375ad8c7ffff796f968582a04753879
2018-04-16 23:18:18 +02:00
mpl 139cd8bd01 vendor: add go4.org/media/heif
At rev 7b81d6948d11710f710d0c4ef52daac1dc7c936b

Updates issue #969

Change-Id: I6f21de58c0865d3cbc8186b3a6834444b6d1206e
2018-04-13 00:10:11 +02:00
mpl e264292d25 vendor: update github.com/rwcarlsen/goexif
To rev fb35d3c3290d09f3524b684b5d42d0063c227158

Gopkg.lock update withheld on purpose, as something weird is going on
with myitcv.io, and I I want to ask the maintainer about it first.

Change-Id: I4fc5e3bf022371b3114210f30be1d16d8d89e741
2018-04-11 00:03:11 +02:00
Eric Drechsel e4903de21b vendor: update gopherjs to 82b322028c96512b15077093b16a5f1c7ea897ac
Change-Id: I19128ea01fad41267eaf870e57e799388123c3fb
2018-04-03 17:08:44 -07:00
Paul Lindner 9b8fb64aa2 vendor: dep cleanup for transitive dependencies
Remove the following transitive packages with constraints. dep
does not enforce these:

 - github.com/cznic/fileutil
 - github.com/cznic/lldb
 - github.com/cznic/mathutil
 - github.com/edsrzf/mmap-go
 - github.com/golang/protobuf
 - github.com/gopherjs/jsbuiltin
 - github.com/pkg/errors

Rerun dep ensure -update and resync packages.

Change-Id: I3a6613459628dc963516e840a453d2bc2d25835a
2018-02-16 17:35:19 -08:00
Paul Lindner ecfd0851f5 vendor: disable non-go pruning for github.com/gopherjs/jsbuiltin
jsbuiltin.inc.js is required for proper operation

Change-Id: I9443dcf58d8e02d07068cdbded6bd74933805fd5
2018-02-12 16:13:08 -08:00
Mathieu Lonjaret d212707a6f Merge "vendor: readd github.com/gopherjs/jsbuiltin/jsbuiltin.inc.js" 2018-02-12 19:34:20 +00:00
mpl edbddab985 vendor: readd github.com/gopherjs/jsbuiltin/jsbuiltin.inc.js
It is being automatically removed by dep ensure since
3dfd895def but its removal breaks the web
UI.

This change alone is therefore probably not enough, we need to teach dep not
to remove it.

Change-Id: I61d50e703e786fdebc10446784dc84d43a0c1620
2018-02-12 20:11:49 +01:00
Paul Lindner 5894af5196 vendor: upgrade to a versioned dep of sqlite
Use the now renamed libsqlite3 build pragma. This requires
having sqlite3 installed on the system instead of using the
c code bundled in vendor (which is removed by the dep tool
by default)

1.6.0 corresponds with rev
github.com/mattn/go-sqlite3@6c771bb9887719704b210e87e934f08be014bdb1

Changelog: See https://github.com/mattn/go-sqlite3/releases

Change-Id: I48fc0bc005715b83805837f544e7fa7875e6d56a
2018-02-12 09:42:29 -08:00
Paul Lindner 3dfd895def vendor: update to dep v0.4.0 which allows for auto pruning, more legal files and no tests
Change-Id: I434887599e29664cb45440df3648207ae978c932
2018-02-06 06:56:32 -08:00
Paul Lindner fecf799c00 vendor: revert Camlistore->Perkeep change made in vendor
Change-Id: Ieeb91cb4fab9287fac19f0ce728c0773dfe1985e
2018-01-30 14:13:48 -08:00
Paul Lindner 459c75410e all: more renaming of Camlistore to Perkeep
Change-Id: I118e3cbcf20d80afeffc84f001388c4556f21628
2018-01-30 03:02:56 -08:00
mpl e9e9da4bf8 server/camlistored: use Let's Encrypt http-01 challenge
As the priority is to fix GCE instances, the port for the http-01
challenge is not configurable for now (80) even not on GCE, but it will
be in a follow-up change.

update golang.org/x/crypto/* (for acme) to rev
13931e22f9e72ea58bb73048bc752b48c6d4d4ac
update golang.org/x/sys/* to rev
fff93fa7cd278d84afc205751523809c464168ab (because unix is a dep of
crypto)

remove warning about Let's Encrypt security issue from pkg/deploy/gce

I had to manually exclude vendor/golang.org/x/crypto/acme/jws_test.go
for now because it contains a private key, and git whines about it, and
i could not override it.

Fixes #1033

Change-Id: Ie4f2049e97892dee9ab513300a5f12e64976aec8
2018-01-16 23:43:13 +01:00
mpl da9020ec71 cmd/camput: compact LevelDB on HaveCache setup
This CL is about levelDB as the HaveCache for camput, and there are
several aspects to it. To describe it, I'll take the particular example
where you want to add many permanodes (~33k) to a given set, with
camput. Something like:

for _, blob := range blobs {
	do("camput attr -add sha1-foobar camliMember " + blob)
}

In a "normal" levelDB use case, everytime the number of level-0 .ldb
files goes over 4 (by default), a background compaction task is
started to transform these SST into level-1 ones, and remove the level-0
ones.
However, since our particular camput call is very short lived
(especially on a local Perkeep), not only might there be not enough time
for the compaction to be triggered, but even if it is, when the DB is
flushed (on a Close call), any ongoing compactions are cancelled. This
makes level-0 compactions very unlikely to happen on short-lived camput
calls. As a result, the number of level-0 files keeps growing until
levelDB fails while trying to open them all, because it hits the current
process ulimit.

Now, in this CL, what we propose is to systematically force a compaction
as soon as the HaveCache is opened. It is not scheduled concurrently, so
we are sure that the compaction happens before the DB actually gets used
by camput. This seems to make sure that the number of level-0 tables
never grows too much. With this change, I was able to run the above
example on 33K blobs without hitting the ulimit error.

However, it should be noted that potential problems might remain. The
compaction for levels above 0 is triggered based only on the total size
of the level (e.g. at 100MB by default for level-1), and not on the
number of files. Since we're creating many tiny tables (basically 1
entry per table), the number of files grows very fast while the total
size does not, and the compaction does not get triggered, even if forced
with CompactRange. This does not seem to be a problem for our use case,
as levelDB does not seem to need to open many of the level-1 files at
the same time, so we're not hitting the ulimit problem because of that.

If needed, there's at least one way this problem (if it is one?) could
be fixed: make the compaction trigger on other conditions, such as
number of files per level. I've experimented with it (forcing the
level-1 compaction to trigger at the 100 files limit), and it seems to
be working. But I had to do change the goleveldb code itself, and I
don't think levelDB implementations are supposed to do that.

For information, at the end of the run on the 33K blobs:
$ du -sch *.ldb
...
83M	total
$ ll | wc -l
20988

And indeed, when asking for leveldb.stats on the table:
 Level |   Tables   |    Size(MB)   |
-------+------------+---------------+
   0   |          1 |       0.00015 |
   1   |      20981 |       3.47307 |

Also, update github.com/syndtr/goleveldb to
34011bf325bce385408353a30b101fe5e923eb6e
And remove github.com/syndtr/gosnappy as goleveldb does not use it
anymore.

Also apply this change to StatCache.

Fixes #1008

Change-Id: If9f790a003e67f3c075881470e52e5f2174afa73
2018-01-16 00:46:11 +01:00
Paul Lindner 45aed2db49 vendor: upgrade github/russross/blackfriday to v2
This upgrades the markdown conversion library to v2 and
switches camweb to use the new, simplified API.

Change-Id: I710110431fdfa32104c591abdf9b01c74a214f48
2018-01-12 18:11:02 -08:00
Paul Lindner d35f919539 vendor/github.com/go-sql-driver/mysql: upgrade to v1.3.0
Upgrades mysql driver to a versioned release, fixes a minor issue
in dbinit that caused SHOW DATABASES queries to fail and improves
error messages to help diagnose such problems.

Changelog: vendor/github.com/go-sql-driver/mysql/CHANGELOG.md
Revision: go-sql-driver/mysql@a0583e0143

Change-Id: I4f5fdee60b30eca85564c452f72774e9c15828f3
2018-01-12 10:02:14 -08:00
Paul Lindner 837fe8ac46 vendor: Update github.com/gorilla/websocket to v1.2.0
Maps to rev: gorilla/websocket@ea4d1f681b

Also adjust the search websocket code to use the new API
which does proper origin checks.

Changelog: https://github.com/gorilla/websocket/releases/tag/v1.2.0

Change-Id: Ie25490b6319a98345aa6272e9eabc35c298bc06d
2018-01-11 10:42:39 -08:00
Paul Lindner 020c6923ce vendor: fully switch to using the dep vendor tree management tool
Gopkg.toml / Gopkg.lock contain the full set of revisions used by
Perkeep now.  You can remove your entire vendor tree and

  dep ensure && dep prune

will restore you to a known good state.

This final change contains various files that were missing (like
LICENSE/README.md/tests) and also prunes a number of packages that
are transitively unused.

Fixes #889

Change-Id: I6ee6c4a4e14e2de6b6f33620eb7e2c44e97ce91b
2018-01-09 18:27:36 -08:00
Paul Lindner cb160bbb1a Merge "vendor: sync gopherjs and remove local modifications that remove fsnotify" 2018-01-09 23:24:14 +00:00
Paul Lindner 4c64eb1767 Merge "vendor: update google go related packages to consistent revisions" 2018-01-09 23:14:18 +00: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
Paul Lindner 5e2b7a582e vendor: update contributing docs to mention the upcoming use of the dep tool
also remove vendor/README as the entire directory will be dep managed shortly.

Addresses #889

Change-Id: I08aa9178ed03bfa0c2bfd80e79a10bdba2d4ef85
2018-01-09 14:24:46 -08:00
Paul Lindner 5b0c2db6d7 vendor: sync gopherjs and remove local modifications that remove fsnotify
Sync following revisions:
- github.com/fsnotify/fsnotify@629574ca2a5df945712d3079857300b5e4da0236
- github.com/gopherjs/gopherjs@b40cd48c38f9a18eb3db20d163bad78de12cf0b7
- github.com/neelance/astrewrite@99348263ae862cc230986ce88deaddbf7edcc034

Addresses: #889

Change-Id: I638f96e8d2c5b4557039985ff9b891daecb4dc69
2018-01-08 11:52:25 -08:00
Paul Lindner cb571228af vendor: update google go related packages to consistent revisions
Uses revisions as close to current usage as possible.

Addresses issues with repos that have different per-directory
revisions.

- cloud.google.com/go
  rev: b70ccc799b9d019708c3eb9395acef6e3f6b7bc8
- github.com/golang/protobuf
  rev: 1e59b77b52bf8e4b449a57e6f79f21226d571845
- google.golang.org/api
  rev: 48e49d1645e228d1c50c3d54fb476b2224477303
- google.golang.org/appengine
  rev: 150dc57a1b433e64154302bdc40b6bb8aefa313a
  version: v1.0.0
- google.golang.org/genproto
  rev: 08f135d1a31b6ba454287638a3ce23a55adace6f

Addresses #889

Change-Id: I41610d2f409d7a558a59e3018094a124efc100c5
2018-01-08 10:00:54 -08:00
Paul Lindner 683d81f2df vendor: prune vendor directories that will be removed by dep
- bazil.org/fuse
- github.com/cznic/mathutil/mersenne
- github.com/golang/glog
- myitcv.io/gogenerate/_scripts
- google.golang.org/grpc/Documentation
- myitcv.io/react/testutils
- github.com/cznic/fileutil/{falloc,hdb,storage}

Addresses #889

Change-Id: Icde028ba4d433a7311132c1c86837e6cb4217fc3
2018-01-08 01:13:03 +00:00
Paul Lindner 7ed0b7ec5c vendor/github.com/rwcarlsen/goexif: update and remove local modifications
Remove goexif local changes (a TODO, README and gofmt)
Update to rev: 709fab3d192d7c62f86043caff1e7e3fb0f42bd8
Use dep to prune unused files

Change-Id: Icce8885917b798b25eaeed4c98ff393ce0db66b8
2018-01-03 23:27:13 -08:00
Paul Lindner d5b55e51a8 Merge "all: update mongo to latest version" 2018-01-03 21:04:12 +00:00
Brad Fitzpatrick 15012bc37a Merge "vendor/github.com/mattn/go-sqlite3: remove local customizations for sqlite3" 2018-01-03 20:14:21 +00:00
Paul Lindner 364e125929 vendor/github.com/mattn/go-sqlite3: remove local customizations for sqlite3
This pulls in a clean upstream version of go-sqlite3 at revision
919cf4144a09abfd877330bbe735f3a243a84537 using the dep tool.

The current method of using the -sqlite flag in make.go appears to
enable conditional builds with/without sqlite3, obsoleting the
need for local modifications.

We also manually remove sqlite

Addresses: #889

Change-Id: I4d2c107cd12608ac0bcb7c0607629ecb2d7f880f
2018-01-03 12:10:43 -08:00
Paul Lindner 49b1af4a1b all: update mongo to latest version
The mongo integration was using a very old package.  It's using
a new namespace now.  Upgrade and adjust all call points

Removes labix.org/v2/mgo

Introduces gopkg.in/mgo.v2 from branch v2 with revision
  3f83fa5005286a7fe593b055f0d7771a7dce4655

Change-Id: I2784fca941998460f58e0ac8d3d51286401590b5
2018-01-03 10:49:07 -08:00