From 0986bbc7405d11d15a0c9fb0670995849dd0530b Mon Sep 17 00:00:00 2001 From: dennis Date: Sat, 19 Oct 2019 23:07:48 +0200 Subject: initial commit --- .gitignore | 2 ++ mkosi.default | 14 ++++++++++++++ mkosi.nspawn | 17 +++++++++++++++++ mkosi.postinst | 17 +++++++++++++++++ .../system/multi-user.target.wants/sonarr.service | 1 + mkosi.skeleton/etc/systemd/system/sonarr.service | 17 +++++++++++++++++ 6 files changed, 68 insertions(+) create mode 100644 .gitignore create mode 100644 mkosi.default create mode 100644 mkosi.nspawn create mode 100755 mkosi.postinst create mode 120000 mkosi.skeleton/etc/systemd/system/multi-user.target.wants/sonarr.service create mode 100644 mkosi.skeleton/etc/systemd/system/sonarr.service 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 -- cgit v1.2.3