import { Def, Opt } from '@site/src/components/Anchor'; import { ConfigurationTab } from '@site/src/components/Configuration'; import configOptions from './help.json';
Configuration
Neko uses the Viper library to manage configuration. The configuration file is optional and is not required for Neko to run. If a configuration file is present, it will be read in and merged with the default configuration values.
The merge order is as follows:
Default configuration values
Configuration file
Environment variables
Command-line arguments
Example merging order
The final value of server.bind
will be 127.0.0.1:8083
.
Configuration File {#file}
You have multiple ways to specify the configuration file for the neko server:
Command-line argument:
-config=/path/to/config.yaml
Environment variable:
NEKO_CONFIG=/path/to/config.yaml
Place the
neko.yaml
file in the same directory as the neko binary.Place the
neko.yaml
file to/etc/neko/neko.yaml
(ideal for Docker containers).
The configuration file can be specified in YAML, JSON, TOML, HCL, envfile, and Java properties format. Throughout the documentation, we will use the YAML format.
Example configuration files
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
Room Configuration {#session}
This is the initial configuration of the room that can be modified by an admin in real-time.
<ConfigurationTab options={configOptions} filter={[ 'session.private_mode', 'session.locked_logins', 'session.locked_controls', 'session.control_protection', 'session.implicit_hosting', 'session.inactive_cursors', 'session.merciful_reconnect', 'session.heartbeat_interval', ]} comments={false} />
whether private mode is enabled, users do not receive the room video or audio.
whether logins are locked for users, admins can still login.
whether controls are locked for users, admins can still control.
users can gain control only if at least one admin is in the room.
automatically grants control to a user when they click on the screen, unless an admin has locked the controls.
whether to show inactive cursors server-wide (only for users that have it enabled in their profile).
whether to allow reconnecting to the websocket even if the previous connection was not closed. This means that a new login can kick out the previous one.
interval in seconds for sending a heartbeat message to the server. This is used to keep the connection alive and to detect when the connection is lost.
Server Configuration {#server}
This is the configuration of the neko server.
<ConfigurationTab options={configOptions} filter={[ 'server.bind', 'server.cert', 'server.key', 'server.cors', 'server.metrics', 'server.path_prefix', 'server.pprof', 'server.proxy', 'server.static', ]} comments={false} />
address/port/socket to serve neko. For docker you might want to bind to
0.0.0.0
to allow connections from outside the container.and paths to the SSL cert and key used to secure the neko server. If both are empty, the server will run in plain HTTP.
is a list of allowed origins for CORS.
If empty, CORS is disabled, and only same-origin requests are allowed.
If
*
is present, all origins are allowed. Neko will respond always with the requested origin, not with*
since credentials are not allowed with wildcard.If a list of origins is present, only those origins are allowed for CORS.
when true, prometheus metrics are available at
/metrics
.is the prefix for all HTTP requests. This is useful when running neko behind a reverse proxy and you want to serve neko under a subpath, e.g.
/neko
.when true, the pprof endpoint is available at
/debug/pprof
for debugging and profiling. This should be disabled in production.when true, neko will trust the
X-Forwarded-For
andX-Real-IP
headers from the reverse proxy. Make sure your reverse proxy is configured to set these headers and never trust them when not behind a reverse proxy. See Reverse Proxy Setup for more information.path to the directory containing the neko client files to serve. This is useful if you want to serve the client files on the same domain as the server.
Logging Configuration {#log}
This is the configuration of the logging system.
<ConfigurationTab options={configOptions} filter={[ 'log.dir', 'log.json', 'log.level', 'log.nocolor', 'log.time', ]} comments={false} />
directory to store logs. If empty, logs are written to stdout. This is useful when running neko in a container.
when true, logs are written in JSON format.
log level to set. Available levels are
trace
,debug
,info
,warn
,error
,fatal
,panic
, anddisabled
.when true, ANSI colors are disabled in non-JSON output. Accepts as well
NO_COLOR
environment variable.time format used in logs. Available formats are
unix
,unixms
, andunixmicro
.
:::tip Shortcut environment variable to enable DEBUG mode: NEKO_DEBUG=true
:::
Full Configuration Reference {#full}
Here is a full configuration with default values as shown in the help command. Please refer to the sub-sections for more details.
Next Steps {#next}
import DocCardList from '@theme/DocCardList';