Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic_auth label is still being written to caddyfile as basicauth which spams logs #633

Closed
brando56894 opened this issue Jun 19, 2024 · 3 comments

Comments

@brando56894
Copy link

Caddy recently updated the name of basicauth to basic_auth and while the former still works, it spams the logfile with tens or hundreds of messages about it. It appears that whatever magic is used to convert Docker labels to Caddy config files still interprets basic_auth as basicauth which results in a ton of log spamming as mentioned before.

Here's a section of my compose file with the updated directive name in the label

  dozzle:
    container_name: dozzle
    image: amir20/dozzle:latest
    restart: always
    environment:
      TZ: America/New_York
      DOZZLE_ENABLE_ACTIONS: true
    labels:
      caddy: dozzle.mydomain.com
      caddy.reverse_proxy: "{{upstreams 8080}}"
      caddy.basic_auth: "*"
      caddy.basic_auth.bran: '$2a$14$OzxUNUtrb9vvl9AcaBaO2.hG1QF/d6ZzFguTW70KOxwpf/QmqLJUS'
      caddy.tls.dns: 'cloudflare apikey
      caddy.tls.resolvers: '1.1.1.1'
    networks:
      - web
      - internal
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - "8080:8080"

And the resulting chunk from Caddyfile.autosave

dozzle.mydomain.com {
        basicauth * {
                bran $2a$14.hG1QF/d6ZzFguTW70KOxwpf/QmqLJUS
        }
        reverse_proxy 172.18.0.2:8080
        tls {
                dns cloudflare apikey
                resolvers 1.1.1.1
        }
}

And the resulting log spamming

2024/06/19 18:00:16.177 WARN    config.adapter.caddyfile        the 'basicauth' directive is deprecated, please use 'basic_auth' instead!
2024/06/19 18:00:16.177 WARN    config.adapter.caddyfile        the 'basicauth' directive is deprecated, please use 'basic_auth' instead!
@francislavoie
Copy link
Collaborator

Make sure all your Docker services are rebooted/recreated. Do docker compose down then docker compose up -d to make sure their labels are all refreshed.

@brando56894
Copy link
Author

I just had to redo everything for other reasons so everything is fresh and I'm still getting that warning.

@malemburg
Copy link

Tested with 29-alpine and things work fine, so I guess you just need to upgrade to a later version.

@francislavoie francislavoie closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants