homelab/nomad-job/rutorrent.nomad

87 lines
2.2 KiB
Plaintext
Raw Permalink Normal View History

2022-05-26 12:20:32 +00:00
job "torrent" {
datacenters = ["hetzner"]
2022-12-10 16:10:32 +00:00
priority = 80
2022-10-29 08:40:01 +00:00
type = "service"
2022-05-26 12:20:32 +00:00
meta {
forcedeploy = "0"
}
2023-11-04 20:34:03 +00:00
vault {
policies= ["torrent"]
}
2022-10-29 08:40:01 +00:00
group "bittorent" {
2022-05-26 12:20:32 +00:00
network {
mode = "host"
port "http" {
2022-10-29 08:40:01 +00:00
to = 8080
2022-05-26 12:20:32 +00:00
host_network = "private"
}
port "torrent" {
2022-10-29 08:40:01 +00:00
static = 6881
2022-05-26 12:20:32 +00:00
host_network = "public"
}
2022-08-27 07:35:11 +00:00
port "ecoute" {
2022-10-29 08:40:01 +00:00
static = 50000
2022-08-27 07:35:11 +00:00
host_network = "public"
}
2022-05-26 12:20:32 +00:00
}
task "bittorent" {
driver = "podman"
2022-05-26 12:20:32 +00:00
service {
name = "bittorent"
port = "http"
address_mode= "host"
2022-05-26 12:20:32 +00:00
tags = [
2022-10-29 08:40:01 +00:00
"homer.enable=true",
"homer.name=torrent",
2023-11-05 18:08:17 +00:00
"homer.url=https://torrent.ducamps.eu",
2022-10-29 08:40:01 +00:00
"homer.service=Application",
2023-11-05 18:08:17 +00:00
"homer.logo=https://${NOMAD_JOB_NAME}.ducamps.eu/images/favicon-196x196.png",
2022-10-29 08:40:01 +00:00
"homer.target=_blank",
"traefik.enable=true",
2023-11-05 18:08:17 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`${NOMAD_JOB_NAME}.ducamps.eu`)",
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.eu",
2022-10-29 08:40:01 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver",
2023-10-07 16:40:40 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.entrypoints=web,websecure",
2023-11-04 20:34:03 +00:00
"traefik.http.routers.${NOMAD_JOB_NAME}.middlewares=torrentauth",
"traefik.http.middlewares.torrentauth.basicauth.users=admin:${ADMIN_HASHED_PWD}"
2022-05-26 12:20:32 +00:00
]
}
2023-11-04 20:34:03 +00:00
template {
data = <<-EOF
ADMIN_HASHED_PWD={{ with secret "secrets/nomad/torrent" }}{{.Data.data.hashed_pwd}}{{ end }}
EOF
destination = "secrets/env"
env = true
}
user = "root"
2022-05-26 12:20:32 +00:00
config {
image = "docker.io/crazymax/rtorrent-rutorrent:latest"
privileged = "true"
2022-05-26 12:20:32 +00:00
ports = [
"http",
2022-08-27 07:35:11 +00:00
"torrent",
"ecoute"
2022-10-29 08:40:01 +00:00
]
2022-05-26 12:20:32 +00:00
volumes = [
2022-10-10 19:22:42 +00:00
"/mnt/hetzner/storagebox/rutorrentConfig:/data",
2022-05-28 14:01:14 +00:00
"/mnt/hetzner/storagebox/file:/downloads"
2022-05-26 12:20:32 +00:00
]
}
env {
2024-01-04 18:37:42 +00:00
PUID = 100001
2022-10-29 08:40:01 +00:00
PGID = 984
UMASK = 002
2022-11-26 20:04:33 +00:00
WEBUI_PORT = "8080"
2022-05-26 12:20:32 +00:00
}
resources {
2022-08-27 07:35:11 +00:00
memory = 450
2022-05-26 12:20:32 +00:00
}
}
}
}