forked from kenellorando/cadence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·70 lines (63 loc) · 2.94 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
echo "***************************************************************"
echo "NOTE: If you need help determining configuration values to use,"
echo "installation documentation is available on GitHub:"
echo "https://github.com/kenellorando/cadence/wiki/Installation"
echo "***************************************************************"
echo ""
echo "[1/5] Absolute Path to Music"
echo "Set an absolute path to a directory containing audio files (e.g. mp3, flac)"
echo "to be played on the radio. The target is not recursively searched."
read -p " Music path: " CADENCE_PATH
echo ""
echo "[2/5] Stream Host Address"
echo "Set the stream host address. This may be a DNS name, public IP, or private IP."
echo "Use localhost:8000 if your Cadence instance is meant for local use only."
read -p " Stream address: " CADENCE_STREAM_HOST
echo ""
echo "[3/5] Rate Limiter Timeout"
echo "Set a rate limit timeout in integer seconds. This prevents the same listener"
echo "from requesting songs within the configured timeframe. Set to 0 to disable."
read -p " Rate limit: " CADENCE_RATE
echo ""
echo "[4/5] Radio Service Password"
echo "Set a secure, unique service password. Input is hidden."
read -s -p " Password: " CADENCE_PASS
echo ""
echo ""
echo "[5/5] Enable Reverse Proxy?"
echo "Do you want to enable a reverse proxy? Skip if you are broadcasting locally only"
echo "or have your own reverse proxy configured. Skip if you do not know what this means."
read -p " [y/N]: " ENABLE_REVERSE_PROXY
if [[ "$ENABLE_REVERSE_PROXY" =~ ^([yY])$ ]]
then
echo "Please provide the domain name you will use for Cadence UI."
read -p " Web UI Domain: " CADENCE_WEB_HOST
else
echo "No reverse proxy will be configured."
fi
cp ./config/cadence.env.example ./config/cadence.env
cp ./config/icecast.xml.example ./config/icecast.xml
cp ./config/liquidsoap.liq.example ./config/liquidsoap.liq
cp ./config/nginx.conf.example ./config/nginx.conf
cp ./docker-compose.yml.example ./docker-compose.yml
sed -i 's|CADENCE_PASS_EXAMPLE|'"$CADENCE_PASS"'|g' ./config/cadence.env
sed -i 's|CADENCE_PASS_EXAMPLE|'"$CADENCE_PASS"'|g' ./config/icecast.xml
sed -i 's|CADENCE_PASS_EXAMPLE|'"$CADENCE_PASS"'|g' ./config/liquidsoap.liq
sed -i 's|CADENCE_RATE_EXAMPLE|'"$CADENCE_RATE"'|g' ./config/cadence.env
sed -i 's|CADENCE_STREAM_HOST_EXAMPLE|'"$CADENCE_STREAM_HOST"'|g' ./config/icecast.xml
sed -i 's|CADENCE_PATH_EXAMPLE|'"$CADENCE_PATH"'|g' ./config/cadence.env
sed -i 's|CADENCE_PATH_EXAMPLE|'"$CADENCE_PATH"'|g' ./config/liquidsoap.liq
sed -i 's|CADENCE_STREAM_HOST_EXAMPLE|'"$CADENCE_STREAM_HOST"'|g' ./config/nginx.conf
sed -i 's|CADENCE_WEB_HOST_EXAMPLE|'"$CADENCE_WEB_HOST"'|g' ./config/nginx.conf
sed -i 's|CADENCE_PATH_EXAMPLE|'"$CADENCE_PATH"'|g' ./docker-compose.yml
echo ""
echo "Configuration completed."
docker compose down
docker compose pull
if [[ "$ENABLE_REVERSE_PROXY" =~ ^([yY])$ ]]
then
docker compose --profile nginx up
else
docker compose up
fi