Permalink
Browse files

pkg/serverinit: enable sharing on GCE by default

The default server config on GCE (as deployed by the launcher) did not
have a share handler. This CL adds one, so that users can benefit from
the new sharing feature from the web UI.

Also, the button for sharing from the web UI does not appear anymore if
the config that the web UI gets from the discovery does not have a
"shareRoot", because it's a strong hint that the server does not have a
share handler.

Change-Id: I6c444995339fda8dba864b1d6729fb7c1b6d72bd
  • Loading branch information...
mpl committed Apr 5, 2017
1 parent 753bd38 commit 9e34d14ef5f240f35bd88d71495da0f6cbf99600
Showing with 6 additions and 0 deletions.
  1. +1 −0 pkg/serverinit/env.go
  2. +5 −0 server/camlistored/ui/goui/sharebutton/sharebutton.go
@@ -66,6 +66,7 @@ func DefaultEnvConfig() (*Config, error) {
GoogleCloudStorage: ":" + strings.TrimPrefix(blobBucket, "gs://"),
DBNames: map[string]string{},
PackRelated: true,
ShareHandler: true,
}

externalIP, _ := metadata.ExternalIP()
@@ -66,6 +66,11 @@ func New(key string, config map[string]string, getSelection func() []SharedItem,
fmt.Println("Nil config for ShareItemsBtn")
return nil
}
shareRoot, ok := config["shareRoot"]
if !ok || shareRoot == "" {
// Server has no share handler
return nil
}
if showSharedURL == nil {
fmt.Println("Nil showSharedURL for ShareItemsBtn")
return nil

0 comments on commit 9e34d14

Please sign in to comment.