Configuration¶
There are three major ways to configure Crazy Arms,
- Station Settings in the station admin site
- The startup environment file (
.env
) - The Harbor source code, using Liquidsoap
Station Settings (Dynamic Settings)¶
In the station admin site, the following configuration options are available, and are dynamically configured, which is to say they can be changed at any time without having to restart (and rebuild) the Crazy Arms server. Anyone with administrator privileges can edit these in the web app.
Some Settings May Not Be Available
If Zoom or local Icecast server is disabled in the .env
file, those
sections will not be available. See
more information on the .env
file below.
Below are a list of configuration options, organized by section.
General Options¶
STATION_NAME
— Type: String (required, 40 characters max)-
The name of your radio station.
Default:
'Crazy Arms Radio Station'
PLAYOUT_LOG_PURGE_DAYS
— Type: Integer (non-negative)-
The number of days to keep playout log entries after which they’re purged. Set to 0 to keep playout log entries forever.
Default:
14
APPEND_LIVE_ON_STATION_NAME_TO_METADATA
— Type: Boolean (true or false)-
Append the string “LIVE on
” to the stream’s metadata for live broadcasts. Default:
True
AutoDJ Configuration¶
AUTODJ_ENABLED
— Type: Boolean (true or false)-
Whether or not to run an AutoDJ on the harbor.
Default:
True
AUTODJ_REQUESTS
— Type: Choice of: Disabled (nobody), Users, Users with “Program the AutoDJ” permissions, Superusers-
AutoDJ requests enabled for the following users.
Default:
'disabled'
AUTODJ_REQUESTS_NUM
— Type: Integer (non-zero)-
The maximum number of pending AutoDJ requests (if enabled)
Default:
5
AUTODJ_ANTI_REPEAT_ENABLED
— Type: Boolean (true or false)-
Whether or not the AutoDJ should attempt its anti-repeat algorithm. Note if you have too few tracks, this won’t work.
Default:
True
AUTODJ_ANTI_REPEAT_NUM_TRACKS_NO_REPEAT
— Type: Integer (non-negative)-
Number of tracks to avoid to avoid repeating (if possible). Set to 0 to disable.
Default:
50
AUTODJ_ANTI_REPEAT_NUM_TRACKS_NO_REPEAT_ARTIST
— Type: Integer (non-negative)-
Number of tracks to avoid playing the same artist (if possible). Set to 0 to disable.
Default:
15
AUTODJ_PLAYLISTS_ENABLED
— Type: Boolean (true or false)-
Whether or not the AutoDJ should use playlists
Default:
True
AUTODJ_STOPSETS_ENABLED
— Type: Boolean (true or false)-
Whether or not the AutoDJ plays stop sets (for ADs, PSAs, Station IDs, etc)
Default:
False
AUTODJ_STOPSETS_ONCE_PER_MINUTES
— Type: Integer (non-negative)-
How often a stop set should approximately be played (in minutes)
Default:
20
Harbor Configuration¶
HARBOR_COMPRESSION_NORMALIZATION
— Type: Boolean (true or false)-
Enable compression and normalization on harbor stream.
Default:
True
HARBOR_TRANSITION_WITH_SWOOSH
— Type: Boolean (true or false)-
Transition between harbor sources with a ~1 second swoosh effect.
Default:
False
HARBOR_SWOOSH_AUDIO_FILE
— Type: File-
Audio file for the swoosh (if enabled). Sound be short, ie under 3-4 seconds.
Default:
False
HARBOR_TRANSITION_SECONDS
— Type: Decimal (non-negative)-
Fadeout time in seconds when transitioning between harbor sources. Set to 0 for no fadeout.
Default:
2.5
HARBOR_MAX_SECONDS_SILENCE_BEFORE_INVACTIVE
— Type: Integer (non-zero)-
The maximum number of seconds of silence on a live source (eg. Zoom or live DJs) until it will be considered inactive, ie until we would treat it as if it were offline.
Default:
15
HARBOR_FAILSAFE_AUDIO_FILE
— Type: File-
Failsafe audio file that the harbor should play if there’s nothing else to stream.
Default:
False
UPSTREAM_FAILSAFE_AUDIO_FILE
— Type: File-
Failsafe audio file that should be broadcast to upstream servers if we can’t connect to the harbor, ie the harbor failed to start.
Default:
False
Audio Assets Configuration¶
ASSET_ENCODING
— Type: Choice of: MP3, Ogg Vorbis, FLAC-
Encoding of downloaded external assets and non-standard input files.
Default:
'mp3'
ASSET_BITRATE
— Type: Choice of: 64kbit, 128kbit, 192kbit, 256kbit, 320kbit-
Bitrate (quality) of downloaded external and non-standard audio files. (Unused for FLAC.)
Default:
'128K'
ASSET_DEDUPING
— Type: Boolean (true or false)-
Enable duplicate detection for audio assets based on metadata and audio fingerprint.
Default:
True
Google Calendar Based Authentication¶
GOOGLE_CALENDAR_ENABLED
— Type: Boolean (true or false)-
Enabled Google Calendar based authentication for DJs.
Default:
False
GOOGLE_CALENDAR_ID
— Type: String-
Google Calendar ID.
Default:
'example@gmail.com'
GOOGLE_CALENDAR_CREDENTIALS_JSON
— Type: String-
Past the contents of your Google Service JSON Account Key here (a
credentials.json
file).For more info from Google about this please click here.Default:
''
Zoom Settings¶
ZOOM_MAX_SHOW_LENTH_MINUTES
— Type: Integer (number of minutes)-
Maximum show length (in minutes) of an unscheduled Zoom broadcast.
Default:
300
ZOOM_DEFAULT_SHOW_LENTH_MINUTES
— Type: Integer (number of minutes)-
Default show length (in minutes) of an unscheduled Zoom broadcast. Note shows scheduled through Google Calendar will default to the length of the calendar event (or the maximum show length above, whichever is shorter).
Default:
120
Local Icecast Server Settings¶
ICECAST_LOCATION
— Type: String-
Location setting for the Icecast server.
Default:
'The World'
ICECAST_ADMIN_EMAIL
— Type: Email Address-
The admin email setting for the Icecast server.
Default:
'admin@mystation.com'
ICECAST_ADMIN_PASSWORD
— Type: String (required)-
Admin password for the Icecast server.
Default:
'default'
ICECAST_SOURCE_PASSWORD
— Type: String (required)-
Source password for the Icecast server.
Default:
'default'
ICECAST_RELAY_PASSWORD
— Type: String (required)-
Relay password for the Icecast server.
Default:
'default'
ICECAST_MAX_CLIENTS
— Type: Integer (non-negative)-
Max connected clients allowed the Iceacst server (0 for unlimited).
Default:
0
ICECAST_MAX_SOURCES
— Type: Integer (non-negative)-
Max sources allowed to connect to the Icecast server (0 for unlimited).
Default:
0
The Environment File – .env
(Static Settings)¶
When Crazy Arms starts for the first time with ./compose.sh
, you’ll get asked
a series of simple questions. In your root directory, all that’s happening is
the file .default.env
is being modified and copied to .env
.
Advanced Users Only
Editing the .env
file is meant to be done once at installation (or rarely),
and is intended for systems administrators only, ie the nerds who set up
Crazy Arms for your station. If your just a regular admin user, you’ll
probably be more interested in the station settings
above.
Which Services Start
If you edit ZOOM_ENABLED
, ICECAST_ENABLED
, EMAIL_ENABLED
,
HARBOR_TELNET_WEB_ENABLED
, RTMP_ENABLED
you actually are controlling
which services (or Docker containers) Crazy Arms starts up. This is the
reason why these settings are static, since the list of containers
we choose to run is determined at start time.
Below is a copy of the .default.env
file that shipped with Crazy Arms which
does a decent enough job of explaining what each option does.
# .default.env -- The default configuration for Crazy Arms
#
# Notes:
# * The ./compose.sh script will copy this and fill out some values for you
# on first run.
# * Boolean values must be 0 or 1
# * SECRET_KEY _must_ be set (./compose.sh will set it for you)
#
# Whether to run in DEBUG mode (Do _NOT_ set this to 1 on production)
DEBUG=0
# Django secret key -- MUST be set, ./compose.sh will generate one for you
# - Valid characters: Letter, numbers and any of: ! @ # % ^ & * ( - _ = + )
SECRET_KEY=
# Default timezone for server (note: users can set their own TZ in the web UI)
TIMEZONE=US/Pacific
# Domain name used for the web app, ie if it's at http://radio.crazyarms.xyz/,
# enter radio.crazyarm.xyz.
#
# Note: This to match what users type into their web browser or the web app will
# refuse connections.
DOMAIN_NAME=localhost
# Allow DJs to broadcast via a Zoom room
ZOOM_ENABLED=0
# Whether or not to run a local Icecast server (kh fork)
ICECAST_ENABLED=1
# Use letsencrypt to enable HTTPS. The DNS record for DOMAIN_NAME must resolve
# to the IP address of your server.
HTTPS_ENABLED=0
# letencrypt requires an email address if you use it
HTTPS_CERTBOT_EMAIL=
# Enable email notifications
EMAIL_ENABLED=0
# If you've enabled emails, these must to be specified
EMAIL_SMTP_SERVER=smtp.mystation.com
EMAIL_SMTP_PORT=587
EMAIL_SMTP_USERNAME=no-reply@mystation.com
EMAIL_SMTP_PASSWORD=
EMAIL_SMTP_USE_TLS=1
# Harbor Telnet Access over Web (experimental, so disabled by default)
HARBOR_TELNET_WEB_ENABLED=0
# RTMP streaming
RTMP_ENABLED=0
# Custom port overrides, set these to whatever you like. SFTP could be set to 22
# if you aren't running ssh on your server.
#HARBOR_PORT=8001
#HTTP_PORT=80
#HTTPS_PORT=443
#ICECAST_PORT=8000
#SFTP_PORT=2022
#RTMP_PORT=1935
Liquidsoap Source (Advanced)¶
TODO
- Liquidsoap
- It’s complicated but lots of fun to use.