Editing the config
Everything Nyquist knows lives in one file, nyquist.toml: settings, streams, templates and users. Nyquist looks for it in the folder you start it from, or wherever -c points:
nyquist run -c /etc/nyquist/nyquist.tomlEvery setting is optional. Leave one out and Nyquist uses its default, so an empty file works just fine. The config reference lists every setting with its default.
Whoever saves the file, the panel, the API or you in your editor, your own comments and layout stay right where they were.
Three ways to change things
Section titled “Three ways to change things”From the panel
Section titled “From the panel”The Settings page lists every setting with what’s in effect, its default and a short explanation. Change what you need and save, Nyquist checks your changes first and writes only the lines you changed. Resetting a setting takes it out of the file, so the default applies again.
The Config page is a real editor for the whole file, with highlighting, line numbers, search and checks while you type. Saving shows you a diff first.
Both apply what you saved right away, just like a reload.
By hand
Section titled “By hand”Open nyquist.toml in any editor. Settings go in sections like these:
[log]level = "debug"
[viewers]tracking = "address"idle_timeout = "45s"Then reload so Nyquist picks it up.
Over the API
Section titled “Over the API”Change a few settings at a time with PATCH /api/v1/settings, or read, check and save the whole file with /api/v1/config. The API has examples of both.
Reload after editing by hand
Section titled “Reload after editing by hand”Nyquist doesn’t watch the file, you tell it when you’re done:
- Send it a
SIGHUP, likekill -HUP $(pidof nyquist). - Hit Reload config file on the Server page of the panel.
- Call
POST /api/v1/reload.
A broken file gets rejected and the running settings stay put, so a typo can’t take your server down. Check the log for what went wrong, or run nyquist check first.
Check before you go live
Section titled “Check before you go live”nyquist check reads a file and tells you whether Nyquist would take it, without starting anything:
nyquist check -c nyquist.tomlA good file gets a thumbs up:
Looks good! 2 streams and 1 template in nyquist.tomlA file with problems gets every one of them, with the line and a marker under the spot:
Oops, line 2, column 1: [log] level needs to be one of off, error, warn, info, debug, trace |2 | level = "loud" | ^^^^^^^^^^^^^^It exits with a non-zero code when something’s wrong, so it fits right into a deploy script.
Right away or after a restart
Section titled “Right away or after a restart”Most settings kick in the moment you save or reload, and so do streams, templates and users. The ones that shape listeners and the media pipeline, like ports, SRT, segment lengths and the MPEG-TS layout, wait for a restart. The config reference lists them section by section, and says it for every single setting too.
When something waits for a restart, the panel shows a banner naming the sections until you restart, and GET /api/v1/server lists them in restart_sections.
Nobody overwrites anybody
Section titled “Nobody overwrites anybody”Every version of the file has a version string, a hash of its contents. Saving from the panel or the API sends back the version it started from, and if the file changed in the meantime, from the panel, the API or by hand, the save gets turned away and nothing gets overwritten. Grab the file again, redo your changes and save.
Changes worth a second look
Section titled “Changes worth a second look”Some changes are fine but deserve a second look, so the panel and the API warn you about them before you save:
- Moving the listeners, or turning RTMP or SRT off.
- Turning the panel off.
- Removing yourself, or losing your admin role.
- Changing your own password, which logs you out.
- Renaming the session cookie, which logs everyone out.
- Shortening
session_max, which ends older logins.
A file that leaves nobody as admin is refused, since nobody could change anything after that. Saving or reloading a file also logs out every user whose password changed or who’s gone.
Writing values
Section titled “Writing values”- Durations are strings like
"500ms","30s","10m","12h"or"7d", and you can mix units, like"1h 30m". - PIDs can be written in hex, like
0x100. - Addresses are lists of
"address:port"strings, like["0.0.0.0:8080"]. An empty list turns that listener off. - Headers in
[http]take an empty string to leave the header out.
nyquist check explains anything it doesn’t like.