tiredofit / docker-traefik-cloudflare-companion

Automatically Create CNAME records for containers served by Traefik

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add multiple excluded subdomains in docker-compose

Elpatii opened this issue · comments

Hey!

It seems we can't add multiple subdomains to exclude in docker-compose with the variable DOMAIN1_EXCLUDED_SUB_DOMAINS

When enter one subdomain, there is no problem. The CNAME record will not be added in the DNS zone.
But if adding multiple subdomains, with comma separated, all subdomains will be added by a CNAME in the DNS zone.

Example of working excluded subdomains docker-compose:

  cf-companion:
    container_name: cf-companion
    hostname: cf-companion
    image: tiredofit/traefik-cloudflare-companion:latest
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - TIMEZONE=$TZ
      - TRAEFIK_VERSION=2
      - CF_EMAIL=$CLOUDFLARE_EMAIL
      - CF_TOKEN=$CLOUDFLARE_API_KEY
      - TARGET_DOMAIN=$DOMAINNAME
      - DOMAIN1=$DOMAINNAME
      - DOMAIN1_ZONE_ID=XXXXXXXXXXXXX
      - DOMAIN1_PROXIED=TRUE
      - DOMAIN1_EXCLUDED_SUB_DOMAINS=phpmyadmin

Example of not working excluded subdomains docker-compose (if wanted to use more than one subdomain excluded):

  cf-companion:
    container_name: cf-companion
    hostname: cf-companion
    image: tiredofit/traefik-cloudflare-companion:latest
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - TIMEZONE=$TZ
      - TRAEFIK_VERSION=2
      - CF_EMAIL=$CLOUDFLARE_EMAIL
      - CF_TOKEN=$CLOUDFLARE_API_KEY
      - TARGET_DOMAIN=$DOMAINNAME
      - DOMAIN1=$DOMAINNAME
      - DOMAIN1_ZONE_ID=XXXXXXXXXXXXX
      - DOMAIN1_PROXIED=TRUE
      - DOMAIN1_EXCLUDED_SUB_DOMAINS=phpmyadmin,influxdb

Already tried with a space between subdomains, with a semicolon, by specifying multiple times DOMAIN1_EXCLUDED_SUB_DOMAINS (only the last definition is working, of course), with double quotes. None are working.

Thanks for the help!

Confirming this issue still exists.

commented

@tiredofit any insight on this? Being plural, it's easy to assume there can be multiple subdomains.

I've raised a PR to fix this bug.

Fixed in 6.8.4 courtesy of cford1080.