job "authelia" { datacenters = ["homelab"] priority = 80 type = "service" meta { forcedeploy = "0" } constraint { attribute = "${attr.cpu.arch}" value = "amd64" } group "authelia" { network { mode = "host" port "authelia" { to = 9091 } } volume "authelia-config" { type = "csi" source = "authelia-config" access_mode = "multi-node-multi-writer" attachment_mode = "file-system" } vault { policies = ["authelia"] } task "authelia" { driver = "docker" service { name = "authelia" port = "authelia" tags = [ "traefik.enable=true", "traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`auth.ducamps.eu`)", "traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=auth.ducamps.eu", "traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver", "traefik.http.routers.${NOMAD_JOB_NAME}.entrypoints=web,websecure", ] } action "generate-client-secret" { command = "authelia" args = ["crypto", "hash", "generate", "pbkdf2", "--random", "--random.length", "72", "--random.charset", "rfc3986" ] } config { image = "authelia/authelia" ports = ["authelia"] args = [ "--config", "/local/configuration.yml", ] } volume_mount { volume = "authelia-config" destination = "/config" } env { AUTHELIA_SESSION_SECRET = uuidv4() AUTHELIA_IDENTITY_VALIDATION_RESET_PASSWORD_JWT_SECRET = uuidv4() } template { data = <