Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
You have to provide the location of the config file by setting the environment variable CORE_CONFIGFILE
to path to the config file. Example:
The config file is written in JSON format.
If the config file doesn't exist yet, it will be created and its fields will be filled with their default values.
If the config file is partially complete or of an older version, it will be upgraded and the missing fields will be filled with their default values.
If you don't provide the CORE_CONFIGFILE
environment variable, the default config values will be used and the configuration will not be persisted to the disk.
As of version 16.12.0:
If no path is given in the environment variable CORE_CONFIGFILE, different standard locations will be probed:
os.UserConfigDir() + /datarhei-core/config.js
os.UserHomeDir() + /.config/datarhei-core/config.js
./config/config.js
If the config.js doesn't exist in any of these locations, it will be assumed at ./config/config.js
A minimal valid config file must contain at least the config version:
Configuration values can be changed by either editing the config file directly, or via the JSON API (API for short) or via environment variables (ENV for short). All environment variables have the prefix CORE_
followed by the JSON names in uppercase. Example:
Following, every field of the configuration file will be described in detail:
ID of the Core. If not set, a UUIDv4 will be generated. Default: unset
Human-readable name of the Core. If not set a custom name will be generated. Default: unset
HTTP listening address.
Default: :8080
The default :8080
will listen on all interfaces on port 8080. To use a specific interface, write additionally it's IP, e.g. 127.0.0.1:8080
to only listen on the loopback interface.
Log settings.
Database (processes, metadata, ...) endpoint.
Configuration to detect or set the host-/domainname.
API Security options.
TLS/HTTPS settings (also required for RTMPS).
General configuration, DiskFS, MemFS, and S3.
RTMP server for publishing and playing streams.
SRT server for publishing and playing streams.
General FFmpeg settings.
HLS-/MPEG-DASH session management and bandwidth limitations.
General metrics settings.
HTTP/S route configuration (e.g., to inject UI's).
Core / Golang debugging options.
All about datarhei Update-Checks and data tracking.
CORE_UPDATE_CHECK=true
CORE_SERVICE_URL=https://service.datarhei.com
Check for updates and send anonymized data (default: false).
Requires service.url
.
IP addresses are anonymized and stored for 30 days on servers in the EU.
URL for the update_check
Service API.
Default: https://service.datarhei.com
About anonymizied data:
We receive: id, os architecture, uptime, process stats (total: running, failed, killed), viewer count
The data is used exclusively for the further development of the products and error detection. Domains/IP addresses, companies, and persons remain anonymous.
Enable TLS / HTTPS support
These settings are for configuring the TLS / HTTPS support for datarhei Core.
If TLS is enabled, the HTTPS server will listen on this address. The default address is :8181
.
The default :8181
will listen on all interfaces on port 8181. To use a specific interface, write additionally it's IP, e.g. 127.0.0.1:8181
to only listen on the loopback interface.
Set this value to true
in order to enable TLS / HTTPS support. If enabled you have to either provide your own certificate (see cert_file and key_file) or enable automatic certificate from Let's Encrypt (see auto).
If TLS is enabled, a HTTP server listening on address will be additionally started. This server provides access to everything as the HTTPS server, additionally it will allow ACME http-1 challenges in case Let's Encrypt (auto) certificates are enabled.
By default this is set to false
.
Enable automatic certificate generation from Let's Encrypt. This only works if enable
is set to true
and at least one public hostname is defined in host.name. All listed hostnames will be included in the certificate. All listed public hostnames is required to point to the host where datarhei Core is running on.
In order for Let's Encrypt to resolve the http-1 challenge, the HTTP server of the datarhei Core must be reachable on port 80. Either by setting address to :80
or by forwarding/mapping port 80 to the actual port the HTTP server is listening on.
The obtained certificates will be stored in the /cert
subdirectory of db.dir to be available after a restart.
Any provided paths in cert_file
and key_file
will be ignored.
By default this is set to false
.
An email address that is required for Let's Encrypt in order to receive a certificate.
By default the email address cert@datarhei.com
is used.
If you bring your own certificate, provide the path to the certificate file in PEM format.
By default this is not set.
If you bring your own certificate, provide the path to the key file in PEM format
By default this is not set.
If you want to use automatic certificates from Let's Encrypt, set tls.enable and tls.auto to true
. and host.name has to be set to the domain name this host will be reachable. Otherwise the ACME http-1 challenge will not work.
To create a self-signed certificate and key file pair, run this command and provide a reasonable value for the Common Name (CN). The CN is the fully qualified name of the host the instance is running on (e.g., localhost
). You can also use an IP address or a wildcard name, e.g., *.example.com
.
RSA SSL certificate
ECDSA SSL certificate
Call openssl ecparam -list_curves
to see all available supported curves listed.
Settings for the host datarhei Core is running on.
A list of public host/domain names or IPs this host is reacheable under. For the ENV use a comma separated list of public host/domain names or IPs.
The default is an empty list.
Enable detection of public IP addresses in case the list of names is empty.
By default this is set to true
.
Logging settings for the datarhei Core.
The verbosity of the logging. The datarhei Core is writing the logs to stderr
. Possible values are:
silent
No logging at all.
error
Only errors will be logged.
warn
Warnings and errors will be logged.
info
General information, warnings, and errors will be logged.
debug
Debug messages and every thing else will be logged. This is very chatty.
The default logging level is info
.
Logging topics allow you to restrict what type of messages will be logged. This is practical if you enable debug logging and want to see only the logs you're interested in. An empty list of topics means that all topics will be logged.
An non-exhaustive list of logging topics:
cleanup
config
core
diskfs
http
httpcache
https
let's encrypt
memfs
process
processstore
rtmp
rtmp/s
rtmps
update
service
session
sessionstore
srt
By default all topics are logged.
The log is also kept in memory for retrieval via the API. This value defines how many lines shoul dbe kept in memory.
The default is 1000 lines.
These are the settings for securing the API from unwanted access.
Set this value to true
in order to allow only ready access to the API. All API endpoints for writing will not be mounted.
By default this value is set to false
.
A list of IPs that are allowed to access the API via HTTP. Each entry has to be an IP range in CIDR notation, e.g. ["127.0.0.1/32","::1/128"]
. Provide the list as comma-separated values for the environment variable, e.g. 127.0.0.1/32,::1/128
. If the list is empty, then all IPs are allowed. If the list contains any invalid IP range, the server will refuse to start.
By default the list is empty.
A list of IPs that are not allowed to access the API via HTTP. Each entry has to be an IP range in CIDR notation. Provide the list as comma-separated values for the environment variable. If the list is empty, then no IPs will be blocked. If the list contains any invalid IP range, the server will refuse to start.
By default the list is empty.
A list of IPs that are allowed to access the API via HTTPS. Each entry has to be an IP range in CIDR notation. Provide the list as comma-separated values for the environment variable. If the list is empty, then all IPs are allowed. If the list contains any invalid IP range, the server will refuse to start.
By default the list is empty.
A list of IPs that are not allowed to access the API via HTTPS. Each entry has to be an IP range in CIDR notation. Provide the list as comma-separated values for the environment variable. If the list is empty, then no IPs will be blocked. If the list contains any invalid IP range, the server will refuse to start.
By default the list is empty.
Set this value to true
to enable JWT authentication for the API. If it is enabled, you have to provide a username and password. The username and password will be sent to the /api/login
endpoint in order to obtain an access and refresh JWT.
It is strongly recommended to enable authentication for the API in order to prevent access from unwanted parties.
By default this value is set to false
.
Set this value to true
in order to allow unprotected access from localhost.
Be default this value is set to false
.
The username for JWT authentication. If JWT authentication is enabled, a username must be defined.
By default this value is empty, i.e. no username defined.
The password for JWT authentication. If JWT authentication is enabled, a password must be defined.
By default this value is empty, i.e. no password defined.
A secret for signing the JWT. If you leave this value empty, a random secret will be generated for you.
By default this value is empty.
Set this value to true
in order to enable API auth0 protection. With this a valid Auth0 access JWT can be used instead of a username/password in order to obtain the access and refresh JWT. Additionally you have to provide a list of tenants and their users to validate the Auth0 access JWT against.
By default this value is set to false
.
A list of allowed tenants and their users. A tenant is a JSON object:
You can obtain the domain, audience, and clientid from your Auth0 account. You also have to provide a list of allowed users that are member of that tenant.
For providing the list of tenants and their users as an environement variable you have to provide a comma-separated list of base64 encoded tenant JSON objects.
As of version 16.12.0 there's a different syntax available for providing the tenants as environment variable. A list of comma separated URLs of this form:
By default this list is empty.
Settings for accessing the available storage types. The storages are accessible via HTTP, mounted to different paths.
Path to a file with the mime-type definitions. This is a file with the MIME types has one MIME type per line followed by a list of file extensions (including the "."). Files served from the storages will have the matching mime-type associated to it.
Example:
Relative paths are interpreted relative to where the datarhei Core binary is executed.
Default: ./mime.types
Define a list of allowed CORS origin for accessing the storages.
By default it contains the only element *
, allowing access from anywhere.
The disk storage is mounted at /
via the HTTP server.
The memory storage is mounted at /memfs
via the HTTP server.
The S3 storage is mounted at the configured path via the HTTP server.
S3 storage is available as of version 16.12.0
A simple SRT server for publishing and playing streams
The settings for the built-in SRT server. Check out our for more information.
Set this value to true
in order to enable the built-in SRT server.
By default the SRT server is disabled.
If the SRT server is enabled, it will listen on this address. The default address is :6000
.
The default :6000
will listen on all interfaces on port 6000. To use a specific interface, write additionally it's IP, e.g. 127.0.0.1:6000
to only listen on the loopback interface.
Define a passphrase in order to enable SRT encryption. If the passphrase is set it is required and applies to all connections.
By default the passphrase is not set (i.e. an empty string).
The token is an arbitrary string that needs to be comunicated in the streamid. Only with a valid token it is possible to publish or request streams. If the token is not set, anybody could publish and request streams.
By default the token is not set (i.e. an empty string).
Set this value to true in order to enable logging for the SRT server. This will log events on the SRT protocol level. You have to provide the topics you are interested in, otherwise nothing will be logged.
By default the logging is disabled.
Logging topics allow you to define what type of messages will be logged. This is practical if you want to debug a SRT connection. An empty list of topics means that no topics will be logged.
By default no topics are logged (i.e. an empty array).
The settings for the in-memory filesystem. This filesystem is accessible on /memfs
via HTTP. This filesystem can only be accessed via HTTP. Writing to and deleting from the filesystem can be restricted by HTTP basic auth.
Set this value to true
in order to enable basic auth for PUT
, POST
, and DELETE
operations on /memfs. Read access (GET
, HEAD
) is not restricted. If enabled, you have to define a username and a password.
It is highly recommended to enable basic auth for write operations on /memfs
.
By default this value is set to false
.
Username for Basic-Auth of /memfs. This has to be set if basic auth is enabled.
By default this value is not set, i.e. an empty string.
Password for Basic-Auth of /memfs. This has to be set if basic auth is enabled.
By default this value is not set, i.e. an empty string.
The maximum amount of data that is allowed to be stored in this filesystem. The value is interpreted as megabytes. A 507 Insufficient Storage
will be returned if you hit the limit. Use a value equal to or smaller than 0
to not set any limits. The limit will be the available memory.
By default no limit is set, i.e. a value of 0
.
Whether to automatically remove the oldest files if the filesystem is full.
By default this value is set to false
.
A simple RTMP server for publishing and playing streams
The settings for the built-in SRT server. Check out our for more information.
Set this value to true
in order to enable the built-in RTMP server.
By default the RTMP server is disabled.
Set this value to true
to enable the RTMPS server that will run in parallel with the RTMP server on a different port. You have to have set to true in order for enabling the RTMPS server because it will use the same certificate as for the HTTPS server.
By default TLS is disabled.
If the RTMP server is enabled, it will listen on this address. The default address is :1935
.
The default :1935
will listen on all interfaces on port 1935. To use a specific interface, write additionally it's IP, e.g. 127.0.0.1:1935
to only listen on the loopback interface.
If the RTMPS server is enabled, it will listen on this address. The default address is :1936
.
The default :1936
will listen on all interfaces on port 1936. To use a specific interface, write additionally it's IP, e.g. 127.0.0.1:1936
to only listen on the loopback interface.
Define the app a stream can be published on, e.g. /live
to require the path in an RTMP URLs to start with /live
.
The default app is /
.
To prevent anybody from publish or playing streams, define token to be a secret only known to the publishers and subscribers. The token has to be put in the query of the stream URL, e.g. /live/stream?token=abc123
.
As of version 16.12.0 the token can be appended to the path instead of a query parameter, e.g. /live/stream/abc123
. With this the token corresponds to a stream key.
By default the token is not set (i.e. an empty string).
Settings for the FFmpeg binary.
Path to the ffmpeg
binary. The system's %PATH will be searched for the ffmpeg binary. You can also provide an absolute or relative path to the binary.
By default this value is set to ffmpeg
.
The maximum number of simultaneously running ffmpeg
instances. Set this value to 0
in order to not impose any limit.
By default this value is set to 0
.
To control where FFmpeg can read from and where FFmpeg can write from, you can define patterns that matches the input addresses or the output addresses. These patterns are regular expressions that can be provided here. For the respective environment variables the expressions need to be space-separated, e.g. https?:// rtsp:// rtmp://
.
It will be rejected if the address is outside the storage.disk.dir
directory. Otherwise, the protocol file:
will be prepended. If you want to explicitely allow or block access to the filesystem, use file:
as pattern in the respective list.
Special cases are the output addresses -
(which will be rewritten to pipe:
), and /dev/null
, which will be allowed even though it's outside of storage.disk.dir
.
List of patterns for allowed inputs.
By default this list is empty, i.e. all inputs are allowed.
List of patterns for disallowed inputs.
By default this list is empty, i.e. no inputs are blocked.
List of patterns for allowed outputs.
By default this list is empty, i.e. all outputs are allowed.
List of patterns for disallowed outputs.
By default this list is empty, i.e. no outputs are blocked.
The number of latest FFmpeg log lines for each process to keep.
By default this value is set to 50
lines.
The number of historic logs for each process to keep.
By default this value is set to 3
.
The settings for the disk filesystem. This filesystem is accessible on /
via HTTP. This filesystem can only be accessed for reading via HTTP. Writing to and deleting from the filesystem is possible .
Path to a directory on disk. It will be exposed on /
for reading.
Relative paths are interpreted relative to where the datarhei Core binary is executed.
By default it is set to ./data
.
The maximum amount of data that is allowed to be stored in this filesystem. The value is interpreted as megabytes. A 507 Insufficient Storage
will be returned if you hit the limit. Use a value equal to or smaller than 0
to not impose any limits. Then all the available space on the disk is the limit.
By default no limit is set, i.e. a value of 0
.
Set this value to true
in order to enable the cache for the disk. The cache is an LRU cache, i.e. the least recently accessed files in the cache will be removed in case the cache is full and a new file wants to be added.
By default the value is set to true
.
Limit for the size of the cache in megabytes. A value of 0 doesn't impose any limit. The limit will be the available memory.
By default no limit is set, i.e. a value of 0
.
Number of seconds to keep a file in the cache.
By default this value is set to 300
seconds.
Limit for the size of a file to be allowed to be put in the cache in megabytes.
By default this value is set to 1
megabyte.
A list of file extensions to cache, e.g. [".ts", ".mp4"]
. Leave the list empty in order to cache all files. Use a space-separated list of extensions for the environment variable, e.g. .ts .mp4
.
By default the list is empty.
A list of file extensions not to cache, e.g. [".m3u8", ".mpd"]
. Leave the list empty in order to block no extension. Use a space-separated list of extensions for the environment variable, e.g. .m3u8 .mpd
.
By default the manifest files for HLS and DASH are blocked from caching, i.e. [".m3u8", ".mpd"].
The settings for the S3 filesystem. This filesystem is accessible on the configured path via HTTP. This filesystem can only be accessed via HTTP. Writing to and deleting from the filesystem can be restricted by HTTP basic auth.
Any S3 compatible service can be used, e.g. Amazon, Minio, Backblaze, ...
Available as of version 16.12.0
The name for this storage. The name will be used in placeholders, e.g. {fs:aws}
, and for accessing the filesystem via the api, e.g. /api/v3/fs/aws
. The name memfs
is reserved for the in-memory filesystem.
By default this value is not set, but is required.
The path where the filesystem will be mounted in the HTTP server. It needs to be an absolute path. A mountpoint is required.
By default this value is not set, but is required.
Set this value to true
in order to enable basic auth for PUT
, POST
, and DELETE
operations on the configured mountpoint. Read access (GET
, HEAD
) is not restricted. If enabled, you have to define a username and a password.
It is highly recommended to enable basic auth for write operations on the mountpoint.
By default this value is set to false
.
Username for Basic-Auth of the configured mountpoint. This has to be set if basic auth is enabled.
By default this value is not set, i.e. an empty string.
Password for Basic-Auth of the configured mountpoint. This has to be set if basic auth is enabled.
By default this value is not set, i.e. an empty string.
The endpoint for the S3 storage. For Amazon AWS S3 it would be e.g. s3.amazonaws.com
. Ask your S3 storage provider to the necessary credentials.
By default this value is not set, i.e. an empty string.
Your access key ID for the S3 storage. Ask your S3 storage provider to the necessary credentials.
By default this value is not set, i.e. an empty string.
Your secret access key for the S3 storage. Ask your S3 storage provider to the necessary credentials.
By default this value is not set, i.e. an empty string.
The name of the bucket you want to use. If the bucket does not exist already it will be created.
By default this value is not set, i.e. an empty string.
Identifier for the region the storage is located, e.g. eu
, us-west1
, ... . If your S3 storage provider doesn't support regions, leave this field empty.
By default this value is not set, i.e. an empty string.
Whether to use HTTPS or HTTP. It is strongly recommended to enable this setting.
By default this is set to false
.
Find a list of known logging topics on the .
Independently of the values of access.output
there's a check that verifies that output can only be written to the directory specified in and works as follows: if the address has a protocol specifier other than file:
, then no further checks will be applied. If the protocol is file:
or no protocol specifier is given, the address is assumed to be a path that is checked to be inside of storage.disk.dir
.
Settings for static HTTP routes.
List of path prefixes that are not allowed to be overwritten by a static route. If a static route would overwrite one of the blocked prefixes, an error will be thrown at startup. For the environment variable, provide a comma-separated list of prefixes, e.g. /prefix1,/prefix2
.
By default this value is set to ["/api"]
.
A list of static routes. This maps a path to a different path and results in a HTTP redirect, e.g. {"/foo.txt": "/bar.txt"}
will redirect requests from /foo.txt
to /bar.txt
. Path have to start with a /
and they are based on storage.disk.dir on the filesystem.
The special suffix /*
of a route allows you to serve whole directories from another root than storage.disk.dir, e.g. {"/ui/*", "/path/to/ui"}
. If you use a relative path as target, then it will be added to the current working directory.
By default no routes are defined.
A path to a directory holding UI files. This will be mounted as /ui
.
By default this value is not set, i.e. an empty string.
The debugging settings can help to find and solve issues with the datarhei Core.
By setting this to true, the endpoint /profiling will be established where you can access different diagnostic solutions as described in https://go.dev/doc/diagnostics.
By default this setting is set to false
.
Golang is usually quite greedy when it comes to claim memory to itself. This settings lets you define the number of seconds between forcing the garbage collector to run in order return memory to the OS. If this is not set, the runtime will decide on its own when to run the garbage collector.
Alternatively, you can set the environment variable GOMEMLIMIT
to a value in bytes in order to set a soft memory limit. This will influence the garbage colltector when the consumed memory comes close to this limit. If you use the GOMEMLIMIT
environment variable you are advised to leave the force_gc
option disabled.
The default for this setting is 0
(i.e. disabled).
As of version 16.12.0 use this valuess to impose a soft limit to the memory consumption of the Core application itselft (i.e. with out the memory consumption of the ffmpeg processes). This has the same effect as setting the GOMEMLIMIT
environment variable.
The provided value is the number of megabytes the Core application is allowed to consumed.
The default for this setting is 0
(i.e. no limit).
Settings for session capturing. Sessions for HLS, RTMP, SRT, HTTP, and FFmpeg are captured.
Set this value to true in order to enable session capturing.
By default this value is set to true
.
List of IP ranges in CIDR notation to ignore for session capturing. If either end of a connection falls into this list of IPs, the session will not be captured. For the environment variable provide a comma-separated list of IP ranges in CIDR notation.
By default this value is set to ["127.0.0.1/32","::1/128"]
.
The timeout in seconds for an idle session. After this timeout the session is considered as closed. Applies only to HTTP and HLS sessions.
By default this value is set to 30
seconds.
Whether to persist the session history. The session history is stored as sessions.json
in db.dir. If the session history is not persisted it will be kept only in memory.
By default the session history is not persisted, i.e. this value is set to false
.
Interval in seconds in which to persist the current session history. This setting has only effect if persisting the session history is enabled.
By default this value is set to 300
seconds.
The maximum allowed outgoing bitrate in mbit/s. If the limit is reached, any new HLS sessions will be rejected. A value of 0 means no limitation of the outgoing bitrate.
By default this is value is set to 0
, i.e. unlimited.
The maximum allowed number of simultaneous sessions. If the limit is reached, any new HLS sessions will be rejected. A value of 0 means no limitation of the number of sessions.
By default this value is set to 0, i.e. unlimited.
Settings for collecting metrics of the core and FFmpeg processes.
Caution with many processes and low values! It will increases CPU and RAM usage.
Enable collecting metrics data of the datarhei Core itself and the FFmpeg processes. The metrics can be queried via the metrics API endpoint.
By default collecting the metrics is disabled.
Enable prometheus endpoint at /metrics
. This requires that collecting metrics is enabled.
By default this is disabled.
Define for how many seconds historic metrics data should be kept.
By default this value is set to 300
.
Define in which interval (in seconds) the metrics should be collected.
By default this value is set to 2
.