coollabsio / coolify

An open-source & self-hostable Heroku / Netlify / Vercel alternative.
https://coolify.io
Apache License 2.0
31.88k stars 1.64k forks source link

[Bug]: Docker compose labels for traefik applies middleware to all routers #2196

Open michael-at-boost opened 4 months ago

michael-at-boost commented 4 months ago

Description

I think this counts as a bug but it could be a feature request. Applying basic auth in docker compose to a service like Minio applies the auth to all routers.

e.g. - 'traefik.http.middlewares.custom-auth.basicauth.users=test:$2y$10$8C2MxnUPIv3jgexD...etc'

You can't manually target a router in labels because the original line will exist and cause a dupe e.g. - 'traefik.http.routers.https-0-xab0k4w-minio.middlewares=gzip,custom-auth' ^^ this prevents the whole service from loading.

It's an issue because you might want auth (or ip whitelist) on the console router but not on the API router.

Minimal Reproduction (if possible, example repository)

Vanilla Coolify (v4.0.0-beta.277) Vanilla Minio from services

Exception or Error

No response

Version

v4.0.0-beta.277

marcomaiermm commented 4 months ago

+1

leoriviera commented 2 months ago

Heya! Just run across this. It's a bit of a pain.

@andrasbacsai, I'm new to the project but I like Coolify and I'm happy to take a look into this if you point me in the right direction.

Telokis commented 1 month ago

This is indeed a problem that prevents us from properly customizing Traefik for specific services.
One quick and easy solution would be for the auto-generated labels to be added before the user-defined ones in the resulting docker-compose.yml. This would let users override the auto-defined labels themselves.