Commit Graph

6772 Commits

Author SHA1 Message Date
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
Mathieu Lonjaret 8c3fd33b88 Merge "cmd/camput: compact LevelDB on HaveCache setup" 2018-01-16 14:11:51 +00: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
Mathieu Lonjaret 12f55f4efd Merge "internal/httputil: remove unused CertFingerPrints" 2018-01-15 23:42:26 +00:00
mpl 14286029ff internal/httputil: remove unused CertFingerPrints
It became unused in 8813375592 , when we
started using Let's Encrypt in pkg/deploy/gce

Fixes #1000

Change-Id: Id88e035ea8246fe0d4637489e9e97a59e223fd0d
2018-01-16 00:41:04 +01:00
Magnus Landerblom e4970b542d server/camlistored: don't use deprecated lastModifiedDate for uploaded file
Use web standard lastModified instead of the deprecated lastModifiedDate.

See warning at top of:
https://developer.mozilla.org/en-US/docs/Web/API/File/lastModifiedDate

Change-Id: I0b975dc17129de4b68b279e9acd44bbac4bf3f2f
2018-01-15 22:27:00 +00: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
Paul Lindner 412f9de061 Merge "vendor: upgrade github/russross/blackfriday to v2" 2018-01-14 00:18:44 +00:00
Paul Lindner 71a6392381 Merge "vendor: use semantic version v1.1 for github.com/cznic/lldb" 2018-01-14 00:18:37 +00:00
Brad Fitzpatrick 7f42eef7b3 Merge "pkg/blobserver/union: add "union" blobserver type" 2018-01-13 20:42:16 +00: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 f365bb2695 vendor: use semantic version v1.1 for github.com/cznic/lldb
The existing revision already maps to this version.

Change-Id: I2502423bc05ecc602273dd4cd122a65a6c3952cc
2018-01-12 18:10:17 -08:00
Paul Lindner 745c7b877f Merge "vendor/github.com/go-sql-driver/mysql: upgrade to v1.3.0" 2018-01-12 23:06:41 +00:00
Will Norris 9399eb13d1 website: properly calculate domainName in prod
move calculation of domainName into main rather than init.  This is
necessary because the root var, which domainName is based on, is not
passed as a command line flag when run in production.

Also clean up a few minor things in godoc.go from previous CLs, such as
removing the docRx var which is no longer used.

Fixes #1036

Change-Id: I7145b87d5f1ed13e143bd3750ce22f2d41d6169d
2018-01-12 19:25:03 +00: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 990b613e2e pkg/test/integration: fix websocket integration test failures
In rev: 837fe8ac46 a new
version of websocket was imported and changes were made to use
origin checking.  This integration test was missed during those
changes.

This change fixes this test and adds the origin data to the
request, uses the correct 'ws' scheme and uses the new Dialer
API to make requests.

Change-Id: I93e8228794665012f15370532cdeda3cb702ea00
2018-01-12 06:24:38 -08:00
Tamás Gulácsi 2ba0c43003 pkg/blobserver/union: add "union" blobserver type
This blobserver is just "cat"ing the given "read" storages.
This is read-only, so you should use some other storage to augment this for
writing and removing - for example the "cond" storage is perfect for this.

My use-case is to use blobpacked with large=diskpacked, small=filesystem,
but consolidate the small blob storage into a diskpacked + filesystem
after the filesystem becomes huge.

Another use-case is joining separately built camlistore servers into one.
(For me, they have to be separated later, so I've built them separately,
but I've to use it joined for a month).

Change-Id: I4e7e42cd59286f0f34da2f6ff01e44439771d53c
2018-01-12 06:54:24 +01:00
Paul Lindner 32e37c926d Merge "vendor: Update github.com/gorilla/websocket to v1.2.0" 2018-01-11 21:26:51 +00: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
mpl c42fd33f51 pkg/deploy/gce: warn about autocert being broken
Fix s/Camlistore/Perkeep/ while we're there.

Change-Id: Ifce76b77ce04af8952e37953e1646ee785e9d09d
2018-01-11 01:22:44 +01:00
mpl 392f8269a5 server/camlistored: update embed dir location
Follow-up of 463832ed76

fixes #1032

Change-Id: Ib5789fce5620bed2a3251afc947a0bc0bcfd3f41
2018-01-10 20:18:19 +01: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 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 67ad77491c pkg/serverinit: improve error message to help people find config file with errors
Change-Id: I5a09a50a1fbdaea0f83dc9a586c65b83e0160f53
2018-01-09 23:12:37 +00:00
Brad Fitzpatrick 6bb4cc91ba pkg/blobserver/mongo: fix stat behavior on missing blob
Tests pass now.

Change-Id: Ib98ca8c213b638a79bfd61f1b7739459b3fd03da
2018-01-09 15:12:05 -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
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
Brad Fitzpatrick 97752c049f doc: cross-link compare and prior-art pages
Change-Id: I0fbbe38a72b6d4de895c8f5e13c483375d20a5ba
2018-01-09 11:14:00 -08:00
Brad Fitzpatrick 916f8807a7 doc: add comparison to other software and services
Change-Id: I45f228abd4ca7f970e433e5254428dd48fe596fc
2018-01-09 11:04:44 -08:00
Brad Fitzpatrick 0e8980b54b blobserver: change BlobStatter interface, simplify proxycache
This addresses a long-standing TODO in the BlobStatter interface to
clean it up. Just like all new Go programmers, I misused channels in
APIs. I should've cleaned this up years ago.

While here, I also added a context.

The rest should get contexts later.

This also cleans up a few things here & there.

The pkg/client statting no longer does batching, which added a lot of
complexity. There was a comment saying something like "once we have
SPDY, we can delete this". Well, we have HTTP/2 now, so seems
deletable.

All tests pass.

Change-Id: I034ce07d9b70e5cc9e5482213368993e638d4bc8
2018-01-08 16:54:52 -08:00
Brad Fitzpatrick 27bacd3df1 pkg/blob, all: support SHA-224 blobrefs, make them the default
Updates #537

Change-Id: I3966697cbdb05ca4b380974be604deebdaa258c2
2018-01-08 16:34:41 -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
Brad Fitzpatrick 617ac40512 all: rename cammount to pk-mount
Updates #981

Change-Id: Ie1d2e3c0fd7e2b7a7801ceac0fd8f93f62d56651
2018-01-08 09:54:41 -08:00
Brad Fitzpatrick 01419ae02d pkg/test/integration: skip non-UTF-8 test on filesystems requiring UTF-8
Fixes #1025

Change-Id: Ia6212140197958ef6660bf3ced6a9bb427ae5aef
2018-01-08 06:47:16 -08:00
Brad Fitzpatrick 962dfe5b23 Merge "website: fix docHandler test when run via devcam" 2018-01-08 14:33:58 +00:00
Paul Lindner b3e91ad9f0 website: fix docHandler test when run via devcam
The test added for proper markdown title generation
do not work when run via devcam.  This is caused by
depending on doc/uses.md as the input testdata.
devcam does not copy markdown files into the target tmp
directory so this test fails when run that way.

Solution is create a markdown file in a testdata directory.
These are copied to the target tmp directory and the test
succeeds.

Change-Id: Iae654dca2374b925e6c895a71d4d93b12ccc188b
2018-01-08 06:08:19 -08:00
Paul Lindner 266447a7e7 dev/devcam: import vendor files as-is, do not require gofmt
Change-Id: If3afd3769dbad0a20bd8ff2f2bbb5eb9f89f345a
2018-01-07 19:14:08 -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
Brad Fitzpatrick 7a54a2c07a Merge "website: remove old TODO on removing Installation header from cmd/*" 2018-01-07 16:24:04 +00:00
Adam Shannon b8dbd56b35 website: remove old TODO on removing Installation header from cmd/*
Change-Id: I4f77d9271c17442b69e3f9ebbcc39acc6361e221
2018-01-07 10:23:24 -06:00
Adam Shannon c8ec846787 website: rename perkeep irc room
Updates #981

Change-Id: I7c30a3d1271e608422dc04c5e1ac703bcfc16c67
2018-01-07 10:09:49 -06:00
Paul Lindner 3c9440708e website: generate proper titles for markdown files
It appears that markdown generation added class ids at some point.
This means that all pages on perkeep.org have the title "Perkeep"

Also added a test for this case.

This issue was flagged by the Google Webmaster Tools.

Change-Id: I7ddab56e03a506b84aab415d94856b8f1c126250
2018-01-06 15:46:59 -08: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
Will Norris c57fd7ae93 Merge changes I15575227,I07f817ed
* changes:
  website: allow serving godoc for any valid package
  website: derive godoc package domain from serving dir
2018-01-06 01:03:02 +00:00
Will Norris 9787462d49 website: allow serving godoc for any valid package
Fixes #1010

Change-Id: I15575227eb881a0c83ab2e60af0d344fedaf1850
2018-01-06 00:54:22 +00:00
Will Norris 101ce48bdc website: derive godoc package domain from serving dir
this is a straight revert of 02938281 plus the additional logic to
derive the domain name from the serving directory. This allows package
docs to also be served from localhost during development.

Updates #1010

Change-Id: I07f817edb0b83b03e363373945d143ed3cb82fbf
2018-01-05 23:57:46 +00:00
Mathieu Lonjaret a2135d90a6 Merge "pkg/serverinit: keep DBNames compatibility for existing GCE instances" 2018-01-05 20:54:56 +00:00