Serve multiple listeners
Serve one Synnax Core on several addresses, each with its own TLS certificate.
A Synnax Core can serve several addresses, called listeners. Each listener has its own address and its own certificate, and each serves the full API. For example, Drivers can reach the Core at a company address with a certificate from your organization, while operators reach it at a Tailscale address with a certificate from Tailscale.
Listeners work only in a
configuration file. For one
address, use --listen and Set up TLS.
Configure listeners
-
Copy the certificate and key from your organization into the certificates folder as
node.crtandnode.key. The certificate must covercore01.example.com. The Core loadsnode.crtandnode.keyat start, whatever certificates the listeners use:sudo mkdir -p /usr/local/synnax/certs sudo cp core01.crt /usr/local/synnax/certs/node.crt sudo cp core01.key /usr/local/synnax/certs/node.key -
In the configuration file, set
listento a list of listeners. Afilelistener with no paths servesnode.crt:listen: - address: core01.example.com:9090 cert: source: file advertise: true - address: core01.example-tailnet.ts.net:9091 cert: source: tailscale name: console -
Start the Core with the file:
synnax start --config=/usr/local/synnax/config.yaml
Drivers connect to port 9090 with the certificate from your organization. Operators connect to port 9091 over Tailscale. For each field of a listener, see Multiple listeners.
Certificate sources
Set cert.source on each listener. Listeners can use different sources.
fileA PEM certificate and key from the
certandkeypaths. Without both paths, the listener serves the node certificate. When the files change, the listener uses the new files with no restart.autoA certificate signed by the Core CA for the listener address. Do not set
certorkey.tailscaleA
ts.netcertificate from the localtailscaled, renewed by Tailscale. Turn on HTTPS for the tailnet. If the Core does not run as root, runtailscale set --operator=<user>for its user. Do not setcertorkey.
The advertised listener
The embedded Driver connects to one address: the address of the advertised listener. Set
advertise: true on one listener. If no listener sets it, the first listener is
advertised.
The certificate of the advertised listener must cover its host, and must be signed by
the Core CA or be the node.crt of the Core.
The advertised listener cannot use tailscale, because a Tailscale certificate is not
signed by the Core CA. The exception is a Core that starts with --no-driver.
Start errors
The Core does not start when:
- Two listeners have the same address.
- More than one listener sets
advertise: true. - A
filelistener sets only one ofcertandkey, or anautoortailscalelistener sets either. - A
listenlist is used with--auto-cert,--node-cert, or--node-key. - The certificate of the advertised listener does not meet the rules above.
--insecure turns off TLS on every listener and ignores all certificate sources.