summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--mkosi.default14
-rw-r--r--mkosi.nspawn17
-rwxr-xr-xmkosi.postinst17
l---------mkosi.skeleton/etc/systemd/system/multi-user.target.wants/sonarr.service1
-rw-r--r--mkosi.skeleton/etc/systemd/system/sonarr.service17
6 files changed, 68 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3dff6a2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+# mkosi cache
+mkosi.cache/*
diff --git a/mkosi.default b/mkosi.default
new file mode 100644
index 0000000..883527c
--- /dev/null
+++ b/mkosi.default
@@ -0,0 +1,14 @@
+[Distribution]
+Distribution=ubuntu
+Release=bionic
+Repositories=main,universe
+Mirror=http://no.archive.ubuntu.com
+
+[Output]
+Format=directory
+Output=/var/lib/machines/sonarr
+
+[Packages]
+WithNetwork=yes
+Packages=
+ gnupg
diff --git a/mkosi.nspawn b/mkosi.nspawn
new file mode 100644
index 0000000..62ce7ac
--- /dev/null
+++ b/mkosi.nspawn
@@ -0,0 +1,17 @@
+[Exec]
+Hostname=sonarr
+ResolvConf=copy-host
+Timezone=copy
+PrivateUsers=false
+NoNewPrivilegs=yes
+
+[Files]
+#PrivateUsersChown=yes
+BindReadOnly=
+Bind=/var/local/docker-sonarr:/config
+Bind=/srv/cold/series:/tv
+Bind=/srv/cold/series:/srv/cold/series
+Bind=/srv/data/complete:/downloads
+
+[Network]
+VirtualEthernet=no
diff --git a/mkosi.postinst b/mkosi.postinst
new file mode 100755
index 0000000..62bf4ea
--- /dev/null
+++ b/mkosi.postinst
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -ex
+
+export DEBIAN_FRONTEND=noninteractive
+export XDG_CONFIG_HOME="/config/xdg"
+
+apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0xA236C58F409091A18ACA53CBEBFF6B99D9B78493
+echo "deb http://apt.sonarr.tv/ master main" > /etc/apt/sources.list.d/sonarr.list
+
+apt update
+
+apt install --yes nzbdrone
+
+groupadd --system --gid 997 warez
+useradd --system --gid warez --uid 997 --home-dir /opt/NzbDrone warez
+
+chown -R warez: /opt/NzbDrone
diff --git a/mkosi.skeleton/etc/systemd/system/multi-user.target.wants/sonarr.service b/mkosi.skeleton/etc/systemd/system/multi-user.target.wants/sonarr.service
new file mode 120000
index 0000000..c518c7e
--- /dev/null
+++ b/mkosi.skeleton/etc/systemd/system/multi-user.target.wants/sonarr.service
@@ -0,0 +1 @@
+../sonarr.service \ No newline at end of file
diff --git a/mkosi.skeleton/etc/systemd/system/sonarr.service b/mkosi.skeleton/etc/systemd/system/sonarr.service
new file mode 100644
index 0000000..86b461b
--- /dev/null
+++ b/mkosi.skeleton/etc/systemd/system/sonarr.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Sonarr Daemon
+After=network.target
+
+[Service]
+User=warez
+Group=warez
+Umask=022
+
+Type=simple
+ExecStart=/usr/bin/mono /opt/NzbDrone/NzbDrone.exe -nobrowser -data=/config
+TimeoutStopSec=20
+KillMode=process
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target