timothymiller/cloudflare-ddns

[Need help] Error reading config.json (JSON Validation successfull)

Closed this issue · 3 comments

Hey guys i think i am just oversee something.

I get the message "😡 Error reading config.json" and i do not know why.

Here is my config.json

{
	"cloudflare": [
		{
			"authentication": {
				"api_token": "apitokenfordnseditthezone"
			},
			"zone_id": "zoneid",
			"subdomains": [
				{
					"name": "eb",
					"proxied": false
				},
				{
					"name": "px",
					"proxied": false
				},
				{
					"name": "p",
					"proxied": false
				},
				{
					"name": "ha",
					"proxied": true
				}
			]
		}
	],
	"a": true,
	"aaaa": false,
	"purgeUnknownRecords": false,
	"ttl": 300
}

Here is my docker compose service:

  cloudflare-ddns:
    image: timothyjmiller/cloudflare-ddns:latest
    container_name: cloudflare-ddns
    security_opt:
      - no-new-privileges:true
    network_mode: "host"
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - /opt/cloudflare-ddns:/config.json
    restart: unless-stopped

I created the config.json under following path: /opt/cloudflare-ddns/config.json
I also tested to set the config.json permission to 777 and verified the json with a validator.

What am i doing wrong here? I am new to docker and i think it is just a small mistake.

This might be a silly question but did you actually add the zone id "number" you get from cloudflare?

This might be a silly question but did you actually add the zone id "number" you get from cloudflare?

No problem :) and yes i add the string from the overview: Zone ID from Cloudflare

I found the problem it was my docker compose - i had to directly give the config.json file in the docker volume section. Like written here in the readme. I dont know why i didnt get this.

This my docker compose yml now:
  cloudflare-ddns:
    image: timothyjmiller/cloudflare-ddns:latest
    container_name: cloudflare-ddns
    security_opt:
      - no-new-privileges:true
    network_mode: "host"
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - /opt/cloudflare-ddns/config.json:/config.json
    restart: unless-stopped

Thank you.