Resource icon

FN11.1 iocage jails for NZB Hydra and Lidarr (headphones alternative)

Hello

Based on this resource but with some more jails you can add. I took the scripts from that resource and changed what needed to be changed to make it work for the below applications.

Remember to change <IP>/<MASK> and <GATEWAY> as indicated in the other guide. Also the location to your files. Mines /mnt/JRaid/ but yours will be different

NZB Hydra
NZBHydra is a meta search for NZB indexers. It provides easy access to a number of raw and newznab based indexers. You can search all your indexers from one place and use it as indexer source for tools like Sonarr, Radarr, etc.
echo '{"pkgs":["databases/py-sqlite3","security/py-openssl","ca_root_nss","git"]}' > /tmp/pkg.json
iocage create -n "nzbhydra" -p /tmp/pkg.json -r 11.1-RELEASE ip4_addr="vnet0|<IP>/<MASK>" defaultrouter="<GATEWAY>" vnet="on" allow_raw_sockets="1" boot="on"
rm /tmp/pkg.json
iocage fstab -a nzbhydra /mnt/JRaid/Applications/Nzbhydra /config nullfs rw 0 0
iocage exec nzbhydra ln -s /usr/local/bin/python2.7 /usr/local/bin/python
iocage exec nzbhydra git clone https://github.com/theotherp/nzbhydra.git /usr/local/share/nzbhydra
iocage exec nzbhydra "pw user add nzbhydra -c nzbhydra -u 1001 -d /nonexistent -s /usr/bin/nologin"
iocage exec nzbhydra chown -R nzbhydra:nzbhydra /config /usr/local/share/nzbhydra
iocage exec nzbhydra ee /usr/local/etc/rc.d/nzbhydra

> Paste the following:

Code:
#!/bin/sh
#
# PROVIDE: nzbhydra
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# nzbhydra_enable (bool): Set to NO by default.
#		 Set it to YES to enable it.
# nzbhydra_user: The user account nzbhydra daemon runs as what
#		 you want it to be. It uses 'nzbhydra' user by
#		 default. Do not sets it as empty or it will run
#		 as root.
# nzbhydra_group: The group account nzbhydra daemon runs as what
#		 you want it to be. It uses 'nzbhydra' group by
#		 default. Do not sets it as empty or it will run
#		 as wheel.
# nzbhydra_data_dir: Directory where nzbhydra configuration
#		 data is stored.
#		 Default: /var/db/nzbhydra

. /etc/rc.subr
name="nzbhydra"
rcvar="${name}_enable"
load_rc_config ${name}

: ${nzbhydra_enable:="NO"}
: ${nzbhydra_user:="nzbhydra"}
: ${nzbhydra_group:="nzbhydra"}
: ${nzbhydra_data_dir:="/config"}

pidfile="/var/run/nzbhydra/nzbhydra.pid"
command="/usr/local/bin/python"
command_args="/usr/local/share/nzbhydra/nzbhydra.py --config ${nzbhydra_data_dir}/settings.cfg --database ${nzbhydra_data_dir}/nzbhydra.db --pidfile ${pidfile} --daemon --nobrowser"

start_precmd="nzbhydra_prestart"
nzbhydra_prestart() {
if [ ! -d ${pidfile%/*} ]; then
	 install -d -o ${nzbhydra_user} -g ${nzbhydra_group} ${pidfile%/*}
fi

if [ ! -d ${nzbhydra_data_dir} ]; then
	 install -d -o ${nzbhydra_user} -g ${nzbhydra_group} ${nzbhydra_data_dir}
fi
}

run_rc_command "$1"


> Finish paste, save and exit (ctrl+c then type exit and press enter)

iocage exec nzbhydra chmod u+x /usr/local/etc/rc.d/nzbhydra
iocage exec nzbhydra sysrc "nzbhydra_enable=YES"
iocage exec nzbhydra sysrc "nzbhydra_user=nzbhydra"
iocage exec nzbhydra sysrc "nzbhydra_data_dir=/config"
iocage exec nzbhydra service nzbhydra start

Lidarr
Lidarr is a music collection manager for Usenet and BitTorrent users. Like Sonarr and Radarr but for music. It can monitor multiple RSS feeds for new tracks from your favorite artists and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available.

Edit: Please follow the official wiki instead: https://github.com/lidarr/Lidarr/wiki/Installation-(FreeBSD-FreeNAS)

echo '{"pkgs":["mono","mediainfo","sqlite3","ca_root_nss"]}' > /tmp/pkg.json
iocage create -n "lidarr" -p /tmp/pkg.json -r 11.1-RELEASE ip4_addr="vnet0|<IP>/<MASK>" defaultrouter="<GATEWAY>" vnet="on" allow_raw_sockets="1" boot="on"
rm /tmp/pkg.json
iocage fstab -a lidarr /mnt/JRaid/Applications/Lidarr /config nullfs rw 0 0
iocage fstab -a lidarr /mnt/JRaid/Applications/Downloaders /mnt/Downloaders nullfs rw 0 0
iocage fstab -a lidarr /mnt/JRaid/Media /mnt/Media nullfs rw 0 0
iocage exec lidarr ln -s /usr/local/bin/mono /usr/bin/mono
iocage exec lidarr "fetch https://ci.appveyor.com/api/buildjo...tifacts/Lidarr.develop.0.2.0.262.linux.tar.gz -o /usr/local/share"
iocage exec lidarr "tar -xzvf /usr/local/share/Lidarr.*.linux.tar.gz -C /usr/local/share"
iocage exec lidarr "rm /usr/local/share/Lidarr.*.linux.tar.gz"
iocage exec lidarr "pw user add lidarr -c lidarr -u 1001 -d /nonexistent -s /usr/bin/nologin"
iocage exec lidarr chown -R lidarr:lidarr /usr/local/share/Lidarr /config
iocage exec lidarr mkdir /usr/local/etc/rc.d

Create an rc file for radarr using your favorite editor at /mnt/iocage/jails/lidarr/root/usr/local/etc/rc.d/lidarr
(see nzbhydra steps above to use 'ee' if you dont know how)

Code:
#!/bin/sh

# $FreeBSD$
#
# PROVIDE: lidarr
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# lidarr_enable:	Set to YES to enable lidarr
#			Default: NO
# lidarr_user:	The user account used to run the lidarr daemon.
#			This is optional, however do not specifically set this to an
#			empty string as this will cause the daemon to run as root.
#			Default: media
# lidarr_group:	The group account used to run the lidarr daemon.
#			This is optional, however do not specifically set this to an
#			empty string as this will cause the daemon to run with group wheel.
#			Default: media
# lidarr_data_dir:	Directory where lidarr configuration
#			data is stored.
#			Default: /var/db/lidarr

. /etc/rc.subr
name=lidarr
rcvar=${name}_enable
load_rc_config $name

: ${lidarr_enable:="NO"}
: ${lidarr_user:="lidarr"}
: ${lidarr_group:="lidarr"}
: ${lidarr_data_dir:="/config"}

pidfile="${lidarr_data_dir}/nzbdrone.pid"
command="/usr/sbin/daemon"
procname="/usr/local/bin/mono"
command_args="-f ${procname} /usr/local/share/Lidarr/Lidarr.exe --data=${lidarr_data_dir} --nobrowser"

start_precmd=lidarr_precmd
lidarr_precmd() {
	if [ ! -d ${lidarr_data_dir} ]; then
	install -d -o ${lidarr_user} -g ${lidarr_group} ${lidarr_data_dir}
	fi

	export XDG_CONFIG_HOME=${lidarr_data_dir}
}

run_rc_command "$1"


iocage exec lidarr chmod u+x /usr/local/etc/rc.d/lidarr
iocage exec lidarr sysrc "lidarr_enable=YES"
iocage exec lidarr service lidarr start
Author
lukyjay
Views
1,668
First release
Last update
Rating
0.00 star(s) 0 ratings
Top