Commit Graph

148 Commits

Author SHA1 Message Date
Daniel Heath 59ac14caa5 Vendor OpenSans (apache 2 licence)
Change-Id: Ie74b37efc007011b32810fd91c65b7750588a76e
2017-12-29 10:22:49 -08:00
Attila Tajti f47366c659 genfileembed: always embed paths with slashes
Also change make.go to propagate -all to genfileembed.

Fixes #982

Change-Id: I605d5fc35ae0fc9c12fca639ff0a0111836b653c
2017-12-08 09:24:14 +01:00
Paul Lindner f28eb3cce8 Remove appengine server and the old python blobserver
Change-Id: I734f4621f77ce902050e9b37805e7f8912f75e97
2017-11-30 19:13:37 -08:00
Sterchele Nicolas 2e46fca5cc Update camlistore and gopherjs to go1.9
Vendoring:
- update gopherjs to rev: b40cd48c38f9a18eb3db20d163bad78de12cf0b7
- as usual, replace the fsnotify import statements with our dummy
  pkg/misc/fakefsnotify, as described in
https://camlistore-review.googlesource.com/c/9409
- add vendor/golang.org/x/tools/go/gcimporter15 dependency from
  rev: e531a2a1c15f94033f6fa87666caeb19a688175f

- make.go + .travis.yml: make go1.9 the required version
- Update comments on doc/environments-vars.md for CAMLI_GOPHERJS_GOROOT

Fixes #948
Fixes #949

Change-Id: I9285aebadad1502708d164a9dc69e044a325cb3a
2017-09-20 08:23:11 +02:00
Paul Lindner fa46c3935d Correct various misspelled words
Change-Id: I236e880526e4c2b0bd318da041983d557e0aa885
2017-09-11 08:33:31 -07:00
Paul Jolly 4581abc238 vendor: upgrade to use myitcv.io/react
myitcv.io/react replaces github.com/myitcv/gopherjs/react.

This commits also includes relevant changes to reflect the new API of
myitcv.io/react:

https://github.com/myitcv/react/wiki/Changelog

myitcv.io/react
rev 0b147f16090bc5007116c494ca7ea95f78ee4a16

myitcv.io/gogenerate (required by myitcv.io/react/cmd/reactGen)
rev bd69a94c96953d20e106734856b69d71c8fa122b

github.com/gopherjs/jsbuiltin (required by myitcv.io/react)
rev 67703bfb044e3192fbcab025c3aeaeedafad1f2f

Change-Id: I1951519d30455915aa2f75fbb418057f8075e27c
2017-08-30 08:46:33 +01:00
mpl ccab088e61 vendor/embed/fontawesome: embed woff2 files as well
Change-Id: Idbbd099b5ee32b179d7b9c035e8477d0924bf5d9
2017-08-23 03:09:25 +02:00
mpl f1733b2162 make.go: specify GOROOT for gopherjs where needed
GOROOT needs to be specified when building gopherjs itself, and for
gopherjs, when building the go part of the web UI.

Fixes #935

Change-Id: I7f83cefa9fd44019e8f75f8a0de70e198c905fd8
2017-07-17 13:30:40 +02:00
mpl e4b7db8274 server/camlistored/ui: improve map aspect search and markers
Notably:

-do not load any markers on an empty search query, because that would
mean loading absolutely all of the items with a location, which seems
like a bad idea.

-use different markers for different nodes. For now, foursquare
checkins, file images, and files have their own marker.

-vendor in https://github.com/lvoogdt/Leaflet.awesome-markers to achieve
the above, which relies on Font Awesome, which we already have in.
icons available for the markers: http://fontawesome.io/icons/

-when no location can be inferred from the search query, set the view to
encompass all markers that were drawn.

-when a location search is known, draw a rectangle representing the
results zone.

-use thumber for image in marker popup

-use title, if possible, instead of blobRef for link text in marker
popup

-switch to directly using OpenStreetMap tiles, instead of MapBox ones.

https://storage.googleapis.com/camlistore-screenshots/Screenshot_20170622-232359.png

Change-Id: Ibc84fa988aea8b8d3a2588ee8790adf6d9b5ad7a
2017-07-06 01:03:03 +02:00
mpl 749d51281d make.go: fix building on FreeBSD
running gopherjs would fail on FreeBSD with errors such as:
../../go1/src/vendor/golang_org/x/net/route/address.go:31:35: undeclared
name: sysAF_LINK

This happens because in $GOROOT/src/vendor/golang_org/x/net/route the
needed constants are defined in zsys_freebsd_$ARCH.go files, where $ARCH
only exists for "386", "amd64", and "arm". So as gopherjs runs for the
"js" arch, all of the zsys_freebsd* files are ignored and the constants
are not defined.

This bug was reported in https://github.com/gopherjs/gopherjs/issues/511
and the "solution" eventually recommended in
https://github.com/gopherjs/gopherjs/pull/513 is to run with GOOS=linux
regardless of the host OS. Using GOOS=linux side-steps the problem since
linux does not need the problematic constants, and the GOOS value is not
supposed to matter for the generated javascript.

fixes #928

Change-Id: I20757a211ea4c671438e94e57552a0cee7a25e81
2017-05-18 01:40:19 +02:00
nico ff7cf8af05 make: fixed copy/paste by replacing *website with *camnetdns
Change-Id: Idd0fbf86dfb89f50f26f1be47f08301571b9aa7b
2017-04-18 03:18:05 +10: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
Steve Armstrong 9e2e35cf6f app/scanningcabinet: move static UI files to folder
Change-Id: I410fbaf0a113732cc2bde319607edab384122678
2017-03-24 21:36:03 -07: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
Steve Armstrong ab86174bc6 app/scanningcabinet: Compile scancab during make.go
Change-Id: Ia44afa903dfce6246d391b5d11a8b1e397f12e0c
2017-03-14 08:35:12 -07: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
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 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 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
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
Filippo Valsorda 87b283cde5 make.go: always populate gopherjsGoroot
The change in I7c80976d46ce8d69e394d226c685c8554176ea0f wasn't working
for me.  make.go might be a little smarter by requiring the exact Go
version that it knows the pinned gopherjs needs, instead of just
checking it is not devel, but in any case it seems sensible to always
respect the env var.

Successfully built like this after this patch:

    CAMLI_GOPHERJS_GOROOT=$(go env GOROOT) go1.8rc3 run make.go

Change-Id: I58f398531cd65847b5bf82f9b9d0aa26bbe9b90d
2017-02-04 23:37:21 +00:00
mpl 02548899a8 make.go: increase, and enforce, git rev to 10 chars
Issue #839 suggests to not cut the rev at all, and let it be user
defined. I have no good argument against, but I'm taking the more
conservative approach suggested by others in issue #888.

Fixes #888

Change-Id: Id65b1b074e6646a756353119a12081330775e066
2017-01-30 17:35:33 +01:00
Mathieu Lonjaret e6cb7e372e Merge "make: fix version check for go1.8beta and go1.8rc" 2017-01-19 16:39:30 +00:00
Tamás Gulácsi 6fe477614d make: fix version check for go1.8beta and go1.8rc
CAMLI_GOPHERJS_GOROOT has effect only if verifyGopherjsGoroot is called,
which only happened if go version was "devel".

This CL runs the verifyGopherjsGoroot check for go1.8rc and go1.8beta
versions too.

Change-Id: I7c80976d46ce8d69e394d226c685c8554176ea0f
2017-01-19 17:35:27 +01:00
mpl 3e93b66765 make.go: allow dots in mirrored filenames
Fixes #887

Change-Id: I4274f422b417f1f7fd08fe9eea058974455a8895
2017-01-02 22:28:45 +01:00
mpl e1053362a2 make.go: when running with go tip, use Go 1.7 to build gopherjs
Introduce CAMLI_GOPHERJS_GOROOT to that effect.

Fixes #875

Change-Id: I6f5266bbf8b07be565dc0d47ed18d534715f4d0e
2016-11-28 17:48:44 +01:00
mpl 2c4332ada2 make.go: optionally build camnetdns
server/camnetdns: update to cloud.google.com/go imports.

vendor: add github.com/miekg/dns at rev
3f1f7c8ec9ead89493df11f2c3d8bec353a2c2c0 as a dep of server/camnetdns

Change-Id: Ief8e0ad3e09a6c3511c72a7991309808f855d3df
2016-10-04 01:58:50 +02:00
mpl 10aa2b3fbd make.go: use host GOOS and GOARCH when go generating zsearch.go
Because our go generate line is:
//go:generate go run gensearchtypes.go -out zsearch.go

which will run a binary of gensearchtypes.go built for whatever $GOOS is
set to. Which will fail if $GOOS is different from runtime.GOOS (the
cross-compiling case).

I suppose it means that the day pkg/search becomes GOOS differentiated,
we may have to introduce an -os flag to gensearchtypes.go, since it
calls go doc on camlistore.org/pkg/search, whose output might depend on
GOOS?

Change-Id: I1ea32bb9190300120887ee8614dcdd2d1391a954
2016-09-05 18:40:10 +02:00
mpl 5bc0864f81 Switch to Go1.7
vendoring: update gopherjs to rev
45518c130e5bd1525f20110830a4986365a153de

Patch on upstream to remove fsnotify dep added (for reference) as:
vendor/github.com/gopherjs/gopherjs/nofsnotify.diff

make.go: make Go1.7 the required version

Fixes #838

Change-Id: I2013ee4832a26f8be3a8b42f02e40a347674ec9a
2016-08-30 16:46:07 +02:00
mpl bccc0ff7a1 make.go: do not cross-compile gopherjs
Because it needs to run on the native platform, not the one we
cross-compile to.

Fixes #845

Change-Id: Iffaeab8d02dacecc0c1dd579481219c6a542b1b2
2016-08-27 01:48:04 +02:00
mpl f40cfc78bb make.go: generate search types for app/publisher
Using go:generate to call a shell script with some go doc + sed hackery.
we could probably do it better with go/types later if needed.

Change-Id: Ie1cf04d418b8b498f83f7029eb736dbc779feeb5
2016-07-18 17:05:58 +02:00
mpl 3b2ec3af0f make.go: build and run gopherjs for publisher
Run gopherjs to generate trivial javascript code that is used by the
publisher app.

Context:
https://github.com/camlistore/camlistore/issues/798#issuecomment-226902924

github.com/gopherjs vendored in at rev
f3c437955da554f2643747a598b0cc772a749f3f

PLEASE NOTE that this copy of gopherjs has been modified to avoid
depending on fsnotify. Hence the -w flag and the gopherjs serve command
are most likely broken.
Diff for that modification:
https://gist.github.com/mpl/ac9033bb28207401b7cedc3d74e6c096

Dependencies for building gopherjs:

kardianos/osext 29ae4ffbc9a6fe9fb2bc5029050ce6996ea1d3bc
neelance/sourcemap 8c68805598ab8d5637b1a72b5f7d381ea0f39c31
spf13/cobra c678ff029ee250b65714e518f4f5c5cb934955de
spf13/pflag 7f60f83a2c81bc3c3c0d5297f61ddfa68da9d3b7
golang.org/x/crypto/ssh/terminal
c197bcf24cde29d3f73c7b4ac6fd41f4384e8af6
golang.org/x/tools/go/types/typeutil
ac02106e04bdb66a2db0413d931012bea165d7e0

github.com/gopherjs/jquery vendored in at
fbbfc4bbe29a29cb05788b66be44e0ac7f43cac7

jquery vendored in at 2.2.3

Change-Id: I7ff2d8e43e8a963f5ac1d13a2c936f263f7c53fc
2016-07-13 00:06:20 +02:00
mpl 044c7b32d0 make.go: mirror assembly code too
pkg/fs/fs_test.go depends on bazil.org/fuse/syscallx, which in turn
depends on golang.org/x/sys/unix
We already had the assembly code vendored in for golang.org/x/sys/unix,
but we weren't mirroring it in make.go

This didn't show with 'go run make.go' because it only affects a test.
And it didn't show with 'go test ./pkg/fs' either, because the assembly
would then be found in GOPATH.
Only devcam test would detect it.

Change-Id: Ibb90a5fb986a3d0308ff9f1f8df8d5866cfec8c5
2016-05-10 01:01:48 +02:00
mpl 93a7f46720 make.go: remove --use_gopath
Because it makes full integration with gopherjs impossible (without
polluting the user's GOPATH), as long as
https://github.com/gopherjs/gopherjs/issues/415 is not fixed.

Also it is kind of antithetical with the point of make.go anyway.

We still rely on CAMLI_MAKE_USEGOPATH for the integration tests that run
make.go to know that they shouldn't recursively create another temp
GOPATH (when they're already in such a temp dir, because they're started
through devcam test).

Change-Id: Icc6af46ec5976fdf08e9b8bf4249e307a15499cf
2016-05-09 17:22:39 +02:00
mpl bc4dbb0b5a make.go: just build website with -website
That should make it easier to catch missing dependencies. Because
'go run make.go -website' will ignore whatever's in your GOPATH, and
only use what's in our vendor.

Change-Id: I94648633a9fa69a5742b7e83031dab34470b9cde
2016-04-30 17:29:12 -07:00
Will Norris 7ec2b0ac2e website: update doc URLs
s/docs/doc/ and s/http/https/ for camlistore.org doc URLs in website and
code.

Change-Id: I875e2acece1f594a304f2bdb63f756fcb315abc8
2016-04-27 08:48:50 -07:00
mpl 63d6e384bb path fixes for third_party move
A few more left in in misc/docker that I'll do separately

Related: 75d60962f6

Change-Id: Id5f6a3729e33aca97f8664ca8ef91afc64461891
2016-04-21 12:25:17 -07:00
Brad Fitzpatrick 75d60962f6 Move remaining stuff in third_party/* to vendor/*
Change-Id: Ifbcc02817083cba68d8c1acec3e6ec50e8f61149
2016-04-20 16:49:15 -07:00
mpl fafc3d11de make.go: build for ARM in its own versioned gopath dir
Fixes issues #691 #692

Change-Id: I47dcd1c672c0c810ebe47bce1a6badcedfca139b
2016-03-11 21:47:27 +01:00
mpl d3058bb716 make.go: make GOARM default to 7, fix TODO
Issue #691

Change-Id: I2d0c123cbad8f0ef765b243f66013dd7bc74086d
2016-03-11 18:35:53 +01:00
Mathieu Lonjaret 1d7df7ceb4 Merge "misc/docker: stamp version as well to binaries" 2016-03-11 16:10:23 +00:00
mpl d4bc2d1f35 make.go: add TODO about cross-compiling on ARMvx to ARMvy
Change-Id: I14e39220c5ae83482ca12cfe3b1a08ff3ab2a007
2016-03-11 16:11:31 +01:00
Mathieu Lonjaret 9bcfc91a79 Merge "make.go: Add parameters to allow for ARM cross compiling" 2016-03-11 15:07:08 +00:00
mpl 04437c2e49 make.go: typo
Change-Id: I33e77a340bdb5f94afa7dbaa860b88c5399089e0
2016-03-10 01:00:55 +01:00
Steve Armstrong b879e54502 make.go: Add parameters to allow for ARM cross compiling
Change-Id: I670da8025c651d07039781cace879a84d8489bd7
2016-03-09 09:28:05 -08:00
Mathieu Lonjaret 34d292a6f3 Merge "importer/pinboard: kill World after test" 2016-03-03 14:33:52 +00:00
mpl 33a8eec553 make.go: require Go 1.6
Change-Id: I8ebf1c96795adc22348de36917066bbbbb7b8f06
2016-02-24 17:55:42 +01:00
mpl eb0db1f1ff importer/pinboard: kill World after test
Related: Issue #680

Change-Id: I10a1ffc611d159288b4dc9d52e96524bbb385ee1
2016-02-13 00:46:20 +01:00
mpl 21604dbe56 misc/docker: stamp version as well to binaries
Version in binaries will now be:
"X.Y (git rev xxxxx)"
if X.Y is specified with --tarball_version,
"xxxx"
otherwise.

Also uniformized the flags names and use in other programs.

Fixes #665

Change-Id: I958094f69b279437504854a3ff10e924d42c4fb6
2016-02-09 17:31:29 +01:00