Initial productized Importarr service
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
services:
|
||||
importarr:
|
||||
image: ghcr.io/OWNER/importarr:0.1.0
|
||||
env_file: importarr.env
|
||||
ports:
|
||||
- "8765:8765"
|
||||
volumes:
|
||||
- ./config:/config
|
||||
- /srv/scrypted/sabnzbd-data/downloads/manual:/data/downloads/manual
|
||||
- /path/to/movies:/data/movies
|
||||
- /path/to/tv:/data/tv
|
||||
restart: unless-stopped
|
||||
@@ -0,0 +1,12 @@
|
||||
IMPORTARR_SAB_URL=http://sabnzbd:8080
|
||||
IMPORTARR_SAB_API_KEY=change-me
|
||||
IMPORTARR_SAB_CATEGORY=manual
|
||||
IMPORTARR_DOWNLOAD_ROOT=/data/downloads/manual
|
||||
IMPORTARR_MOVIES_ROOT=/data/movies
|
||||
IMPORTARR_TV_ROOT=/data/tv
|
||||
IMPORTARR_STATE_PATH=/config/importarr.db
|
||||
IMPORTARR_LOG_LEVEL=info
|
||||
IMPORTARR_AUTH_TOKEN=change-me
|
||||
IMPORTARR_BIND_HOST=0.0.0.0
|
||||
IMPORTARR_BIND_PORT=8765
|
||||
IMPORTARR_POLL_SECONDS=60
|
||||
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Importarr manual media importer
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/etc/importarr/importarr.env
|
||||
ExecStart=/usr/local/bin/importarr
|
||||
Restart=on-failure
|
||||
User=importarr
|
||||
Group=importarr
|
||||
StateDirectory=importarr
|
||||
ReadWritePaths=/var/lib/importarr /etc/importarr
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Run as root: sudo sh deploy/systemd-install.sh" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
install -d -m 0755 /etc/importarr /var/lib/importarr
|
||||
if ! id importarr >/dev/null 2>&1; then
|
||||
useradd --system --home /var/lib/importarr --shell /usr/sbin/nologin importarr
|
||||
fi
|
||||
chown importarr:importarr /var/lib/importarr
|
||||
if [ ! -f /etc/importarr/importarr.env ]; then
|
||||
install -m 0600 deploy/importarr.env.example /etc/importarr/importarr.env
|
||||
echo "Created /etc/importarr/importarr.env; edit it before starting the service."
|
||||
fi
|
||||
install -m 0644 deploy/importarr.service /etc/systemd/system/importarr.service
|
||||
python3 -m pip install --upgrade .
|
||||
systemctl daemon-reload
|
||||
systemctl enable importarr.service
|
||||
echo "Edit /etc/importarr/importarr.env, then run: systemctl start importarr.service"
|
||||
Reference in New Issue
Block a user