Hey,
I'm curretly transforming from docker
to file
provider to get a more structured overview. In this process I stumbled upon the BasicAuth middleware, which is not working for me anymore. I'm using Traefik 2.2.0
.
I created the user password token as the following:
echo $(htpasswd -nbB user "password") | sed -e s/\\$/\\$\\$/g # user:$$2y$$05$$/y/x10aXefWaplC44ccSwOCjOEqBivNs9GKRAleKWCIPnXmCzKHrS
If I load everything in I dont get any errors in the Traefik logs and I can also go to the dashboard but it keeps asking me for the password. Even if I type it in correctly.
Is there a mistake in my config?
# /etc/traefik/traefik.yml
entryPoints:
http:
address: :80
https:
address: :443
certificatesResolvers:
letsEncrypt:
acme:
email: redacted
storage: /etc/traefik/acme/acme.json
dnsChallenge:
provider: cloudflare
delayBeforeCheck: 0
api:
dashboard: true
providers:
docker:
endpoint: unix:///var/run/docker.sock
exposedByDefault: false
file:
directory: /etc/traefik/dynamic/
watch: true
# /etc/traefik/dynamic/dashboard.yml
http:
routers:
dashboard:
entryPoints:
- https
rule: "Host(`admin.example.com`)"
service: api@internal # This is the defined name for api. You cannot change it.
tls:
certResolver: letsEncrypt
domains:
- main: "admin.example.com"
middlewares:
- authtraefik
- compress
# /etc/traefik/dynamic/traefik-dashboard-auth.yml
http:
middlewares:
authtraefik:
basicAuth:
removeheader: true
realm: "traefik-dashboard"
users:
- "user:$$2y$$05$$/y/x10aXefWaplC44ccSwOCjOEqBivNs9GKRAleKWCIPnXmCzKHrS"