Commit Graph

51 Commits

Author SHA1 Message Date
Brad Fitzpatrick d6a0b05df0 Rename import paths from camlistore.org to perkeep.org.
Part of the project renaming, issue #981.

After this, users will need to mv their $GOPATH/src/camlistore.org to
$GOPATH/src/perkeep.org. Sorry.

This doesn't yet rename the tools like camlistored, camput, camget,
camtool, etc.

Also, this only moves the lru package to internal. More will move to
internal later.

Also, this doesn't yet remove the "/pkg/" directory. That'll likely
happen later.

This updates some docs, but not all.

devcam test now passes again, even with Go 1.10 (which requires vet
checks are clean too). So a bunch of vet tests are fixed in this CL
too, and a bunch of other broken tests are now fixed (introduced from
the past week of merging the CL backlog).

Change-Id: If580db1691b5b99f8ed6195070789b1f44877dd4
2018-01-01 16:03:34 -08:00
Paul Lindner 04b9c0b1c4 pkg: lint fixes for "context.Context should be the first parameter of a function"
Change-Id: I0185eec5616c72d859978aec03880860421c7193
2017-12-13 11:33:21 -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 b09cd377d7 Switch to stdlib context from golang.org/x/net/context
This switches most usages of the pre-1.7 context library to use the
standard library.  Remaining usages are in:

  app/publisher/main.go
  pkg/fs/...

Change-Id: Ia74acc39499dcb39892342a2c9a2776537cf49f1
2017-11-26 01:12:26 -08:00
mpl fdf50ad339 pkg/deploy/gce: update GCE API service name
Fixes #943

Change-Id: I676b76dc6b7e25bb5c418150aedf2766a1089ee8
2017-09-07 16:24:00 +02:00
mpl ec6f46f59b pkg/deploy: add debugging print
Change-Id: I4e466e29167ff702ce5df0b1cf125aa6ccce5aca
2017-05-05 19:23:54 +02:00
mpl af10e5a8dd pkg/deploy/gce: also create Google Cloud Project for user
This change allows the launcher to create a Google Cloud Project on
behalf of the user, as well as enabling the required APIs.

Radio buttons have been added to the form, such that the user can choose
between creating a new project, or reusing one of their existing
projects. Some javascript (jquery) code has been added to modify the
rest of the form fields depending on which button is selected, and if
the project id field is empty or not.

On project creation, if the user didn't pick one, we generate a project
ID that is a (0,1e10) random number prefixed with "camlistore-launcher-",
and we then use google.golang.org/api/cloudresourcemanager to create
the project.

On project creation success, we redirect back to the form, but with the
project id  input field pre-filled with the newly created project
(passed as url query parameter during redirection). The user can then
set the other fields, and submit again for instance creation.

Note that the user still has to enable billing for the selected project
BEFORE instance creation, even when we create the project for them.

Right before instance creation, we now also take care of enabling the
required APIs (Compute Engine, Cloud Storage, Stackdriver Logging)
through the use of google.golang.org/api/servicemanagement. Note that
suprisingly, even though the docs
(https://cloud.google.com/service-management/getting-started) specify
that we should enable the Service Management API on the project in order
to use it, we apparently don't need to do so. So far.

vendor: add
google.golang.org/api/cloudresourcemanager/v1
google.golang.org/api/servicemanagement/v1
google.golang.org/api/gensupport/
at rev 48e49d1645e228d1c50c3d54fb476b2224477303

Fixes #819

Change-Id: Id58b453e432e4d7c29d3ede04917ab4d244f142e
2017-04-21 18:09:10 +02:00
mpl 1e69b9f784 vendor: update cloud.google.com/go/logging to V2 API
In addition to API changes, the V2 logging API uses
google.golang.org/grpc, which does not rely directly on net/http. This
is a problem for us because, among other things, when needed (on
CoreOS), we insert the system Root CAs in the TLSConfig of the
default http client through httputil.InstallCerts, which has no effect
on google.golang.org/grpc calls. Therefore, we switch to
github.com/bradfitz/grpc-go instead, which does rely on net/http.

And since GRPC requires HTTP/2, we also now need to manually configure
the default transport (since we're already modifying it) to be HTTP/2
enabled.

Related dependencies updated/added:

updated:

cloud.google.com/go/logging
a64eb5d53f434cc548fd6b2898b5a3e8a0c31b78

github.com/golang/protobuf
8ee79997227bf9b34611aee7946ae64735e6fd93

added:

github.com/bradfitz/grpc-go
188a132adcfba339f1f2d5da52498451341f9ee8
as a replacement for google.golang.org/grpc

github.com/googleapis/gax-go
da06d194a00e19ce00d9011a13931c3f6f6887c7

google.golang.org/genproto/googleapis/logging
08f135d1a31b6ba454287638a3ce23a55adace6f

google.golang.org/genproto/googleapis/datastore
08f135d1a31b6ba454287638a3ce23a55adace6f

google.golang.org/api/support/bundler
e4c04685e5d7db47ff294aa9e514b3a638c431c9

google.golang.org/genproto/googleapis/rpc/status
08f135d1a31b6ba454287638a3ce23a55adace6f

Fixes #873

Change-Id: I3ba14c94122dd9f1b88ef61c2dc26430690d28a9
2017-02-06 19:59:24 +01:00
mpl 8813375592 pkg/deploy: no self-signed certs, name in camlistore.net
This CL changes the GCE launcher to work with the new features of
camlistored: i.e. that it can automatically get a hostname in
camlistore.net, and that it can get an HTTPS certificate from Let's
Encrypt, for said hostname.

In order for the user to easily (without having to look at the logs)
know what their hostname is, camlistored stores it as the
"camlistore-hostname" key in the custom metadata of the GCE instance.
The deployer can then query for that key, to report the hostname on the
instance creation success page.

Change-Id: Iaaef2d51f34fa5e1e0ee90097919abab7ee72a12
2017-01-13 16:47:04 +01:00
mpl ab06dbd80d vendor: rename google.golang.org/cloud to cloud.google.com/go
rm google.golang.org/cloud
add cloud.google.com/go at a47b182e769f5e75f5fc927ff6ee2678f7f552cf
update google.golang.org/api to 63cb68f1e3834e44683ca062ddf06cb9a889380a
update google.golang.org/grpc to
0e6ec3a4501ee9ee2d023abe92e436fd04ed4081
update go4.org to f5283521d7365fb2875408726e9cbf349f173767

fix in cmd/ pkg/ server/

TODO(mpl): fix misc/docker tools as well. next CL.

Fixes #832

Change-Id: I842b968a0afea8a5822913bd614d67cdbe50ee63
2016-09-08 15:14:12 +02:00
Joseph Anthony Pasquale Holsten 118585fef1 pkg/constants/google: remove, use oauth2/google instead
The google Endpoint is now available in upstream oauth2, we no longer
need to define it ourselves.

Fixes #810

Change-Id: I37db869ff7696c53ba456ecba55e72c8c86dd119
2016-06-08 16:15:39 -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 8d37fd1a6f pkg/deploy/gce: remove old TODO
I don't think we will ever want that wiping feature for the production handler.
As for the command-line tool, people who use it know enough to destroy
their instances themselves if they need to.

Change-Id: I94cd92ebc4904cc3249b8dcff946a025daace589
2016-02-25 23:28:55 +01:00
mpl 243c7c146a deploy/gce: do not ask for password
Issue #656

Change-Id: Ida28675588b30eed786957aaaca674cadbf9c404
2016-02-10 19:43:56 +01:00
Brad Fitzpatrick a3d6ed6fa6 launcher: don't default password to the project ID
Change-Id: I9e68d768a436a5e3d3b445982feba3a9520fb643
2015-12-28 21:35:57 -08:00
Brad Fitzpatrick 5a2fe47b73 cmd/camdeploy: fix build, embed a client ID/secret, accept region or zone
Much easier to use now.
2015-12-28 15:15:11 -08:00
Brad Fitzpatrick 1bed370b47 pkg/deploy/gce: launcher wording & behavior tweaks
Update wording and links. Change default zone to a default
region. Generate a random password if blank.
2015-12-27 18:43:17 -08:00
Brad Fitzpatrick b22a78deda Fix launcher. Work in localhost dev mode more easily. 2015-12-27 13:52:35 -08:00
mpl 32e922ad3d vendor: mv go4.org/cloud/gceutil go4.org/cloud/google/gceutil
Change-Id: I21c27b250b3a272f56b387ef07169a29da85f76c
2015-12-23 17:59:26 +01:00
Tamás Gulácsi 9f7e1df32b Remove pkg/context
Use golang.org/x/net/context instead.

Fixes #648.

Change-Id: I676a2f25458be97610a49d6f954f2102cbd373fa
2015-12-12 23:09:02 +01: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 d9a3bbc73a pkg/vendor: update google.golang.org/cloud/storage
rev 2375e186ca77be721a7c9c7b13a659738a8511d2

This is so we can use storage.Client in pkg/wkfs/gcs (and later in
other places) instead of pkg/googlestorage

Change-Id: I1d0eafbffd40e0326c41214692754f6671ec1d5d
2015-12-03 00:55:53 +01:00
mpl 1e2a306e8d vendor: add go4.org/cloud, update google.golang.org/api, and golang.org/x/net/context
Import go4.org/cloud/cloudlaunch and go4.org/cloud/gceutil, which were
previously in pkg/cloudlaunch, at rev
2c497a8c195996d6c48402c150da4919c1d99f33

Because the version on go4.org was updated to use the latest
google.golang.org/api/* , we also update our
vendor/google.golang.org/api/* to rev
030d584ade5f79aa2ed0ce067e8f7da50c9a10d5

This in turns requires to add vendor/golang.org/x/net/context/ctxhttp
(and update vendor/golang.org/x/net/context/) to rev
4f2fc6c1e69d41baf187332ee08fbd2b296f21ed

Also adding vendor/google.golang.org/api/gensupport for the same reason.

Change-Id: I9d6c3059626f7ecc0fbf2df0415043a464d27caa
2015-11-25 19:29:46 +01:00
mpl 12eddf9c19 vendor: go4.org/strutil go4.org/syncutil
They were internal packages (under pkg), which we are now moving to
go4.org, so we in turn need to vendor them in now.

Change-Id: I92224f731404d0bd4ca1c57492bed37cb3367ed4
2015-11-21 00:21:20 +01:00
mpl 775da29abe pkg/deploy/gce: always use latest stable CoreOS
Added pkg/cloudlaunch/gceutil package.

Fixes issue #649

Change-Id: I47830489b29de9c555b4706fe387be08e3f57e16
2015-11-18 00:17:33 +01:00
mpl 621388f0bf camweb: send deploy handler logs to GCLogging as well
When logging to Google Cloud Logging, make sure the deploy handler logs
are written there too.

We tag them with the from:camli-gce-launcher label.

Change-Id: I4dab010009f98efd2aeba7c57dc4ab3ca6a566b3
2015-11-16 23:40:05 +01:00
mpl 20ad3d699b pkg/deploy/gce: use WIP tarball if WIP=1 in request URL
That way I don't have to constantly edit deploy.go (and fix it before
committing a CL) when debugging for GCE.

Change-Id: Ie4f75443e4356c5ce1a59931f3cb9e34344350be
2015-10-21 01:46:38 +02:00
mpl c9e6ca58ef deploy/gce: use our own systemd-docker image
Fixes issue #646

Change-Id: I209132ec45cb433804b4cc86513aee252f17ea21
2015-10-19 22:27:54 +02:00
mpl 9c0f51b041 osutil,deploy: on GCE, deploy with enough scope to log on GCL
Otherwise, if scope is missing, warn about it.

Change-Id: If840c4f5783708dd5693993ca39b10fd2ad5442e
2015-08-25 17:08:18 +02:00
mpl 432abe24ec deploy/gce: update coreos image
Change-Id: I8a876ec31ab2360b74ca644e88f605536a6a7867
2015-08-24 23:28:18 +02:00
Brad Fitzpatrick 6f58fc2426 Fix build, move more stuff from third_party to vendor. 2015-08-18 10:19:49 +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
Brad Fitzpatrick 58ec210183 For GCE, don't send and ignore a 'localhost' hostname.
Change-Id: I329e86783c4b14deb9b8dfcb6ac827e3436d5faa
2015-04-02 03:40:19 -07:00
mpl c42fb6e05d pkg/deploy: use new camlistore/server new image name
Change-Id: I603f992d0185ad8f9600b18ec25ba267ec993262
2015-04-01 16:06:40 +02:00
mpl e7bc92191a Merge "deploy/gce: query the regions, use them in form, pick random zone" 2015-03-02 20:44:41 +00:00
mpl fd5e8c4048 deploy/gce: query the regions, use them in form, pick random zone
Change-Id: Ie7170c7c12aeb4e32474510d9931f662795bcd41
2015-03-02 19:25:08 +01:00
mpl 376e53ccd5 deploy/gce: make sure mysql is done starting...
...before starting camlistored.

Issue #569

Change-Id: I38578be631373b9a78127283b1c0b2a05d72a8f5
2015-02-11 23:51:34 +01:00
mpl 10a0689c11 deploy/gce: do not overwrite TLS cert and key
Issue #535

Change-Id: I26eea8f9f6b18ec1ef4ea3ca373a65f03903994b
2015-02-04 20:33:08 +01:00
mpl e02ac6b36c deploy/gce: on success, show SHA-1 of certificate too
Also small TODO, template cleanup, and further cosmetics.

Change-Id: I9171e8e1389abaae216068c9fded518786e1a3a0
2015-02-04 19:54:27 +01:00
mpl 0265e91a28 deploy/gce: redid the form
Change-Id: I62fd3eb432f2c9a6f85d08adbb073e587a4387ab
2015-01-31 19:05:08 +01:00
Salmān Aljammāz df8209ca7a gce deploy: add http(s) firewall rules if they're missing.
fixes #572

Change-Id: Ibb69cf256331378c54597e20d09565578eebd777
2015-01-29 17:26:25 +03:00
mpl 83bb6bce78 deploy/gce: add HTTP auth creds to wizard.
And instruction to change them through GCP UI.

Issue #573

Change-Id: I39e6a2904cd1ca57bed40e4c361ca963049438fc
2015-01-28 22:29:42 +01:00
mpl 0e31e41767 deploy/gce: fix project label, check project id exists
Issue #571

Also moved the "file an issue" msg appending to sooner, so I can do a
proper error type check, instead of a lame string contents check.

Also fixed progress msg as per Aaron suggestion.

Change-Id: Ifa31a8d58cdf20d5068b4db4f7ab0370633bbd34
2015-01-27 22:58:16 +01:00
mpl 8c1cd14a84 pkg/deploy/gce: check for any possible instance before trying to create
Go through all the existing zones to check for existing instances.

Issue #568

Change-Id: Id67d1b9e19f246b993465de9d7d022512187c1aa
2015-01-25 02:35:41 +01:00
mpl 0098b8e691 pkg/deploy/gce: detect when requested instance already exists
Issue #568

Change-Id: I6fe56417ffdc56ce3ddc5412c313d9a329bdbaf7
2015-01-23 20:37:49 +01:00
Brad Fitzpatrick aada432c52 third_party: add oauth2/google, google.golang.org/cloud, google.golang.org/api
oauth2 at 267028f9bc2a1177dc5769be38c68c1b4fbe91c4
google cloud at 2e43671e4ad874a7bca65746ff3edb38e6e93762
google api at fc402b0d6f2a46ba7dcf0a4606031f45fb82a728
  (partial commit only, since it's 16+ MB)

And update all callers from the old
code.google.com/p/google-api-go-client over to google.golang.org/api.

Change-Id: Ide190e04bb863928f98369a7c4d2b8c19fda1f66
2015-01-22 15:10:36 -08:00
mpl e3f16b8ead pkg/deploy/gce: add web wizard to deploy on Google Cloud
Issue #531

Change-Id: I47900eb7b82b7775ec1d26b1d6796e5701ee672d
2015-01-19 16:24:37 +01:00
mpl 1a286f919f pkg/deploy/gce: revert to hardcoded google endpoints for oauth2
google.Endpoint is the only thing we were using from
third_party/golang.org/x/oauth2/google
And pkg google would in turn bring in lots of dependencies (that I had
forgotten in 22f45f14a5).
Replacing Endpoint with the hardcoded values hence allows us to not
vendor in all those dependencies.

Also fix make.go to build camdeploy as well.

Change-Id: I6ba51991187a11705c97c9546848303540f99aa1
2015-01-13 01:28:09 +01:00
mpl 22f45f14a5 Add new oauth2, use it in deploy/gce
third_party/golang.org/x/net/context at 67f25490433376b5f7da086c0b9283fcdeca3a7b
third_party/golang.org/x/oauth2 at 5361962df4497a7fc777f5c3bd1b5c7ac36c604c

I only updated camdeploy, and did not remove code.google.com/p/goauth2
yet, because I do not want to get distracted by potential breakages, so
we can first get the gce deploy wizard in.

Change-Id: Ifa7987a044c741d3f00f49f47b31e3e07bdf973d
2015-01-09 22:02:39 +01: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