Add validation to prevent duplicate domain hosts
What problem will this feature address?
I've run into issues where team members accidentally create duplicate domains, which breaks Traefik routing and causes deployments to fail. Right now there's nothing stopping multiple apps from using the same domain.
Describe the solution you'd like
We should prevent duplicate domains by:
- Adding a unique constraint at the database level
- Checking for duplicates before creating/updating domains
- Showing a error message when someone tries to use an existing domain
Describe alternatives you've considered
For now, manually check existing domains before creating new ones and use naming conventions (e.g., project-alpha-app.domain.com, project-beta-app.domain.com), but this doesn't scale well with multiple team members and is error-prone.
Additional context
No response
Will you send a PR to implement it?
Maybe, need help
I understand the idea, but in some situations, you'd want to give two services the same domain. Something that could be added is a warning that the domain may already be used by another service.
For example:
You put your website on
mydomain.com with path /
and your backend on
mydomain.com with path /api
Edit: just noticed that we could in theory do UNIQUE(domain, path)... I might look into it