Question: Installing arr-scripts without dockers?!
pickonedev opened this issue · 3 comments
Hi!
I have installed bazarr, sonarr, radarr without docker containers. There is any possibility to install arr-scripts the same, without dockers?
If yes, can someone please tell me how to achieve this? I'm two weeks linux newbie, so be patient with me.
Thanks!
I haven't tested this yet (aside from making sure it does install properly in ubuntu).
Edit: Tested and working in Ubuntu. Note, I am not providing support for this
#!/usr/bin/bash
# This is a "slightly" modified version of https://github.com/RandomNinjaAtk/arr-scripts/blob/main/lidarr/setup.bash
# Its probably worth cleaning this up a bit so _some_/all of it can be submitted upstream?
CUSTOM_SERVICES_D=/opt/lidarr-scripts/custom-services.d
CUSTOM_SCRIPTS_D=/opt/lidarr-scripts/custom-cont-init.d
CONFIG_DIR=/opt/lidarr-scripts/config
LIDARR_SERVICE_NAME=lidarr.service
LIDARR_DEPENEDENT_SERVICE_NAME=lidarr-setup.service # This the service that will run the various scripts in ${CUSTOM_SCRIPTS_D}
SMA_PATH="/usr/local/sma"
OPUSTAGS_VERSION=1.10.1
NODE_VERSION=22
ATOMICPARSLEY_VERSION="20240608.083822.1ed9031"
version="1.3-m"
echo "*** updating repo ***" &&\
apt-get update -yq &&\
apt-get install curl -yq &&\
curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" -o /tmp/nodesource.sh &&\
bash /tmp/nodesource.sh &&\
rm /tmp/nodesource.sh
echo "*** install packages ***" && \
apt-get install -qy \
tidy \
flac \
jq \
git \
gcc \
ffmpeg \
imagemagick \
opus-tools \
python3-dev \
python3-pip \
unzip \
nodejs \
build-essential \
cmake \
pkg-config \
wget \
libogg-dev &&\
# We need to build opustags since its not in the ubuntu repo yet
# thanks https://askubuntu.com/a/1405659
echo "*** building opustags ***" &&\
mkdir /tmp/opustags_build &&\
curl -fsSL "https://github.com/fmang/opustags/archive/refs/tags/${OPUSTAGS_VERSION}.tar.gz" -o /tmp/opustags.tar.gz &&\
pushd /tmp/opustags_build &&\
tar -xzf /tmp/opustags.tar.gz &&\
rm -f /tmp/opustags.tar.gz &&\
pushd $(find /tmp/opustags_build/ -maxdepth 1 -mindepth 1 -type d -iname 'opustags*') &&\
mkdir -p build &&\
pushd build &&\
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release .. &&\
make &&\
make install &&\
popd && popd && popd &&\
rm -rf /tmp/opustags_build &&\
# need to install atomicparsley
echo "*** installing atomic parsley ***" &&\
curl -fsSL "https://github.com/wez/atomicparsley/releases/download/${ATOMICPARSLEY_VERSION}/AtomicParsleyLinux.zip" -o /tmp/atomicparsley.zip &&\
pushd /usr/local/bin &&\
unzip /tmp/atomicparsley.zip && popd &&\
rm /tmp/atomicparsley.zip &&\
echo "*** install freyr client ***" && \
npm install -g miraclx/freyr-js &&\
echo "*** install python packages ***" && \
pip install --upgrade --no-cache-dir \
jellyfish \
beautifulsoup4 \
yt-dlp \
beets \
yq \
pyxDamerauLevenshtein \
pyacoustid \
requests \
colorama \
python-telegram-bot \
pylast \
mutagen \
r128gain \
tidal-dl \
deemix && \
echo "************ setup SMA ************"
if [ -d "${SMA_PATH}" ]; then
rm -rf "${SMA_PATH}"
fi
echo "************ setup directory ************" && \
mkdir -p ${SMA_PATH} && \
echo "************ download repo ************" && \
git clone https://github.com/mdhiggins/sickbeard_mp4_automator.git ${SMA_PATH} && \
mkdir -p ${SMA_PATH}/config && \
echo "************ create logging file ************" && \
mkdir -p ${SMA_PATH}/config && \
touch ${SMA_PATH}/config/sma.log && \
chgrp users ${SMA_PATH}/config/sma.log && \
chmod g+w ${SMA_PATH}/config/sma.log && \
echo "************ install pip dependencies ************" && \
python3 -m pip install --upgrade pip && \
pip3 install -r ${SMA_PATH}/setup/requirements.txt
mkdir -p ${CUSTOM_SERVICES_D}
echo "Download QueueCleaner service..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/universal/services/QueueCleaner -o ${CUSTOM_SERVICES_D}/QueueCleaner.bash
echo "Done"
echo "Download AutoConfig service..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/AutoConfig.service.bash -o ${CUSTOM_SERVICES_D}/AutoConfig.bash
echo "Done"
echo "Download Video service..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/Video.service.bash -o ${CUSTOM_SERVICES_D}/Video.bash
echo "Done"
echo "Download Tidal Video Downloader service..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/TidalVideoDownloader.bash -o ${CUSTOM_SERVICES_D}/TidalVideoDownloader.bash
echo "Done"
echo "Download Audio service..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/Audio.service.bash -o ${CUSTOM_SERVICES_D}/Audio.bash
echo "Done"
echo "Download AutoArtistAdder service..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/AutoArtistAdder.bash -o ${CUSTOM_SERVICES_D}/AutoArtistAdder.bash
echo "Done"
echo "Download UnmappedFilesCleaner service..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/UnmappedFilesCleaner.bash -o ${CUSTOM_SERVICES_D}/UnmappedFilesCleaner.bash
echo "Done"
mkdir -p ${CUSTOM_SERVICES_D}/python
echo "Download ARLChecker service..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/python/ARLChecker.py -o ${CUSTOM_SERVICES_D}/python/ARLChecker.py
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/ARLChecker -o ${CUSTOM_SERVICES_D}/ARLChecker
echo "Done"
mkdir -p ${CONFIG_DIR}/extended
echo "Download Script Functions..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/universal/functions.bash -o ${CONFIG_DIR}/extended/functions
echo "Done"
echo "Download PlexNotify script..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/PlexNotify.bash -o ${CONFIG_DIR}/extended/PlexNotify.bash
echo "Done"
echo "Download SMA config..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/sma.ini -o ${CONFIG_DIR}/extended/sma.ini
echo "Done"
if [ ! -f ${CONFIG_DIR}/extended/beets-config.yaml ]; then
echo "Download Beets config..."
curl "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/beets-config.yaml" -o ${CONFIG_DIR}/extended/beets-config.yaml
echo "Done"
fi
if [ ! -f ${CONFIG_DIR}/extended/beets-config-lidarr.yaml ]; then
echo "Download Beets lidarr config..."
curl "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/beets-config-lidarr.yaml" -o ${CONFIG_DIR}/extended/beets-config-lidarr.yaml
echo "Done"
fi
if [ ! -f ${CONFIG_DIR}/extended/deemix_config.json ]; then
echo "Download Deemix config..."
curl "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/deemix_config.json" -o ${CONFIG_DIR}/extended/deemix_config.json
echo "Done"
fi
if [ ! -f ${CONFIG_DIR}/extended/tidal-dl.json ]; then
echo "Download Tidal config..."
curl "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/tidal-dl.json" -o ${CONFIG_DIR}/extended/tidal-dl.json
echo "Done"
fi
echo "Download LyricExtractor script..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/LyricExtractor.bash -o ${CONFIG_DIR}/extended/LyricExtractor.bash
echo "Done"
echo "Download ArtworkExtractor script..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/ArtworkExtractor.bash -o ${CONFIG_DIR}/extended/ArtworkExtractor.bash
echo "Done"
echo "Download Beets Tagger script..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/BeetsTagger.bash -o ${CONFIG_DIR}/extended/BeetsTagger.bash
echo "Done"
if [ ! -f ${CONFIG_DIR}/extended/beets-genre-whitelist.txt ]; then
echo "Download beets-genre-whitelist.txt..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/beets-genre-whitelist.txt -o ${CONFIG_DIR}/extended/beets-genre-whitelist.txt
echo "Done"
fi
if [ ! -f ${CONFIG_DIR}/extended.conf ]; then
echo "Download Extended config..."
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/lidarr/extended.conf -o ${CONFIG_DIR}/extended.conf
chmod 777 ${CONFIG_DIR}/extended.conf
echo "Done"
fi
cat << EOF > /usr/local/bin/lidarr-setup-scripts.sh
#!/usr/bin/sh
for file in ${CUSTOM_SCRIPTS_D}/*; do
echo "Running \${file}"
chmod 744 \${file}
./\${file}
done
EOF
chmod 744 /usr/local/bin/lidarr-setup-scripts.sh
# https://www.linuxserver.io/blog/2019-09-14-customizing-our-containers
# Now that we have everything downloaded, we are going to setup a systemd script that starts each of these before lidarr starts
cat << EOF > /etc/systemd/system/${LIDARR_DEPENEDENT_SERVICE_NAME}
[Unit]
Description=Lidarr Setup Scripts
After=syslog.target network.target
[Service]
User=root
Type=oneshot
ExecStart=/usr/local/bin/lidarr-setup-scripts.sh
[Install]
WantedBy=multi-user.target
EOF
chmod 644 /etc/systemd/system/${LIDARR_DEPENEDENT_SERVICE_NAME}
# Next we need to create a service file for every service we downloaded
service_files=()
readarray -d '' services < <(find "${CUSTOM_SERVICES_D}" -maxdepth 1 -mindepth 1 -type f -print0)
for service in "${services[@]}"; do
chmod 744 ${service}
service_name=$(basename "${service}")
service_file="/etc/systemd/system/${service_name}.service"
service_files+=("${service_file}")
echo "Setting up service file ${service_file}"
cat << EOF > ${service_file}
[Unit]
Description=Lidarr Companion Script ${service}
After=${LIDARR_SERVICE_NAME}
[Service]
Type=simple
ExecStart=${service}
[Install]
WantedBy=multi-user.target
EOF
done
if [ "${CONFIG_DIR}" != "/config" ]; then
echo "Symlinking ${CONFIG_DIR} to /config"
if [ -e /config ] && [ "$(readlink -f /config)" != "${CONFIG_DIR}" ] ; then
echo "/config already exists!"
exit 1
fi
ln -s "${CONFIG_DIR}" /config 2>/dev/null
fi
mkdir -p "${CONFIG_DIR}/logs"
# symlinking env to with-contenv to make docker scripts shutup
[ ! -f /usr/bin/with-contenv ] && ln -s /usr/bin/env /usr/bin/with-contenv
# Finally we need to reload systemd and get things up and running
systemctl daemon-reload -q
for service in "${service_files[@]}"; do
echo "Enabling ${service}"
systemctl enable --now "${service}"
done
exitThat said, if you are "new" to linux, you may consider not installing lidarr and this baremetal. This tool is absolutely designed to work with the container version of lidarr and makes several assumptions that it is working in docker. I would use it as intended
What @miversen33 said is right... Nothing stopping you from running these outside the container on a linux system but support is complicated enough as is.... So no support will be provided, but your welcome to do what you want with the scripts....
@RandomNinjaAtk would you be open to me updating the above script so its more "maintainable" and extending it to allow for proper outside docker support?
Really your script does 3 things
- Install packages from the os package manager (the hardest part to extend but not impossible)
- Install python packages (should work across all major linux distros)
- Sets up services and init scripts for the linuxserver container (can be relatively easily modified to set those up as systemd-scripts as well via the above).
If so, I am open to doing that as I am using lidarr outside a container and in my specific case, I cannot use the linuxserver container version (due to a DNS bug with lidarr in alpine I guess?).