veyron/go/src/...: replace "127.0.0.1:0" and "localhost:0" with ":0" in address flag default for binaries, and make sure to override --address to "127.0.0.1:0" in tests (since GCE requires ipv4).
Change-Id: Id12564f3e49fe57807fcf4c224cec8fb5e66c900
diff --git a/examples/inspector/inspector/test.sh b/examples/inspector/inspector/test.sh
index 65f6a46..4faaa49 100755
--- a/examples/inspector/inspector/test.sh
+++ b/examples/inspector/inspector/test.sh
@@ -19,7 +19,7 @@
./identity generate inspector >"${ID}" || shell_test::fail "line ${LINENO}: failed to generate an identity"
export VEYRON_IDENTITY="${ID}"
- ./inspectord >ep &
+ ./inspectord --address=127.0.0.1:0 >ep &
for i in 1 2 3 4; do
local EP=$(cat ep)
if [[ -n "${EP}" ]]; then
diff --git a/examples/inspector/inspectord/main.go b/examples/inspector/inspectord/main.go
index cd6c84f..b3307c1 100644
--- a/examples/inspector/inspectord/main.go
+++ b/examples/inspector/inspectord/main.go
@@ -1,6 +1,7 @@
package main
import (
+ "flag"
"fmt"
"os"
@@ -12,21 +13,22 @@
var (
log vlog.Logger
r veyron2.Runtime
+
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on")
+ address = flag.String("address", ":0", "address to listen on")
)
func main() {
- var err error
r = rt.Init()
log = r.Logger()
- if err != nil {
- log.Fatalf("failed to init runtime: %q", err)
- }
hostname, _ := os.Hostname()
server, err := r.NewServer()
if err != nil {
log.Fatalf("failed to create server: %q", err)
}
- ep, err := server.Listen("tcp", "localhost:0")
+ ep, err := server.Listen(*protocol, *address)
if err != nil {
log.Fatalf("listen failed: %q", err)
}
diff --git a/examples/mdb/test.sh b/examples/mdb/test.sh
index acfb120..3596c5a 100755
--- a/examples/mdb/test.sh
+++ b/examples/mdb/test.sh
@@ -24,7 +24,7 @@
local VIEWER_PORT=$(cat "${VIEWER_PORT_FILE}")
local -r HTML_FILE="${TMPDIR}/index.html"
- curl 2>/dev/null "http://localhost:${VIEWER_PORT}" -o "${HTML_FILE}" || shell_test::fail "line ${LINENO}: failed to fetch http://localhost:${VIEWER_PORT}"
+ curl 2>/dev/null "http://127.0.0.1:${VIEWER_PORT}" -o "${HTML_FILE}" || shell_test::fail "line ${LINENO}: failed to fetch http://127.0.0.1:${VIEWER_PORT}"
if grep -q "moviesbox" "${HTML_FILE}"; then
shell_test::pass
diff --git a/examples/rockpaperscissors/impl/impl_test.go b/examples/rockpaperscissors/impl/impl_test.go
index 5a6a856..6f1b7f2 100644
--- a/examples/rockpaperscissors/impl/impl_test.go
+++ b/examples/rockpaperscissors/impl/impl_test.go
@@ -21,7 +21,7 @@
}
dispatcher, err := mtlib.NewMountTable("")
- protocol, hostname := "tcp", "localhost:0"
+ protocol, hostname := "tcp", "127.0.0.1:0"
endpoint, err := server.Listen(protocol, hostname)
if err != nil {
t.Fatalf("Listen(%v, %v) failed: %v", protocol, hostname, err)
@@ -47,7 +47,7 @@
}
rpsService := impl.NewRPS()
- if _, err = server.Listen("tcp", "localhost:0"); err != nil {
+ if _, err = server.Listen("tcp", "127.0.0.1:0"); err != nil {
t.Fatalf("Listen failed: %v", err)
}
disp := ipc.SoloDispatcher(rps.NewServerRockPaperScissors(rpsService), nil)
diff --git a/examples/rockpaperscissors/rpsbot/main.go b/examples/rockpaperscissors/rpsbot/main.go
index a29b8fc..a7fd405 100644
--- a/examples/rockpaperscissors/rpsbot/main.go
+++ b/examples/rockpaperscissors/rpsbot/main.go
@@ -22,8 +22,9 @@
)
var (
- // TODO(rthellend): Remove the address and protocol flags when the config manager is working.
- protocol = flag.String("protocol", "tcp", "network to listen on. For example, set to 'veyron' and set --address to the endpoint/name of a proxy to have this service proxied.")
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on. For example, set to 'veyron' and set --address to the endpoint/name of a proxy to have this tunnel service proxied.")
address = flag.String("address", ":0", "address to listen on")
)
diff --git a/examples/rockpaperscissors/rpsplayercli/main.go b/examples/rockpaperscissors/rpsplayercli/main.go
index fa56b89..d7fa81a 100644
--- a/examples/rockpaperscissors/rpsplayercli/main.go
+++ b/examples/rockpaperscissors/rpsplayercli/main.go
@@ -23,8 +23,9 @@
)
var (
- // TODO(rthellend): Remove the address and protocol flags when the config manager is working.
- protocol = flag.String("protocol", "tcp", "network to listen on. For example, set to 'veyron' and set --address to the endpoint/name of a proxy to have this service proxied.")
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on. For example, set to 'veyron' and set --address to the endpoint/name of a proxy to have this tunnel service proxied.")
address = flag.String("address", ":0", "address to listen on")
)
diff --git a/examples/rockpaperscissors/rpsscorekeeper/main.go b/examples/rockpaperscissors/rpsscorekeeper/main.go
index ff0aca9..787907c 100644
--- a/examples/rockpaperscissors/rpsscorekeeper/main.go
+++ b/examples/rockpaperscissors/rpsscorekeeper/main.go
@@ -18,8 +18,9 @@
)
var (
- // TODO(rthellend): Remove the address and protocol flags when the config manager is working.
- protocol = flag.String("protocol", "tcp", "network to listen on. For example, set to 'veyron' and set --address to the endpoint/name of a proxy to have this service proxied.")
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on. For example, set to 'veyron' and set --address to the endpoint/name of a proxy to have this tunnel service proxied.")
address = flag.String("address", ":0", "address to listen on")
)
diff --git a/examples/todos/test.sh b/examples/todos/test.sh
index d4a6615..956a2e8 100755
--- a/examples/todos/test.sh
+++ b/examples/todos/test.sh
@@ -24,7 +24,7 @@
local -r VIEWER_PORT=$(cat "${VIEWER_PORT_FILE}")
local -r HTML_FILE="${TMPDIR}/index.html"
- curl 2>/dev/null "http://localhost:${VIEWER_PORT}" -o "${HTML_FILE}" || fail "line ${LINENO}: failed to fetch http://localhost:${VIEWER_PORT}"
+ curl 2>/dev/null "http://127.0.0.1:${VIEWER_PORT}" -o "${HTML_FILE}" || fail "line ${LINENO}: failed to fetch http://127.0.0.1:${VIEWER_PORT}"
if grep -q "/lists" "${HTML_FILE}"; then
shell_test::pass
diff --git a/examples/tunnel/tunneld/main.go b/examples/tunnel/tunneld/main.go
index e49dc8e..157e7a2 100644
--- a/examples/tunnel/tunneld/main.go
+++ b/examples/tunnel/tunneld/main.go
@@ -18,8 +18,9 @@
)
var (
- // TODO(rthellend): Remove the address and protocol flags when the config manager is working.
- protocol = flag.String("protocol", "tcp", "network to listen on. For example, set to 'veyron' and set --address to the endpoint/name of a proxy to have this tunnel service proxied.")
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on. For example, set to 'veyron' and set --address to the endpoint/name of a proxy to have this tunnel service proxied.")
address = flag.String("address", ":0", "address to listen on")
)
diff --git a/examples/tunnel/tunneld/test.sh b/examples/tunnel/tunneld/test.sh
index 2aaa4f6..3889c93 100755
--- a/examples/tunnel/tunneld/test.sh
+++ b/examples/tunnel/tunneld/test.sh
@@ -30,7 +30,7 @@
# Start mounttabled and find its endpoint.
local -r MTLOG="${TMPDIR}/mt.log"
- ./mounttabled --address=localhost:0 > "${MTLOG}" 2>&1 &
+ ./mounttabled --address=127.0.0.1:0 > "${MTLOG}" 2>&1 &
for i in 1 2 3 4; do
local EP=$(grep "Mount table service at:" "${MTLOG}" | sed -e 's/^.*endpoint: //')
if [[ -n "${EP}" ]]; then
@@ -49,7 +49,7 @@
# Start tunneld and find its endpoint.
local -r TUNLOG="${TMPDIR}/tunnel.log"
- ./tunneld --address=localhost:0 > "${TUNLOG}" 2>&1 &
+ ./tunneld --address=127.0.0.1:0 > "${TUNLOG}" 2>&1 &
for i in 1 2 3 4; do
local EP=$(grep "Listening on endpoint" "${TUNLOG}" | sed -e 's/^.*endpoint //' | awk '{print $1}')
if [[ -n "${EP}" ]]; then
diff --git a/examples/wspr_sample/sampled/lib/sampled.go b/examples/wspr_sample/sampled/lib/sampled.go
index 530b838..16a4376 100644
--- a/examples/wspr_sample/sampled/lib/sampled.go
+++ b/examples/wspr_sample/sampled/lib/sampled.go
@@ -42,8 +42,8 @@
return nil, nil, fmt.Errorf("error listening to service: %v", err)
}
- // Publish the cache service. This will register it in the mount table and maintain the
- // registration until StopServing is called.
+ // Publish the cache service. This will register it in the mount table and
+ // maintain the registration until StopServing is called.
if err := s.Serve("cache", disp); err != nil {
return nil, nil, fmt.Errorf("error publishing service: %v", err)
}
diff --git a/runtimes/google/ipc/benchmarks/bmserver/main.go b/runtimes/google/ipc/benchmarks/bmserver/main.go
index 017ad69..d0e5d25 100644
--- a/runtimes/google/ipc/benchmarks/bmserver/main.go
+++ b/runtimes/google/ipc/benchmarks/bmserver/main.go
@@ -12,8 +12,10 @@
)
var (
- address = flag.String("address", ":0", "address to listen on")
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
protocol = flag.String("protocol", "tcp", "protocol to listen on")
+ address = flag.String("address", ":0", "address to listen on")
)
func main() {
diff --git a/runtimes/google/ipc/full_test.go b/runtimes/google/ipc/full_test.go
index 0020de0..5b87cbb 100644
--- a/runtimes/google/ipc/full_test.go
+++ b/runtimes/google/ipc/full_test.go
@@ -265,7 +265,7 @@
t.Errorf("InternalNewServer failed: %v", err)
}
vlog.VI(1).Info("server.Listen")
- ep, err := server.Listen("tcp", "localhost:0")
+ ep, err := server.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Errorf("server.Listen failed: %v", err)
}
@@ -403,7 +403,7 @@
if err != nil {
t.Errorf("InternalNewServer failed: %v", err)
}
- _, err = server.Listen("tcp", "localhost:0")
+ _, err = server.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Errorf("server.Listen failed: %v", err)
}
@@ -979,12 +979,12 @@
t.Errorf("InternalNewServer failed: %v", err)
continue
}
- if _, err := server.Listen("tcp", "localhost:0"); err != nil {
+ if _, err := server.Listen("tcp", "127.0.0.1:0"); err != nil {
t.Errorf("server.Listen failed: %v", err)
server.Stop()
continue
}
- if _, err := server.Listen("tcp", "localhost:0"); err != nil {
+ if _, err := server.Listen("tcp", "127.0.0.1:0"); err != nil {
t.Errorf("server.Listen failed: %v", err)
server.Stop()
continue
@@ -1216,7 +1216,7 @@
if err != nil {
vlog.Fatal(err)
}
- proxy, err := proxy.New(rid, nil, "tcp4", "127.0.0.1:0", "")
+ proxy, err := proxy.New(rid, nil, "tcp", "127.0.0.1:0", "")
if err != nil {
vlog.Fatal(err)
}
diff --git a/runtimes/google/ipc/stream/benchmark/throughput_flow.go b/runtimes/google/ipc/stream/benchmark/throughput_flow.go
index 7c1ea25..8f2392c 100644
--- a/runtimes/google/ipc/stream/benchmark/throughput_flow.go
+++ b/runtimes/google/ipc/stream/benchmark/throughput_flow.go
@@ -27,7 +27,7 @@
func createListeners(mode veyron2.VCSecurityLevel, m stream.Manager, N int) (servers []listener, err error) {
for i := 0; i < N; i++ {
var l listener
- if l.ln, l.ep, err = m.Listen("tcp", "localhost:0", mode); err != nil {
+ if l.ln, l.ep, err = m.Listen("tcp", "127.0.0.1:0", mode); err != nil {
return
}
servers = append(servers, l)
diff --git a/runtimes/google/ipc/stream/manager/manager_test.go b/runtimes/google/ipc/stream/manager/manager_test.go
index 84a78ee..6c78e89 100644
--- a/runtimes/google/ipc/stream/manager/manager_test.go
+++ b/runtimes/google/ipc/stream/manager/manager_test.go
@@ -45,7 +45,7 @@
server := InternalNew(naming.FixedRoutingID(0x55555555))
client := InternalNew(naming.FixedRoutingID(0xcccccccc))
- ln, ep, err := server.Listen("tcp", "localhost:0")
+ ln, ep, err := server.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Fatal(err)
}
@@ -133,7 +133,7 @@
serverID := newID("server")
// VCSecurityLevel is intentionally not provided to Listen - to test
// default behavior.
- ln, ep, err := server.Listen("tcp", "localhost:0", vc.FixedLocalID(serverID))
+ ln, ep, err := server.Listen("tcp", "127.0.0.1:0", vc.FixedLocalID(serverID))
if err != nil {
t.Fatal(err)
}
@@ -191,11 +191,10 @@
func TestListenEndpoints(t *testing.T) {
server := InternalNew(naming.FixedRoutingID(0xcafe))
- ln1, ep1, err1 := server.Listen("tcp", "localhost:0")
- ln2, ep2, err2 := server.Listen("tcp", "localhost:0")
- // Since "localhost:0" was used as the network address, a random port
- // will be assigned in each case. The endpoint should include that
- // random port.
+ ln1, ep1, err1 := server.Listen("tcp", "127.0.0.1:0")
+ ln2, ep2, err2 := server.Listen("tcp", "127.0.0.1:0")
+ // Since "127.0.0.1:0" was used as the network address, a random port will be
+ // assigned in each case. The endpoint should include that random port.
if err1 != nil {
t.Error(err1)
}
@@ -231,7 +230,7 @@
func TestCloseListener(t *testing.T) {
server := InternalNew(naming.FixedRoutingID(0x5e97e9))
- ln, ep, err := server.Listen("tcp", "localhost:0")
+ ln, ep, err := server.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Fatal(err)
}
@@ -250,7 +249,7 @@
func TestShutdown(t *testing.T) {
server := InternalNew(naming.FixedRoutingID(0x5e97e9))
- ln, _, err := server.Listen("tcp", "localhost:0")
+ ln, _, err := server.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Fatal(err)
}
@@ -260,7 +259,7 @@
t.Errorf("expecting %d listeners, got %d for %s", n, expect, debugString(server))
}
server.Shutdown()
- if _, _, err := server.Listen("tcp", "localhost:0"); err == nil {
+ if _, _, err := server.Listen("tcp", "127.0.0.1:0"); err == nil {
t.Error("server should have shut down")
}
if n, expect := numListeners(server), 0; n != expect {
@@ -272,7 +271,7 @@
server := InternalNew(naming.FixedRoutingID(0x55555555))
client := InternalNew(naming.FixedRoutingID(0xcccccccc))
- ln, ep, err := server.Listen("tcp", "localhost:0")
+ ln, ep, err := server.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Fatal(err)
}
@@ -295,7 +294,7 @@
func TestSessionTicketCache(t *testing.T) {
server := InternalNew(naming.FixedRoutingID(0x55555555))
- _, ep, err := server.Listen("tcp", "localhost:0", vc.FixedLocalID(newID("server")))
+ _, ep, err := server.Listen("tcp", "127.0.0.1:0", vc.FixedLocalID(newID("server")))
if err != nil {
t.Fatal(err)
}
@@ -319,7 +318,7 @@
// Have the server read from each flow and write to rchan.
rchan := make(chan string)
- ln, ep, err := server.Listen("tcp", "localhost:0", vc.FixedLocalID(newID("server")))
+ ln, ep, err := server.Listen("tcp", "127.0.0.1:0", vc.FixedLocalID(newID("server")))
if err != nil {
t.Fatal(err)
}
@@ -393,9 +392,9 @@
server := InternalNew(naming.FixedRoutingID(0x55555555))
client := InternalNew(naming.FixedRoutingID(0xcccccccc))
- // Using "tcp4" instead of "tcp" because the latter can end up with
- // IPv6 addresses and our Google Compute Engine integration test
- // machines cannot resolve IPv6 addresses.
+ // Using "tcp4" instead of "tcp" because the latter can end up with IPv6
+ // addresses and our Google Compute Engine integration test machines cannot
+ // resolve IPv6 addresses.
// As of April 2014, https://developers.google.com/compute/docs/networking
// said that IPv6 is not yet supported.
ln, ep, err := server.Listen("tcp4", "127.0.0.1:0")
@@ -404,14 +403,13 @@
}
go acceptLoop(ln)
- // We'd like an endpoint that contains an address that's different
- // to the one used for the connection. In practice this is awkward
- // to achieve since we don't want to listen on ":0" since that will
- // annoy firewalls. Instead we listen on 127.0.0.1 and we fabricate an
- // endpoint that doesn't contain 127.0.0.1 by using ":0" to create it.
- // This leads to an endpoint such that the address
- // encoded in the endpoint (e.g. "0.0.0.0:55324") is different from
- // address of the connection (e.g. "127.0.0.1:55324").
+ // We'd like an endpoint that contains an address that's different than the
+ // one used for the connection. In practice this is awkward to achieve since
+ // we don't want to listen on ":0" since that will annoy firewalls. Instead we
+ // listen on 127.0.0.1 and we fabricate an endpoint that doesn't contain
+ // 127.0.0.1 by using ":0" to create it. This leads to an endpoint such that
+ // the address encoded in the endpoint (e.g. "0.0.0.0:55324") is different
+ // from the address of the connection (e.g. "127.0.0.1:55324").
_, port, _ := net.SplitHostPort(ep.Addr().String())
nep := version.Endpoint(ep.Addr().Network(), net.JoinHostPort("", port), ep.RoutingID())
diff --git a/runtimes/google/ipc/stream/proxy/proxy_test.go b/runtimes/google/ipc/stream/proxy/proxy_test.go
index c5ccf58..cd1d7b4 100644
--- a/runtimes/google/ipc/stream/proxy/proxy_test.go
+++ b/runtimes/google/ipc/stream/proxy/proxy_test.go
@@ -28,12 +28,7 @@
}
func TestProxy(t *testing.T) {
- // Using "tcp4" instead of "tcp" because the latter can end up with
- // IPv6 addresses and our Google Compute Engine integration test
- // machines cannot resolve IPv6 addresses.
- // As of April 2014, https://developers.google.com/compute/docs/networking
- // said that IPv6 is not yet supported.
- proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), nil, "tcp4", "127.0.0.1:0", "")
+ proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), nil, "tcp", "127.0.0.1:0", "")
if err != nil {
t.Fatal(err)
}
@@ -93,7 +88,7 @@
}
func TestDuplicateRoutingID(t *testing.T) {
- proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), nil, "tcp4", "127.0.0.1:0", "")
+ proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), nil, "tcp", "127.0.0.1:0", "")
if err != nil {
t.Fatal(err)
}
@@ -121,7 +116,7 @@
func TestProxyIdentity(t *testing.T) {
proxyID := newID("proxy")
- proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), proxyID, "tcp4", "127.0.0.1:0", "")
+ proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), proxyID, "tcp", "127.0.0.1:0", "")
if err != nil {
t.Fatal(err)
}
@@ -145,7 +140,7 @@
}
func TestServerIdentity(t *testing.T) {
- proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), nil, "tcp4", "127.0.0.1:0", "")
+ proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), nil, "tcp", "127.0.0.1:0", "")
if err != nil {
t.Fatal(err)
}
@@ -185,7 +180,7 @@
}
func TestHostPort(t *testing.T) {
- proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), nil, "tcp4", "127.0.0.1:0", "")
+ proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), nil, "tcp", "127.0.0.1:0", "")
if err != nil {
t.Fatal(err)
}
@@ -202,7 +197,7 @@
}
func TestClientBecomesServer(t *testing.T) {
- proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), nil, "tcp4", "127.0.0.1:0", "")
+ proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), nil, "tcp", "127.0.0.1:0", "")
if err != nil {
t.Fatal(err)
}
diff --git a/runtimes/google/rt/http.go b/runtimes/google/rt/http.go
index c05e8cd..a890dac 100644
--- a/runtimes/google/rt/http.go
+++ b/runtimes/google/rt/http.go
@@ -26,12 +26,12 @@
}
func (rt *vrt) initHTTPDebugServer() {
- // TODO(ashankar,cnicolaou): Change the default debug address to
- // the empty string.
- // In March 2014 this was temporarily set to "127.0.0.1:0" so that the debugging
- // HTTP server always runs, which was useful during initial veyron
- // development. We restrict it to localhost to avoid annoying firewall
- // warnings and to provide a modicum of security.
+ // TODO(ashankar,cnicolaou): Change the default debug address to the empty
+ // string.
+ // In March 2014 this was temporarily set to "127.0.0.1:0" so that the
+ // debugging HTTP server always runs, which was useful during initial veyron
+ // development. We restrict it in this way to avoid annoying firewall warnings
+ // and to provide a modicum of security.
rt.debug.addr = "127.0.0.1:0"
rt.debug.mux = http.NewServeMux()
}
diff --git a/runtimes/google/vsync/vsyncd/main.go b/runtimes/google/vsync/vsyncd/main.go
index 66c8633..a915550 100644
--- a/runtimes/google/vsync/vsyncd/main.go
+++ b/runtimes/google/vsync/vsyncd/main.go
@@ -12,18 +12,23 @@
"veyron2/vlog"
)
-func main() {
- peerEndpoints := flag.String("peers", "",
- "comma separated list of endpoints of the vsync peer")
- peerDeviceIDs := flag.String("peerids", "",
- "comma separated list of deviceids of the vsync peer")
- devid := flag.String("devid", "", "Device ID")
- storePath := flag.String("store", os.TempDir(), "path to store files")
- vstoreEndpoint := flag.String("vstore", "", "endpoint of the local Veyron store")
- // TODO(rthellend): Remove the address flag when the config manager is working.
- address := flag.String("address", ":0", "address to listen on")
- syncTick := flag.Duration("synctick", 0, "clock tick duration for sync with a peer (e.g. 10s)")
+var (
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on")
+ address = flag.String("address", ":0", "address to listen on")
+ peerEndpoints = flag.String("peers", "",
+ "comma separated list of endpoints of the vsync peer")
+ peerDeviceIDs = flag.String("peerids", "",
+ "comma separated list of deviceids of the vsync peer")
+ devid = flag.String("devid", "", "Device ID")
+ storePath = flag.String("store", os.TempDir(), "path to store files")
+ vstoreEndpoint = flag.String("vstore", "", "endpoint of the local Veyron store")
+ syncTick = flag.Duration("synctick", 0, "clock tick duration for sync with a peer (e.g. 10s)")
+)
+
+func main() {
flag.Parse()
if *devid == "" {
vlog.Fatalf("syncd:: --devid needs to be specified")
@@ -50,7 +55,7 @@
syncDisp := vsync.NewSyncDispatcher(syncService, auth)
// Create an endpoint and begin listening.
- if endpoint, err := s.Listen("tcp", *address); err == nil {
+ if endpoint, err := s.Listen(*protocol, *address); err == nil {
vlog.VI(0).Infof("syncd:: Listening now at %v", endpoint)
} else {
vlog.Fatalf("syncd:: error listening to service: err %v", err)
diff --git a/services/mgmt/application/applicationd/main.go b/services/mgmt/application/applicationd/main.go
index 397e3c3..34c9ac7 100644
--- a/services/mgmt/application/applicationd/main.go
+++ b/services/mgmt/application/applicationd/main.go
@@ -11,15 +11,19 @@
"veyron2/vlog"
)
+var (
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on")
+ address = flag.String("address", ":0", "address to listen on")
+
+ name = flag.String("name", "", "name to mount the application manager as")
+ storeName = flag.String("store", "", "object name of the application manager store")
+)
+
func main() {
- var address, protocol, name, storeName string
- // TODO(rthellend): Remove the address and protocol flags when the config manager is working.
- flag.StringVar(&address, "address", "localhost:0", "network address to listen on")
- flag.StringVar(&name, "name", "", "name to mount the application manager as")
- flag.StringVar(&protocol, "protocol", "tcp", "network type to listen on")
- flag.StringVar(&storeName, "store", "", "object name of the application manager store")
flag.Parse()
- if storeName == "" {
+ if *storeName == "" {
vlog.Fatalf("Specify a store using --store=<name>")
}
runtime := rt.Init()
@@ -30,18 +34,18 @@
}
defer server.Stop()
- dispatcher, err := impl.NewDispatcher(storeName, vflag.NewAuthorizerOrDie())
+ dispatcher, err := impl.NewDispatcher(*storeName, vflag.NewAuthorizerOrDie())
if err != nil {
vlog.Fatalf("NewDispatcher() failed: %v", err)
}
- endpoint, err := server.Listen(protocol, address)
+ endpoint, err := server.Listen(*protocol, *address)
if err != nil {
- vlog.Fatalf("Listen(%v, %v) failed: %v", protocol, address, err)
+ vlog.Fatalf("Listen(%v, %v) failed: %v", *protocol, *address, err)
}
- if err := server.Serve(name, dispatcher); err != nil {
- vlog.Fatalf("Serve(%v) failed: %v", name, err)
+ if err := server.Serve(*name, dispatcher); err != nil {
+ vlog.Fatalf("Serve(%v) failed: %v", *name, err)
}
- vlog.VI(0).Infof("Application manager published at %v/%v", endpoint, name)
+ vlog.VI(0).Infof("Application manager published at %v/%v", endpoint, *name)
// Wait until shutdown.
<-signals.ShutdownOnSignals()
diff --git a/services/mgmt/application/impl/impl_test.go b/services/mgmt/application/impl/impl_test.go
index 3321f58..de8d13b 100644
--- a/services/mgmt/application/impl/impl_test.go
+++ b/services/mgmt/application/impl/impl_test.go
@@ -40,7 +40,7 @@
t.Fatalf("NewDispatcher() failed: %v", err)
}
- protocol, hostname := "tcp", "localhost:0"
+ protocol, hostname := "tcp", "127.0.0.1:0"
endpoint, err := server.Listen(protocol, hostname)
if err != nil {
t.Fatalf("Listen(%v, %v) failed: %v", protocol, hostname, err)
diff --git a/services/mgmt/binary/binaryd/main.go b/services/mgmt/binary/binaryd/main.go
index a676c94..da36a77 100644
--- a/services/mgmt/binary/binaryd/main.go
+++ b/services/mgmt/binary/binaryd/main.go
@@ -20,46 +20,50 @@
defaultRootPrefix = "veyron_binary_repository"
)
+var (
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on")
+ address = flag.String("address", ":0", "address to listen on")
+
+ name = flag.String("name", "", "name to mount the binary repository as")
+ root = flag.String("root", "", "root directory for the binary repository")
+)
+
func main() {
- var address, protocol, name, root string
- // TODO(rthellend): Remove the address and protocol flags when the config manager is working.
- flag.StringVar(&address, "address", "localhost:0", "network address to listen on")
- flag.StringVar(&name, "name", "", "name to mount the binary repository as")
- flag.StringVar(&protocol, "protocol", "tcp", "network type to listen on")
- flag.StringVar(&root, "root", "", "root directory for the binary repository")
flag.Parse()
- if root == "" {
+ if *root == "" {
var err error
- if root, err = ioutil.TempDir("", defaultRootPrefix); err != nil {
+ if *root, err = ioutil.TempDir("", defaultRootPrefix); err != nil {
vlog.Errorf("TempDir() failed: %v\n", err)
return
}
- path, perm := filepath.Join(root, impl.VersionFile), os.FileMode(0600)
+ path, perm := filepath.Join(*root, impl.VersionFile), os.FileMode(0600)
if err := ioutil.WriteFile(path, []byte(impl.Version), perm); err != nil {
vlog.Errorf("WriteFile(%v, %v, %v) failed: %v", path, impl.Version, perm, err)
return
}
} else {
- _, err := os.Stat(root)
+ _, err := os.Stat(*root)
switch {
case err == nil:
case os.IsNotExist(err):
perm := os.FileMode(0700)
- if err := os.MkdirAll(root, perm); err != nil {
- vlog.Errorf("MkdirAll(%v, %v) failed: %v", root, perm, err)
+ if err := os.MkdirAll(*root, perm); err != nil {
+ vlog.Errorf("MkdirAll(%v, %v) failed: %v", *root, perm, err)
return
}
- path, perm := filepath.Join(root, impl.VersionFile), os.FileMode(0600)
+ path, perm := filepath.Join(*root, impl.VersionFile), os.FileMode(0600)
if err := ioutil.WriteFile(path, []byte(impl.Version), perm); err != nil {
vlog.Errorf("WriteFile(%v, %v, %v) failed: %v", path, impl.Version, perm, err)
return
}
default:
- vlog.Errorf("Stat(%v) failed: %v", root, err)
+ vlog.Errorf("Stat(%v) failed: %v", *root, err)
return
}
}
- vlog.Infof("Binary repository rooted at %v", root)
+ vlog.Infof("Binary repository rooted at %v", *root)
runtime := rt.Init()
defer runtime.Cleanup()
server, err := runtime.NewServer()
@@ -69,21 +73,21 @@
}
defer server.Stop()
auth := vflag.NewAuthorizerOrDie()
- dispatcher, err := impl.NewDispatcher(root, defaultDepth, auth)
+ dispatcher, err := impl.NewDispatcher(*root, defaultDepth, auth)
if err != nil {
- vlog.Errorf("NewDispatcher(%v, %v, %v) failed: %v", root, defaultDepth, auth, err)
+ vlog.Errorf("NewDispatcher(%v, %v, %v) failed: %v", *root, defaultDepth, auth, err)
return
}
- endpoint, err := server.Listen(protocol, address)
+ endpoint, err := server.Listen(*protocol, *address)
if err != nil {
- vlog.Errorf("Listen(%v, %v) failed: %v", protocol, address, err)
+ vlog.Errorf("Listen(%v, %v) failed: %v", *protocol, *address, err)
return
}
- if err := server.Serve(name, dispatcher); err != nil {
- vlog.Errorf("Serve(%v) failed: %v", name, err)
+ if err := server.Serve(*name, dispatcher); err != nil {
+ vlog.Errorf("Serve(%v) failed: %v", *name, err)
return
}
- vlog.Infof("Binary repository published at %v/%v", endpoint, name)
+ vlog.Infof("Binary repository published at %v/%v", endpoint, *name)
// Wait until shutdown.
<-signals.ShutdownOnSignals()
}
diff --git a/services/mgmt/binary/impl/impl_test.go b/services/mgmt/binary/impl/impl_test.go
index 5301b63..553639c 100644
--- a/services/mgmt/binary/impl/impl_test.go
+++ b/services/mgmt/binary/impl/impl_test.go
@@ -109,7 +109,7 @@
if err != nil {
t.Fatalf("NewDispatcher(%v, %v, %v) failed: %v", root, depth, nil, err)
}
- protocol, hostname := "tcp", "localhost:0"
+ protocol, hostname := "tcp", "127.0.0.1:0"
endpoint, err := server.Listen(protocol, hostname)
if err != nil {
t.Fatalf("Listen(%v, %v) failed: %v", protocol, hostname, err)
diff --git a/services/mgmt/build/buildd/main.go b/services/mgmt/build/buildd/main.go
index d12d603..6ad2ae3 100644
--- a/services/mgmt/build/buildd/main.go
+++ b/services/mgmt/build/buildd/main.go
@@ -13,13 +13,17 @@
"veyron2/vlog"
)
+var (
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on")
+ address = flag.String("address", ":0", "address to listen on")
+
+ gobin = flag.String("gobin", "go", "path to the Go compiler")
+ name = flag.String("name", "", "name to mount the build server as")
+)
+
func main() {
- var address, gobin, name, protocol string
- // TODO(rthellend): Remove the address and protocol flags when the config manager is working.
- flag.StringVar(&address, "address", "localhost:0", "network address to listen on")
- flag.StringVar(&gobin, "gobin", "go", "path to the Go compiler")
- flag.StringVar(&name, "name", "", "name to mount the build server as")
- flag.StringVar(&protocol, "protocol", "tcp", "network type to listen on")
flag.Parse()
runtime := rt.Init()
defer runtime.Cleanup()
@@ -29,16 +33,16 @@
return
}
defer server.Stop()
- endpoint, err := server.Listen(protocol, address)
+ endpoint, err := server.Listen(*protocol, *address)
if err != nil {
- vlog.Errorf("Listen(%v, %v) failed: %v", protocol, address, err)
+ vlog.Errorf("Listen(%v, %v) failed: %v", *protocol, *address, err)
return
}
- if err := server.Serve(name, ipc.SoloDispatcher(build.NewServerBuilder(impl.NewInvoker(gobin)), vflag.NewAuthorizerOrDie())); err != nil {
- vlog.Errorf("Serve(%v) failed: %v", name, err)
+ if err := server.Serve(*name, ipc.SoloDispatcher(build.NewServerBuilder(impl.NewInvoker(*gobin)), vflag.NewAuthorizerOrDie())); err != nil {
+ vlog.Errorf("Serve(%v) failed: %v", *name, err)
return
}
- vlog.Infof("Build server endpoint=%q name=%q", endpoint, name)
+ vlog.Infof("Build server endpoint=%q name=%q", endpoint, *name)
// Wait until shutdown.
<-signals.ShutdownOnSignals()
diff --git a/services/mgmt/build/impl/impl_test.go b/services/mgmt/build/impl/impl_test.go
index 2f767da..fda143f 100644
--- a/services/mgmt/build/impl/impl_test.go
+++ b/services/mgmt/build/impl/impl_test.go
@@ -28,7 +28,7 @@
if err != nil {
t.Fatalf("NewServer() failed: %v", err)
}
- protocol, hostname := "tcp", "localhost:0"
+ protocol, hostname := "tcp", "127.0.0.1:0"
endpoint, err := server.Listen(protocol, hostname)
if err != nil {
t.Fatalf("Listen(%v, %v) failed: %v", protocol, hostname, err)
diff --git a/services/mgmt/lib/binary/impl_test.go b/services/mgmt/lib/binary/impl_test.go
index e99c693..11487cc 100644
--- a/services/mgmt/lib/binary/impl_test.go
+++ b/services/mgmt/lib/binary/impl_test.go
@@ -43,7 +43,7 @@
if err != nil {
t.Fatalf("NewDispatcher(%v, %v, %v) failed: %v", root, depth, nil, err)
}
- protocol, hostname := "tcp", "localhost:0"
+ protocol, hostname := "tcp", "127.0.0.1:0"
endpoint, err := server.Listen(protocol, hostname)
if err != nil {
t.Fatalf("Listen(%v, %v) failed: %v", protocol, hostname, err)
diff --git a/services/mgmt/node/impl/util_test.go b/services/mgmt/node/impl/util_test.go
index 3388b63..762bf02 100644
--- a/services/mgmt/node/impl/util_test.go
+++ b/services/mgmt/node/impl/util_test.go
@@ -34,7 +34,7 @@
if err != nil {
t.Fatalf("NewMountTable() failed: %v", err)
}
- protocol, hostname := "tcp", "localhost:0"
+ protocol, hostname := "tcp", "127.0.0.1:0"
endpoint, err := server.Listen(protocol, hostname)
if err != nil {
t.Fatalf("Listen(%v, %v) failed: %v", protocol, hostname, err)
@@ -80,7 +80,7 @@
if err != nil {
vlog.Fatalf("NewServer() failed: %v", err)
}
- protocol, hostname := "tcp", "localhost:0"
+ protocol, hostname := "tcp", "127.0.0.1:0"
endpoint, err := server.Listen(protocol, hostname)
if err != nil {
vlog.Fatalf("Listen(%v, %v) failed: %v", protocol, hostname, err)
diff --git a/services/mgmt/node/noded/main.go b/services/mgmt/node/noded/main.go
index 1fe7ff4..12e6267 100644
--- a/services/mgmt/node/noded/main.go
+++ b/services/mgmt/node/noded/main.go
@@ -13,12 +13,16 @@
"veyron2/vlog"
)
+var (
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on")
+ address = flag.String("address", ":0", "address to listen on")
+
+ publishAs = flag.String("name", "", "name to publish the node manager at")
+)
+
func main() {
- // TODO(rthellend): Remove the address and protocol flags when the config manager is working.
- var address, protocol, publishAs string
- flag.StringVar(&address, "address", "localhost:0", "network address to listen on")
- flag.StringVar(&protocol, "protocol", "tcp", "network type to listen on")
- flag.StringVar(&publishAs, "name", "", "name to publish the node manager at")
flag.Parse()
runtime := rt.Init()
defer runtime.Cleanup()
@@ -27,9 +31,9 @@
vlog.Fatalf("NewServer() failed: %v", err)
}
defer server.Stop()
- endpoint, err := server.Listen(protocol, address)
+ endpoint, err := server.Listen(*protocol, *address)
if err != nil {
- vlog.Fatalf("Listen(%v, %v) failed: %v", protocol, address, err)
+ vlog.Fatalf("Listen(%v, %v) failed: %v", *protocol, *address, err)
}
name := naming.MakeTerminal(naming.JoinAddressName(endpoint.String(), ""))
vlog.VI(0).Infof("Node manager object name: %v", name)
@@ -46,8 +50,8 @@
if err != nil {
vlog.Fatalf("Failed to create dispatcher: %v", err)
}
- if err := server.Serve(publishAs, dispatcher); err != nil {
- vlog.Fatalf("Serve(%v) failed: %v", publishAs, err)
+ if err := server.Serve(*publishAs, dispatcher); err != nil {
+ vlog.Fatalf("Serve(%v) failed: %v", *publishAs, err)
}
impl.InvokeCallback(name)
diff --git a/services/mgmt/profile/impl/impl_test.go b/services/mgmt/profile/impl/impl_test.go
index ca9ff10..8a2fb7f 100644
--- a/services/mgmt/profile/impl/impl_test.go
+++ b/services/mgmt/profile/impl/impl_test.go
@@ -54,7 +54,7 @@
if err != nil {
t.Fatalf("NewDispatcher() failed: %v", err)
}
- protocol, hostname := "tcp", "localhost:0"
+ protocol, hostname := "tcp", "127.0.0.1:0"
endpoint, err := server.Listen(protocol, hostname)
if err != nil {
t.Fatalf("Listen(%v, %v) failed: %v", protocol, hostname, err)
diff --git a/services/mgmt/profile/profiled/main.go b/services/mgmt/profile/profiled/main.go
index 61482b2..73f3465 100644
--- a/services/mgmt/profile/profiled/main.go
+++ b/services/mgmt/profile/profiled/main.go
@@ -11,15 +11,19 @@
"veyron2/vlog"
)
+var (
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on")
+ address = flag.String("address", ":0", "address to listen on")
+
+ name = flag.String("name", "", "name to mount the profile manager as")
+ storeName = flag.String("store", "", "object name of the profile manager store")
+)
+
func main() {
- var address, name, protocol, storeName string
- // TODO(rthellend): Remove the address and protocol flags when the config manager is working.
- flag.StringVar(&address, "address", "localhost:0", "network address to listen on")
- flag.StringVar(&name, "name", "", "name to mount the profile manager as")
- flag.StringVar(&protocol, "protocol", "tcp", "network type to listen on")
- flag.StringVar(&storeName, "store", "", "object name of the profile manager store")
flag.Parse()
- if storeName == "" {
+ if *storeName == "" {
vlog.Fatalf("Specify a store using --store=<name>")
}
runtime := rt.Init()
@@ -29,19 +33,19 @@
vlog.Fatalf("NewServer() failed: %v", err)
}
defer server.Stop()
- dispatcher, err := impl.NewDispatcher(storeName, vflag.NewAuthorizerOrDie())
+ dispatcher, err := impl.NewDispatcher(*storeName, vflag.NewAuthorizerOrDie())
if err != nil {
vlog.Fatalf("NewDispatcher() failed: %v", err)
}
- endpoint, err := server.Listen(protocol, address)
+ endpoint, err := server.Listen(*protocol, *address)
if err != nil {
- vlog.Fatalf("Listen(%v, %v) failed: %v", protocol, address, err)
+ vlog.Fatalf("Listen(%v, %v) failed: %v", *protocol, *address, err)
}
- if err := server.Serve(name, dispatcher); err != nil {
- vlog.Fatalf("Serve(%v) failed: %v", name, err)
+ if err := server.Serve(*name, dispatcher); err != nil {
+ vlog.Fatalf("Serve(%v) failed: %v", *name, err)
}
- vlog.VI(0).Infof("Profile manager published at %v/%v", endpoint, name)
+ vlog.VI(0).Infof("Profile manager published at %v/%v", endpoint, *name)
// Wait until shutdown.
<-signals.ShutdownOnSignals()
diff --git a/services/mgmt/root/rootd/main.go b/services/mgmt/root/rootd/main.go
index c20a76a..b0adae2 100644
--- a/services/mgmt/root/rootd/main.go
+++ b/services/mgmt/root/rootd/main.go
@@ -1,13 +1,22 @@
package main
import (
- "veyron/lib/signals"
+ "flag"
+ "veyron/lib/signals"
"veyron/services/mgmt/root/impl"
+
"veyron2/rt"
"veyron2/vlog"
)
+var (
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on")
+ address = flag.String("address", ":0", "address to listen on")
+)
+
func main() {
r := rt.Init()
defer r.Cleanup()
@@ -18,10 +27,9 @@
}
defer server.Stop()
dispatcher := impl.NewDispatcher()
- protocol, hostname := "tcp", "localhost:0"
- ep, err := server.Listen(protocol, hostname)
+ ep, err := server.Listen(*protocol, *address)
if err != nil {
- vlog.Errorf("Listen(%v, %v) failed: %v", protocol, hostname, err)
+ vlog.Errorf("Listen(%v, %v) failed: %v", *protocol, *address, err)
return
}
vlog.VI(0).Infof("Listening on %v", ep)
diff --git a/services/mounttable/mounttabled/mounttable.go b/services/mounttable/mounttabled/mounttable.go
index 658aab0..7d58cd5 100644
--- a/services/mounttable/mounttabled/mounttable.go
+++ b/services/mounttable/mounttabled/mounttable.go
@@ -18,9 +18,13 @@
)
var (
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on")
+ address = flag.String("address", ":0", "address to listen on")
+
mountName = flag.String("name", "", "Name to mount this mountable as. Empty means don't mount.")
- // TODO(rthellend): Remove the address flag when the config manager is working.
- address = flag.String("address", ":0", "Address to listen on. Default is to use a randomly assigned port")
+
aclFile = flag.String("acls", "", "ACL file. Default is to allow all access.")
nhName = flag.String("neighborhood_name", "", "If non-empty, publish in the local neighborhood under this name.")
)
@@ -65,7 +69,7 @@
vlog.Errorf("r.NewMountTable failed: %v", err)
return
}
- mtEndpoint, err := mtServer.Listen("tcp", *address)
+ mtEndpoint, err := mtServer.Listen(*protocol, *address)
if err != nil {
vlog.Errorf("mtServer.Listen failed: %v", err)
return
@@ -94,7 +98,7 @@
vlog.Errorf("parsing of address(%q) failed: %v", *address, err)
return
}
- if _, err = nhServer.Listen("tcp", net.JoinHostPort(host, "0")); err != nil {
+ if _, err = nhServer.Listen(*protocol, net.JoinHostPort(host, "0")); err != nil {
vlog.Errorf("nhServer.Listen failed: %v", err)
return
}
diff --git a/services/mounttable/mounttabled/test.sh b/services/mounttable/mounttabled/test.sh
index f3b74d3..560abcd 100755
--- a/services/mounttable/mounttabled/test.sh
+++ b/services/mounttable/mounttabled/test.sh
@@ -24,7 +24,7 @@
# Start mounttabled and find its endpoint.
local NHNAME=test$$
local MTLOG="${TMPDIR}/mt.log"
- ./mounttabled --address=localhost:0 --neighborhood_name="${NHNAME}" > "${MTLOG}" 2>&1 &
+ ./mounttabled --address=127.0.0.1:0 --neighborhood_name="${NHNAME}" > "${MTLOG}" 2>&1 &
for i in 1 2 3 4; do
local EP=$(grep "Mount table service at:" "${MTLOG}" | sed -e 's/^.*endpoint: //')
diff --git a/services/proximity/proximityd/main.go b/services/proximity/proximityd/main.go
index 7a43e1b..5019ca8 100644
--- a/services/proximity/proximityd/main.go
+++ b/services/proximity/proximityd/main.go
@@ -18,10 +18,12 @@
)
var (
- // TODO(rthellend): Remove the address and protocol flags when the config manager is working.
- protocol = flag.String("protocol", "tcp", "network to listen on. For example, set to 'veyron' and set --address to the endpoint/name of a proxy to have this service proxied.")
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on")
address = flag.String("address", ":0", "address to listen on")
- name = flag.String("name", "", "name to mount the proximity service as")
+
+ name = flag.String("name", "", "name to mount the proximity service as")
)
func main() {
diff --git a/services/proxy/proxyd/main.go b/services/proxy/proxyd/main.go
index 043a45d..2a669a0 100644
--- a/services/proxy/proxyd/main.go
+++ b/services/proxy/proxyd/main.go
@@ -15,17 +15,19 @@
"veyron2/vlog"
)
-func main() {
- var (
- // TODO(rthellend): Remove the address and protocol flags when the config manager is working.
- address = flag.String("address", ":0", "Network address the proxy listens on")
- pubAddress = flag.String("published_address", "", "Network address the proxy publishes. If empty, the value of --address will be used")
- protocol = flag.String("protocol", "tcp", "Network type the proxy listens on")
- httpAddr = flag.String("http", ":14142", "Network address on which the HTTP debug server runs")
- healthzAddr = flag.String("healthz_address", "", "Network address on which the HTTP healthz server runs. It is intended to be used with a load balancer. The load balancer must be able to reach this address in order to verify that the proxy server is running")
- name = flag.String("name", "", "Name to mount the proxy as")
- )
+var (
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on")
+ address = flag.String("address", ":0", "address to listen on")
+ pubAddress = flag.String("published_address", "", "Network address the proxy publishes. If empty, the value of --address will be used")
+ httpAddr = flag.String("http", ":14142", "Network address on which the HTTP debug server runs")
+ healthzAddr = flag.String("healthz_address", "", "Network address on which the HTTP healthz server runs. It is intended to be used with a load balancer. The load balancer must be able to reach this address in order to verify that the proxy server is running")
+ name = flag.String("name", "", "Name to mount the proxy as")
+)
+
+func main() {
r := rt.Init()
defer r.Cleanup()
diff --git a/services/security/dischargerd/main.go b/services/security/dischargerd/main.go
index fb44bb7..2b5524e 100644
--- a/services/security/dischargerd/main.go
+++ b/services/security/dischargerd/main.go
@@ -14,10 +14,13 @@
)
var (
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
protocol = flag.String("protocol", "tcp", "protocol to listen on")
address = flag.String("address", ":0", "address to listen on")
- aclFile = flag.String("discharger-acl", "", "ACL to use for the discharge service")
- publish = flag.String("publish", "discharger", "the Object Name under which to publish this service")
+
+ aclFile = flag.String("discharger-acl", "", "ACL to use for the discharge service")
+ publish = flag.String("publish", "discharger", "the Object Name under which to publish this service")
storeName = flag.String("revocation-store", "", "Object Name of the Veyron store to be used for revocation. Omit to disable revocation functionality.")
publishRevoker = flag.String("publish-revoker", "revoker", "the Object Name under which to publish this service")
diff --git a/services/store/stored/main.go b/services/store/stored/main.go
index 5104a64..75e250c 100644
--- a/services/store/stored/main.go
+++ b/services/store/stored/main.go
@@ -31,10 +31,14 @@
var (
mountName string
- dbName = flag.String("db", "/var/tmp/veyron_store.db", "Metadata database")
- // TODO(rthellend): Remove the address flag when the config manager is
- // working.
- address = flag.String("address", ":0", "Address to listen on")
+
+ // TODO(rthellend): Remove the protocol and address flags when the config
+ // manager is working.
+ protocol = flag.String("protocol", "tcp", "protocol to listen on")
+ address = flag.String("address", ":0", "address to listen on")
+
+ dbName = flag.String("db", "/var/tmp/veyron_store.db",
+ "Metadata database")
viewerPort = flag.Int("viewerPort", 5000,
"IPV4 port to serve viewer from, or 0 to disable viewer")
)
@@ -76,7 +80,7 @@
// Register the services.
storeDisp := server.NewStoreDispatcher(storeService, auth)
// Create an endpoint and start listening.
- ep, err := s.Listen("tcp", *address)
+ ep, err := s.Listen(*protocol, *address)
if err != nil {
log.Fatal("s.Listen() failed: ", err)
}
diff --git a/tools/application/impl/impl_test.go b/tools/application/impl/impl_test.go
index ddfebdf..94e80be 100644
--- a/tools/application/impl/impl_test.go
+++ b/tools/application/impl/impl_test.go
@@ -80,7 +80,7 @@
t.Errorf("NewServer failed: %v", err)
return nil, nil, err
}
- endpoint, err := server.Listen("tcp", "localhost:0")
+ endpoint, err := server.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Errorf("Listen failed: %v", err)
return nil, nil, err
diff --git a/tools/binary/impl/impl_test.go b/tools/binary/impl/impl_test.go
index f31ceb8..126ce11 100644
--- a/tools/binary/impl/impl_test.go
+++ b/tools/binary/impl/impl_test.go
@@ -89,7 +89,7 @@
t.Errorf("NewServer failed: %v", err)
return nil, nil, err
}
- endpoint, err := server.Listen("tcp", "localhost:0")
+ endpoint, err := server.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Errorf("Listen failed: %v", err)
return nil, nil, err
diff --git a/tools/build/impl/impl_test.go b/tools/build/impl/impl_test.go
index 32a987f..c4bdba1 100644
--- a/tools/build/impl/impl_test.go
+++ b/tools/build/impl/impl_test.go
@@ -34,7 +34,7 @@
if err != nil {
t.Fatalf("NewServer failed: %v", err)
}
- protocol, address := "tcp", "localhost:0"
+ protocol, address := "tcp", "127.0.0.1:0"
endpoint, err := server.Listen(protocol, address)
if err != nil {
t.Fatalf("Listen(%v, %v) failed: %v", protocol, address, err)
diff --git a/tools/identity/googleoauth.go b/tools/identity/googleoauth.go
index 1aedd1f..92421a2 100644
--- a/tools/identity/googleoauth.go
+++ b/tools/identity/googleoauth.go
@@ -20,9 +20,11 @@
// 1. Generate a state token to be included in the HTTP request
// (though, arguably, the random port assignment for the HTTP server is
// enough for XSRF protecetion)
- // 2. Setup an HTTP server which will intercept redirect links from the OAuth flow.
+ // 2. Setup an HTTP server which will intercept redirect links from the OAuth
+ // flow.
// 3. Print out the link for the user to click
- // 4. Return the authorization code obtained from the redirect to the "result" channel.
+ // 4. Return the authorization code obtained from the redirect to the "result"
+ // channel.
var stateBuf [32]byte
if _, err := rand.Read(stateBuf[:]); err != nil {
return nil, fmt.Errorf("failed to generate state token for OAuth: %v", err)
diff --git a/tools/mounttable/impl/impl_test.go b/tools/mounttable/impl/impl_test.go
index 33c9b76..8ec26e6 100644
--- a/tools/mounttable/impl/impl_test.go
+++ b/tools/mounttable/impl/impl_test.go
@@ -60,7 +60,7 @@
t.Errorf("NewServer failed: %v", err)
return nil, nil, err
}
- endpoint, err := server.Listen("tcp", "localhost:0")
+ endpoint, err := server.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Errorf("Listen failed: %v", err)
return nil, nil, err
diff --git a/tools/profile/impl/impl_test.go b/tools/profile/impl/impl_test.go
index 45ccf14..3e600bf 100644
--- a/tools/profile/impl/impl_test.go
+++ b/tools/profile/impl/impl_test.go
@@ -91,7 +91,7 @@
t.Errorf("NewServer failed: %v", err)
return nil, nil, err
}
- endpoint, err := server.Listen("tcp", "localhost:0")
+ endpoint, err := server.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Errorf("Listen failed: %v", err)
return nil, nil, err
diff --git a/tools/proximity/impl/impl_test.go b/tools/proximity/impl/impl_test.go
index 460cd83..7286470 100644
--- a/tools/proximity/impl/impl_test.go
+++ b/tools/proximity/impl/impl_test.go
@@ -53,7 +53,7 @@
t.Errorf("NewServer failed: %v", err)
return nil, nil, err
}
- endpoint, err := server.Listen("tcp", "localhost:0")
+ endpoint, err := server.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Errorf("Listen failed: %v", err)
return nil, nil, err
diff --git a/tools/vrpc/impl/impl_test.go b/tools/vrpc/impl/impl_test.go
index ac5c4c0..54e06f4 100644
--- a/tools/vrpc/impl/impl_test.go
+++ b/tools/vrpc/impl/impl_test.go
@@ -133,7 +133,7 @@
return nil, nil, err
}
- endpoint, err := server.Listen("tcp", "localhost:0")
+ endpoint, err := server.Listen("tcp", "127.0.0.1:0")
if err != nil {
t.Errorf("Listen failed: %v", err)
return nil, nil, err