Sharkord

Configuration

Configure Sharkord with config.ini and environment variables.

config.ini lives in the data directory. It covers the process: ports, limits, proxies. Everything else is in the server settings UI. Restart after editing.

Rewritten on every start

Sharkord merges the file with its defaults and writes it back, so new options show up after updates. Comments and unknown keys are dropped. A file that fails validation is replaced with the defaults.

[server]
host=
port=4991
debug=false
autoupdate=false
backupDatabase=true
maxRequestBodyBytes=262144
rateLimitersEnabled=true
allowedOrigins[]=*
trustedProxies[]=127.0.0.1
trustedProxies[]=::1
trustedProxies[]=10.0.0.0/8
trustedProxies[]=172.16.0.0/12
trustedProxies[]=192.168.0.0/16
trustedProxies[]=fc00::/7

[oidc]
enabled=false
issuer=
clientId=
clientSecret=
redirectUri=
disableLocalLogin=false

[webRtc]
port=40000
announcedAddress=
announcedAddressV6=
internalAnnouncedAddress=
maxBitrate=30000000

Lists repeat the key with [], one line per entry.

Server

FieldDefaultDescription
hostemptyAddress to listen on. Empty means all interfaces. Leave it empty in Docker.
port4991Port for HTTP and WebSocket traffic.
debugfalseVerbose debug logging.
autoupdatefalseCheck for new releases every hour and install them. Ignored in Docker. See Updating.
backupDatabasetrueSnapshot the database before applying migrations. See Database Migrations.
maxRequestBodyBytes262144Max HTTP request body, in bytes. Uploads are not affected.
rateLimitersEnabledtrueTurns every rate limit on or off. The limits themselves are set in the server settings, see Rate Limits.
allowedOrigins*Origins allowed to call the server from a browser. * allows any.
trustedProxiesloopback and private rangesAddresses or CIDR ranges whose forwarded headers are believed. See Behind a Proxy.

Single Sign-On

The [oidc] section. See Single Sign-On.

WebRTC

FieldDefaultDescription
port40000Media port, UDP and TCP. Open both.
announcedAddressemptyPublic IPv4 address or domain clients send media to. Set it behind NAT or Docker.
announcedAddressV6emptyPublic IPv6 address or domain. Turns on IPv6 voice next to IPv4. See below.
internalAnnouncedAddressemptyLAN IP or domain sent to clients next to announcedAddress. See below.
maxBitrate30000000Maximum bitrate per connection, in bits per second.

When announcedAddress is empty, the server looks up its public IP at startup (icanhazip, ipify or ifconfig.me). Setting it skips the lookup. A domain (a DDNS record, say) is resolved to its IPv4 address once at startup, so restart the server when that address changes. If it does not resolve, or you put an IPv6 address here, the server falls back to the lookup and warns in the log.

If the server and its clients are on the same machine or LAN, set it to 127.0.0.1 (same machine) or the server's LAN IP (other devices on the network). Most routers do not loop the public IP back to your own network, so voice fails to connect otherwise.

If both LAN and remote users need to connect, keep announcedAddress on the public address and set internalAnnouncedAddress to the server's LAN IP. Every client gets both, and the browser uses whichever one it can reach. A domain works too: it is resolved by the server, so with split DNS the server's own resolver has to return the LAN IP for it. In Docker, use the host's LAN IP, not the container's. Remote clients receive the LAN IP as well, so leave it empty if you do not need it.

Voice is IPv4 only unless announcedAddressV6 is set. Set it to the server's public IPv6 address, or a domain with an AAAA record, and the server also listens on IPv6 on the same port. Clients get both addresses and use whichever works, so IPv6 only clients can connect too. Open the port for IPv6 in the firewall as well. If the value is not an IPv6 address or the domain has no AAAA record, IPv6 stays off and the log says why.

Rate Limits

Rate limits are set in Server Settings → Rate Limits, by anyone with the Manage Settings permission. Changes apply without a restart.

Every action has the global limit, 120 requests per minute by default, counted separately per action: per user when logged in, per IP before that. A few actions have their own limit, either because a low one protects a secret (login, server password, owner token) or because normal use needs more room (typing, push to talk, voice streams).

The same tab has a switch to turn every limit off. rateLimitersEnabled=false here (or SHARKORD_RATE_LIMITERS_ENABLED=false) turns them off regardless of that switch, which is the way back in if a limit set too low locks you out. The tab then shows the limits as disabled.

Environment Variables

Env variables win over config.ini. Empty values are ignored.

VariableOverrides
SHARKORD_HOSTserver.host
SHARKORD_PORTserver.port
SHARKORD_DEBUGserver.debug
SHARKORD_AUTOUPDATEserver.autoupdate
SHARKORD_BACKUP_DATABASEserver.backupDatabase
SHARKORD_MAX_REQUEST_BODY_BYTESserver.maxRequestBodyBytes
SHARKORD_RATE_LIMITERS_ENABLEDserver.rateLimitersEnabled
SHARKORD_ALLOWED_ORIGINSserver.allowedOrigins
SHARKORD_TRUSTED_PROXIESserver.trustedProxies
SHARKORD_OIDC_ENABLEDoidc.enabled
SHARKORD_OIDC_ISSUERoidc.issuer
SHARKORD_OIDC_CLIENT_IDoidc.clientId
SHARKORD_OIDC_CLIENT_SECREToidc.clientSecret
SHARKORD_OIDC_REDIRECT_URIoidc.redirectUri
SHARKORD_OIDC_DISABLE_LOCAL_LOGINoidc.disableLocalLogin
SHARKORD_WEBRTC_PORTwebRtc.port
SHARKORD_WEBRTC_ANNOUNCED_ADDRESSwebRtc.announcedAddress
SHARKORD_WEBRTC_ANNOUNCED_ADDRESS_V6webRtc.announcedAddressV6
SHARKORD_WEBRTC_INTERNAL_ANNOUNCED_ADDRESSwebRtc.internalAnnouncedAddress
SHARKORD_WEBRTC_MAX_BITRATEwebRtc.maxBitrate

Lists are comma separated: SHARKORD_TRUSTED_PROXIES="127.0.0.1,::1".

SHARKORD_DATA_PATH moves the whole data directory.

On this page