tiredofit / docker-traefik-cloudflare-companion

Automatically Create CNAME records for containers served by Traefik
MIT License
384 stars 64 forks source link

Support alternative syntax for traefik2 multihosts #33

Closed mbjurstrom closed 3 years ago

mbjurstrom commented 3 years ago

The following host rule syntax is valid within traefik:

"Host(subdomain.domain.com,subdomain2.domain.com,subdomain3.domain.com)"

This configuration was incorrectly parsed previously, and the 'Host' portion of regex is safe to remove based on the "if 'Host' in value:" check.

Originally added by dchidell at https://github.com/tiredofit/docker-traefik-cloudflare-companion/pull/15 . Just updated it for the current code base. Updated the check_service_t2 method as well as updated the documentation

Fixes: https://github.com/tiredofit/docker-traefik-cloudflare-companion/issues/16

tiredofit commented 3 years ago

I will retest this today. It's been a while since I have thought about this one - Again it's probably due to my Python skills where I was resistant due to a potential breaking change. I'll take a peek tonight when out of my day commitments.

mbjurstrom commented 3 years ago

No rush:) The regex should match both Host(example1.domain.tld, example2.domain.tld) and Host(example1.domain.tld) || Host(example2.domain.tld) so it shouldn't break anything. and as @dchidell wrote in the commit message.

the 'Host' portion of regex is safe to remove based on the "if 'Host' in value:" check.

So it should be fine. :) But extra tests are always good:)