[ARVADOS] created: 2.1.0-216-gcc38121ea
Git user
git at public.arvados.org
Mon Dec 14 20:48:49 UTC 2020
at cc38121ea934d9601c41cae19ccff03f34573837 (commit)
commit cc38121ea934d9601c41cae19ccff03f34573837
Author: Tom Clegg <tom at curii.com>
Date: Mon Dec 14 15:47:46 2020 -0500
17212: Listen on 127.0.0.xx instead of 0.0.0.0, minimize conflicts.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/boot/nginx.go b/lib/boot/nginx.go
index 0f105d6b6..4d581d1d5 100644
--- a/lib/boot/nginx.go
+++ b/lib/boot/nginx.go
@@ -51,12 +51,12 @@ func (runNginx) Run(ctx context.Context, fail func(error), super *Supervisor) er
{"WORKBENCH1", super.cluster.Services.Workbench1},
{"WS", super.cluster.Services.Websocket},
} {
- port, err := internalPort(cmpt.svc)
+ host, port, err := internalPort(cmpt.svc)
if err != nil {
return fmt.Errorf("%s internal port: %s (%v)", cmpt.varname, err, cmpt.svc)
}
- if ok, err := addrIsLocal(net.JoinHostPort(super.ListenHost, port)); !ok || err != nil {
- return fmt.Errorf("urlIsLocal() failed for host %q port %q: %v", super.ListenHost, port, err)
+ if ok, err := addrIsLocal(net.JoinHostPort(host, port)); !ok || err != nil {
+ return fmt.Errorf("urlIsLocal() failed for host %q port %q: %v", host, port, err)
}
vars[cmpt.varname+"PORT"] = port
diff --git a/lib/boot/passenger.go b/lib/boot/passenger.go
index 6a2c4b61f..0b77d2f38 100644
--- a/lib/boot/passenger.go
+++ b/lib/boot/passenger.go
@@ -97,7 +97,7 @@ func (runner runPassenger) Run(ctx context.Context, fail func(error), super *Sup
if err != nil {
return err
}
- port, err := internalPort(runner.svc)
+ host, port, err := internalPort(runner.svc)
if err != nil {
return fmt.Errorf("bug: no internalPort for %q: %v (%#v)", runner, err, runner.svc)
}
@@ -118,7 +118,10 @@ func (runner runPassenger) Run(ctx context.Context, fail func(error), super *Sup
defer super.waitShutdown.Done()
err = super.RunProgram(ctx, runner.src, nil, railsEnv, "bundle", "exec",
"passenger", "start",
- "-p", port,
+ "--address", host,
+ "--port", port,
+ "--disable-anonymous-telemetry",
+ "--disable-security-update-check",
"--log-file", "/dev/stderr",
"--log-level", loglevel,
"--no-friendly-error-pages",
diff --git a/lib/boot/supervisor.go b/lib/boot/supervisor.go
index 1e8e83ff3..a06ddf0da 100644
--- a/lib/boot/supervisor.go
+++ b/lib/boot/supervisor.go
@@ -693,22 +693,22 @@ func randomHexString(chars int) string {
return fmt.Sprintf("%x", b)
}
-func internalPort(svc arvados.Service) (string, error) {
+func internalPort(svc arvados.Service) (host, port string, err error) {
if len(svc.InternalURLs) > 1 {
- return "", errors.New("internalPort() doesn't work with multiple InternalURLs")
+ return "", "", errors.New("internalPort() doesn't work with multiple InternalURLs")
}
for u := range svc.InternalURLs {
- if _, p, err := net.SplitHostPort(u.Host); err != nil {
- return "", err
+ if h, p, err := net.SplitHostPort(u.Host); err != nil {
+ return "", "", err
} else if p != "" {
- return p, nil
+ return h, p, nil
} else if u.Scheme == "https" {
- return "443", nil
+ return h, "443", nil
} else {
- return "80", nil
+ return h, "80", nil
}
}
- return "", fmt.Errorf("service has no InternalURLs")
+ return "", "", fmt.Errorf("service has no InternalURLs")
}
func externalPort(svc arvados.Service) (string, error) {
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list