Skip to content

v2.22.0

Choose a tag to compare

@github-actions github-actions released this 19 Nov 15:42
· 51 commits to main since this release
e27b01b

Bind the server command to a specific address

The server command listened on every IPv4 interface, with no way to narrow it. --host now sets the IPv4 address it listens on, and the address applies to every --port (#528).

dewy server --registry ghr://owner/repo --host 127.0.0.1 --port 8000 -- /opt/app/current/app
  • --host requires --port. Only an IPv4 unicast address is accepted: a hostname such as localhost, an IPv6 address, and a multicast or broadcast address are rejected at startup. The assets and container commands reject the option.
  • 0.0.0.0 behaves the same as omitting the option, which is the default and listens on all IPv4 interfaces.
  • The --health-path check is sent to the given address, since a server bound to a specific interface does not accept connections on 127.0.0.1. With 0.0.0.0 or no --host, it is still sent to 127.0.0.1. The check no longer goes through HTTP_PROXY or HTTPS_PROXY, so a proxy set for reaching a registry cannot answer it in place of the application.
  • With an address other than 0.0.0.0, the SERVER_STARTER_PORT environment variable passed to the application lists each socket as host:port=fd instead of port=fd. An application that parses the variable itself must accept this form.

Nothing changes when --host is not set.

Documentation

  • The multi-port and signal handling samples serve on the sockets passed by server-starter (#529). The Go samples bound their ports with ListenAndServe, and the multi-port sample read the file descriptor in SERVER_STARTER_PORT as the port number. Under the server command, server-starter already holds the ports, so the samples left the configured ports unanswered, and binding the correct port fails with "address already in use" on Linux. The samples now turn each descriptor into a net.Listener with os.NewFile and net.FileListener and serve on it, which also keeps the ports open across a graceful restart.

Internal

  • Applied go fix modernizations (#530).
  • The end-to-end tests cover blue/green slots with the server command (#526), and the e2e docs describe the current test structure (#525).
  • Bumped go.opentelemetry.io/otel/sdk from 1.46.0 to 1.47.0 (#527).