diff --git a/nomad-job/rutorrent.nomad b/nomad-job/rutorrent.nomad index 61838cd..930f0ef 100644 --- a/nomad-job/rutorrent.nomad +++ b/nomad-job/rutorrent.nomad @@ -6,6 +6,9 @@ job "torrent" { meta { forcedeploy = "0" } + vault { + policies= ["torrent"] + } group "bittorent" { network { mode = "host" @@ -40,10 +43,17 @@ job "torrent" { "traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.win", "traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver", "traefik.http.routers.${NOMAD_JOB_NAME}.entrypoints=web,websecure", - - + "traefik.http.routers.${NOMAD_JOB_NAME}.middlewares=torrentauth", + "traefik.http.middlewares.torrentauth.basicauth.users=admin:${ADMIN_HASHED_PWD}" ] } + template { + data = <<-EOF + ADMIN_HASHED_PWD={{ with secret "secrets/nomad/torrent" }}{{.Data.data.hashed_pwd}}{{ end }} + EOF + destination = "secrets/env" + env = true + } user = "root" config {