From 673df1c2b7152a5fc22478777b0f61c8af7c438e Mon Sep 17 00:00:00 2001 From: kjeld Schouten-Lebbing Date: Thu, 27 Feb 2020 18:12:07 +0100 Subject: [PATCH] Added -arr services and updates organizr --- lidarr-conf/lidarr.rc | 36 +++++++++++++++++++++ lidarr.sh | 20 ++++++++++++ organizr-conf/custom/organizr.conf | 29 ++++++++++++++++- radarr-conf/radarr.rc | 50 ++++++++++++++++++++++++++++++ radarr.sh | 20 ++++++++++++ sonarr-conf/sonarr.rc | 50 ++++++++++++++++++++++++++++++ sonarr.sh | 20 ++++++++++++ 7 files changed, 224 insertions(+), 1 deletion(-) create mode 100644 lidarr-conf/lidarr.rc create mode 100644 lidarr.sh create mode 100644 radarr-conf/radarr.rc create mode 100644 radarr.sh create mode 100644 sonarr-conf/sonarr.rc create mode 100644 sonarr.sh diff --git a/lidarr-conf/lidarr.rc b/lidarr-conf/lidarr.rc new file mode 100644 index 00000000..a47c4d35 --- /dev/null +++ b/lidarr-conf/lidarr.rc @@ -0,0 +1,36 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: lidarr +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable lidarr: +# lidarr_enable="YES" + +. /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}/lidarr.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" \ No newline at end of file diff --git a/lidarr.sh b/lidarr.sh new file mode 100644 index 00000000..c61d530f --- /dev/null +++ b/lidarr.sh @@ -0,0 +1,20 @@ +echo '{"pkgs":["mono","mediainfo","sqlite3","ca_root_nss","curl","chromaprint","nano"]}' > /tmp/pkg.json +iocage create -n "lidarr" -p /tmp/pkg.json -r 11.3-RELEASE interfaces="vnet0:bridge30" ip4_addr="vnet0|192.168.30.32/24" defaultrouter="192.168.30.1" vnet="on" allow_raw_sockets="1" boot="on" +rm /tmp/pkg.json +iocage exec lidarr mkdir -p /config +iocage exec lidarr mkdir -p /mnt/music +iocage exec lidarr mkdir -p /mnt/fetched +iocage fstab -a lidarr /mnt/tank/apps/lidarr /config nullfs rw 0 0 +iocage fstab -a lidarr /mnt/tank/downloads/complete /mnt/fetched nullfs rw 0 0 +iocage fstab -a lidarr /mnt/tank/library/Music /mnt/music nullfs rw 0 0 +iocage exec lidarr ln -s /usr/local/bin/mono /usr/bin/mono +iocage exec lidarr "fetch https://github.com/lidarr/Lidarr/releases/download/v0.2.0.371/Lidarr.develop.0.2.0.371.linux.tar.gz -o /usr/local/share" +iocage exec lidarr "tar -xzvf /usr/local/share/Lidarr.develop.*.linux.tar.gz -C /usr/local/share" +iocage exec lidarr "rm /usr/local/share/Lidarr.*.tar.gz" +iocage exec lidarr "pw user add lidarr -c lidarr -u 353 -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 +cp ./lidarr-conf/lidarr.rc /mnt/tank/iocage/jails/lidarr/root/usr/local/etc/rc.d/lidarr +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 \ No newline at end of file diff --git a/organizr-conf/custom/organizr.conf b/organizr-conf/custom/organizr.conf index d3759b02..817615c4 100644 --- a/organizr-conf/custom/organizr.conf +++ b/organizr-conf/custom/organizr.conf @@ -20,7 +20,7 @@ location / { location /transmission { auth_request /auth-0; add_header X-Frame-Options "SAMEORIGIN"; - proxy_pass http://127.0.0.1:9091; + proxy_pass http://192.168.30.29:9091; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -61,6 +61,15 @@ location /radarr { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } + + location /lidarr { + auth_request /auth-0; + add_header X-Frame-Options "SAMEORIGIN"; + proxy_pass http://192.168.30.32:7878; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } location /jackett { auth_request /auth-0; @@ -126,4 +135,22 @@ location /ombi/ { proxy_set_header Connection keep-alive; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; + } + + location /grafana { + auth_request /auth-0; + add_header X-Frame-Options "SAMEORIGIN"; + proxy_pass http://192.168.30.34; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location /bitwarden { + auth_request /auth-0; + add_header X-Frame-Options "SAMEORIGIN"; + proxy_pass http://192.168.30.33:8000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } \ No newline at end of file diff --git a/radarr-conf/radarr.rc b/radarr-conf/radarr.rc new file mode 100644 index 00000000..0c746079 --- /dev/null +++ b/radarr-conf/radarr.rc @@ -0,0 +1,50 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: radarr +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# radarr_enable: Set to YES to enable radarr +# Default: NO +# radarr_user: The user account used to run the radarr 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 +# radarr_group: The group account used to run the radarr 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 +# radarr_data_dir: Directory where radarr configuration +# data is stored. +# Default: /var/db/radarr + +. /etc/rc.subr +name=radarr +rcvar=${name}_enable +load_rc_config $name + +: ${radarr_enable:="NO"} +: ${radarr_user:="radarr"} +: ${radarr_group:="radarr"} +: ${radarr_data_dir:="/config"} + +pidfile="${radarr_data_dir}/nzbdrone.pid" +command="/usr/sbin/daemon" +procname="/usr/local/bin/mono" +command_args="-f ${procname} /usr/local/share/Radarr/Radarr.exe --data=${radarr_data_dir} --nobrowser" + +start_precmd=radarr_precmd +radarr_precmd() { +if [ ! -d ${radarr_data_dir} ]; then +install -d -o ${radarr_user} -g ${radarr_group} ${radarr_data_dir} +fi + +export XDG_CONFIG_HOME=${radarr_data_dir} +} + +run_rc_command "$1" \ No newline at end of file diff --git a/radarr.sh b/radarr.sh new file mode 100644 index 00000000..e3043e4b --- /dev/null +++ b/radarr.sh @@ -0,0 +1,20 @@ +echo '{"pkgs":["mono","mediainfo","sqlite3","ca_root_nss","curl","nano"]}' > /tmp/pkg.json +iocage create -n "radarr" -p /tmp/pkg.json -r 11.3-RELEASE interfaces="vnet0:bridge30" ip4_addr="vnet0|192.168.30.31/24" defaultrouter="192.168.30.1" vnet="on" allow_raw_sockets="1" boot="on" +rm /tmp/pkg.json +iocage exec radarr mkdir -p /config +iocage exec radarr mkdir -p /mnt/music +iocage exec radarr mkdir -p /mnt/fetched +iocage fstab -a radarr /mnt/tank/apps/radarr /config nullfs rw 0 0 +iocage fstab -a radarr /mnt/tank/downloads/complete /mnt/fetched nullfs rw 0 0 +iocage fstab -a radarr /mnt/tank/library/Movies /mnt/movies nullfs rw 0 0 +iocage exec radarr ln -s /usr/local/bin/mono /usr/bin/mono +iocage exec radarr "fetch https://github.com/Radarr/Radarr/releases/download/v0.2.0.995/Radarr.develop.0.2.0.995.linux.tar.gz -o /usr/local/share" +iocage exec radarr "tar -xzvf /usr/local/share/Radarr.*.linux.tar.gz -C /usr/local/share" +iocage exec radarr rm /usr/local/share/Radarr.*.linux.tar.gz +iocage exec radarr "pw user add radarr -c radarr -u 352 -d /nonexistent -s /usr/bin/nologin" +iocage exec radarr chown -R radarr:radarr /usr/local/share/Radarr /config +iocage exec radarr mkdir /usr/local/etc/rc.d +cp ./radarr-conf/radarr.rc /mnt/tank/iocage/jails/radarr/root/usr/local/etc/rc.d/radarr +iocage exec radarr chmod u+x /usr/local/etc/rc.d/radarr +iocage exec radarr sysrc "radarr_enable=YES" +iocage exec radarr service radarr start \ No newline at end of file diff --git a/sonarr-conf/sonarr.rc b/sonarr-conf/sonarr.rc new file mode 100644 index 00000000..079045bb --- /dev/null +++ b/sonarr-conf/sonarr.rc @@ -0,0 +1,50 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: sonarr +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# sonarr_enable: Set to YES to enable sonarr +# Default: NO +# sonarr_user: The user account used to run the sonarr 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 + # sonarr_group: The group account used to run the sonarr 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 +# sonarr_data_dir: Directory where sonarr configuration +# data is stored. +# Default: /var/db/sonarr + +. /etc/rc.subr +name=sonarr +rcvar=${name}_enable +load_rc_config $name + +: ${sonarr_enable:="NO"} +: ${sonarr_user:="sonarr"} +: ${sonarr_group:="sonarr"} +: ${sonarr_data_dir:="/config"} + +pidfile="${sonarr_data_dir}/nzbdrone.pid" +command="/usr/sbin/daemon" +procname="/usr/local/bin/mono" +command_args="-f ${procname} /usr/local/share/NzbDrone/NzbDrone.exe --data=${sonarr_data_dir} --nobrowser" + +start_precmd=sonarr_precmd +sonarr_precmd() { +if [ ! -d ${sonarr_data_dir} ]; then +install -d -o ${sonarr_user} -g ${sonarr_group} ${sonarr_data_dir} +fi + +export XDG_CONFIG_HOME=${sonarr_data_dir} +} + +run_rc_command "$1" \ No newline at end of file diff --git a/sonarr.sh b/sonarr.sh new file mode 100644 index 00000000..e99bd3eb --- /dev/null +++ b/sonarr.sh @@ -0,0 +1,20 @@ +echo '{"pkgs":["mono","mediainfo","sqlite3","ca_root_nss","curl","nano"]}' > /tmp/pkg.json +iocage create -n "sonarr" -p /tmp/pkg.json -r 11.3-RELEASE interfaces="vnet0:bridge30" ip4_addr="vnet0|192.168.30.30/24" defaultrouter="192.168.30.1" vnet="on" allow_raw_sockets="1" boot="on" +rm /tmp/pkg.json +iocage exec sonarr mkdir -p /config +iocage exec sonarr mkdir -p /mnt/music +iocage exec sonarr mkdir -p /mnt/fetched +iocage fstab -a sonarr /mnt/tank/apps/sonarr /config nullfs rw 0 0 +iocage fstab -a sonarr /mnt/tank/downloads/complete /mnt/fetched nullfs rw 0 0 +iocage fstab -a sonarr /mnt/tank/library/Series /mnt/series nullfs rw 0 0 +iocage exec sonarr ln -s /usr/local/bin/mono /usr/bin/mono +iocage exec sonarr "fetch http://download.sonarr.tv/v2/master/mono/NzbDrone.master.tar.gz -o /usr/local/share" +iocage exec sonarr "tar -xzvf /usr/local/share/NzbDrone.master.tar.gz -C /usr/local/share" +iocage exec sonarr rm /usr/local/share/NzbDrone.master.tar.gz +iocage exec sonarr "pw user add sonarr -c sonarr -u 351 -d /nonexistent -s /usr/bin/nologin" +iocage exec sonarr chown -R sonarr:sonarr /usr/local/share/NzbDrone /config +iocage exec sonarr mkdir /usr/local/etc/rc.d +cp ./sonarr-conf/sonarr.rc /mnt/tank/iocage/jails/sonarr/root/usr/local/etc/rc.d/sonarr +iocage exec sonarr chmod u+x /usr/local/etc/rc.d/sonarr +iocage exec sonarr sysrc "sonarr_enable=YES" +iocage exec sonarr service sonarr start \ No newline at end of file