diff --git a/config/dev-server-config.json b/config/dev-server-config.json index bca87814d..5fca65435 100644 --- a/config/dev-server-config.json +++ b/config/dev-server-config.json @@ -9,6 +9,7 @@ "/": { "handler": "root", "handlerArgs": { + "ownerName": ["_env", "${USER}-dev"], "blobRoot": "/bs-and-maybe-also-index/", "searchRoot": "/my-search/", "stealth": false diff --git a/pkg/server/root.go b/pkg/server/root.go index 0be78fb0c..d0d654051 100644 --- a/pkg/server/root.go +++ b/pkg/server/root.go @@ -20,6 +20,7 @@ import ( "encoding/json" "fmt" "net/http" + "os/user" "time" "camlistore.org/pkg/auth" @@ -34,6 +35,8 @@ type RootHandler struct { // clients. Stealth bool + OwnerName string // for display purposes only + // URL prefixes (path or full URL) to the primary blob and // search root. BlobRoot string @@ -50,9 +53,14 @@ func init() { } func newRootFromConfig(ld blobserver.Loader, conf jsonconfig.Obj) (h http.Handler, err error) { + u, err := user.Current() + if err != nil { + return + } root := &RootHandler{ BlobRoot: conf.OptionalString("blobRoot", ""), SearchRoot: conf.OptionalString("searchRoot", ""), + OwnerName: conf.OptionalString("ownerName", u.Name), } root.Stealth = conf.OptionalBool("stealth", false) if err = conf.Validate(); err != nil { @@ -106,8 +114,9 @@ func (rh *RootHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { func (rh *RootHandler) serveDiscovery(rw http.ResponseWriter, req *http.Request) { m := map[string]interface{}{ - "blobRoot": rh.BlobRoot, - "searchRoot": rh.SearchRoot, + "blobRoot": rh.BlobRoot, + "searchRoot": rh.SearchRoot, + "ownerName": rh.OwnerName, } if gener, ok := rh.Storage.(blobserver.Generationer); ok { initTime, gen, err := gener.StorageGeneration() diff --git a/server/camlistored/ui/index.html b/server/camlistored/ui/index.html index 96958c74c..dad9c95ee 100644 --- a/server/camlistored/ui/index.html +++ b/server/camlistored/ui/index.html @@ -11,7 +11,7 @@ -

Recent Permanodes

+

Recent Permanodes

diff --git a/server/camlistored/ui/index.js b/server/camlistored/ui/index.js index c73711905..7b189225d 100644 --- a/server/camlistored/ui/index.js +++ b/server/camlistored/ui/index.js @@ -28,6 +28,8 @@ function indexOnLoad() { selGo.addEventListener("change", function(e) { window.location = goTargets[selGo.value]; }); + + setTextContent($("topTitle"), Camli.config.ownerName + "'s Vault"); } var lastSelIndex = 0;