Add sabnzbd
This commit is contained in:
parent
2f9d0533e0
commit
f46cb72681
@ -239,6 +239,9 @@
|
||||
- name: media-downloads
|
||||
path: /srv/volumes/media-write/Downloads
|
||||
read_only: false
|
||||
- name: sabnzbd-config
|
||||
path: /srv/volumes/media-write/Downloads/sabnzbd
|
||||
read_only: false
|
||||
- name: photoprism-media
|
||||
path: /srv/volumes/photos/Photoprism
|
||||
read_only: false
|
||||
|
26
services/backups/jobs/sabnzbd.hcl
Normal file
26
services/backups/jobs/sabnzbd.hcl
Normal file
@ -0,0 +1,26 @@
|
||||
job "sabnzbd" {
|
||||
schedule = "@daily"
|
||||
|
||||
config {
|
||||
repo = "rclone::ftp,env_auth:/nomad/sabnzbd"
|
||||
passphrase = env("BACKUP_PASSPHRASE")
|
||||
}
|
||||
|
||||
backup {
|
||||
paths = ["/data/media-write/Downloads/sabnzbd"]
|
||||
# Because path is absolute
|
||||
restore_opts {
|
||||
Target = "/"
|
||||
}
|
||||
}
|
||||
|
||||
forget {
|
||||
KeepLast = 2
|
||||
KeepHourly = 24
|
||||
KeepDaily = 30
|
||||
KeepWeekly = 8
|
||||
KeepMonthly = 6
|
||||
KeepYearly = 2
|
||||
Prune = true
|
||||
}
|
||||
}
|
@ -4,6 +4,88 @@ job "ipdvr" {
|
||||
|
||||
type = "service"
|
||||
|
||||
group "sabnzbd" {
|
||||
network {
|
||||
mode = "bridge"
|
||||
|
||||
port "main" {
|
||||
host_network = "loopback"
|
||||
to = 8080
|
||||
}
|
||||
}
|
||||
|
||||
volume "sabnzbd-config" {
|
||||
type = "host"
|
||||
read_only = false
|
||||
source = "sabnzbd-config"
|
||||
}
|
||||
|
||||
volume "media-downloads" {
|
||||
type = "host"
|
||||
read_only = false
|
||||
source = "media-downloads"
|
||||
}
|
||||
|
||||
service {
|
||||
name = "sabnzbd"
|
||||
port = "main"
|
||||
|
||||
connect {
|
||||
sidecar_service {
|
||||
proxy {
|
||||
local_service_port = 8080
|
||||
}
|
||||
}
|
||||
|
||||
sidecar_task {
|
||||
resources {
|
||||
cpu = 50
|
||||
memory = 20
|
||||
memory_max = 50
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tags = [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.sabnzbd.entryPoints=websecure",
|
||||
]
|
||||
}
|
||||
|
||||
task "sabnzbd" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "linuxserver/sabnzbd"
|
||||
ports = ["main"]
|
||||
}
|
||||
|
||||
env = {
|
||||
"PGID" = 100
|
||||
"PUID" = 1001
|
||||
"TZ" = "America/Los_Angeles"
|
||||
}
|
||||
|
||||
volume_mount {
|
||||
volume = "sabnzbd-config"
|
||||
destination = "/config"
|
||||
read_only = false
|
||||
}
|
||||
|
||||
volume_mount {
|
||||
volume = "media-downloads"
|
||||
destination = "/downloads"
|
||||
read_only = false
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 400
|
||||
memory = 500
|
||||
memory_max = 800
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group "nzbget" {
|
||||
network {
|
||||
mode = "bridge"
|
||||
@ -127,6 +209,11 @@ job "ipdvr" {
|
||||
destination_name = "nzbget"
|
||||
local_bind_port = 6789
|
||||
}
|
||||
|
||||
upstreams {
|
||||
destination_name = "sabnzbd"
|
||||
local_bind_port = 8080
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,24 @@ resource "nomad_job" "ipdvr" {
|
||||
jobspec = file("${path.module}/ip-dvr.nomad")
|
||||
}
|
||||
|
||||
resource "consul_config_entry" "sabnzbd_intents" {
|
||||
depends_on = [nomad_job.ipdvr]
|
||||
|
||||
name = "sabnzbd"
|
||||
kind = "service-intentions"
|
||||
|
||||
config_json = jsonencode({
|
||||
Sources = [
|
||||
{
|
||||
Action = "allow"
|
||||
Name = "sonarr"
|
||||
Precedence = 9
|
||||
Type = "consul"
|
||||
},
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
resource "consul_config_entry" "nzbget_intents" {
|
||||
depends_on = [nomad_job.ipdvr]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user