Commit Graph

119 Commits

Author SHA1 Message Date
Paul Lindner ba92702834 all: lint fixes for "should omit 2nd value from range"
Change-Id: I7bb19d376f96a39ecae7dbdb4d6808f704bae5fb
2017-12-13 11:31:25 -08:00
Paul Lindner 15feaeb24c all: lint fixes for 'error strings should not be capitalized or end with punctuation or a newline'
Change-Id: I9c3766a51ac8be694ae76befff4b6fa9a85e34eb
2017-12-11 06:13:25 -08:00
Paul Lindner f28eb3cce8 Remove appengine server and the old python blobserver
Change-Id: I734f4621f77ce902050e9b37805e7f8912f75e97
2017-11-30 19:13:37 -08:00
Mathieu Lonjaret 3911a41bd5 Merge "cmd/*: always output on fatal errors" 2017-10-22 15:07:06 +00:00
mpl a6a3cac0df cmd/*: always output on fatal errors
This CL addresses issues #685 and #862.

The general problem is that some critical errors, that lead clients such
as camput to exit with failure, are not displayed when not running in
verbose mode.

The reason that happens is because of code such as:

	if *cmdmain.FlagVerbose {
		log.SetOutput(cmdmain.Stderr)
	} else {
		log.SetOutput(ioutil.Discard)
	}

which means that in non-verbose mode we discard absolutely all log
messages, even those that would be printed during a Fatal* call.

To address that problem, we introduce a logger, as well as the Printf
and Logf functions using it, in pkg/cmdmain. These two functions only
output when *cmdmain.FlagVerbose is true.

Commands such as camput or camtool should now always:
1) log.SetOutput(cmdmain.Stderr) in init().
2) use log.Printf for messages that should always be printed.
3) use cmdmain.Printf/Logf for messages that should only be printed when
*cmdmain.FlagVerbose is true.
4) use log.Fatal for critical errors.
5) optionally, set the Verbose and Logger of the client(s) they are
using.

Also, camput and camtool are now relying on the global -verbose flag
from cmdmain, instead of having to define one for each subcommand.

fixes #685
fixes #862

Change-Id: I088032fd28184a201076097bf878894b22a8a120
2017-10-19 02:22:44 +02:00
Tamás Gulácsi 0bfa352bae pkg/importer: add gphotos, a Google Photos importer
Uses the Google Drive API to import photos from the Google Photos folder
in Google Drive.

Still a work in progress, so not yet added to allimporters.

Issues #874 #896

Change-Id: I9b9bffe071434b2a55be667579c3699a3addb8ed
2017-05-08 18:41:34 +02: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
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
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
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 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
Will Norris 77ed42edf8 add canonical import paths
The import path was added to the go file that included the package
documentation if one existed.  Otherwise, I used what seemed to be the
primary file for the package.

Fixes #689

Change-Id: If51be0e86529fd6f179e80af6781e639f8550fd2
2016-03-13 19:57:14 -07:00
mpl cde9dcb6f3 devcam hook: add commit-msg hook
To replace the misc/commit-msg.githook bash script

Code mostly copied from golang.org/x/review/git-codereview/hook.go

Fixes issue #590

Change-Id: I887cd32f9b6113d1a6b5d8b6eea6355da5706074
2016-02-25 17:50:44 +01:00
Mathieu Lonjaret d471cba23f Merge "serverinit: enable blobPacked in default config" 2015-12-24 23:28:20 +00:00
mpl cf08d789f2 website: sidestep failInTests panics from osutil
Because camweb now depends on pkg/deploy/gce, which has global vars
initialized with calls from osutil.

And test website from devcam test

Change-Id: I233c229e96ded5bfde4e2c1fa7a18bbf757ab1fb
2015-12-07 22:48:12 +01:00
mpl 3e37ca9120 devcam test: build things in ./misc/docker too
Fixes issue #651

Change-Id: I10e4b73946dea073399bdb21888202f85a33c1b7
2015-12-03 16:49:11 +01:00
mpl 8127040762 pkg/client: use Transport.DialTLS
We can now use DialTLS when we need a custom TLS setup, i.e. with
android, or when using self-signed certificates, or when totally
skipping certificates verification.

This allows us to get rid of the scheme rewriting hack, which simplifies
things, in particular because we have less tricky URL/host parsing to
do.

For the sake of tests and not affecting "real" code, I introduced the
fake_android build tag, so the tests can use custom functions to
simulate testing whether we're on android.

Fixes #566

Change-Id: I72ac2bb69ad2365e98dd6ca2e7016ce9c2d7c57e
2015-09-26 00:09:26 +02:00
mpl 974ed85e2e devcam test: run devcam hook pre-commit
Instead of the old ./misc/pre-commit.githook
Also fix devcam hook pre-commit so we don't show the override message in
that case.

Change-Id: I390016765056b9c4d3331d12bef8f2581e5621df
2015-09-22 15:57:36 +02:00
mpl b118fc23fb devcam hook: no import path checking in pre-commit because Go 1.5
We won't be rewriting the import paths of our third-parties anymore
since we use the new vendor mechanism that comes with Go 1.5. Hence, no
need to check for those rewrites anymore.

Change-Id: Ib9557b60c077190bfd5a6db95ad582f153aa4a68
2015-08-21 19:57:09 +02:00
mpl 8ea07d33d2 devcam server: preset CAMLI_LEVELDB_ENABLED to false
Change-Id: Id35fc6f965186b4d2f1a2d427d2e5506a98cce1f
2015-08-21 18:35:30 +02:00
mpl 4f0e6079bf devcam: fix self-building wrt new vendoring
Change-Id: I26c8a49bb2fe7e03dea08a653ae6533e7ef05d17
2015-08-16 15:50:33 +02:00
mpl 9a24acca6c devcam fixv,hook: docs, bugfix, cleanup.
Change-Id: Ie5f9f9ea62c13221d6b9c9913ef953ab39fb7914
2015-08-03 19:45:10 +02:00
mpl 6fa15a228e devcam: git hooks in go, 3rd party imports too
devcam hook: install git hooks and/or run them

devcam fixv: fix import paths in vendored files

More/better docs later.

Addresses #590
Addresses #591

Change-Id: I162717bc2e8a8190a6fe81086b3e14fcdf8ab92a
2015-08-01 02:16:10 +02:00
mpl afb47c7cd9 devcam server: add syndtr/goleveldb indexer. make it the default.
Change-Id: Ice835d7505404ad9eeaf040d465409bb0e4c420d
2015-07-26 17:53:36 +02:00
mpl 66a5a6176f serverinit: enable blobPacked in default config
Also, devcam server: make loose blobs location consistent with
location on production server.

Change-Id: Ib4314f4b736595c071e710792d2e8ecacebf3a14
2015-07-23 16:43:13 +02:00
mpl 3db00e5e98 devcam: move modtime check after cwd check
checkCamliSrcRoot was meant to give a nice error msg if devcam is
invoked from outside the Camlistore source tree. However, it was never
called because the modtime check (checkModtime), which itself needs to
be run from that same location, was called first. So we were always
getting the terse "open dev/devcam: no such file or directory" error
message instead.

Fixes #589

Change-Id: I13a1bb3819217ffbaf727fa6154f077dd8babd49
2015-05-07 16:53:44 +02:00
Brad Fitzpatrick 3e84782750 devcam: always use blobpacked for devcam server
Maybe it can be an option in the future, but for now it's
always on.

Change-Id: I7ec408b145870fc7dcffa42638ebb0daf595982d
2015-02-04 21:02:38 -08:00
mpl db9a833d02 devcam test: missing filepath.FromSlash
Change-Id: Icc3461d5435702414b1fe716ef81c18a8e3c2c34
2014-10-27 22:52:27 +01:00
Bill Thiede af19bf089c devcam: run git pre-commit hook as a test.
Additional check to prevent b bad imports and un-go-fmt'd code
from sneaking in.
If users don't run tests, it will break the builder.

Change-Id: I95c74724aac68d915aa5195b6d8fcb78f92349e0
2014-10-02 09:32:23 -07:00
mpl bb49185463 serverinit: add support for memory-only indexer. Enable in devcam.
To avoid confusion, the previously named "memoryIndex" configuration
parameter, which actually meant to slurp the index into the memory
corpus, has been renamed to "copyIndexToMemory". "memoryIndex" is now
the parameter to enable a memory-only indexer.

http://camlistore.org/issue/416

Change-Id: I7026e5463fda3a1887a88e0b07d4e3431c60c8b7
2014-08-26 22:46:13 +02:00
mpl 2fdb689503 devcam: add the -wipecache option
Change-Id: Ia3149361b3b210fd8e3b5fe42147018d3ab4e6fd
2014-08-22 23:36:31 +02:00
mpl 46efff80cc devcam: set CAMLI_CACHE_DIR
This change makes osutil.CacheDir return a different value with devcam,
allowing us to have a different location for cached blobs from the one
used in "prod" mode.

Change-Id: I58a88627515ff41cd2be72928d020f4c14736235
2014-08-21 18:06:35 +02:00
mpl ae097a3960 devcam: warn when outdated
http://camlistore.org/issue/482

Change-Id: Ifafec9c9ff337aefa98e630242cb28f19495d4b5
2014-08-19 17:45:54 +02:00
mpl d953dee008 devcam test: do not "recurse" temp GOPATH, docs, couple more options.
Problem: make.go creates an isolated temp gopath ./tmp/build-gopath. The
integration tests make use of that gopath (by running make.go) to build
the tools, and run the test world in it. Similarly, devcam test uses
make.go to setup that temp gopath, and runs the tests from the source
files in that gopath. Consequently, when the integration tests are run
through devcam test, even though they're run from the temp gopath, they
would use the make.go in it, which would create a nested temp gopath
(CAMLIROOT/tmp/build-gopath/src/camlistore.org/tmp/build-gopath) in
which to run the tests.

This patch addresses this issue by creating a new flag (-envGoPath), and
the corresponding env var (CAMLI_MAKE_USEGOPATH), which tells make.go
not to create a new temporary gopath (and hence not to mirror any
files), and to rely on the already set GOPATH env var instead.

Also refactored make.go a bit, and added a couple options and doc to
devcam test.

Change-Id: Ia8a5d7a31e6e317f05218d9e18fb886001cd19cb
2014-08-08 22:02:57 +02:00
mpl 748fd21e96 importer: wire run (context) HTTP client with host HTTP client
Killing two birds with one stone: we don't need to set it in devcam
anymore now.

Also switched to using the short form (run's one) everywhere, for
consistency.

Change-Id: I1e72ab99a07392c4970b1ed19b6e460ff422a24a
2014-07-22 15:40:06 +02:00
mpl b82459424d devcam server --makethings
Only creates twitter things for now.

http://camlistore.org/issue/417

Change-Id: I05d548e012586279e165c01468524ceb055ff17b
2014-07-21 23:24:33 +02:00
mpl 6f5133a728 server/app: first look for app executable in CAMLI_APP_BINDIR
Change-Id: I2d8e525c33da5813d67fbd74ca9af8059864a205
2014-06-16 00:02:09 +02:00
mpl a34f9e2669 publisher app
http://camlistore.org/issue/365

Change-Id: I281fdcbbe6a2bdf15607e75a21bc93b453f82c85
2014-06-15 00:03:03 +02:00
mpl 173adebc19 Merge "apps: more generic app handler work, to prepare for publisher" 2014-06-10 21:29:01 +00:00
mpl 9723b5c814 apps: more generic app handler work, to prepare for publisher
http://camlistore.org/issue/365

Change-Id: I3c34ba1f09debc3aaaf68ad9fb11b595470b6b5d
2014-06-14 18:36:10 +02:00
Brad Fitzpatrick d5fb600ac2 Better demo setup
Change-Id: I61e55e3773e30332e6a7d3b426090fbe946a2462
2014-06-02 15:55:10 +09:00
mpl 4569a7f475 devcam review: submit changes for review
Context: http://camlistore.org/issue/408

Change-Id: I587de65c9dc8d87c02541096e1f4f7765e644962
2014-05-13 23:06:30 +02:00
Nick O'Neill 2d70c95aef Tweet importing with some basic info
Change-Id: I73455eef50dcdc495ddc042d266b3a4a8020c877
2014-03-20 18:57:43 -07:00
mpl 05058091e9 kvutil: add VerifyDb*, use kvutil in sorted
http://camlistore.org/issue/393

Change-Id: If9482aa05f2346644196e3218dcde571e4d1a1a1
2014-03-20 01:21:27 +01:00
mpl 4ac7601315 sorted/kv: enable VerifyDb* options with env var
http://camlistore.org/issue/393

Change-Id: I97bbe3d4ab6eb186c3960db0995cedeec3a34ddf
2014-03-20 00:04:18 +01:00
Tamás Gulácsi 65fa5d6d3e Picasa: add importer.
Imports all images from all albums, and puts each image in its album.
Each album is linked under "Picasa (<username>)".
Tries to skip already imported files (check based on album/filename).
See Issue #391.

Change-Id: If00751671a429891c05bbe41f59c1421b2ff2de8
2014-03-17 10:52:51 +01:00
Brad Fitzpatrick 8ce47c69d4 make-release: don't clean stuff from the zip
Change-Id: I775926080f7cec04b3de4b574f78396613ae27c5
2014-02-27 22:03:52 -08:00
Brad Fitzpatrick 4a079bbec4 Move dev-db shell script out of the root.
Change-Id: Iddb0b2316121ad13395b0624b1c1fdf61150bb6a
2014-02-27 21:26:02 -08:00
Andrew Gerrand d136d91000 add devcam server -fullindex flag
Change-Id: I5ef7968d122c9a64665ab70a5f9571f6e3147836
2014-02-11 10:37:41 +11:00