Commit Graph

6404 Commits

Author SHA1 Message Date
mpl fae92b072e app/scanningcabinet: add go doc
Change-Id: I7076e0777a10675b0cf1ae5ed86e473dad148c46
2017-04-12 18:36:31 +02:00
mpl 71131ae554 website: add link to launcher on release page
Change-Id: I3f06ebb689ebaac6c5c47f6bf85c05831a97b6f0
2017-04-07 15:41:16 +02:00
mpl 4a95b88e3f C: add Will Norris
Change-Id: Ieb685a8cc8052435c9b505b70072a3a9792195b3
2017-04-07 01:40:15 +02:00
mpl d8f58a3512 website: 2017-04-05 release
GCE launcher now also deploys at
9e34d14ef5

Change-Id: I61fc461832effc608f6daf7777eea599a1841a2e
2017-04-05 19:00:18 +02:00
mpl 9e34d14ef5 pkg/serverinit: enable sharing on GCE by default
The default server config on GCE (as deployed by the launcher) did not
have a share handler. This CL adds one, so that users can benefit from
the new sharing feature from the web UI.

Also, the button for sharing from the web UI does not appear anymore if
the config that the web UI gets from the discovery does not have a
"shareRoot", because it's a strong hint that the server does not have a
share handler.

Change-Id: I6c444995339fda8dba864b1d6729fb7c1b6d72bd
2017-04-05 16:17:46 +02:00
mpl 753bd38ca9 misc/docker/server: build with make.go
So far, when building camlistored docker image for CoreOS, we were not
using make.go, and we were neither running gopherjs nor embedding the
resources (but rather provide the UI resources at their default
filesystem location).

Now that we're using gopherjs for the web UI, it is a hard dependency
for the camlistore server.
We could reproduce the steps in make.go to build gopherjs, run it to
build the web ui resources, and then move the resources at the right
place, but since make.go already does the equivalent work it seems
to make more sense to use it, which is the main point of this CL.

Similarly, it seems to make more sense to now build a binary with the
resources embedded, which is the default make.go behaviour, instead of
building a "raw" camlistored, and provide the resources as additional
directories in the container image, so this CL takes that approach too.

Finally, it was necessary to add the "-static" flag to make.go, so we
can keep on building a static camlistored binary, that does not rely on
libc for DNS. Because our container image is FROM SCRATCH, with just the
necessary binaries, in order to get a container image of a reasonable
size.

One drawback of now using make.go in
misc/docker/server/build-camlistore-server.go is we're doing some
unnecessary (since we're already running in the isolation of a
container) copying to the virtual gopath, but that seems a very tiny
price to pay. Especially considering how rarely we run that code.

Change-Id: I416c86d366cd4ed2d3b8b1636a6a65a83b9f15d7
2017-04-05 02:10:12 +02:00
Mathieu Lonjaret e3a3fd8094 Merge "blobserver/b2: update b2 library to refresh tokens and tune blobserver" 2017-04-03 14:44:57 +00:00
Mathieu Lonjaret 65d2bcd31e Merge "sync: add option to hourly fetch and check random blobs from dest" 2017-04-03 14:11:54 +00:00
Filippo Valsorda a0b605ec21 blobserver/b2: update b2 library to refresh tokens and tune blobserver
Previously the b2 library would not refresh authorization token,
resulting in errors after 24 hours of uptime.

Also, fix RemoveBlobs not to return an error on not found names. This
was working correctly with a previous iteration of the b2 library, and
was not fixed when the API changed.

github.com/FiloSottile/b2: d05beb60354dacaa61460156f5c498bc25aecbcf

Change-Id: I8d735abd64616b82fd95807e15ffdd7d450a4ed6
2017-04-01 16:48:11 +01:00
Filippo Valsorda 915bb70c57 sync: add option to hourly fetch and check random blobs from dest
Services often have a free download quota, which we can use to fetch
some random blobs, to compare with the source.

Change-Id: I526e62580af4cae7004d756721336d01c2f020c4
2017-04-01 16:18:24 +01:00
Steve Armstrong af5c7d1535 app/scanningcabinet: fix tag cloud and add typeahead
* Switch getTags to return a frequency map
* Removed old tag cloud library because it has been [archived and is not available](https://code.google.com/archive/p/visapi-gadgets/)
* Switched to [jQCloud](http://mistic100.github.io/jQCloud/) and vendored in the CSS and JS
* Add type-ahead suggestion for tag search box and tag edit page

Change-Id: I69b00b107d531f744c1a96cd986dee34fb3dfe06
2017-03-31 23:58:27 -07:00
Steve Armstrong 70746313f6 app/scanningcabinet: logf for prefixing
Change-Id: I9baf72c2d9f0e02f121c28638533ed43980219ff
2017-03-28 21:15:02 -07:00
Mathieu Lonjaret 1486c78dec Merge "app/scanningcabinet: move static UI files to folder" 2017-03-27 14:23:15 +00:00
Michael Morrissey 318558cb31 C+A: add Michael Morrissey (Individual CLA)
Change-Id: I4bb1a12490f03cde3fd495538def0d536744421b
2017-03-26 17:22:07 -04:00
Mathieu Lonjaret e0107f74bc Merge "Initial cut at importing financial transactions using Plaid.com. No Plaid-specific UI in this first pass; just import/data model only." 2017-03-26 00:24:48 +00: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
Steve Armstrong 9e2e35cf6f app/scanningcabinet: move static UI files to folder
Change-Id: I410fbaf0a113732cc2bde319607edab384122678
2017-03-24 21:36:03 -07:00
mpl 1d32408503 pkg/server: make share handler support share deletions
Since we don't actually ever remove blobs (until we add garbage
collection, and even then), if a share claim gets deleted (with a delete
claim), the only knowledge of the deletion resides in the Index.

So when the share handler verifies the sharing chain, there is nothing
preventing it from reading a supposedly deleted share claim (from the
blobserver), and concluding that the share chain is valid.

This change adds the index handler to the share handler, so it can check
the deletion status of a share claim, and hence support "share
cancellation".

Fixes #914

Change-Id: I572fdddee30e745aa2d2a6720c83c8e8c916515d
2017-03-24 22:33:50 +01:00
mpl 3f242dbee4 pkg/serverinit: properly update golden files
Since -update_golden reorders lexicographically, and it seems we forgot
to systematically use it in previous updates, the files are now
unordered. So I'm running it now, so that future real changes don't get
polluted and hard to review in the reordering churn.

Change-Id: I7618f2e8dcc22f19850bb15c57084fc9688d67ce
2017-03-24 18:21:04 +01:00
Mathieu Lonjaret d4b31d3b83 Merge "server/camlistored/ui: add "Share" feature" 2017-03-23 00:36:44 +00:00
mpl 77dfe8046d server/camlistored/ui: add "Share" feature
To share a file or directory through Camlistore's sharing
mechanism (https://camlistore.org/doc/sharing).

Only single-item sharing supported for now.

On success, the share URL is displayed in a dialog.
If the item is a file, it can be fetched with any HTTP client through
that URL. If the item is a dir, the share URL is of the claim, so one
must follow the transitive chain of sharing to get the directory's
children, i.e. use camget -shared.

Fixes #880

Change-Id: I324a684dec10225e5b8314dda7f1b77a0de6f727
2017-03-23 00:44:18 +01:00
mpl 252a653892 website: update the download page
It should have been done along with ece654c596

Change-Id: Ie796cce674dace2e9b1cc41ff7fe96c2f2318cc4
2017-03-21 23:58:01 +01:00
Mathieu Lonjaret 75424def01 Merge "pkg/server: add files "zipper" to DownloadHandler" 2017-03-17 13:36:40 +00:00
mpl 71090f7c80 pkg/server: add files "zipper" to DownloadHandler
We want to add a feature for clients (the web UI), where they can select
a bunch of files and ask the server for a zip archive of all these files.

This CL modifies the DownloadHandler so it does exactly that upon
reception of a POST request with a query parameter of the form
files=sha1-foo,sha1-bar,sha1-baz

This CL also adds a new button to the contextual sidebar of the web UI,
that takes care of sending the download request to the server.

known limitations: only permanodes with file as camliContent are
accepted as a valid selection (i.e. no sets, or static-dirs, etc) for
now.

Implementation detail:
We're creating an ephemeral DOM form on the fly to send the request.
The reason is: if we sent it as a Go http request, we'd have to read
the response manually and then we'd have no way of writing it to disk.
If we did it with an xhr, we could write the response to disk by
creating a File or Blob and then using URL.createObjectURL(), but we'd
have to keep the response in memory while doing so, which is
unacceptable for large enough archives.

Fixes #899

Change-Id: I104f7c5bd10ab3369e28d33752380dd12b5b3e6b
2017-03-17 00:59:19 +01:00
Mathieu Lonjaret 640fd08296 Merge "app/scanningcabinet: Fix scancab pdf extraction" 2017-03-15 16:54:27 +00:00
Steve Armstrong ddbcf34e9d app/scanningcabinet: Fix scancab pdf extraction
Change-Id: I187a4bbefce6f20b1aeaeab7ddde3d1dbecbb55c
2017-03-14 08:39:07 -07:00
Steve Armstrong ab86174bc6 app/scanningcabinet: Compile scancab during make.go
Change-Id: Ia44afa903dfce6246d391b5d11a8b1e397f12e0c
2017-03-14 08:35:12 -07:00
Steve Armstrong 79f832a1d5 server/app: app param defaults
Minimizing redundant info when setting up an app:

* prefix - Now optional and defaults to the handler prefix the whole app is attached to
* serverListen - Defaults to the host part of serverBaseURL

Change-Id: I395e71c54b9e81849681fe406ff1b5f412e92c9c
2017-03-13 22:16:29 -07:00
Mathieu Lonjaret 6816cdb621 Merge "web UI: add "About" menu entry and dialog" 2017-03-07 00:00:19 +00:00
mpl 155849d80b gitignore: scanningcabinet
Change-Id: Ie6d65bd894054536484991664a8d70c394d19aff
2017-03-07 00:28:10 +01:00
mpl ceb5ea5b10 web UI: add "About" menu entry and dialog
This change adds an "About" entry to the header menu, that pops up an
"About" dialog when clicked on.

But, under this innocent sounding feature is actually a more important
change: this feature is partly added through the use of gopherjs
generated code. In addition, the element added (a menu item) is
integrated
seamlessly into the menu as a React element, thanks to the use of
github.com/myitcv/gopherjs/react.

pkg/env had to be broken with build tags, because importing
"cloud.google.com/go/compute/metadata" (or one of its deps) seems to be
breaking the generated javascript.
https://github.com/camlistore/camlistore/issues/904

github.com/myitcv/gopherjs/react at rev
c04b811da4a086defd882a94cc1901da2d2158b0

honnef.co/go/js/dom at rev 24aa052bc5c63cfb9383bf59493ee48621ca788c

Issue #904
Fixes #798

Change-Id: Ic09b94014d520277f8178727293787ece468babd
2017-03-07 00:24:07 +01:00
Mathieu Lonjaret 41bc850dc0 Merge "devcam/hook: handle 'verbose' commits" 2017-03-06 18:11:01 +00:00
Euan Kemp 23ef425564 devcam/hook: handle 'verbose' commits
See https://github.com/golang/go/issues/16376, and the related
https://go-review.googlesource.com/#/c/25342/.

Prior to this change, `git commit -v` would result in a nonsensical
commit message.

Change-Id: Ib11de27488b01fccff07b9385f7fa988bc6fe165
2017-03-04 12:42:52 -08:00
Euan Kemp 9ebb29e28e devcam/server: update default config with prefix
This update the default configuration such that `devcam server` and
`devcam server -hello` work again. Changes in whether prefix and listen
were required on the application left both of those targets broken.

The default server target was only broken briefly, when the scanning
cabinet was introduced.

The `server -hello` command has been broken for months.

This change is a temporary one. A more proper fix is present in
https://camlistore-review.googlesource.com/#/c/9206/.

Once that change is merged, this commit can be reverted.

Change-Id: If692760da265502fece3b981bdd34d4d5bea5690
2017-03-04 12:29:49 -08:00
mpl 1951498e63 pkg/index: use missing dep mechanism for static sets too
We relied on missTrackFetcher to return errMissingDep when the
underlying Fetch() returned os.ErrNotExist. The caller could then know
how to act if some indexing operation failed because of an errMissingDep
error.

This was wrong for 2 reasons:

1) if a function fn(tf blob.Fetcher) error does:

	if _, _, err := tf.Fetch(br); err != nil {
		return fmt.Errorf("wrapping this error in a nicer error
message: %v", err)
	}

when we call err := fn(tf), we lose the ability to directly determine
whether err is an errMissingDep. We'd have to parse the error string,
which is gross.

This is exactly what happens in populateDir, when we call
dr.StaticSet().

And in order to fix issue #738, we want to be able to tell when a call
to dr.StaticSet() failed because the underlying Fetch() operation
failed.

2) The blob.Fetcher interface specifically states that os.ErrNotExist
should be returned when a blob is not found. We were breaking that rule
by returning errMissingDep.

In order to address both 1) and 2), it seemed like we could add an err
field to missTrackFetcher to keep track of when an os.ErrNotExist
occurred during a Fetch, and let Fetch return an os.ErrNotExist.
However, that would not work, as a missTrackFetcher is used concurrently
by several callers, so a given caller wouldn't be able to tell whether
"its" Fetch failed or a Fetch from a concurrent caller failed.

Therefore, we introduce trackErrorsFetcher, that has such an error field,
and that wraps the missTrackFetcher. All the callers can keep on sharing
the missTrackFetcher, but each of them initialize their own
trackErrorsFetcher, and can check the errors field after a failed call to a
function is suspected to be the result of a failed Fetch.

Also added a test to demonstrate that issue #738 is fixed.

Fixes #738

Change-Id: Ia5c3081b71c77be1e8cff0bbc847ade68f019bf9
2017-03-03 00:11:42 +01:00
mpl ece654c596 website: 2017-03-01 release
The image deployed by the launcher is also at
dc4d1650b3

Change-Id: Ifb22c5501aa31dde3ca5a0af2ad25c6127b293e1
2017-03-01 20:09:52 +01:00
Mathieu Lonjaret dc4d1650b3 Merge "doc: add low-level section in server-config" 2017-03-01 14:18:50 +00:00
mpl 372f6c68b2 doc: add low-level section in server-config
And the first low-level configuration example: replication to a remote
instance.

Change-Id: I028d9185c192421fe0904b3149d4d187c78474dc
2017-02-28 23:58:41 +01:00
Mathieu Lonjaret 9047f0e6f8 Merge "Dockerfile: fix for Go 1.8" 2017-02-28 14:52:39 +00:00
mpl 2a27bccf46 Dockerfile: fix for Go 1.8
Change-Id: I81982fe5d23e9846822024222e2006905a1158dc
2017-02-28 01:39:35 +01:00
mpl 5146f917eb misc/monthly.go: add blank lines to release notes source
Change-Id: Ia3ef2b037ad20b7b75f52609f1a2b1c1010b642f
2017-02-27 20:43:56 +01:00
Mathieu Lonjaret cc5f683e57 Merge "vendor: update gopherjs to 1.8-1" 2017-02-18 01:31:34 +00:00
Mathieu Lonjaret d9200f9855 Merge "pkg/index: simplify out of order indexing" 2017-02-18 01:19:01 +00:00
mpl 0167d40164 vendor: update gopherjs to 1.8-1
rev b9bcb1da229a59cc1e1d168401662cb6450aae08

Also added pkg/misc/fakefsnotify just so we only have to do:
-       "github.com/fsnotify/fsnotify"
+       fsnotify "camlistore.org/pkg/misc/fakefsnotify"
in vendor/github.com/gopherjs/gopherjs/build/build.go
in order to avoid vendoring fsnotify, without having to grossly
patch the gopherjs code as we previously did.

Change-Id: Ic106a6afa1117d2061415355c236433f835895f1
2017-02-18 01:06:58 +01:00
mpl 66d75cbcf9 pkg/index: simplify out of order indexing
There's a race that takes place at the end of the reindexing process.

In func (x *Index) Reindex(), we wait for all the reindexing goroutines
to be done, with wg.Wait. However, any (or all) of those goroutines
could have triggered (they call indexBlob, which calls
blobserver.Receive, which calls noteBlobIndexed, which can send on
tickleOoo) an asynchronous out of order reindexing which is NOT waited
on.

The race can be trivially demonstrated by changing:

  WaitTickle:
  	for range ix.tickleOoo {
+  		time.Sleep(5*time.Second)

in receive.go, and running:
  go test ./pkg/index/ -run TestReindex_*

This CL rewrites the out of order indexing implementation to make it
simpler, and in the process, fixes the above bug.

Fixes #756

Change-Id: If79fb1ad8869cefce4a095ef2becdba333732bce
2017-02-17 20:29:02 +01:00
mpl 912af01da2 make.go: make it work for gopherjs again
The default location for the gopherjs go version needed to be adjusted
for when CAMLI_GOPHERJS_GOROOT is not provided.

Change-Id: Ieda2e6dbc002891e977684be50577753f3ae9a7e
2017-02-17 01:17:25 +01:00
mpl 8a459f6626 travis CI: revert to Go 1.7
Because gopherjs master branch still needs Go 1.7.
So we either need to include a Go 1.7 with CAMLI_GOPHERJS_GOROOT in the
travis build (which I will look into later), or wait for gopherjs to
support Go 1.8.

Change-Id: I8e991de279bf822e1b5ef64dcae241880fe3eb73
2017-02-17 00:46:02 +01:00
mpl c35cd68b5c make.go: switch to Go 1.8
Same with friends under misc/, and travis CI.

Change-Id: Iadf67a81b0eb044684f3acf24415ccf12dc24e96
2017-02-17 00:23:03 +01:00
Mathieu Lonjaret dc66fe281e Merge "new app: scanning cabinet" 2017-02-16 22:11:58 +00:00
mpl 5a24ffd854 new app: scanning cabinet
WARNING: this app is still experimental, and even its data schema might
change. Do not use in production.

This change adds a Camlistore-based port of the scanning cabinet app
originally created by Brad Fitzpatrick:
https://github.com/bradfitz/scanningcabinet

Some of it is inspired from the App Engine Go port of Patrick Borgeest:
https://bitbucket.org/pborgeest/nometicland

The data schema is roughly as follows:

-a scan is a permanode, with the node type: "scanningcabinet:scan".
-a scan's camliContent attribute is set to the actual image file.
-a scan also holds the "dateCreated" attribute, as well as the
"document" attribute, which references the document this scan is a part
of (if any).

-a document is a permanode, with the node type: "scanningcabinet:doc".
-a document page, is modeled by the "camliPath:sha1-xxx" = "pageNumber"
relation, where sha1-xxx is the blobRef of a scan.
-a document can also hold the following attributes: "dateCreated",
"tag", "locationText", "title", "startDate", and "paymentDueDate".

Known caveats, in decreasing order of concern:
-the data schema might still change.
-the scancab tool, to actually create and upload the files from physical
documents, is practically untested (since I do not own a scanner).
-some parts, in particular related to searches, are probably
sub-optimized.
-the usual unavoidable bugs.

Change-Id: If6afc509e13f7c21164a3abd276fec075a3813bb
2017-02-15 17:14:45 +01:00