Configuration File
This page describes the main configuration file of Centova Cast, castd.conf, and the local configuration file of
the Centova Cast web server, cc-web-local.conf. Most administrators do not need to change these files. The installer
writes the correct values for a normal installation.
The files are in the etc directory of the Centova Cast installation:
/usr/local/centovacast/etc/castd.conf- the configuration of the Centova Cast daemon (cc-castd)./usr/local/centovacast/etc/cc-web-local.conf- the ports and the hostname of the Centova Cast web server (cc-web).
CAUTION: Make a copy of a configuration file before you change it. An incorrect value can stop the control panel.
Format of castd.conf
castd.conf contains blocks. Each block has a name and a list of keys between braces ({ and }). A block can
contain other blocks. Each key is on a line of its own. The value comes after the key name, separated by a space.
web-service {
hostname "cast.example.com"
http-port 80 2197
}
These rules apply to the values:
- Put a text value between double quotation marks, for example
"cast.example.com". - Write a number,
trueandfalsewithout quotation marks. - If a key has more than one value, separate the values with spaces, for example
http-port 80 2197. - Write a time period in the named blocks as a number and a unit:
s(seconds),m(minutes) orh(hours). For example,30sis 30 seconds and5mis 5 minutes. - A line that starts with
//is a comment. Centova Cast ignores it.
A relative path in the file is relative to the installation directory. For example, var/run/castd/castd.sock is
/usr/local/centovacast/var/run/castd/castd.sock.
The file belongs to the root user and the centovacast group. Its permissions are 0640. Keep these permissions.
The file contains the cryptography key and the license key of your installation.
Note: castctl register and the installer also write to castd.conf.
Applying Changes
After you change castd.conf, tell Centova Cast to use the new values. There are two methods:
Reload
Centova Cast reads the file again, and applies the new values to the parts that can change while it runs. The streams and the control panel continue. To reload, type:systemctl reload cc-castdRestart
Centova Cast stops and starts again. A restart applies all of the values in the file. To restart, type:systemctl restart cc-castd
A reload applies changes to these items: the file-server block, the binaries block, the error-reporting
key, and the media block in system. For all other changes, restart cc-castd. Some parts of Centova Cast read
their values only when they start, so a reload does not apply them.
If the file contains an error, a reload does not change the configuration. Centova Cast keeps the previous values,
and writes a warning to its log. Make sure that the file is correct before you restart cc-castd. If the file
contains an error at start time, Centova Cast does not start.
The access-control block of the api-server block always needs a restart.
After you change cc-web-local.conf, tell the web server to read the file again:
systemctl reload cc-web
The web-service Block
The web-service block configures the address of the control panel. Centova Cast uses these values to make the
links to the control panel, for example in email messages and in tune-in links.
hostname
Specifies the hostname of the control panel. To give the control panel more than one hostname, separate the hostnames with spaces, for examplehostname "cast.example.com" "panel.example.com". Centova Cast uses the first hostname in links. This key must contain at least one hostname. The installer sets it from its--hostnameoption. If you change it, also change theserver_nameline incc-web-local.conf.tls-method
Specifies how Centova Cast gets the TLS certificate of the control panel. The values areacme(a certificate from Let's Encrypt),self(a self-signed certificate) andcustom(a certificate that you supply). For more information, see the TLS Certificates section.http-port
Specifies the HTTP ports of the control panel. Separate more than one port with spaces, for examplehttp-port 80 2197. Centova Cast uses the first port in links. These ports must be the same as the HTTP ports incc-web-local.conf. If this key contains80, Centova Cast can get ACME certificates with HTTP validation. The value in the shipped file is2197.https-port
Specifies the HTTPS ports of the control panel. Separate more than one port with spaces, for examplehttps-port 443 2199. Centova Cast uses the first port in links. These ports must be the same as the HTTPS ports incc-web-local.conf. If this key is empty, Centova Cast makes HTTP links only. The value in the shipped file is2199.http-proxy
Specifies the base URL for the HTTP tune-in links that go through the stream proxy of the control panel, for example"http://proxy.example.com:8000". Centova Cast adds the path/proxy/USERNAMEto this URL. If this key is not in the file, Centova Cast uses the first hostname and the first HTTP port of the control panel.https-proxy
Specifies the base URL for the HTTPS tune-in links that go through the stream proxy. If this key is not in the file, Centova Cast uses the first hostname and the first HTTPS port of the control panel.
The changes to hostname and tls-method take effect only when cc-castd starts. For the procedure, see the
Changing the Certificate of the Control Panel
section.
The api-server Block
The api-server block configures the internal server of the Centova Cast daemon. The web server sends the requests
for the control panel and the API to this server. Do not change these keys unless Centova Technologies tells you to.
bind-address
Specifies the address on which the daemon receives requests. The value in the shipped file is the UNIX socket"unix:var/run/castd/castd.sock". The web server configuration (etc/cc-web.conf) contains the same address. If you change one, you must change the other.unix-socket
Specifies the permissions (perms) and the group (group) of the UNIX socket. The values in the shipped file are0o660and"ccui". The web server runs in theccuigroup, and must be able to open the socket.access-control
Specifies which addresses can use the parts of the daemon, and which proxies the daemon trusts (trusted-proxies). A change in this block needs a restart ofcc-castd.max-request-size
Specifies the maximum size of an HTTP request, in megabytes. This size is the maximum size of a file that a user uploads through the control panel, and of a backup that a user restores. The value in the shipped file is256.max-api-request-size
Specifies the maximum size of an API request that is not an upload, in megabytes. The default is1.private-address
Specifies the TCP address on which the daemon receives requests from the autoDJ software of the accounts. The value in the shipped file is"127.0.0.1:2198". Use an address on the local server only.
The file-server Block
The file-server block configures the services that clients use to manage their media files without the control
panel. Each service has an enable key. If enable is true, the service runs. A reload applies the changes in
this block.
webdav
Controls the WebDAV service. The service uses the ports of the control panel, at the URL path/dav/. The value in the shipped file isenable true.s3
Controls the S3-compatible service. The service uses the ports of the control panel, at the URL path/s3/. The value in the shipped file isenable false.ftp
Controls the FTP service. The FTP service also supports FTPS, with the certificate of the control panel. The block has these keys:enable
Iftrue, the FTP service runs. The value in the shipped file isfalse.bind-address
Specifies the address and the port of the FTP service. The value in the shipped file is"0.0.0.0:2121", that is, port 2121 on all IPv4 addresses.passive-port-range
Specifies the range of ports for passive FTP connections, with the keysstartandend. This block is not in the shipped file. If it is not set, the FTP service selects the ports itself. If the server has a firewall, set a range and open these ports in the firewall. For example:ftp { enable true bind-address "0.0.0.0:2121" passive-port-range { start 50000 end 50100 } }
sftp
Controls the SFTP service (file transfer over SSH). The SFTP service has its own SSH server, which permits only SFTP. It does not give a shell, and it does not use or change the SSH server of the system. The block has these keys:enable
Iftrue, the SFTP service runs. The value in the shipped file isfalse.bind-address
Specifies the address and the port of the SFTP service. The value in the shipped file is"0.0.0.0:2222".
If you enable the FTP or the SFTP service, make sure that the firewall of the server permits connections to its port.
The system Block
The system block contains the license, the cryptography key, and other values for the full installation.
license-key
Specifies the license key of Centova Cast. The installer sets it.media
Contains theextensionskey. This key specifies the file name extensions of the media files, without the dot. The media library imports only files with these extensions, and the file manager marks them as media files. Upper case and lower case are the same. The value in the shipped file isextensions mp3 ogg aac aacp wma wmv.crypto
Contains thekeykey. This key specifies the cryptography key of the installation, as a base64 text. The installer generates it.CAUTION: Do not change or remove the cryptography key. Keep it secret. Centova Cast uses it to encrypt stored data. If the key changes, Centova Cast cannot read the data that it encrypted with the old key.
error-reporting
Iftrue, Centova Cast sends a report to Centova Technologies when it finds a critical error. The report contains basic information about the server (the Linux distribution and version, the CPU, the memory use) and the details of the error. Centova Cast removes usernames, IP addresses and other personal data from the error message. Centova Cast keeps the reports invar/spool/errors/current.jsonl, and a background job sends them every few hours. To stop the reports, set this key tofalse. The value in the shipped file istrue.
The events Block
The events block configures the monitoring of the streaming servers.
poller
Configures how frequently Centova Cast asks each Shoutcast and Icecast streaming server for its status, for example the number of listeners. The block has these keys:frequency
Contains two keys.standardspecifies the interval when Centova Cast can read the playlist log of the streaming server.no-playlist-logspecifies the interval when there is no playlist log, and Centova Cast finds the current track through the status of the streaming server. The values in the shipped file arestandard 5mandno-playlist-log 30s.timeout
Specifies the maximum time for one status request. The value in the shipped file is8s.
bitrate-checker
Configures the bit rate checker. The bit rate checker measures the bit rate of each mount point of a stream, and compares it with the bit rate limit of the account. The block has these keys:bitrate-tolerance
Specifies how much the measured bit rate can be more than the limit, as a fraction of the limit. For example,0.08is 8 percent. The value in the shipped file is0.08.frequency
Specifies the interval between two checks of a stream. Centova Cast adds a random time of up to 90 percent of this interval to each check. The value in the shipped file is30m.timeout
Specifies the maximum time for one connection of the bit rate checker. The value in the shipped file is30s.
log-parser
Configures how Centova Cast reads the playlist logs of the streaming servers. It contains therate-limitblock, which limits the number of track changes that Centova Cast accepts. Some sources send many track changes in a short time, to make an animated title in players. Therate-limitblock has these keys:meta-changes
Specifies the maximum number of track changes in one period. The value in the shipped file is3.per
Specifies the length of the period. The value in the shipped file is15s.
Example: With
meta-changes 3andper 15s, Centova Cast accepts at most 3 track changes in each period of 15 seconds for a stream.
The websockets Block
The websockets block configures the websocket server. The control panel uses websockets to show live information,
for example the listener count.
channels
Contains thestate-filekey. This key specifies the file in which the websocket server saves the state of its channels. The value in the shipped file is"var/lib/websocketd/cc-websocketd.state".
The workers Block
The workers block sets the number of parallel workers for some tasks. More workers make a task faster, but use more
CPU, memory, disk and network capacity.
events
Contains these keys:poll-workers
Specifies the number of workers that ask the streaming servers for their status. The value in the shipped file is8.bitrate-checker-workers
Specifies the number of workers that measure the bit rates of the streams. The value in the shipped file is4.
media
Contains these keys:import-workers
Specifies the number of workers that read media files for one import job of the media library. The value must be from 1 to 20. If the value is less than 1, Centova Cast uses 3. If it is more than 20, Centova Cast uses 20. The value in the shipped file is3.album-data-workers
Specifies the number of workers that get album information and cover images for one import job. The value must be from 1 to 64. If the value is less than 1, Centova Cast uses 3. If it is more than 64, Centova Cast uses 64. For a job that only updates the album data of the media library, the maximum is 20. The value in the shipped file is6.
Note that more than one import job can run at the same time. The disk is the usual limit for the import workers. The album data workers usually wait for the network. Keep these values low.
The binaries Block
The binaries block specifies the program file of each streaming server and autoDJ package. Each key is a package
name: shoutcast2, icecast, mediamtx, centovasrc, liquidsoap or icescc. The value is the full path of
the program.
The package installer (sbin/install) writes this block through the castctl register command. Do not change it
yourself. For more information, see the castctl register section.
Note that the streaming software runs in a restricted environment. The program must be in a directory that the systemd unit file of Centova Cast permits.
The advanced Block
The advanced block contains keys that change the behavior of Centova Cast in detail. This manual does not
describe these keys, with one exception: the tls.acme.dns.* keys for DNS validation. For these keys, see the
DNS Validation (Wildcard Hostnames) section. Write each key
on a line of its own, followed by its value:
advanced {
session.timeout 3600
auth.password.minlength 8
}
If a key is not in the block, Centova Cast uses its default value. Restart cc-castd after you change this block.
The cc-web-local.conf File
cc-web-local.conf contains the local settings of the Centova Cast web server. The web server is based on nginx,
and the file uses the nginx syntax. Each line ends with a semicolon. A line that starts with # is a comment.
The file belongs to the root user and the ccui group. Its permissions are 0640.
listen
Specifies a port on which the web server receives connections. Each port has its ownlistenline. A line withsslis an HTTPS port. A line withoutsslis an HTTP port. To use one address only, writeip:portinstead of the port, for example192.0.2.5:2199. Write an IPv6 address between brackets, for example[2001:db8::5]:2199. On a server with IPv6, the installer adds a[::]:portline for each port.The installer always configures port 2199 (HTTPS) and port 2197 (HTTP). It also configures port 443 and port 80, unless you install with the
--no-webportsoption. A typical file contains these lines:listen 2199 default ssl; listen 443 ssl; listen 2197 default; listen 80;set $startpagedomain
Specifies a domain for start page URLs of the formhttp://USERNAME.example.com. If a request for the root path ofUSERNAME.example.comarrives, the web server shows the start page of the accountUSERNAME. For this function, configure a wildcard DNS record*.example.comthat points to the server. The installer sets this value to the hostname of the control panel.server_name
Specifies the hostname of the control panel for the web server. The installer sets it. If you changehostnamein theweb-serviceblock ofcastd.conf, also change this line.
If you change a listen line, also change http-port or https-port in the web-service block of castd.conf.
Then reload cc-web and restart cc-castd.
Example: To stop the use of ports 80 and 443 for the control panel:
- Remove the lines
listen 443 ssl;andlisten 80;fromcc-web-local.conf. Also remove the[::]:443and[::]:80lines, if they are in the file. - In
castd.conf, sethttp-port 2197andhttps-port 2199. - Reload the web server with
systemctl reload cc-web. - Restart the Centova Cast daemon with
systemctl restart cc-castd.
Note that the control panel then cannot get ACME certificates with HTTP validation. For more information, see the HTTP Validation section.