Перейти к содержимому

rchat-server command line

Это содержимое пока не доступно на вашем языке.

rchat-server [OPTIONS]
FlagEnvironment variableDefaultMeaning
-c, --config <PATH>none/etc/rchat/server.tomlConfig file. A missing or unreadable file is a startup error.
-b, --bind <ADDR>RCHAT_BIND_ADDRfrom bind_addrListen address, overriding the config file, e.g. 0.0.0.0:443 or 127.0.0.1:8443.
-l, --log-level <LEVEL>RCHAT_LOG_LEVELinfoLog verbosity: error, warn, info, debug or trace. Also accepts tracing filter directives such as rchat_server=debug.
--init-relay-identitynoneCreate the relay identity key at relay_identity_path, print its pin, then exit. Refuses to overwrite an existing key. Run once, as the service user.
--print-relay-pinnonePrint the relay’s pin (rk:1:…) and version, then exit.
--print-invitenonePrint the relay invite (an rchat://relay link with the relay’s URL and pin) and draw it as a QR code, then exit. The host comes from [server.decoy] host, else the first [server.acme] domain; with neither it refuses. Run as the service user. The invite holds the secret WebSocket path: it is printed only here, never logged. See Inviting people to your relay.
--public-port <PORT>nonefrom [server] public_port; unset: 443 when proxy_protocol = true, else the port of bind_addrWith --print-invite: the port clients dial (NAT, rdr, a jail), 1–65535. 443 is left out of the invite.
--rotate-relay-identitynoneCreate a new identity key at version + 1, write a handover signed by the old key, delete the old key, print the new pin, then exit. Stop the relay first and start it afterwards. The built-in decoy page changes with the key.
--render-decoy <DIR>noneWrite this relay’s static decoy website into DIR (empty, missing, or rendered this way before), then exit. Needs --config and must run as the service user: the site is seeded from the relay’s secret identity key and its host name (--host, else [server.decoy] host, else the first [server.acme] domain, else none), so it is the site the relay serves itself, and it refuses without the key. Rotating the identity changes it. Point [server.decoy] root at DIR. The decoy answers Range like nginx 1.24: several ranges get a 206 multipart/byteranges, bytes=abc and bytes=5-3 get a 416, and a 206 sends no Accept-Ranges. See Configuration guide.
--host <HOSTNAME>nonefrom [server.decoy] host, else the first [server.acme] domain, else noneWith --render-decoy: the relay’s public host name.
--no-tlsnoneoffDevelopment only. Serve plaintext WebSocket with no TLS, ignoring [server.tls] and [server.acme]. Requires [server] dev_origin. Refuses to start on a non-loopback address.
--insecure-public-plaintextnoneoffWith --no-tls, allow a non-loopback address. Anyone on the network can then read and tamper with all traffic. Requires --no-tls.
-h, --helpnonePrint help.
Terminal window
# Production: TLS from the config file
rchat-server --config /etc/rchat/server.toml
# Once, before the first start, as the service user
sudo -u rchat /usr/local/bin/rchat-server --config /etc/rchat/server.toml --init-relay-identity
# The pin to give your users
sudo -u rchat /usr/local/bin/rchat-server --config /etc/rchat/server.toml --print-relay-pin
# Behind a TCP front end on the same host (the relay still terminates TLS)
rchat-server --config /etc/rchat/server.toml --bind 127.0.0.1:8443
# Local development: plaintext on loopback; dev.toml sets dev_origin
rchat-server --config dev.toml --no-tls
  1. Parse flags and read the config file.
  2. Find the relay identity key. With --init-relay-identity, --print-relay-pin or --rotate-relay-identity, do that and exit. Otherwise load the key; a relay run from a config file refuses to start without it.
  3. Decide the TLS mode and validate every setting. Any error stops the server before it binds.
  4. Prepare TLS: load the static certificate, or prepare the ACME cache and start the ACME client.
  5. Bind and serve, and start the metrics endpoint if [metrics] enabled = true.
SignalEffect
SIGHUP (systemctl reload)Static certificate: re-read cert_path and key_path without dropping connections, keeping the old certificate if the new one fails. ACME or --no-tls: nothing to reload. The config file is not re-read.
SIGTERM (systemctl stop)Stop the server. With encrypted queue persistence on, the queue is saved first.