Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update readme for inconsistent TRAEFIK_FILTER vs TRAEFIK_CONSTRAINT #94

Open
BasicWalker opened this issue Mar 24, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@BasicWalker
Copy link

Description of the feature
The readme has inconsistent documentation and examples , specifically for TRAEFIK_FILTER_LABEL, and TRAEFIK_LABEL.

the example under
https://github.com/tiredofit/docker-traefik-cloudflare-companion/blob/main/README.md#by-label-docker-endpoint-only
shows the use of TRAEFIK_CONSTRAINT_LABEL=traefik.constraint and TRAEFIK_CONSTRAINT=proxy-public

where it should be TRAEFIK_CONSTRAINTFILTER_LABEL

Benftits of feature
I had to spend a bunch of time debugging and looking through the code to find what was happening when following the example in the readme which is incorrect. updating the readme would provide more clarity.

Additional context
here is a working example of the docker compose file that i have working if it would be beneficial for showcasing this feature

docker-compose.yml

services:
  # Cloudflare-Companion - Automatic CNAME DNS Creation
  cf-companion:
    image: tiredofit/traefik-cloudflare-companion:latest
    container_name: cf-companion
    restart: always
    profiles: ["core", "all", "network"]
    networks:
      - socket_proxy
    # volumes:
    #   - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - TIMEZONE=$TZ
      - DOCKER_HOST=tcp://socket-proxy:2375
      - TRAEFIK_VERSION=2
      - CF_EMAIL=$CLOUDFLARE_EMAIL
      - CF_TOKEN_FILE=/var/run/cf_token
      - TARGET_DOMAIN=ddns.$DOMAINNAME  # ddns A record for dynamic public IP
      - DOMAIN1=$DOMAINNAME
      - DOMAIN1_ZONE_ID=$CLOUDFLARE_ZONE_ID # Copy from Cloudflare Overview page
      - DOMAIN1_PROXIED=TRUE
      - TRAEFIK_FILTER_LABEL=traefik.constraint
      - TRAEFIK_FILTER=web  # only externally expose docker services with "traefik.constraint=web" label
      - LOG_TYPE=BOTH
      - LOG_LEVEL=DEBUG
      - DRY_RUN=TRUE  # test new configs
    secrets:
      - cf_token
  web-service:
    image: 
    container_name:
    restart: unless-stopped
    profiles: []
    networks:
      - reverse_proxy
    labels:
      - "traefik.enable=true"
      # HTTP Services
      - "traefik.http.services.web-service-svc.loadbalancer.server.port=####"
      - "traefik.http.routers.web-service-secure.service=web-service-svc"
      # HTTP Routers
      - "traefik.http.routers.web-service-secure.entrypoints=internalsecure"
      - "traefik.http.routers.web-service-secure.rule=Host(`web-service.$DOMAINNAME`)"
      # External routing
      - "traefik.constraint=web"  # auto create CNAME records available publicly with Cloudflare-Companion
      - "traefik.http.routers.web-service-web-secure.service=web-service-svc"
      - "traefik.http.routers.web-service-web-secure.entrypoints=websecure"
      - "traefik.http.routers.web-service-web-secure.rule=Host(`web-service.$DOMAINNAME`) || Host(`alias.$DOMAINNAME`)"  # multiple CNAME records
@BasicWalker BasicWalker added the enhancement New feature or request label Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant