oznu / docker-cloudflare-ddns

A small amd64/ARM/ARM64 Docker image that allows you to use CloudFlare as a DDNS / DynDNS Provider.
https://hub.docker.com/r/oznu/cloudflare-ddns/
GNU General Public License v3.0
1.08k stars 220 forks source link

Update multiple sub-domains #94

Open ikkerus opened 2 years ago

ikkerus commented 2 years ago

Unfortunately since a couple of updates of the "latest" repository the updates of the subodmains is not working anymore. I'm using it on unraid and it only updates the latest variable (subdomain 6). See also #79

image

NdR91 commented 2 years ago

Same request here, it takes only the last "SUBDOMAIN" value, ignoring the orthers.

backmind commented 2 years ago

Same request here! This is one of the best docker for cloudflare ddns, It will be handy to launch just one image with all the subdomains rather than a image per subdomain.

What I did was to add docker-compose extension fields to simplify a little the tedious work. For each subdomain add an entry like:

    container_name: cf-ddns-SUBDOMAIN_NAME
    <<: *network-ddns-core
    environment:
      <<: *network-ddns-env
      SUBDOMAIN: "SUBDOMAIN_NAME" 

Where x-network-ddns-core is:

    image: oznu/cloudflare-ddns:latest
    secrets:
      - cf_api_key
      - cf_token_zone
    networks:
      - socket_proxy
    security_opt:
      - no-new-privileges:true
    restart: always 

and x-network-ddns-envv is:

    API_KEY_FILE: /run/secrets/cf_token_zone
    ZONE: $DOMAINNAME
    PROXIED: "true"
    RRTYPE: A
    DELETE_ON_STOP: "false" 

And are defined at the beginning of the docker-compose. I also have defined DOMAINNAE at .env file and cf_token_zone in secrets.

This is not an elegant solution. I have up to 8 subdomains, and each time I want to add new subdomain in traefik I must to create a new entry on docker-compose in this way.

Hope this workaround suits you.

sineverba commented 2 years ago

I solved launching multiple containers. Simply and it works very well.