Giter Site home page Giter Site logo

Comments (6)

tiredofit avatar tiredofit commented on May 22, 2024

Hi there. I added this in version 5.0.0 and 6.0.0 (pyre python rebuild) and am getting reports it's not working.
Will be adding a new development release shortly with some debugging code so I can get some logs to look at.
Will be a day or so.

from docker-traefik-cloudflare-companion.

sudo-kraken avatar sudo-kraken commented on May 22, 2024

brilliant will this be under the "latest" tag or another one for the dockerhub image

from docker-traefik-cloudflare-companion.

tiredofit avatar tiredofit commented on May 22, 2024

You can try tag 6.0.2 for your secrets of CF_EMAIL and CF_TOKEN - Let me know.

from docker-traefik-cloudflare-companion.

sudo-kraken avatar sudo-kraken commented on May 22, 2024

You can try tag 6.0.2 for your secrets of CF_EMAIL and CF_TOKEN - Let me know.

I will give it a try but there isn't a 6.0.2 only 6.0.1 ?

from docker-traefik-cloudflare-companion.

undaunt avatar undaunt commented on May 22, 2024

Using the email and global api token appears to be working for me. Since I'm using Traefik with secrets, I wound up creating a second secret for both email and API that point to the same folder since the ENV variable names were different. This appears to be working for me. If there is a better way to somehow alias different secrets to the same file without redundant global declarations I'd be interested in that.

Using any name for the secrets with the container here except for cf_email and cf_token did not work, as expected.

  cloudflare_email:
    file: $SECRETSDIR/cloudflare_email
  cf_email:
    file: $SECRETSDIR/cloudflare_email
  cloudflare_api_key:
    file: $SECRETSDIR/cloudflare_api_key
  cf_token:
    file: $SECRETSDIR/cloudflare_api_key

########################### SERVICES - FRONT ENDS
# Traefik 2 - Reverse Proxy & LetsEncrypt Certs
  traefik:
    image: traefik:picodon
    container_name: traefik
    restart: always
    networks:
      - $TRAEFIK_NETWORK
      - $SOCKET_NETWORK
    security_opt:
      - no-new-privileges
    ports:
      - target: 80
        published: 80
        protocol: tcp
        mode: host
      - target: 443
        published: 443
        protocol: tcp
        mode: host
    volumes:
      - $DOCKERDIR/traefik/rules:/rules
      - $DOCKERDIR/traefik/acme/acme.json:/acme.json
      - $DOCKERDIR/traefik/traefik.log:/traefik.log
      - $DOCKERDIR/traefik/traefik.yml:/traefik.yml:ro
    environment:
      - CF_API_EMAIL_FILE=/run/secrets/cloudflare_email
      - CF_API_KEY_FILE=/run/secrets/cloudflare_api_key
    secrets:
      - cloudflare_email
      - cloudflare_api_key
    labels:
      - "traefik.enable=true"
      ## HTTP Routers
      - "traefik.http.routers.traefik-rtr.entrypoints=https"
      - "traefik.http.routers.traefik-rtr.rule=Host(`traefik.$DOMAINNAME`)"
      ## Middlewares
      - "traefik.http.routers.traefik-rtr.middlewares=chain-authelia@file"
      ## HTTP Services
      - "traefik.http.routers.traefik-rtr.service=api@internal"

# Cloudflare-Companion - Automatic container CNAME DNS Creation
  cloudflare-companion:
    image: tiredofit/traefik-cloudflare-companion
    container_name: cloudflare-companion
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    networks:
      - $SOCKET_NETWORK
    depends_on:
      - socket-proxy
    environment:
      - TIMEZONE=$TZ
      - TRAEFIK_VERSION=2
      - CF_EMAIL_FILE=/run/secrets/cf_email
      - CF_TOKEN_FILE=/run/secrets/cf_token
      - CONTAINER_LOG_LEVEL=info
      - TARGET_DOMAIN=$DOMAINNAME
      - DOMAIN1=$DOMAINNAME
      - DOMAIN1_ZONE_ID=$CF_API_ZONE_ID
      - DOMAIN1_PROXIED=TRUE
      - DOCKER_HOST=tcp://socket-proxy:2375
    secrets:
      - cf_email
      - cf_token

from docker-traefik-cloudflare-companion.

ptoulouse avatar ptoulouse commented on May 22, 2024

If there is a better way to somehow alias different secrets to the same file without redundant global declarations I'd be interested in that.

There is no better way than that. The issue is that the python function used is not processing secrets the "traditional way".
email = get_docker_secret('CF_EMAIL', autocast_name=True, getenv=True)
It basically goes directly to the /run/secrets directory to find a file named "cf_email", and if not found, fallback on an env variable named "CF_EMAIL". It ignores your CF_EMAIL_FILE and CF_TOKEN_FILE env vars.

To avoid duplication, you would have to set CF_API_EMAIL_FILE=/run/secrets/cf_email for traefik.

from docker-traefik-cloudflare-companion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.