Skip to content

Running version 0.13? Its documentation is on the 0.13 site. Go to the 0.13 documentation

The station control computer

The station control computer

What runs on the station control computer, the Raspberry Pi or the Debian or Ubuntu computer that runs Web Radio Control, and where it keeps its data and logs. You don’t need any of this to use or run the station: Settings and the setup page do everything. This page is for administrators who log in to the computer with SSH, to look closer or to help WRC support (see SSH). On a Raspberry Pi you log in as the Linux user wrchost.

Change nothing by hand under /opt/wrc while Web Radio Control runs. Use Settings, the setup page or the commands below, which keep the station consistent.

What runs where

WhatWhere it runsWhat it does
The station server, Web Radio Control itselfA Docker container, named after its server image, such as wrc-server-arm64v8-2.0.0-b2-1Serves Web Radio Control on the remote control port and the setup page on its own port, controls the devices, runs the audio, and keeps the database. Docker starts it again whenever the computer starts, or when it stops.
Hamlib programs, such as rigctld for a radioIn the container, one for each radio, rotator and amplifierTalk to the devices. They answer only inside the computer.
The audio pipelinesIn the container, two for each radioCarry the received and transmitted audio between the sound cards and the browsers.
The WRC host service, wrc-host-serviceOn the computer, as root, under systemdCarries out what Web Radio Control asks of the computer: its network and Wi-Fi, its firewall, the time servers, the private network, restarting the audio services, rebooting and shutting down, installing the server image, and the resets. It answers only on 127.0.0.1:8010, and only to Web Radio Control.
PipeWire and WirePlumberOn the computer, once for the whole systemFind the sound cards and run them.
chronyOn the computerKeeps the clock, from the public NTP pool, your router and your own time servers (see Time servers).
AvahiOn the computerAnnounces its .local network name on your network.
The station firewallOn the computer, the inet wrc table of nftablesLets in the ports of the station and little else (see Ports).
SSHOn the computerLogins for those who look after the computer. sshguard blocks an address after repeated failed logins.

The container runs on the network of the computer, so its ports are the ports of the computer. Inside it, everything runs as its user wrc, and the container has no sudo.

Where the station keeps its data

Everything that Web Radio Control keeps is on the computer itself, under /opt/wrc, which the container mounts. A software update replaces the software, and leaves the data as it is.

PathWhat it holds
/opt/wrc/data/db/The database: users, devices, settings, reservations, logbooks and contacts. wrc-storage.db, and wrc-storage.db.bak, the copy made at every start.
/opt/wrc/data/db/backups/The automatic backups (see Back up and restore the station).
/opt/wrc/data/certs/The certificate the station uses, and in ca/ the certificate authority of the station, with the certificates of a wrcs.tech domain name and of your own domain, each with its key.
/opt/wrc/data/license/The license key, what the station last learned of its license, and the key with which the station signs its requests to the WRC Cloud Service.
/opt/wrc/data/pending-changes/A change waiting to be kept, such as a new certificate, with what it replaces.
/opt/wrc/logs/The logs (below).
/opt/wrc/updates/The packages of software updates: the downloads, and the packages kept for going back to the version before.
/opt/wrc/installed.jsonThe version installed, and how it got there.
/opt/wrc/LICENSEThe license of Web Radio Control.
/opt/hamlib/The Hamlib that the station runs, and installed.json, its version.

/opt/wrc and everything under it belong to the user and group 1000, and to no one else. On a Raspberry Pi that is wrchost, who reads them directly. On another computer, read them with sudo.

The station reads no configuration file: every setting is in the database, and you change it in Settings. A wrc-config.yaml of Web Radio Control 0.13 is not read.

The WRC host service keeps its own files elsewhere: the program in /usr/local/bin/wrc-host-service, its settings in /etc/wrc/wrc-host-service.yaml, and its state in /var/lib/wrc/host-service/.

Copy the data folder from the command line

The station data export in Settings › Station › Backup & restore is the usual way to keep the data of the station safe. From the command line, you can also copy the data folder whole. Stop the container first, so that nothing writes to the database during the copy:

sudo docker ps --filter name=wrc-server     # the name of the container
sudo docker stop <container>
sudo tar -czpf wrc-data-$(date +%F).tar.gz -C /opt/wrc data
sudo docker start <container>

-p keeps the owner and the permissions. The logs are left out. Add logs after data to keep them too.

To put the copy back, stop the container, unpack the copy, and start the container again:

sudo docker stop <container>
sudo tar -xzpf wrc-data-<date>.tar.gz -C /opt/wrc
sudo docker start <container>
The copy holds the license key and the private keys of the certificates, unencrypted. Keep it as safe as the station. It puts the station back as it was on the same computer. To move a station to other hardware, use the station data export and move the license (see Move your license).

The log files

The logs of Web Radio Control are in /opt/wrc/logs. In Settings › Station › Diagnostics & logs, under Log files, View and search the logs… shows the application and security logs, and All station logs downloads them all as one file (see Station logs).

FileWhat it holds
wrc.logEverything Web Radio Control does: the devices, the audio, the connections, and when each program it runs starts and ends. One JSON object to a line.
wrc-security.logThe logins, sessions and permission checks.
wrc-storage.logThe database.
wrc.err.log, wrc.http.err.logWhat Web Radio Control could not write to its own logs, and the errors of its web servers.
daemons/The output of each program the station runs, in a log of its own (below).

In daemons/, each program has its log, named by the program and what it serves:

FileWhat it holds
rigctld-‹radio›.log, rotctld-‹rotator›.log, ampctld-‹amplifier›.logThe Hamlib program of the device, such as rigctld-radio-689.log: its errors, and with a higher Log detail every exchange with the device.
gst-launch-1.0-‹radio›-input.log, gst-launch-1.0-‹radio›-output.logThe received and transmitted audio of the radio.
pw-dump.logThe program that follows the sound cards through PipeWire.

The logs of Web Radio Control are archived at 25 MB, keeping 20 archives, and those of the programs at 5 MB, keeping 5, unless you change them in Diagnostics & logs. Archives older than 14 days are removed. Passwords, session identifiers, tokens and license IDs are never written to the logs.

sudo tail -f /opt/wrc/logs/wrc.log                         # follow the log of Web Radio Control
sudo grep '"level":"error"' /opt/wrc/logs/wrc.log          # its errors
sudo tail -f /opt/wrc/logs/daemons/rigctld-radio-689.log   # follow the rigctld of a radio

The system journal

The services of the computer log to its system journal. On a Raspberry Pi it is kept on the SD card, up to 64 MB, so the logs of earlier starts survive a restart or a power cut.

journalctl -u wrc-host-service                             # what the WRC host service did
journalctl -u wrc-host-service -u wrc-host-service-rollback  # its updates, and any rollback
journalctl -u docker                                       # Docker
journalctl --list-boots                                    # the starts the journal holds
journalctl -b -1                                           # the start before this one

What the installation printed, on the first start of a Raspberry Pi and at each run of the install bundle, is in /var/log/wrc-install.log.

Commands on the station control computer

CommandWhat it does
sudo wrc-host-service statusSums up the WRC host service: its version, the system, kernel, temperature and throttling of the computer, the state of each of its parts, and the changes waiting to be kept. It changes nothing.
sudo docker exec -u wrc <container> /opt/wrc/wrc diagnostics > wrc-diagnostics.jsonWrites the diagnostic report when Web Radio Control can’t be reached in the browser (see Send a diagnostic report).
sudo nft list table inet wrcShows the station firewall as loaded.
sudo wrc-reset-password, sudo wrc-reset-settings, sudo wrc-reset-everythingReset the station (see Reset the station).
wrc-host-service licensesPrints the third-party software the WRC host service is built with (see Third-party licenses).

A root shell inside the container, for finding a fault with WRC support, is sudo docker exec -u root -it <container> bash.

Last updated on