Commit Graph

99 Commits

Author SHA1 Message Date
Mathieu Lonjaret c914e6cad5 Merge "pkg/serverinit: fix blobpacked_index genconfig for GCS" 2016-05-03 23:17:55 +00:00
mpl e9ae7b016c pkg/serverinit: fix blobpacked_index genconfig for GCS
The b.sortedStorageAt call had an empty filePrefix argument, which
means it would fail if the current index was not a DBMS (but a
file-based DB).

Also, this change adds a default "blobpacked_index" database name value
for the case when a user wants a DBMS index, but hasn't configured a
DBNames map.

Issue #693

Change-Id: Ie4386e789542c006530983e20bccc7a564bc4ee3
2016-05-04 01:15:33 +02:00
Will Norris d3baa6e638 serverinit: remove trailing commas causing invalid JSON
configHandler strips the key "_knownkeys" from all JSON objects in its
output using a regex on the marshaled JSON.  If this was the last key of
an object which contains multiples keys, this leaves the JSON in an
invalid state.  For example,

    {
        "foo": "bar",
        "_knownkeys": {}
    }

becomes:

    {
        "foo": "bar",
    }

The trailing comma here is illegal.  To fix this, we run one more regex
across the output removing any comma at the end of a line just before a
closing brace.  This is never valid in JSON, so is safe to remove
globally here.

Change-Id: I05f54e9f094fbe9cbc720f073b2b78ae80525106
2016-04-29 12:49:26 -07:00
Will Norris aff1874258 serverinit: improve handling of redacted data in config handler
make the "REDACTED" placeholder a valid JSON string and include trailing
comma in attempt to make the document valid JSON (primarily helpful with
browser extensions that parse and render JSON documents, even though the
content type is text/plain).

Add client_secret to the list of redacted keys (used with google cloud
storage, possibly others).

Change-Id: Ia10fc9fffbd667ea7018b750b2a98db0b05dcf82
2016-04-28 13:02:24 -07:00
Mathieu Lonjaret 7332aad3aa Merge "server/camlistored: upload gpg key blob on startup" 2016-04-25 22:43:38 +00:00
mpl 36944ca818 server/camlistored: upload gpg key blob on startup
Fixes Issue #700

Change-Id: Ica92c321666220043e9c157de38e67a043250afe
2016-04-25 15:42:04 -07:00
Brad Fitzpatrick 618250ea8b serverinit: add /debug/goroutines handler
Change-Id: I07ddecc5f70b11ea2a59760011cbc271e030d2c2
2016-04-20 15:57:25 -07:00
Tamás Gulácsi 7402cc0efd Delete misc unused objects
Using honnef.co/go/unused/cmd/unused

Change-Id: I672b3cb77f09e9bd80dcdc149cde4f7f2939e451
2016-04-06 17:59:51 +02:00
mpl c4e53b79d3 pkg/serverinit: improve genconfig error message
Change-Id: I42f30b8abce95c575c0620f4ef2fdb038a8f05db
2016-03-14 18:05:26 +01: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 4dd31658a5 blobserver/blobpacked: reindex meta from packed blobs
Added recovery mode to trigger reindex.

Fixes #676

Change-Id: Ifb9c26e1fe8e562c1dab5f1ce793f1c9165be988
2016-03-11 17:02:38 +01:00
Stephen Searles 23457fb56a adding keys to fields to make go vet happy
Change-Id: I28e38da6f5499c3284e647b1c123bcfc882120f7
2016-01-09 00:34:55 -08:00
mpl 00f370f38c pkg/serverinit: fix test after 7b78c50007
Change-Id: I36800bcf5f1a2e8f19890c97372297f9281999ba
2016-01-06 18:11:52 +01:00
Mathieu Lonjaret 54c5c41d07 Merge "serverinit,blobpacked: wipe blobpacked meta before reindexing" 2015-12-24 23:28:47 +00:00
Mathieu Lonjaret d471cba23f Merge "serverinit: enable blobPacked in default config" 2015-12-24 23:28:20 +00:00
mpl 92d5c1d045 pkg/blobserver/s3: directory & blobpacked support
Fixes issue #529

Change-Id: Iea7aea015b58c0325887fa07ae3a004b7822511e
2015-12-16 23:58:27 +01:00
mpl 40be4d8da2 vendor: go4.org/jsonconfig (and errorutil)
Previously pkg/jsonconfig and pkg/errorutil

Copied from go4.org at rev d1b8a2fb2de6160036e4801aa5e4d855571078b8

Change-Id: I673ed55b0825baa2607289b6082f205100261d7a
2015-12-01 17:21:49 +01:00
mpl 57a45dcd5c pkg/jsonconfig: remove dependence on pkg/osutil
So it can be moved to go4.org

Change-Id: I1b6d427cf66935fa85c746a90914a42f57b28613
2015-12-01 00:43:39 +01:00
mpl 40c0d80b07 vendor: go4.org/wkfs
Previously pkg/wkfs

Copied from go4.org at rev 3970dd22c0e7e2397304ad626a20b72f8db41b58

Note that pkg/wkfs/gcs has not been moved yet (for dependencies
reasons).

Change-Id: I737e88a360bccfc643e1fa43541f65f2384c3157
2015-11-27 00:23:03 +01:00
mpl 8a10bb52e0 pkg/server/status: link to GCL logs on GCE
Fixes issue #592

Change-Id: Ife405816ee42902258c93eac917a6ff5bada4138
2015-11-20 01:26:12 +01:00
mpl 0fe6be3a47 pkg/serverinit: fix diskpacked test
Because I broke it with 7cb8884f00

Change-Id: I39e72d5093c26ed71f5c9076487837b0395b9e73
2015-11-18 23:57:13 +01:00
Mathieu Lonjaret 8efe27aa58 Merge "pkg/serverinit: use syndtr/goleveldb in default config" 2015-11-01 21:17:27 +00:00
mpl 7cb8884f00 pkg/serverinit: use sortedStorageAt for diskpacked
This makes diskpacked index type/location be set the same way it is done for
blobpacked, that is, its type will be the same as the camlistore index's
is. e.g. if the camli index is in MySQL, then the diskpacked index will
be another database in MySQL too.

Additionally, for added clarity wrt to the changes in
https://camlistore-review.googlesource.com/5496 , if we use a file based
indexer, the diskpacked index filename will now be
blobPath/diskpacked-index.kvtype (instead of blobPath/index.kvtype).

Change-Id: I7a9eb5c9caf07f62732ba2771308d351ec37b814
2015-10-31 00:01:38 +01:00
mpl 69fdcbb797 pkg/serverinit: use syndtr/goleveldb in default config
Because benchmarks from ./pkg/index/stress seem to show that levelDB
is more efficient than kvfile for us.

Also changed the filenames to index.kvtype, because the "camli-" prefix
is redundant, and because that's how we name the index files in the rest
of genconfig.go anyway.

Fixes issue #632

Change-Id: If663e94f2c24d646b994c39044eedc9b86327bf2
2015-10-30 23:58:03 +01:00
mpl 59d7e89d87 serverinit,blobpacked: wipe blobpacked meta before reindexing
Fixes #639

Change-Id: Ic202e4478e4979a29b71404c08c3188cbb3c292b
2015-09-08 17:02:11 +02:00
Brad Fitzpatrick 06f7accf31 Require Go 1.5 (due out soon), start move from third_party to vendor.
See https://golang.org/s/go15vendor

This commit moves the google.golang.org/cloud/... packages. The rest
of third_party will move later.

This commit is a dependency for some cloud logging work which we'll
develop in Camlistore's tree.
2015-08-15 22:45:11 +02:00
mpl eec23f4a21 serverinit: use user-defined kv type everywhere, otherwise leveldb.
In a few places, cznic/kv use was hardcoded, instead of picking the user
set kv type, if any. This change makes sure we use the user-defined one,
if set, syndtr/leveldb otherwise.

Relatedly, the low-level config generated for diskpacked now uses that
same principle for its internal index. Also, if a diskpacked is
configured without an index, it now defaults to syndtr/leveldb.

Please note that this patch DOES NOT change the default kv type in the
automatically generated high-level config.

Related: #632

Change-Id: I55dbd385230878e92776e6b83d34c36fd1fa9382
2015-08-05 16:54:29 +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 cad29fe837 pkg/serverinit: fix test related to 9ea7fff917
Change-Id: Ibac3ee15bfb75a68004058d425e2de356aee238f
2015-07-20 17:11:47 +02:00
mpl 9ea7fff917 pkg/serverinit: auth wrap importer handler
I suspect the plan was to let the importer handler take care of its own
auth, but I don't think it's done. So this change lets camlistored wrap
the importer handler with the usual auth layer.

Change-Id: I6101eaec9b9cdc0d9b670c917122533d367bc73d
2015-07-06 18:01:47 +02:00
Mario Russo 7b1903d5b1 pkg/server: added help handler
- Available at '/help/'
- Loads and parses server config upon init and generates the necessary client config for access
- Links to 'Downloadable Tools' are not functional (task is not yet completed)
- A link was added to the default server page as well as a 'Help' option to the Piggy menu

Issue: #536

Change-Id: I10629de034c908ebc76f6feacbbfca1df7bf1c2b
2015-05-28 10:02:17 +02:00
Fabian Reinartz 76a445a956 pkg/server: decouple sign handler from UI, replace JSON maps with structs
Signhandler was moved from the ui to the root handler and genconfig
adjusted accordingly.
New discovery struct types to replace the JSON maps are defined in
pkg/types/camtypes. The changes are related to Issue #539.

Change-Id: Ib3f12feeaf6fa81107de2d468cab491723e590ae
2015-05-25 09:28:07 +02:00
Brad Fitzpatrick af36d78bd7 env: add IsDev and use it everywhere
Change-Id: I5547ce989c05f1f48774f24abee41c489326baa0
2015-04-02 05:55:01 -07:00
Brad Fitzpatrick 58ec210183 For GCE, don't send and ignore a 'localhost' hostname.
Change-Id: I329e86783c4b14deb9b8dfcb6ac827e3436d5faa
2015-04-02 03:40:19 -07:00
Brad Fitzpatrick c7213346d0 Revert "Temporary GCE-specific log spam for debugging."
This reverts commit 314162705c.
2015-04-02 03:25:46 -07:00
Brad Fitzpatrick 314162705c Temporary GCE-specific log spam for debugging.
Change-Id: I62de01cd0be48636e6cac8cd4e7bf8d46f9abf64
2015-04-02 02:29:08 -07:00
Brad Fitzpatrick c9a0beae45 Add new 'env' package to detect the type of environment.
Also, delete my old gce package from third_party and only use the
google metadata package (which my gce package became, and which was
also already vendored into third_party)

Fixes #596

Change-Id: I64fd6f1e9dc6f433466f91f81efd2ecbf039334f
2015-04-01 08:45:36 -07:00
Brad Fitzpatrick 4e8413c501 When on GCE, get UI assets from Docker image.
(The Docker image is still in development)

Change-Id: I0ba1d7482b42d578d6ddbd7cfb42780e29feab24
2015-04-01 02:49:26 -07:00
mpl b78ce17e13 serverinit: add genconfig for blobpacked on Google Cloud Storage.
And enable it (blobpacked) on GCE.

Change-Id: I7b51c186325e80987e48d32392d88bb4c30ee3d5
2015-02-04 19:08:43 +01:00
Brad Fitzpatrick 3026631521 serverinit: move incompatible option checks further down, into the right places
I was getting bogus errors because I replicate to s3, but the
s3+blobpacked error should only come up if s3 is primary.

Also, document the database key used for blobpack's index when mysql
or another db is in use.

Change-Id: I21a1815715f70edc3f98abf7209744703aaf6d3b
2015-01-18 19:04:31 -08:00
Brad Fitzpatrick 4155ac6a3c serverinit: high-level config support for using blobpacked
Users need to set:

     "packRelated": true,

... in their server config. This will probably become the default
value in the future.

This is currently mutually exclusive with diskpacked, which isn't good
at deleting things, and blobpacked loves to delete things (from the
loose blobs).

Updates #532

Change-Id: I8f4ea9406859b2705f26e9d1103d3acf9d1a8411
2015-01-18 18:08:18 -08:00
mpl cfd784269e deploy/gce: use subdirs for config and blobs (instead of buckets)
http://camlistore.org/issue/528

Change-Id: Icb558d7de032f9367e8fb100be87ef24c2982c23
2014-12-17 16:20:58 +01:00
Brad Fitzpatrick 5eeed2aba5 Remove some code.google.com references.
Change-Id: I85ccf92af9389300919eed61f62aae28cc24a820
2014-12-11 17:33:17 +11:00
mpl 5c7208fb94 Merge "blobserver/cloudstorage: directory support" 2014-12-10 15:02:00 +00:00
mpl 8481c2236d blobserver/cloudstorage: directory support
http://camlistore.org/issue/528

Change-Id: I9d26b85af1cf91d1f2b102c7bfb80628af4d1e4d
2014-11-26 00:40:19 +01:00
Emil Hessman e8ffb9a66c pkg: fix various vet reports
Change-Id: I0b7fa09849650fe696e59ad5c5c73a034ab80faa
2014-11-12 23:25:53 +01:00
mpl 9b68fd9f32 serverinit: syndtr/leveldb support
Change-Id: Id48a00f3896c38659a53cf131493d5a19dbfe4b7
2014-10-11 15:40:29 +02:00
mpl 8cf7e1399b serverinit: TestInstallHandlers
http://camlistore.org/issue/416

Change-Id: I14934dd4e0a415c359a13583ddc295be2d35c781
2014-09-25 14:54:29 +02:00
mpl 95885192eb serverinit: enable memory storage in config
http://camlistore.org/issue/416

Change-Id: Idde32273ed651a5876581ad0ea06010970b92a9b
2014-09-11 01:11:07 +02: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