fix: add CODER_AGENT_TAILNET_LISTEN_PORT for specifying a static tailnet port (#6980)

Fixes #5175.
This commit is contained in:
Kyle Carberry
2023-04-03 11:20:19 -05:00
committed by GitHub
parent 4ee01dc95c
commit bc18f6c113
4 changed files with 35 additions and 17 deletions

View File

@ -59,6 +59,7 @@ type Options struct {
// If so, only DERPs can establish connections.
BlockEndpoints bool
Logger slog.Logger
ListenPort uint16
}
// NewConn constructs a new Wireguard server that will accept connections from the addresses provided.
@ -137,6 +138,7 @@ func NewConn(options *Options) (conn *Conn, err error) {
wireguardEngine, err := wgengine.NewUserspaceEngine(Logger(options.Logger.Named("wgengine")), wgengine.Config{
LinkMonitor: wireguardMonitor,
Dialer: dialer,
ListenPort: options.ListenPort,
})
if err != nil {
return nil, xerrors.Errorf("create wgengine: %w", err)