add basic auth to torrent
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
vincent 2023-11-04 21:34:03 +01:00
parent 4e9155e0db
commit 9a0aa359a5

View File

@ -6,6 +6,9 @@ job "torrent" {
meta { meta {
forcedeploy = "0" forcedeploy = "0"
} }
vault {
policies= ["torrent"]
}
group "bittorent" { group "bittorent" {
network { network {
mode = "host" 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.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.win",
"traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver", "traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver",
"traefik.http.routers.${NOMAD_JOB_NAME}.entrypoints=web,websecure", "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" user = "root"
config { config {