Skip to content

Add UI to manage Traefik basic auth middlewares #4284

@quochuydev

Description

@quochuydev

What problem will this feature address?

Dokploy lets Applications manage basic auth through the Advanced → Security UI, but there is no equivalent for Docker Compose apps. For a compose service today, the only path is:

  1. SSH into the host
  2. Manually edit /etc/dokploy/traefik/dynamic/middlewares.yml
  3. Generate a bcrypt hash (e.g. htpasswd -nbB admin pass)
  4. Paste the entry in
  5. Reference it from compose labels or the domain's Middlewares field

This is a lot of friction for the common "I just want a quick login prompt on this compose service" case, and it's error-prone (YAML indentation, manual bcrypt, $ escaping in compose labels).

Describe the solution you'd like

Add a "Basic Auth Middlewares" card to the existing Traefik dashboard page (/dashboard/traefik) that lets the user:

  • List existing basicAuth entries in middlewares.yml (name + usernames only — never the hash)
  • Create a new entry from a form (name + username + password; password bcrypt-hashed server-side)
  • Delete an entry
  • Copy the <name>@file reference to paste into a compose label or a domain's Middlewares field

The feature is intentionally generic — not coupled to any specific application or compose. The user pastes the reference where they want it and redeploys themselves. No DB schema change, no migration, no redeploy coordination.

Describe alternatives you've considered

None.

Additional context

Works locally against the dev instance. Implementation is ~470 lines, additive (no changes to existing routers or DB).

Will you send a PR to implement it?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions