Commit Graph

55 Commits

Author SHA1 Message Date
Jingguo Yao 351b4f9726 client: use index expression over rename map
Use index expression instead of loop.

Change-Id: I26b85e239a227f234fa7432bf7444b6c73e949ba
2014-11-09 10:28:35 +08:00
mpl e8522cca36 website: allow HTML in camli errors. use website for client error.
http://camlistore.org/issue/276

Change-Id: I16f139fe2b6f1200250db668fa415ae42ff2c171
2014-08-21 23:13:56 +02:00
Brad Fitzpatrick ec900d6bd9 pkg/client: some more wkfs usage
Change-Id: Ib4098304beb52492e1b62bfeb88962c9d4095c0d
2014-08-08 11:02:06 -07:00
Brad Fitzpatrick 985bb3482a client: allow missing config file when using camget --shared= 2014-06-23 16:57:06 -07:00
mpl 28ac303dc7 client: add NewFromParams constructor
Also add missing CAMLI_DISABLE_CLIENT_CONFIG_FILE checks

Change-Id: I1f87d9a1a275d603109bae44aa3cf0c7c873be94
2014-05-08 01:49:52 +02:00
mpl e34c4bc828 client: replace CAMLI_CLIENT_IDENTITY with CAMLI_KEYID
And remove all mentions of CAMLI_CLIENT_IDENTITY because there isn't any
need for the both of them.

http://camlistore.org/issue/412

Change-Id: I0d6b8cff0f23738231de98171a23550d82f05fe9
2014-03-31 18:56:11 +02:00
mpl cdc4ed5ae2 camput init: ring/key related fixes
1) Removed exec call to gpg, because it automatically looks in .gnupg/,
which we don't use anymore as a default.
2) Now taking into account global --secret-keyring flag.
This flag is now in osutil.
3) New or modified funcs in osutil
4) Made sure --gpgkey works too.
5) Cleaned up error messages and hints.

Context: http://camlistore.org/issue/364
         http://camlistore.org/issue/368

Change-Id: I2e51032ed0597da656db100d72f5588b37308e1a
2014-03-28 19:55:18 +01:00
Brian Gitonga Marete d373f86d9f pkg/client: Fix ignored files matching.
Because of Go's rules regaring closures (function literals) and bound
variables, in the case in which there were multiple patterns in the
ignoredFiles configuration variable, the entire slice (vector) of
registered matching functions was being called with the
last-configured ignoredFiles pattern as the first variable. This meant
that ignoredFiles did not work if it contained more than one pattern
and in certain circumstances, such a configuration would lead to a
crash.

Change-Id: I0b991aa74d079d4ce27fc0ba373e2ee2cf9eb772
2014-03-04 17:30:50 +03:00
mpl c4c4d6407a client: default to None auth if no auth in config
Defer warning until discovery fails.
Also fix SetupAuth error checks in camtool.

Change-Id: Ib554595603994e929d465e4e0de6acaf319d5b42
2014-02-27 01:37:59 +01:00
Brad Fitzpatrick 520191ecc5 client: don't access UserClientConfigPath or osutil.Homedir unless necessary
Change-Id: I618941204eb561461aab960bde576963296cea87
2014-02-23 10:59:20 -08:00
Brad Fitzpatrick 830864b715 client: don't call osutil.HomeDir during test.
Prep for future changing which makes this crash.

Change-Id: Ic02f7319deffb1d47e89f45d066fa4e62d45e499
2014-02-23 09:34:16 -08:00
Brad Fitzpatrick 9abba638a0 Add new environment variables for setting client identity for use with test.World.
Testing clients should now use CAMLI_CLIENT_IDENTITY,
CAMLI_DISABLE_CLIENT_CONFIG_FILE (both new) and existing
CAMLI_SECRET_RING, set using the new test.World accessors.

Change-Id: I9fc0571b008f033674466bbc98129ae1919a0640
2014-01-20 13:54:42 -08:00
Brad Fitzpatrick a384ff188d Get rid of CAMLI_DEV_KEYBLOBS / keyblobs / etc.
Fixes camlistore.org/issue/277

Change-Id: I7f380f9d18785f600fa0c442d5a19cd118782788
2014-01-20 13:47:08 -08:00
Brad Fitzpatrick 3addb89651 client: don't use server address as alias when upgrading old config
Fixes camlistore.org/issue/342
2014-01-15 16:27:55 -08:00
Brad Fitzpatrick b7230b2897 client: add CAMLI_DEFAULT_SERVER env option for selecting default server
For demos, when we want to show using camput/camget but select the devcam server
instead of our production servers.

Change-Id: Ie2adfd4f80df3119a705b51bb9736c3b66612d1c
2014-01-11 10:41:36 -08:00
mpl 1db2e7eaf3 pkg/client: auth and (camtool) TLS fixes
1) disallow auth from env when not in dev mode or on android
2) allow insecureTLS with flag in debug mode
3) set transport so that insecureTLS or trustedCert modes work

http://camlistore.org/issue/325

Change-Id: I6d8056bb75ffff5f002dfe9bd631ae996dc4e5ef
2014-01-09 11:23:40 -08:00
mpl 3f13d1a043 pkg/client: fix method to find a server in the config
http://camlistore.org/issue/325

Change-Id: I4aa6d5103848b73ed169ab7d7de3a60a33723b79
2014-01-07 18:52:48 -08:00
mpl a9ff17ca81 client: log.Fatalf typo
Change-Id: I2bffa2b6a9de351ed0f8ad0b13c1e1f62212c2ea
2014-01-06 10:46:07 -08:00
mpl 10d863e323 Merge "pkg/client: multi servers config" 2014-01-06 07:24:52 +00:00
mpl bf8c463d0a pkg/client: multi servers config
http://camlistore.org/issue/309

Change-Id: I22bbbf6a808a772272f153b2535d693bd986d13a
2014-01-05 23:19:43 -08:00
mpl 9902305735 Merge "client: improved ignoredFiles" 2014-01-06 04:57:30 +00:00
mpl 7c21c617b6 client: improved ignoredFiles
also changed osutil.HomeDir for windows so it looks like an abs path for
filepath.IsAbs

http://camlistore.org/issue/290

Change-Id: I1b32c1c13e7d23a421a6da2c0f9d6b8b07f48b8d
2014-01-05 20:53:46 -08:00
Brad Fitzpatrick 550b522618 client: fix crashes when used by the Android app
There is no config file on Android.

Fixes camlistore.org/issue/287

Change-Id: If4bee897adee528f9ba58fb3093c327583e00ec4
2014-01-03 16:07:10 -08:00
Dustin Sallings 3742b287a9 require auth config in storage-remote
The client configuration requires this if it's not passed in through the
environment.  Since this is for a storage service, it makes sense to
place it with the specific remote.

Since SetupAuthFromConfig was a bit awkward and not used elsewhere, it's
replaced with a more simple and explicit SetupAuthFromString to which
the exact auth details you wish to use are provided.

Change-Id: Id39ff314738794e299d48cbe634be2aa5d5c3bd1
2013-12-26 11:00:03 -08:00
Brad Fitzpatrick 911d07e16e client: use a method value.
http://golang.org/doc/go1.1#method_values

Change-Id: I68d516fdbfa60b6688f74bd9c3293583fc51b2ec
2013-12-24 19:47:16 -08:00
mpl 6e7eacea4a Merge "pkg/client: some cleanup, doc on the website" 2013-12-23 22:31:45 +00:00
mpl 1e8d46ee45 pkg/client: some cleanup, doc on the website
Changed some keys to be consistent with the server config, and removed
some others.

We're now using jsonconfig to get the keys and validate the config.

Removed some unused funcs/methods, moved some global vars as members of a client.

Also, having two possible defaults for the secret keyring
(.config/camlistore/identity-secring.gpg and .gnupg/secring.gpg)
was annoying and confusing imho, so I removed the latter.

http://camlistore.org/issue/259

Change-Id: Icf79fa8822b62b5d91843698861dd19cb553607a
2013-12-23 20:23:21 +01:00
jakubbrzeski 33e925ffa1 camput: allow ignoring files NOT only if --filenodes used
Change-Id: I7856c5f6602e6b439ebcebbcb83eddb1d1865e88
2013-12-16 16:52:59 +01:00
Brad Fitzpatrick 49fced871b Update a comment in client/config.go
Change-Id: Icc30171776c87107bdf844c4dc908f35ed98b9a4
2013-12-07 06:48:02 -08:00
Brad Fitzpatrick dcf5f6abe7 client: clean up. finish moving all Android stuff to pkg/client/android
Change-Id: Ia3d19a323d9c734a01ec9a12509b115191afcfdd
2013-10-26 11:08:34 -07:00
Brad Fitzpatrick cf15b2be90 client: use the schema.Signer API, remove Client.SignBlob method
Change-Id: I177c78f4f7f4ca54afd021d4ada866a35eea06eb
2013-10-22 07:26:44 -07:00
Brad Fitzpatrick 63b4f390cb client: upload public key if necessary whenever uploading a signed blob
Change-Id: I2e61da4fa2eeae2332c67902f8dd5f064b027835
2013-09-22 19:38:42 +01:00
Bill Thiede 630f6ca61f Document environment variables usage.
Running 'go run dev/envvardoc/envvardoc.go' now shows:
'All environment variables are documented'

I also took the liberty of cleaning-up our mishmash of logic for handling
boolean environment variables, and cleaned up a couple other spots that didn't
seem right.

This change adds docmentation for all variables starting with (CAM|DEV|AWS).
This leaves some variables still undocumented.  If there are variables worth
documenting in the following list, maybe we should rename them to have a
CAM{LI} prefix for consistency's sake:

APPDATA                  pkg/osutil/paths.go:86
APPDATA                  pkg/osutil/paths.go:102
DISPLAY                  pkg/misc/gpgagent/gpgagent.go:126
GOPATH                   pkg/fileembed/genfileembed/genfileembed.go:321
GOPATH                   pkg/osutil/paths.go:168
GOPATH                   pkg/test/world.go:54
GOPATH                   server/appengine/build_test.go:77
GPGKEY                   cmd/camput/init.go:77
GPG_AGENT_INFO           cmd/camput/init.go:153
GPG_AGENT_INFO           pkg/misc/gpgagent/gpgagent.go:50
HOME                     pkg/jsonsign/keys.go:79
HOME                     pkg/jsonsign/signhandler/sig.go:64
HOME                     pkg/osutil/paths.go:36
HOMEPATH                 pkg/osutil/paths.go:34
PKG_CONFIG_PATH          pkg/index/sqlite/dbschema.go:59
RUN_BROKEN_TESTS         pkg/fs/fs_test.go:67
SKIP_DEP_TESTS           pkg/test/testdep.go:29
TERM                     pkg/misc/gpgagent/gpgagent.go:133
TERM                     pkg/misc/pinentry/pinentry.go:99
TESTING_PORT_WRITE_FD    pkg/webserver/webserver.go:135
TEST_GPGAGENT_LIB        pkg/misc/gpgagent/gpgagent_test.go:27
USER                     pkg/netutil/ident.go:135
USER                     pkg/osutil/paths.go:45
USERNAME                 pkg/jsonconfig/eval.go:228
USERNAME                 pkg/osutil/paths.go:43
VERBOSE_FUSE             pkg/fs/fs_test.go:133
VERBOSE_FUSE_STDERR      pkg/fs/fs_test.go:137
XDG_CONFIG_HOME          pkg/osutil/paths.go:104

Change-Id: Ief28710d3deefd1e65247cb5d3b1d8dde73e1f2d
2013-09-06 21:54:03 -07:00
mpl 99aaf3b55e client: take into account "selfPubKeyDir" from config when signing
http://camlistore.org/issue/210

Change-Id: Id6d75393a90bdf3141acc10fddc2b3cedee64422
2013-08-23 21:31:03 +02:00
mpl 31df3635a4 camput: ignore files like .DS_Store with -filenodes
Also made initTrustedCertsOnce a field of the Client
object, as it is a similar change.

http://camlistore.org/issue/104

Change-Id: Iabbd7f06e06d31265f390a23c4bdaac956f856f7
2013-08-19 17:21:10 +02:00
mpl 860f136019 client: on android, do not parse config file
http://camlistore.org/issue/189

Change-Id: I9de22ce16950e4844ad82d97ff48207a80586a34
2013-08-12 18:21:53 +02:00
Brad Fitzpatrick 0bdf20884b all: delete pkg/blobref; convert all from *blobref.BlobRef to new blob.Ref
Change-Id: Id2dfb7f19452bedf4f3c9310b36227fd8117b225
2013-08-03 19:54:30 -07:00
Brad Fitzpatrick 02d38b07ca camput, client: move lot of camput's code into pkg/client
so cammount can use it.

Change-Id: I1bd513e6dfe6faab785c856abbd0d1337e978dd9
2013-07-11 16:46:23 +10:00
mpl 0de2881a16 client: help (wrt to the gpg key) initialize the config
Change-Id: I983e4396abacbc4d8fc354863cffeece65dd5b90
2013-06-22 01:16:11 +02:00
Brad Fitzpatrick 2ebd1aa8e4 Merge "camput: reenable -secret-keyring, use flag.StringVar" 2013-05-01 14:34:12 +00:00
mpl db9fdb7e6e camput: reenable -secret-keyring, use flag.StringVar
http://camlistore.org/issue/76

Change-Id: I37229a1082e5d955cadcc63521ea1b13dd63a33c
2013-05-01 16:48:19 +02:00
mpl af542f5cae client: fix "method not an expression" error for Go1
Change-Id: Id46cfafb6585fb074415d10affbb835373d27112
2013-05-01 15:08:58 +02:00
mpl ac431439f3 Allow HTTPS with a self-signed certificate.
A new client configuration parameter, "trustedCerts" (list of strings)
is introduced. A certificate fingerprint is defined as the 10 digits
prefix of the sha1 of the whole certificate (in ASN1. DER form).
trustedCerts should contain the list of fingerprints of the
certificates we trust. If not empty, the server's certificate
is checked against that list, instead of using the full x509 validation
on it.

-added a dial function and tls configuration, which check if we're using
SSL, and if we're in "trustedCerts" mode.
pkg/client/client.go
pkg/client/config.go

-moved android specific hacks from camput to the client layer, so that
the dial and tls config could reuse/access them. Also allows future
reuse for other commands, such as camget.
pkg/client/android.go

-adapted camput to the above changes:
cmd/camput/android.go
cmd/camput/camput.go
cmd/camput/files.go

-server prints a hint when it generates the self-signed:
pkg/misc/misc.go
server/camlistored/camlistored.go

-camliactivity:
clients/android/res/xml/preferences.xml
clients/android/src/org/camlistore/Preferences.java
clients/android/src/org/camlistore/SettingsActivity.java
clients/android/src/org/camlistore/UploadService.java
clients/android/src/org/camlistore/UploadThread.java

http://camlistore.org/issue/131

Change-Id: I6be20161549a69aafc8eb7b9e96e9351dc1c5b09
2013-04-23 17:10:37 +02:00
mpl f21cea5131 share: refactored
-pkg/server/share.go handles share(d) blobs.
-pkg/blobserver/gethandler no longer deals with share blobs
and has been rewritten like the other handlers (no more auth
in there).
-client and signhandler changed accordingly.
-serverconfig: auth moved up in makeCamliHandler
-share parameter added to the user level and low level config.
-share URL is now http(s)://host[:port]/[prefix/]share/sha1-xxxx.

Addresses http://camlistore.org/issue/107

Change-Id: I0a2c07ac1a1e435b141702e0ff06dc8182721d65
2013-03-06 19:11:00 +01:00
Brad Fitzpatrick 16a7ecf55a client: tolerate missing config file
Change-Id: I43fd2439b3eddb3d883d0db6cc6f23fe535aeb28
2013-01-26 16:46:19 -08:00
Brad Fitzpatrick 7c4380eebe auth: add ErrNoAuth, use it pkg/client log warning.
Change-Id: If657da28bc9888941400c263be61809ead5cef12
2013-01-26 11:23:39 -08:00
Brad Fitzpatrick c7bbccf435 config: Rename blobServer config key and flag to just server. use auth from environment when an explicit server is given
Change-Id: I07cfe3df3b644e143fcb92456e56d238bbbdd52e
2013-01-25 16:23:31 -08:00
Brad Fitzpatrick 827feaa3ac camget, client, schema: start of camget --shared support. see flag docs.
Change-Id: I5dd43129cb0032821a5913a8f20da0ddb38c63da
2013-01-02 12:55:12 -08:00
Brad Fitzpatrick 3d748363f7 pkg/client: don't use config file auth when using an explicit server
Change-Id: I07e3080adf4fed13deb3ec5a2ee900f4fc3a77fe
2013-01-02 11:42:39 -08:00
Brad Fitzpatrick a51cda3a34 client: move stats stuff to stats.go 2012-11-07 21:11:12 -06:00